66
77use DateTimeImmutable ;
88use Laminas \Diactoros \ServerRequest ;
9+ use PHPUnit \Framework \Attributes \CoversClass ;
910use PHPUnit \Framework \Attributes \DataProvider ;
1011use PHPUnit \Framework \Attributes \TestDox ;
12+ use PHPUnit \Framework \Attributes \UsesClass ;
1113use PHPUnit \Framework \MockObject \MockObject ;
1214use PHPUnit \Framework \TestCase ;
1315use SimpleSAML \Module \oidc \Bridges \SspBridge ;
1416use SimpleSAML \Module \oidc \Codebooks \RegistrationTypeEnum ;
1517use SimpleSAML \Module \oidc \Forms \ClientForm ;
1618use SimpleSAML \Module \oidc \Forms \Controls \CsrfProtection ;
19+ use SimpleSAML \Module \oidc \Helpers ;
1720use SimpleSAML \Module \oidc \ModuleConfig ;
1821
19- /**
20- * @covers \SimpleSAML\Module\oidc\Forms\ClientForm
21- */
22+ #[CoversClass(ClientForm::class)]
23+ #[UsesClass(Helpers::class)]
2224class ClientFormTest extends TestCase
2325{
2426 protected MockObject $ csrfProtectionMock ;
@@ -29,6 +31,7 @@ class ClientFormTest extends TestCase
2931 protected MockObject $ sspBridgeMock ;
3032 protected MockObject $ sspBridgeAuthMock ;
3133 protected MockObject $ sspBridgeAuthSourceMock ;
34+ protected Helpers $ helpers ;
3235
3336 protected array $ clientDataSample ;
3437
@@ -42,6 +45,7 @@ public function setUp(): void
4245 $ this ->moduleConfigMock = $ this ->createMock (ModuleConfig::class);
4346 $ this ->serverRequestMock = $ this ->createMock (ServerRequest::class);
4447 $ this ->sspBridgeMock = $ this ->createMock (SspBridge::class);
48+ $ this ->helpers = new Helpers ();
4549
4650 $ this ->sspBridgeAuthMock = $ this ->createMock (SspBridge \Auth::class);
4751 $ this ->sspBridgeMock ->method ('auth ' )->willReturn ($ this ->sspBridgeAuthMock );
@@ -85,15 +89,18 @@ protected function sut(
8589 ?ModuleConfig $ moduleConfig = null ,
8690 ?CsrfProtection $ csrfProtection = null ,
8791 ?SspBridge $ sspBridge = null ,
92+ ?Helpers $ helpers = null ,
8893 ): ClientForm {
8994 $ moduleConfig ??= $ this ->moduleConfigMock ;
9095 $ csrfProtection ??= $ this ->csrfProtectionMock ;
9196 $ sspBridge ??= $ this ->sspBridgeMock ;
97+ $ helpers ??= $ this ->helpers ;
9298
9399 return new ClientForm (
94100 $ moduleConfig ,
95101 $ csrfProtection ,
96102 $ sspBridge ,
103+ $ helpers ,
97104 );
98105 }
99106
0 commit comments