mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 22:53:49 +00:00
fix cs
This commit is contained in:
@@ -29,6 +29,18 @@ use function is_string;
|
||||
*/
|
||||
abstract class AbstractAggregatorTest extends KernelTestCase
|
||||
{
|
||||
/**
|
||||
* provide data for `testAliasDidNotDisappears`.
|
||||
*/
|
||||
public function dataProviderAliasDidNotDisappears()
|
||||
{
|
||||
foreach ($this->getQueryBuilders() as $qb) {
|
||||
foreach ($this->getFormData() as $data) {
|
||||
yield [clone $qb, $data];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* provide data for `testAlterQuery`.
|
||||
*/
|
||||
@@ -63,18 +75,6 @@ abstract class AbstractAggregatorTest extends KernelTestCase
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* provide data for `testAliasDidNotDisappears`.
|
||||
*/
|
||||
public function dataProviderAliasDidNotDisappears()
|
||||
{
|
||||
foreach ($this->getQueryBuilders() as $qb) {
|
||||
foreach ($this->getFormData() as $data) {
|
||||
yield [clone $qb, $data];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an aggregator instance which will be used in tests.
|
||||
*
|
||||
@@ -107,6 +107,28 @@ abstract class AbstractAggregatorTest extends KernelTestCase
|
||||
*/
|
||||
abstract public function getQueryBuilders();
|
||||
|
||||
/**
|
||||
* Compare aliases array before and after that aggregator alter query.
|
||||
*
|
||||
* @dataProvider dataProviderAliasDidNotDisappears
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testAliasDidNotDisappears(QueryBuilder $qb, array $data)
|
||||
{
|
||||
$aliases = $qb->getAllAliases();
|
||||
|
||||
$this->getAggregator()->alterQuery($qb, $data);
|
||||
|
||||
$alteredQuery = $qb->getAllAliases();
|
||||
|
||||
$this->assertGreaterThanOrEqual(count($aliases), count($alteredQuery));
|
||||
|
||||
foreach ($aliases as $alias) {
|
||||
$this->assertContains($alias, $alteredQuery);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* test the alteration of query by the filter.
|
||||
*
|
||||
@@ -269,29 +291,4 @@ abstract class AbstractAggregatorTest extends KernelTestCase
|
||||
'test that the title is not empty'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Compare aliases array before and after that aggregator alter query
|
||||
*
|
||||
* @dataProvider dataProviderAliasDidNotDisappears
|
||||
*
|
||||
* @param QueryBuilder $qb
|
||||
* @param array $data
|
||||
* @return void
|
||||
*/
|
||||
public function testAliasDidNotDisappears(QueryBuilder $qb, array $data)
|
||||
{
|
||||
$aliases = $qb->getAllAliases();
|
||||
|
||||
$this->getAggregator()->alterQuery($qb, $data);
|
||||
|
||||
$alteredQuery = $qb->getAllAliases();
|
||||
|
||||
$this->assertGreaterThanOrEqual(count($aliases), count($alteredQuery));
|
||||
|
||||
foreach ($aliases as $alias) {
|
||||
$this->assertContains($alias, $alteredQuery);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -40,6 +40,18 @@ abstract class AbstractFilterTest extends KernelTestCase
|
||||
$this->prophet = $this->getProphet();
|
||||
}
|
||||
|
||||
/**
|
||||
* provide data for `testAliasDidNotDisappears`.
|
||||
*/
|
||||
public function dataProviderAliasDidNotDisappears()
|
||||
{
|
||||
foreach ($this->getQueryBuilders() as $qb) {
|
||||
foreach ($this->getFormData() as $data) {
|
||||
yield [clone $qb, $data];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function dataProviderAlterQuery()
|
||||
{
|
||||
foreach ($this->getQueryBuilders() as $qb) {
|
||||
@@ -56,18 +68,6 @@ abstract class AbstractFilterTest extends KernelTestCase
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* provide data for `testAliasDidNotDisappears`.
|
||||
*/
|
||||
public function dataProviderAliasDidNotDisappears()
|
||||
{
|
||||
foreach ($this->getQueryBuilders() as $qb) {
|
||||
foreach ($this->getFormData() as $data) {
|
||||
yield [clone $qb, $data];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a filter which will be used in tests.
|
||||
*
|
||||
@@ -99,6 +99,28 @@ abstract class AbstractFilterTest extends KernelTestCase
|
||||
*/
|
||||
abstract public function getQueryBuilders();
|
||||
|
||||
/**
|
||||
* Compare aliases array before and after that filter alter query.
|
||||
*
|
||||
* @dataProvider dataProviderAliasDidNotDisappears
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testAliasDidNotDisappears(QueryBuilder $qb, array $data)
|
||||
{
|
||||
$aliases = $qb->getAllAliases();
|
||||
|
||||
$this->getFilter()->alterQuery($qb, $data);
|
||||
|
||||
$alteredQuery = $qb->getAllAliases();
|
||||
|
||||
$this->assertGreaterThanOrEqual(count($aliases), count($alteredQuery));
|
||||
|
||||
foreach ($aliases as $alias) {
|
||||
$this->assertContains($alias, $alteredQuery);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* test the alteration of query by the filter.
|
||||
*
|
||||
@@ -211,28 +233,4 @@ abstract class AbstractFilterTest extends KernelTestCase
|
||||
'test that the title is not empty'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Compare aliases array before and after that filter alter query
|
||||
*
|
||||
* @dataProvider dataProviderAliasDidNotDisappears
|
||||
*
|
||||
* @param QueryBuilder $qb
|
||||
* @param array $data
|
||||
* @return void
|
||||
*/
|
||||
public function testAliasDidNotDisappears(QueryBuilder $qb, array $data)
|
||||
{
|
||||
$aliases = $qb->getAllAliases();
|
||||
|
||||
$this->getFilter()->alterQuery($qb, $data);
|
||||
|
||||
$alteredQuery = $qb->getAllAliases();
|
||||
|
||||
$this->assertGreaterThanOrEqual(count($aliases), count($alteredQuery));
|
||||
|
||||
foreach ($aliases as $alias) {
|
||||
$this->assertContains($alias, $alteredQuery);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user