Skip to content

Commit

Permalink
Merge pull request #94 from fico7489/filip-patch4
Browse files Browse the repository at this point in the history
filip patch-4
  • Loading branch information
fico7489 authored Mar 26, 2020
2 parents 1dff070 + 6d8ed0c commit 63ffbb9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
matrix:
php_version: [7.2]
laravel_version: [5.*,6.*, 7.*]
laravel_version: [5.5.*,6.*, 7.*]

steps:
- name: Checkout commit
Expand Down
14 changes: 1 addition & 13 deletions tests/Tests/AggregateJoinTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,13 @@

class AggregateJoinTest extends TestCase
{
public function setUp(): void
{
$this->markTestSkipped('skip for now.');
}

private $queryTest = 'select orders.*, SUM(sellers.id) as sort
private $queryTest = 'select orders.*, SUM("sellers"."id") as sort
from "orders"
left join "sellers" on "sellers"."id" = "orders"."seller_id"
where "orders"."deleted_at" is null
group by "orders"."id"
order by sort asc';

private $bindingsTest = ['sellers.id'];

public function testAvg()
{
Order::joinRelations('seller')
Expand All @@ -30,7 +23,6 @@ public function testAvg()

$queryTest = str_replace(EloquentJoinBuilder::AGGREGATE_SUM, EloquentJoinBuilder::AGGREGATE_SUM, $this->queryTest);
$this->assertQueryMatches($queryTest, $this->fetchQuery());
$this->assertEquals($this->bindingsTest, $this->fetchBindings());
}

public function testSum()
Expand All @@ -41,7 +33,6 @@ public function testSum()

$queryTest = str_replace(EloquentJoinBuilder::AGGREGATE_SUM, EloquentJoinBuilder::AGGREGATE_AVG, $this->queryTest);
$this->assertQueryMatches($queryTest, $this->fetchQuery());
$this->assertEquals($this->bindingsTest, $this->fetchBindings());
}

public function testMax()
Expand All @@ -52,7 +43,6 @@ public function testMax()

$queryTest = str_replace(EloquentJoinBuilder::AGGREGATE_SUM, EloquentJoinBuilder::AGGREGATE_MAX, $this->queryTest);
$this->assertQueryMatches($queryTest, $this->fetchQuery());
$this->assertEquals($this->bindingsTest, $this->fetchBindings());
}

public function testMin()
Expand All @@ -63,7 +53,6 @@ public function testMin()

$queryTest = str_replace(EloquentJoinBuilder::AGGREGATE_SUM, EloquentJoinBuilder::AGGREGATE_MIN, $this->queryTest);
$this->assertQueryMatches($queryTest, $this->fetchQuery());
$this->assertEquals($this->bindingsTest, $this->fetchBindings());
}

public function testCount()
Expand All @@ -74,6 +63,5 @@ public function testCount()

$queryTest = str_replace(EloquentJoinBuilder::AGGREGATE_SUM, EloquentJoinBuilder::AGGREGATE_COUNT, $this->queryTest);
$this->assertQueryMatches($queryTest, $this->fetchQuery());
$this->assertEquals($this->bindingsTest, $this->fetchBindings());
}
}

0 comments on commit 63ffbb9

Please sign in to comment.