@@ -768,16 +768,27 @@ public function getRegisteredDependenciesData()
768
768
array ($ bA , $ cBA ),
769
769
array ($ aNon , $ bA , $ cBA ),
770
770
),
771
+ array (
772
+ array ($ cBA ),
773
+ array ($ cBA ),
774
+ 'prod_test '
775
+ ),
776
+ array (
777
+ array ($ cBA ),
778
+ array ($ aNon , $ cBA ),
779
+ 'test ' ,
780
+ true
781
+ ),
771
782
);
772
783
}
773
784
774
785
/**
775
786
* @dataProvider getRegisteredDependenciesData
776
787
*/
777
- public function testRegisteredDependencies (array $ dependencies , array $ expected )
788
+ public function testRegisteredDependencies (array $ dependencies , array $ expected, $ environment = ' test ' , $ debug = false )
778
789
{
779
790
// use test kernel so we can test registeredDependencies() directly
780
- $ kernel = $ this ->getKernelForTest (array ('registerBundles ' ));
791
+ $ kernel = $ this ->getKernelForTest (array ('registerBundles ' ), $ environment , $ debug );
781
792
$ kernel
782
793
->expects ($ this ->once ())
783
794
->method ('registerBundles ' )
@@ -949,14 +960,16 @@ protected function getKernel(array $methods = array(), array $bundles = array())
949
960
/**
950
961
* Returns a mock for the abstract kernel.
951
962
*
952
- * @param array $methods Additional methods to mock (besides the abstract ones)
963
+ * @param array $methods Additional methods to mock (besides the abstract ones)
964
+ * @param string $environment The current environment
965
+ * @param bool $debug Whether to debugging is enabled or not
953
966
*
954
967
* @return KernelForTest|\PHPUnit_Framework_MockObject_MockObject
955
968
*/
956
- protected function getKernelForTest (array $ methods = array ())
969
+ protected function getKernelForTest (array $ methods = array (), $ environment = ' test ' , $ debug = false )
957
970
{
958
971
$ kernel = $ this ->getMockBuilder ('Symfony\Component\HttpKernel\Tests\Fixtures\KernelForTest ' )
959
- ->setConstructorArgs (array (' test ' , false ))
972
+ ->setConstructorArgs (array ($ environment , $ debug ))
960
973
->setMethods ($ methods )
961
974
->getMock ();
962
975
$ p = new \ReflectionProperty ($ kernel , 'rootDir ' );
0 commit comments