File tree Expand file tree Collapse file tree
tests/modules/authorize/lib/Auth/Process Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66namespace SimpleSAML \Test \Module \consent \Auth \Process ;
77
88use PHPUnit \Framework \TestCase ;
9- use SimpleSAML \Module \authorize \Auth \Process \Authorize ;
109use SimpleSAML \Utils \Attributes ;
1110
1211class AuthorizeTest extends TestCase
@@ -161,15 +160,3 @@ public function noregexScenarioProvider()
161160 ];
162161 }
163162}
164- // phpcs:ignore
165- class TestableAuthorize extends Authorize
166- {
167- /**
168- * Override the redirect behavior since its difficult to test
169- * @param array $request the state
170- */
171- protected function unauthorized (&$ request )
172- {
173- $ request ['NOT_AUTHORIZED ' ] = true ;
174- }
175- }
Original file line number Diff line number Diff line change 1+ <?php
2+ /**
3+ * Subclass authorize filter to make it unit testable.
4+ */
5+
6+ namespace SimpleSAML \Test \Module \consent \Auth \Process ;
7+
8+ use SimpleSAML \Module \authorize \Auth \Process \Authorize ;
9+
10+ class TestableAuthorize extends Authorize
11+ {
12+ /**
13+ * Override the redirect behavior since its difficult to test
14+ * @param array $request the state
15+ */
16+ protected function unauthorized (&$ request )
17+ {
18+ $ request ['NOT_AUTHORIZED ' ] = true ;
19+ }
20+ }
You can’t perform that action at this time.
0 commit comments