/** * @param string $configFile * @return \PHP\Manipulator\Config\Xml */ protected function _getConfig($configFile) { try { return Config::factory('xml', $configFile, true); } catch (\Exception $e) { throw new \Exception('Unable to load config: ' . $configFile . PHP_EOL . 'error: ' . $e->getMessage()); } }
/** * @covers \PHP\Manipulator\Config::factory */ public function testFactoryWithConfigStubFromFile() { $file = 'Config/config0.xml'; $config = Config::factory('\\Tests\\Stub\\ConfigStub', TESTS_PATH . '_fixtures/' . $file, true); $this->assertInstanceOf('Tests\\Stub\\ConfigStub', $config); $this->assertEquals($this->getFixtureFileContent($file), $config->data); }
/** * @param integer $number * @return \PHP\Manipulator\Config\Xml */ public function getXmlConfig($number) { return Config::factory('xml', TESTS_PATH . '/_fixtures/Config/config' . $number . '.xml', true); }