@@ -772,16 +772,28 @@ public function getRegisteredDependenciesData()
772
772
array ($ g ),
773
773
array ($ g ),
774
774
),
775
+ // params
776
+ array (
777
+ array ($ cBA ),
778
+ array ($ cBA ),
779
+ 'prod_test ' ,
780
+ ),
781
+ array (
782
+ array ($ cBA ),
783
+ array ($ aNon , $ cBA ),
784
+ 'test ' ,
785
+ true ,
786
+ ),
775
787
);
776
788
}
777
789
778
790
/**
779
791
* @dataProvider getRegisteredDependenciesData
780
792
*/
781
- public function testRegisteredDependencies (array $ dependencies , array $ expected )
793
+ public function testRegisteredDependencies (array $ dependencies , array $ expected, $ environment = ' test ' , $ debug = false )
782
794
{
783
795
// use test kernel so we can test registeredDependencies() directly
784
- $ kernel = $ this ->getKernelForTest (array ('registerBundles ' ));
796
+ $ kernel = $ this ->getKernelForTest (array ('registerBundles ' ), $ environment , $ debug );
785
797
$ kernel
786
798
->expects ($ this ->once ())
787
799
->method ('registerBundles ' )
@@ -801,15 +813,15 @@ public function getRegisteredDependenciesExceptionData()
801
813
return array (
802
814
array (
803
815
array ($ dE ),
804
- "Recursive dependency for ' " .get_class ($ dE ),
816
+ "Recursive dependency for \" " .get_class ($ dE ),
805
817
),
806
818
array (
807
819
array ($ eD ),
808
- "Recursive dependency for ' " .get_class ($ eD ),
820
+ "Recursive dependency for \" " .get_class ($ eD ),
809
821
),
810
822
array (
811
823
array ($ f ),
812
- "Could not find ' " ,
824
+ "Could not find \" " ,
813
825
),
814
826
);
815
827
}
@@ -953,14 +965,16 @@ protected function getKernel(array $methods = array(), array $bundles = array())
953
965
/**
954
966
* Returns a mock for the abstract kernel.
955
967
*
956
- * @param array $methods Additional methods to mock (besides the abstract ones)
968
+ * @param array $methods Additional methods to mock (besides the abstract ones)
969
+ * @param string $environment The current environment
970
+ * @param bool $debug Whether to debugging is enabled or not
957
971
*
958
972
* @return KernelForTest|\PHPUnit_Framework_MockObject_MockObject
959
973
*/
960
- protected function getKernelForTest (array $ methods = array ())
974
+ protected function getKernelForTest (array $ methods = array (), $ environment = ' test ' , $ debug = false )
961
975
{
962
976
$ kernel = $ this ->getMockBuilder ('Symfony\Component\HttpKernel\Tests\Fixtures\KernelForTest ' )
963
- ->setConstructorArgs (array (' test ' , false ))
977
+ ->setConstructorArgs (array ($ environment , $ debug ))
964
978
->setMethods ($ methods )
965
979
->getMock ();
966
980
$ p = new \ReflectionProperty ($ kernel , 'rootDir ' );
0 commit comments