예제 #1
0
파일: DiTests.php 프로젝트: 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);
 }
예제 #2
0
파일: WebTest.php 프로젝트: 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');
 }