mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
parent
e77c7fe04c
commit
6fd6a38949
@ -550,6 +550,7 @@ class CoreKernel implements Kernel
|
||||
$kernel = clone $this;
|
||||
$kernel->setConfigLoader($this->configLoader->nest());
|
||||
$kernel->setInjectorLoader($this->injectorLoader->nest());
|
||||
$kernel->nestedFrom = $this;
|
||||
return $kernel;
|
||||
}
|
||||
|
||||
|
@ -6,6 +6,7 @@ use BadMethodCallException;
|
||||
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 @@ class KernelTest extends SapphireTest
|
||||
/** @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());
|
||||
|
Loading…
Reference in New Issue
Block a user