cs: Fix code style (safe rules only).

This commit is contained in:
Pol Dellaiera
2021-11-23 14:06:38 +01:00
parent 149d7ce991
commit 8f96a1121d
1223 changed files with 65199 additions and 64625 deletions

View File

@@ -1,12 +1,39 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Search;
use Chill\MainBundle\Search\SearchApiQuery;
use PHPUnit\Framework\TestCase;
use function is_string;
/**
* @internal
* @coversNothing
*/
class SearchApiQueryTest extends TestCase
{
public function testBuildParams()
{
$q = new SearchApiQuery();
$q
->addSelectClause('bada', ['one', 'two'])
->addSelectClause('boum', ['three', 'four'])
->setWhereClauses('mywhere', ['six', 'seven']);
$params = $q->buildParameters();
$this->assertEquals(['six', 'seven'], $q->buildParameters(true));
$this->assertEquals(['one', 'two', 'three', 'four', 'six', 'seven'], $q->buildParameters());
}
public function testMultipleWhereClauses()
{
$q = new SearchApiQuery();
@@ -14,9 +41,8 @@ class SearchApiQueryTest extends TestCase
->setSelectKey('bim')
->setSelectPertinence('?', ['gamma'])
->setFromClause('badaboum')
->andWhereClause('foo', [ 'alpha' ])
->andWhereClause('bar', [ 'beta' ])
;
->andWhereClause('foo', ['alpha'])
->andWhereClause('bar', ['beta']);
$query = $q->buildQuery();
@@ -35,27 +61,9 @@ class SearchApiQueryTest extends TestCase
$q->setSelectJsonbMetadata('boum')
->setSelectKey('bim')
->setSelectPertinence('1')
->setFromClause('badaboum')
;
->setFromClause('badaboum');
$this->assertTrue(\is_string($q->buildQuery()));
$this->assertTrue(is_string($q->buildQuery()));
$this->assertEquals([], $q->buildParameters());
}
public function testBuildParams()
{
$q = new SearchApiQuery();
$q
->addSelectClause('bada', [ 'one', 'two' ])
->addSelectClause('boum', ['three', 'four'])
->setWhereClauses('mywhere', [ 'six', 'seven'])
;
$params = $q->buildParameters();
$this->assertEquals(['six', 'seven'], $q->buildParameters(true));
$this->assertEquals(['one', 'two', 'three', 'four', 'six', 'seven'], $q->buildParameters());
}
}