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(''); }
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')); }
/** * @param LoggerEngine $engine * @return void */ public static function setEngine($engine) { Registry::set('hyperframework.logging.logger_engine', $engine); }
/** * @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); }
/** * @param RequestEngine $engine * @return void */ public static function setEngine($engine) { Registry::set('hyperframework.web.request_engine', $engine); }