Skip to content
Permalink
Browse files

BUG Fix unassigned nestedFrom

Fixes #7194
  • Loading branch information
Damian Mooyman
Damian Mooyman committed Jul 20, 2017
1 parent e77c7fe commit 6fd6a38949a7ac524defbc917e7ebcca86e10522
Showing with 4 additions and 0 deletions.
  1. +1 −0 src/Core/CoreKernel.php
  2. +3 −0 tests/php/Core/KernelTest.php
@@ -550,6 +550,7 @@ public function nest()
$kernel = clone $this;
$kernel->setConfigLoader($this->configLoader->nest());
$kernel->setInjectorLoader($this->injectorLoader->nest());
$kernel->nestedFrom = $this;
return $kernel;
}
@@ -6,6 +6,7 @@
use SilverStripe\Control\Director;
use SilverStripe\Core\Config\Config;
use SilverStripe\Core\Config\ConfigLoader;
use SilverStripe\Core\CoreKernel;
use SilverStripe\Core\Injector\Injector;
use SilverStripe\Core\Injector\InjectorLoader;
use SilverStripe\Core\Kernel;
@@ -18,8 +19,10 @@ public function testNesting()
/** @var Kernel $kernel */
$kernel = Injector::inst()->get(Kernel::class);
/** @var CoreKernel $nested1 */
$nested1 = $kernel->nest();
Director::config()->set('alternate_base_url', '/mysite/');
$this->assertEquals($kernel, $nested1->getNestedFrom());
$this->assertEquals($nested1->getConfigLoader(), ConfigLoader::inst());
$this->assertEquals($nested1->getInjectorLoader(), InjectorLoader::inst());
$this->assertEquals(1, ConfigLoader::inst()->countManifests());

0 comments on commit 6fd6a38

Please sign in to comment.
You can’t perform that action at this time.