added some ui tests

pull/594/head
Austin Collier 8 months ago
parent 33676872ed
commit 5549e9106a

@ -116,6 +116,10 @@ Flight::route('/jsonp', function () {
echo "\n\n\n\n\n"; echo "\n\n\n\n\n";
}); });
Flight::route('/json-halt', function () {
Flight::jsonHalt(['message' => 'JSON rendered and halted successfully with no other body content!']);
});
// Test 10: Halt // Test 10: Halt
Flight::route('/halt', function () { Flight::route('/halt', function () {
Flight::halt(400, 'Halt worked successfully'); Flight::halt(400, 'Halt worked successfully');
@ -200,6 +204,7 @@ echo '
<li><a href="/error">Error</a></li> <li><a href="/error">Error</a></li>
<li><a href="/json">JSON</a></li> <li><a href="/json">JSON</a></li>
<li><a href="/jsonp?jsonp=myjson">JSONP</a></li> <li><a href="/jsonp?jsonp=myjson">JSONP</a></li>
<li><a href="/json-halt">JSON Halt</a></li>
<li><a href="/halt">Halt</a></li> <li><a href="/halt">Halt</a></li>
<li><a href="/redirect">Redirect</a></li> <li><a href="/redirect">Redirect</a></li>
</ul>'; </ul>';

@ -74,6 +74,7 @@ class LayoutMiddleware
<li><a href="/error">Error</a></li> <li><a href="/error">Error</a></li>
<li><a href="/json">JSON</a></li> <li><a href="/json">JSON</a></li>
<li><a href="/jsonp?jsonp=myjson">JSONP</a></li> <li><a href="/jsonp?jsonp=myjson">JSONP</a></li>
<li><a href="/json-halt">JSON Halt</a></li>
<li><a href="/halt">Halt</a></li> <li><a href="/halt">Halt</a></li>
<li><a href="/redirect">Redirect</a></li> <li><a href="/redirect">Redirect</a></li>
<li><a href="/streamResponse">Stream Plain</a></li> <li><a href="/streamResponse">Stream Plain</a></li>

@ -171,6 +171,10 @@ Flight::route('/jsonp', function () {
Flight::jsonp(['message' => 'JSONP renders successfully!'], 'jsonp'); Flight::jsonp(['message' => 'JSONP renders successfully!'], 'jsonp');
}); });
Flight::route('/json-halt', function () {
Flight::jsonHalt(['message' => 'JSON rendered and halted successfully with no other body content!']);
});
Flight::map('error', function (Throwable $e) { Flight::map('error', function (Throwable $e) {
echo sprintf( echo sprintf(
<<<HTML <<<HTML

Loading…
Cancel
Save