/** * Run Application * * @return $this */ public function run() { $application = $this; $this->server->getHttpServer()->on('request', function ($request, $response) use($application) { $application->handleRequest($request, $response); }); $this->server->setHost($this->serverHost)->setPort($this->serverPort)->start(); return $this; }
public function testStart() { $mockProcess = Mockery::mock('Pagon\\ChildProcess\\Process'); $this->mockPrimer->shouldReceive('prepare')->andReturn($this->mockPrimer); $this->mockProcessManager->shouldReceive('parallel')->andReturn($mockProcess); $server = new Server($this->mockProcessManager, $this->mockPrimer); $server->start(); }