/** * @param ConfigurationLoader $configurationLoader * * @return $this */ public function setConfigurationLoader(ConfigurationLoader $configurationLoader) { if ($this->config) { $this->config->setLoader($configurationLoader); } else { /* inject loader to be used later when config is created in */ /* @see N98\Magento\Application::init */ $this->configurationLoaderInjected = $configurationLoader; } return $this; }
/** * @test */ public function loader() { $config = new Config(); try { $config->load(); $this->fail('An expected exception was not thrown'); } catch (ErrorException $e) { $this->assertEquals('Configuration not yet fully loaded', $e->getMessage()); } $this->assertEquals(array(), $config->getConfig()); $loader = $config->getLoader(); $this->assertInstanceOf(__NAMESPACE__ . '\\ConfigurationLoader', $loader); $this->assertSame($loader, $config->getLoader()); $loader->loadStageTwo(""); $config->load(); $this->assertInternalType('array', $config->getConfig()); $this->assertGreaterThan(4, count($config->getConfig())); $config->setLoader($loader); }