From b899a995e2fd977fbf7497b36b2dbc8d641ef398 Mon Sep 17 00:00:00 2001 From: Sam Light Date: Wed, 10 Jun 2026 19:00:32 +0100 Subject: Started structure for middleware --- tests/Utils/TestCallable.php | 2 +- tests/Utils/TestMiddleware.php | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 tests/Utils/TestMiddleware.php (limited to 'tests/Utils') diff --git a/tests/Utils/TestCallable.php b/tests/Utils/TestCallable.php index 526ddf4..67b3d6c 100644 --- a/tests/Utils/TestCallable.php +++ b/tests/Utils/TestCallable.php @@ -51,7 +51,7 @@ class TestCallable return $this->calls[$this->getCallCount() - 1] ?? null; } - public function assertIsCalled(): void + public function assertCalled(): void { Assert::assertGreaterThan(0, $this->getCallCount(), 'Not been called'); } diff --git a/tests/Utils/TestMiddleware.php b/tests/Utils/TestMiddleware.php new file mode 100644 index 0000000..2f3ed32 --- /dev/null +++ b/tests/Utils/TestMiddleware.php @@ -0,0 +1,27 @@ +calls; + + return $next($request); + } + + public function assertCalled(): void + { + Assert::assertGreaterThan(0, $this->calls); + } +} -- cgit v1.2.3