File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed
src/Symfony/Component/HttpKernel Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -604,7 +604,7 @@ protected function getKernelParameters()
604604 return array_merge (
605605 array (
606606 '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 () ,
608608 'kernel.environment ' => $ this ->environment ,
609609 'kernel.debug ' => $ this ->debug ,
610610 'kernel.name ' => $ this ->name ,
Original file line number Diff line number Diff line change 1212namespace Symfony \Component \HttpKernel \Tests ;
1313
1414use PHPUnit \Framework \TestCase ;
15+ use Symfony \Component \Config \Loader \LoaderInterface ;
1516use Symfony \Component \DependencyInjection \ContainerBuilder ;
1617use Symfony \Component \HttpKernel \Bundle \BundleInterface ;
1718use Symfony \Component \HttpKernel \Config \EnvParametersResource ;
@@ -761,6 +762,21 @@ public function testSymfonyEnvironmentVariables()
761762 unset($ _SERVER ['SYMFONY__FOO__BAR ' ]);
762763 }
763764
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+
764780 /**
765781 * Returns a mock for the BundleInterface.
766782 *
You can’t perform that action at this time.
0 commit comments