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 [ |
<?php |
||||
'code' => 304, |
if(array_key_exists("t", $_GET)) { |
||||
'lastMod' => (int) $_GET['t'], |
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 |
@echo off |
||||
setlocal |
setlocal |
||||
set base=%~dp0 |
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" |
php "%base%\..\vendor\phpunit\phpunit\phpunit" -c "%base%\phpunit.xml" |
||||
timeout /nobreak /t 1 >nul |
timeout /nobreak /t 1 >nul |
||||
for /f "usebackq tokens=5" %%a in (`netstat -aon ^| find "LISTENING" ^| find ":8000"`) do ( |
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 |
goto :eof |
||||
) |
) |
Loading…
Reference in new issue