/** * 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 testSpecificHttpServer() { $httpServer = Mockery::mock('\\React\\Http\\Server'); $server = new Server($this->mockProcessManager, $this->mockPrimer, null, null, $httpServer); $this->assertSame($httpServer, $server->getHttpServer()); }