public function testPropertiesConfiguration() { $manager = new Manager(); $manager->setConfigureAllProperties(true); $module = $manager->create('Common\\Module', array('_state' => '_state')); $this->assertSame($module->getProtectedState(), '_state'); $manager->setConfigureAllProperties(true); $this->assertTrue($manager->getConfigureAllProperties()); $manager->setConfigureAllProperties(false); $this->assertFalse($manager->getConfigureAllProperties()); $module = $manager->create('Common\\Module', array('_state' => '_state')); $this->assertSame($module->getProtectedState(), null); }
public function testNamedControllerMount() { // defaults $_SERVER['REQUEST_METHOD'] = 'GET'; $_SERVER['REQUEST_URI'] = '/other'; $manager = new Manager(); $manager->setConfigureAllProperties(true); $web = $manager->create('Cti\\Core\\Module\\Web', array('base' => '/', 'controllers' => array('Controller\\DefaultController', 'Controller\\OtherController'))); ob_start(); $web->run(); $this->assertSame(ob_get_clean(), 'other page'); }