コード例 #1
0
 /**
  * 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;
 }
コード例 #2
0
ファイル: ServerTest.php プロジェクト: dantudor/stubber
 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();
 }