mirror of
				https://gitlab.com/Chill-Projet/chill-bundles.git
				synced 2025-10-31 09:18:24 +00:00 
			
		
		
		
	Merge branch '111_exports_suite' of gitlab.com:Chill-Projet/chill-bundles into 111_exports_suite
This commit is contained in:
		| @@ -63,6 +63,18 @@ 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. | ||||
|      * | ||||
| @@ -257,4 +269,29 @@ 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); | ||||
|         } | ||||
|     } | ||||
|  | ||||
| } | ||||
|   | ||||
| @@ -56,6 +56,18 @@ 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. | ||||
|      * | ||||
| @@ -199,4 +211,28 @@ 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