From 72453c49f8d3467e6599f01cecbf8e5926b6bd65 Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Sat, 15 Jun 2024 11:37:32 +0200 Subject: tests: Add helper expectRedirectTo to module test class. Just a shorthand for manually stubbing `goaway` and setting the expectations on the test case. --- tests/unit/Module/TestCase.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tests') diff --git a/tests/unit/Module/TestCase.php b/tests/unit/Module/TestCase.php index f2e19f265..2959eab79 100644 --- a/tests/unit/Module/TestCase.php +++ b/tests/unit/Module/TestCase.php @@ -74,6 +74,12 @@ class TestCase extends \Zotlabs\Tests\Unit\UnitTestCase { } ); } + + protected function expectRedirectTo(string $destination): void { + $this->stub_goaway(); + $this->expectException(RedirectException::class); + $this->expectExceptionMessage($destination); + } } /** -- cgit v1.2.3