Skip to content

Instantly share code, notes, and snippets.

@dillingham
Last active February 15, 2020 03:47
Show Gist options
  • Save dillingham/5f81902798b8401f927cb117840cb4e5 to your computer and use it in GitHub Desktop.
Save dillingham/5f81902798b8401f927cb117840cb4e5 to your computer and use it in GitHub Desktop.
serve php in phpunit test
public static $pid;
public static function setUpBeforeClass() :void
{
self::$pid = exec("php -S localhost:9000 -t ../../public > /dev/null 2>&1 & echo $!");
}
public static function tearDownAfterClass() :void
{
exec('kill ' . self::$pid);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment