Example #1
0
File: DiTests.php Project: cti/di
 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);
 }
Example #2
0
File: WebTest.php Project: cti/core
 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');
 }