From eb9aa22170ce921d2816db539dd865986f0ba6bc Mon Sep 17 00:00:00 2001 From: Sam Light Date: Wed, 10 Jun 2026 19:00:33 +0100 Subject: testing middleware dispatch --- tests/Utils/TestMiddleware.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'tests/Utils/TestMiddleware.php') diff --git a/tests/Utils/TestMiddleware.php b/tests/Utils/TestMiddleware.php index eb3ea04..e273d05 100644 --- a/tests/Utils/TestMiddleware.php +++ b/tests/Utils/TestMiddleware.php @@ -34,6 +34,21 @@ class TestMiddleware implements Middleware Assert::assertGreaterThan(0, $this->calls); } + public function assertCalledTimes(int $val): void + { + Assert::assertSame($val, $this->calls); + } + + public function assertCalledOnce(): void + { + $this->assertCalledTimes(1); + } + + public function assertNotCalled(): void + { + $this->assertCalledTimes(0); + } + public function assertCallNumber(int $num): void { Assert::assertSame($num, $this->call); -- cgit v1.2.3