예제 #1
0
 public function testRun()
 {
     $app = $this->getMockBuilder('Hyperframework\\Cli\\App')->disableOriginalConstructor()->setMethods(['executeCommand', 'finalize'])->getMock();
     $app->expects($this->once())->method('executeCommand');
     $app->expects($this->once())->method('finalize');
     Registry::set('hyperframework.cli.test.app', $app);
     App::run('');
 }
예제 #2
0
 public function testRun()
 {
     $app = $this->getMockBuilder('Hyperframework\\Web\\App')->setConstructorArgs([dirname(__DIR__)])->setMethods(['createController', 'finalize'])->getMock();
     $controller = $this->getMockBuilder('Hyperframework\\Web\\Test\\IndexController')->setConstructorArgs([$app])->getMock();
     $controller->expects($this->once())->method('run');
     $app->expects($this->once())->method('createController')->willReturn($controller);
     $app->expects($this->once())->method('finalize');
     Registry::set('hyperframework.web.test.app', $app);
     App::run();
 }
 public function test()
 {
     Registry::set('name', 'value');
     $this->assertSame('value', Registry::get('name'));
     Registry::remove('name');
     $this->assertFalse(Registry::has('name'));
     Registry::set('name', 'value');
     Registry::clear();
     $this->assertFalse(Registry::has('name'));
 }
예제 #4
0
 /**
  * @param LoggerEngine $engine
  * @return void
  */
 public static function setEngine($engine)
 {
     Registry::set('hyperframework.logging.logger_engine', $engine);
 }
예제 #5
0
 /**
  * @param DbClientEngine $engine
  * @return void
  */
 public static function setEngine($engine)
 {
     Registry::set('hyperframework.db.client_engine', $engine);
 }
 /**
  * @param CsrfProtectionEngine $engine
  * @return void
  */
 public static function setEngine($engine)
 {
     Registry::set('hyperframework.web.csrf_protection_engine', $engine);
 }
예제 #7
0
 /**
  * @param RequestEngine $engine
  * @return void
  */
 public static function setEngine($engine)
 {
     Registry::set('hyperframework.web.request_engine', $engine);
 }