File tree 2 files changed +17
-1
lines changed
src/Symfony/Component/HttpKernel
2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -604,7 +604,7 @@ protected function getKernelParameters()
604
604
return array_merge (
605
605
array (
606
606
'kernel.root_dir ' => realpath ($ this ->rootDir ) ?: $ this ->rootDir ,
607
- 'kernel.project_dir ' => realpath ($ this ->projectDir ) ?: $ this ->projectDir ,
607
+ 'kernel.project_dir ' => realpath ($ this ->getProjectDir ()) ?: $ this ->getProjectDir () ,
608
608
'kernel.environment ' => $ this ->environment ,
609
609
'kernel.debug ' => $ this ->debug ,
610
610
'kernel.name ' => $ this ->name ,
Original file line number Diff line number Diff line change 12
12
namespace Symfony \Component \HttpKernel \Tests ;
13
13
14
14
use PHPUnit \Framework \TestCase ;
15
+ use Symfony \Component \Config \Loader \LoaderInterface ;
15
16
use Symfony \Component \DependencyInjection \ContainerBuilder ;
16
17
use Symfony \Component \HttpKernel \Bundle \BundleInterface ;
17
18
use Symfony \Component \HttpKernel \Config \EnvParametersResource ;
@@ -761,6 +762,21 @@ public function testSymfonyEnvironmentVariables()
761
762
unset($ _SERVER ['SYMFONY__FOO__BAR ' ]);
762
763
}
763
764
765
+ public function testProjectDirExtension ()
766
+ {
767
+ $ kernel = $ this ->getKernel (array ('initializeBundles ' , 'initializeContainer ' , 'getProjectDir ' ));
768
+ $ kernel
769
+ ->expects ($ this ->atLeastOnce ())
770
+ ->method ('getProjectDir ' )
771
+ ->willReturn ('foo ' );
772
+ $ kernel ->boot ();
773
+
774
+ $ r = new \ReflectionMethod ($ kernel , 'getKernelParameters ' );
775
+ $ r ->setAccessible (true );
776
+ $ kernelParameters = $ r ->invoke ($ kernel );
777
+ $ this ->assertSame ('foo ' , $ kernelParameters ['kernel.project_dir ' ]);
778
+ }
779
+
764
780
/**
765
781
* Returns a mock for the BundleInterface.
766
782
*
You can’t perform that action at this time.
0 commit comments