protected function standUpServer($working_dir = NULL
) { // If the user wants to test a new docroot, we have to shut down the old
// server process and generate a new port number.
if ($working_dir !==
$this->serverDocroot && !
empty($this->serverProcess
)) { $this->
stopServer();
} // If there's not a server at this point, make one.
if (!
$this->serverProcess ||
$this->serverProcess->
isTerminated()) { $this->serverProcess =
$this->
instantiateServer($this->
getPortNumber(),
$working_dir);
if ($this->serverProcess
) { $this->serverDocroot =
$working_dir;
} } } /**
* Do the work of making a server process.
*
* Test authors should call visit() or assertVisit() instead.
*
* When initializing the server, if '.ht.router.php' exists in the root, it is
* leveraged. If testing with a version of Drupal before 8.5.x., this file
* does not exist.
*
* @param int $port
* The port number for the server.
* @param string|null $working_dir
* (optional) Server docroot relative to the workspace filesystem. Defaults
* to the workspace directory.
*
* @return \Symfony\Component\Process\Process
* The server process.
*
* @throws \RuntimeException
* Thrown if we were unable to start a web server.
*/