Browse Source
- Adjusted some namespace case - Included Linux test runner; should also work with macOS - Made the PHP server run in the background on Windowsmicrosub
J. King
7 years ago
7 changed files with 42 additions and 15 deletions
@ -1,4 +1,12 @@ |
|||
<?php return [ |
|||
'code' => 304, |
|||
'lastMod' => (int) $_GET['t'], |
|||
]; |
|||
<?php |
|||
if(array_key_exists("t", $_GET)) { |
|||
return [ |
|||
'code' => 304, |
|||
'lastMod' => (int) $_GET['t'], |
|||
]; |
|||
} else { |
|||
return [ |
|||
'code' => 304, |
|||
'cache' => fasel, |
|||
]; |
|||
} |
@ -0,0 +1,7 @@ |
|||
#! /bin/sh |
|||
base=`dirname "$0"` |
|||
php -S localhost:8000 "$base/server.php" >/dev/null & |
|||
php "$base/../vendor/phpunit/phpunit/phpunit" -c "$base/phpunit.xml" |
|||
sleep 1s |
|||
pid=`netstat -tlpn 2>/dev/null | grep ":8000 " | grep -Eo "[0-9]+/php" | grep -Eo "[0-9]+"` |
|||
kill $pid |
@ -1,10 +1,10 @@ |
|||
@echo off |
|||
setlocal |
|||
set base=%~dp0 |
|||
start php -S localhost:8000 "%base%\server.php" |
|||
start /b php -S localhost:8000 "%base%\server.php" >nul |
|||
php "%base%\..\vendor\phpunit\phpunit\phpunit" -c "%base%\phpunit.xml" |
|||
timeout /nobreak /t 1 >nul |
|||
for /f "usebackq tokens=5" %%a in (`netstat -aon ^| find "LISTENING" ^| find ":8000"`) do ( |
|||
taskkill /pid %%a >nul |
|||
taskkill /f /pid %%a >nul |
|||
goto :eof |
|||
) |
Loading…
Reference in new issue