Skip to content
Permalink
Browse files

Fixed tests

  • Loading branch information...
sergeyklay committed Sep 22, 2019
1 parent dd53a8d commit 87fc5200f72b5162ece9b8cdd23a25a24835e07f
@@ -19,7 +19,7 @@
class SomeServiceProvider implements ServiceProviderInterface
{
public function register(DiInterface $di)
public function register(DiInterface $di): void
{
require_once __DIR__ . DIRECTORY_SEPARATOR . 'SomeComponent.php';
@@ -39,12 +39,10 @@ public function mvcModelQueryBuilderDistinct(IntegrationTester $I)
{
$I->wantToTest('Mvc\Model\Query\Builder - distinct()');
$builder = new Builder();
$builder->setDi($this->container);
$phql = $builder->setDi($this->container)
->distinct(true)
$phql = $builder->distinct(true)
->columns(['Robots.name'])
->from(Robots::class)
->getPhql()
@@ -55,12 +53,10 @@ public function mvcModelQueryBuilderDistinct(IntegrationTester $I)
$phql
);
$builder = new Builder();
$builder->setDi($this->container);
$phql = $builder->setDi($this->container)
->distinct(false)
$phql = $builder->distinct(false)
->columns(['Robots.name'])
->from(Robots::class)
->getPhql()
@@ -71,12 +67,10 @@ public function mvcModelQueryBuilderDistinct(IntegrationTester $I)
$phql
);
$builder = new Builder();
$builder->setDi($this->container);
$phql = $builder->setDi($this->container)
->distinct(true)
$phql = $builder->distinct(true)
->distinct(null)
->columns(['Robots.name'])
->from(Robots::class)
@@ -88,12 +82,10 @@ public function mvcModelQueryBuilderDistinct(IntegrationTester $I)
$phql
);
$builder = new Builder();
$builder->setDi($this->container);
$phql = $builder->setDi($this->container)
->distinct(true)
$phql = $builder->distinct(true)
->from(Robots::class)
->getPhql()
;
@@ -40,9 +40,9 @@ public function mvcModelQueryBuilderGroupBy(IntegrationTester $I)
$I->wantToTest('Mvc\Model\Query\Builder - groupBy()');
$builder = new Builder();
$builder->setDi($this->container);
$phql = $builder->setDi($this->container)
->columns(['name', 'SUM(price)'])
$phql = $builder->columns(['name', 'SUM(price)'])
->from(Robots::class)
->groupBy('id, name')
->getPhql()
@@ -48,11 +48,11 @@ public function shouldGenerateCorrectPhql(IntegrationTester $I, Example $example
$expected = $example[1];
$builder = new Builder();
$builder->setDi($this->container);
$query = 'SELECT r.year, r.name AS robot_name FROM [' . Robots::class . '] AS [r] ';
$phql = $builder
->setDi($this->container)
->from(['r' => Robots::class])
->columns(['r.year', 'r.name AS robot_name'])
->orderBy($orderBy)
@@ -79,11 +79,11 @@ public function shouldGenerateCorrectSql(IntegrationTester $I, Example $example)
$expected = $example[1];
$builder = new Builder();
$builder->setDi($this->container);
$query = 'SELECT `r`.`year` AS `r_year`, `r`.`name` AS `robot_name` FROM `robots` AS `r` ';
$phql = $builder
->setDi($this->container)
->from(['r' => Robots::class])
->columns(['r.year', 'r.name AS robot_name'])
->orderBy($orderBy)

0 comments on commit 87fc520

Please sign in to comment.
You can’t perform that action at this time.