From 5549e9106ad866da72870a6fe47c3d633e168db4 Mon Sep 17 00:00:00 2001 From: Austin Collier Date: Thu, 30 May 2024 07:40:22 -0600 Subject: [PATCH] added some ui tests --- tests/server-v2/index.php | 5 +++++ tests/server/LayoutMiddleware.php | 1 + tests/server/index.php | 4 ++++ 3 files changed, 10 insertions(+) diff --git a/tests/server-v2/index.php b/tests/server-v2/index.php index 3c1951c..d0f8bcd 100644 --- a/tests/server-v2/index.php +++ b/tests/server-v2/index.php @@ -116,6 +116,10 @@ Flight::route('/jsonp', function () { 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 Flight::route('/halt', function () { Flight::halt(400, 'Halt worked successfully'); @@ -200,6 +204,7 @@ echo '
  • Error
  • JSON
  • JSONP
  • +
  • JSON Halt
  • Halt
  • Redirect
  • '; diff --git a/tests/server/LayoutMiddleware.php b/tests/server/LayoutMiddleware.php index d23e81c..2d55f24 100644 --- a/tests/server/LayoutMiddleware.php +++ b/tests/server/LayoutMiddleware.php @@ -74,6 +74,7 @@ class LayoutMiddleware
  • Error
  • JSON
  • JSONP
  • +
  • JSON Halt
  • Halt
  • Redirect
  • Stream Plain
  • diff --git a/tests/server/index.php b/tests/server/index.php index a983590..5c86d11 100644 --- a/tests/server/index.php +++ b/tests/server/index.php @@ -171,6 +171,10 @@ Flight::route('/jsonp', function () { 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) { echo sprintf( <<