public function testIniProperty() { $container = new \Fwk\Di\Container(); $this->assertFalse($container->getProperty('iniProp', false)); $this->object->execute(__DIR__ . '/../test-di.xml', $container); $this->assertEquals('testing', $container->getProperty('iniProp')); }
/** * Sets up the fixture, for example, opens a network connection. * This method is called before a test is executed. */ protected function setUp() { $service = new UrlRewriterService(); $services = new \Fwk\Di\Container(); $services->set('requestMatcher', new ClassDefinition('Fwk\\Core\\Components\\RequestMatcher\\RequestMatcher'), true); $services->set('viewHelper', new \Fwk\Core\Components\ViewHelper\ViewHelperService(), true); $services->set('resultTypeService', new \Fwk\Core\Components\ResultType\ResultTypeService(), true); $services->set('urlRewriter', $service, true); $services->set('helloActionService', function () { return 'success'; }); $desc = new \Fwk\Core\Components\Descriptor\Descriptor(TEST_RESOURCES_DIR . DIRECTORY_SEPARATOR . 'Descriptor' . DIRECTORY_SEPARATOR . 'app_test.xml'); $desc->import(TEST_RESOURCES_DIR . DIRECTORY_SEPARATOR . 'Descriptor' . DIRECTORY_SEPARATOR . 'app_test2.xml'); $desc->iniProperties(TEST_RESOURCES_DIR . DIRECTORY_SEPARATOR . 'Descriptor' . DIRECTORY_SEPARATOR . 'config-one.ini'); $this->app = $desc->execute('testApp', $services); }