Example #1
0
 public function testIsRunning()
 {
     $host = '127.0.0.1';
     $port = 8124;
     $serverPath = __DIR__ . '/server-fixtures/test_server.js';
     $server = new TestServer($host, $port, null, $serverPath, 10000);
     $this->assertFalse($server->isRunning());
     $process = $this->getWorkingServerProcessMock($host, $port);
     $server->start($process);
     $this->assertTrue($server->isRunning());
     $process = $this->getTerminatedServerProcessMock();
     try {
         $server->start($process);
     } catch (\RuntimeException $ex) {
         // ignore error
     }
     $this->assertFalse($server->isRunning());
 }