Last active
February 15, 2020 03:47
-
-
Save dillingham/5f81902798b8401f927cb117840cb4e5 to your computer and use it in GitHub Desktop.
serve php in phpunit test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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