File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22
33namespace Pdsinterop \Solid \Auth ;
44
5+ use ArgumentCountError ;
56use PHPUnit \Framework \TestCase ;
67
78abstract class AbstractTestCase extends TestCase
89{
10+ ////////////////////////////// CUSTOM ASSERTS \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
11+
12+ public function expectArgumentCountError (int $ argumentCount ): void
13+ {
14+ $ this ->expectException (ArgumentCountError::class);
15+
16+ $ this ->expectExceptionMessageMatches ('/Too few arguments [^,]+, ' . ($ argumentCount - 1 ) . ' passed/ ' );
17+ }
918}
Original file line number Diff line number Diff line change 77use Pdsinterop \Solid \Auth \Enum \OpenId \OpenIdConnectMetadata as OidcMeta ;
88use Pdsinterop \Solid \Auth \Utils \Base64Url ;
99use PHPUnit \Framework \MockObject \MockObject ;
10- use PHPUnit \Framework \TestCase ;
1110
1211function time () { return 1234 ;}
1312
@@ -18,7 +17,7 @@ function time() { return 1234;}
1817 *
1918 * @uses \Pdsinterop\Solid\Auth\Utils\Base64Url
2019 */
21- class TokenGeneratorTest extends TestCase
20+ class TokenGeneratorTest extends AbstractTestCase
2221{
2322 ////////////////////////////////// FIXTURES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
2423
@@ -55,15 +54,6 @@ private function createTokenGenerator($interval = null): TokenGenerator
5554 return new TokenGenerator ($ this ->mockConfig , $ interval ??$ mockInterval );
5655 }
5756
58- ////////////////////////////// CUSTOM ASSERTS \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
59-
60- private function expectArgumentCountError (int $ argumentCount ): void
61- {
62- $ this ->expectException (\ArgumentCountError::class);
63-
64- $ this ->expectExceptionMessageMatches ('/Too few arguments [^,]+, ' . ($ argumentCount - 1 ) . ' passed/ ' );
65- }
66-
6757 /////////////////////////////////// TESTS \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
6858
6959 /**
You can’t perform that action at this time.
0 commit comments