aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2024-06-15 11:37:32 +0200
committerHarald Eilertsen <haraldei@anduin.net>2024-06-16 08:56:43 +0200
commit72453c49f8d3467e6599f01cecbf8e5926b6bd65 (patch)
treebee66169e72dbfd4d0bead56bfd0bcd98bc22282 /tests/unit
parent66ea277045ef62106051f2614a116234ba4a302a (diff)
downloadvolse-hubzilla-72453c49f8d3467e6599f01cecbf8e5926b6bd65.tar.gz
volse-hubzilla-72453c49f8d3467e6599f01cecbf8e5926b6bd65.tar.bz2
volse-hubzilla-72453c49f8d3467e6599f01cecbf8e5926b6bd65.zip
tests: Add helper expectRedirectTo to module test class.
Just a shorthand for manually stubbing `goaway` and setting the expectations on the test case.
Diffstat (limited to 'tests/unit')
-rw-r--r--tests/unit/Module/TestCase.php6
1 files changed, 6 insertions, 0 deletions
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);
+ }
}
/**