public function testRun() { $host = '127.0.0.1'; $port = 8080; $server = Mockery::mock('\\Stubber\\Server'); $server->shouldReceive('setApplication')->andReturn($server); $server->shouldReceive('setHost')->once()->andReturn($server); $server->shouldReceive('setPort')->once()->andReturn($server); $httpServer = Mockery::mock('\\React\\Http\\Server'); $httpServer->shouldReceive('on')->once(); $server->shouldReceive('getHttpServer')->once()->andReturn($httpServer); $server->shouldReceive('start')->once(); $application = new TestApplication($server); $application->getServer()->setHost($host)->setPort($port); $application->run(); }
function testBooted() { $app = new TestApplication(__DIR__ . "/app", "/tmp"); $app->run(); $this->assertTrue($app->config->booted); }