File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1919use OCP \ICacheFactory ;
2020use OCP \IConfig ;
2121use OCP \IURLGenerator ;
22+ use OCP \Security \Signature \Exceptions \IdentityNotFoundException ;
2223use OCP \Security \Signature \ISignatureManager ;
2324use PHPUnit \Framework \MockObject \MockObject ;
2425use Psr \Log \LoggerInterface ;
@@ -46,6 +47,8 @@ protected function setUp(): void {
4647 $ this ->wireIdentityProofManager ();
4748
4849 $ signatureManager = $ this ->createMock (ISignatureManager::class);
50+ $ signatureManager ->method ('generateKeyIdFromConfig ' )
51+ ->willThrowException (new IdentityNotFoundException ('no configured identity ' ));
4952 $ urlGenerator = $ this ->createMock (IURLGenerator::class);
5053 $ urlGenerator ->method ('getAbsoluteURL ' )
5154 ->willReturnCallback (static fn (string $ path ): string => 'https://alice.example ' . $ path );
@@ -188,6 +191,8 @@ public function testSignerReturnsNullWhenIdentityCannotBeDerived(): void {
188191 // identity at all; provisioning the first key should fail loudly so
189192 // the admin gets a clear message instead of a corrupt half-state.
190193 $ signatureManager = $ this ->createMock (ISignatureManager::class);
194+ $ signatureManager ->method ('generateKeyIdFromConfig ' )
195+ ->willThrowException (new IdentityNotFoundException ('no configured identity ' ));
191196 $ urlGenerator = $ this ->createMock (IURLGenerator::class);
192197 // getAbsoluteURL() yields no host, so the kid's identity cannot be
193198 // resolved; provisioning must fail loudly rather than corrupt state.
You can’t perform that action at this time.
0 commit comments