File tree Expand file tree Collapse file tree
tests/php/Unit/Handler/SignEngine Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2626use OCP \IDateTimeZone ;
2727use OCP \IRequest ;
2828use OCP \ITempManager ;
29+ use OCP \IURLGenerator ;
2930use OCP \IUserSession ;
3031use OCP \L10N \IFactory as IL10NFactory ;
3132use PHPUnit \Framework \Attributes \DataProvider ;
@@ -74,12 +75,18 @@ public function setUp(): void {
7475 }
7576
7677 private function getInstance (array $ methods = []): JSignPdfHandler |MockObject {
78+ $ urlGenerator = $ this ->createMock (IURLGenerator::class);
79+ $ urlGenerator
80+ ->method ('linkToRouteAbsolute ' )
81+ ->willReturnCallback (fn (string $ route , array $ params ): string => 'https://example.test/ ' . $ route . '/ ' . ($ params ['uuid ' ] ?? '' ));
82+
7783 $ signatureTextService = new SignatureTextService (
7884 $ this ->appConfig ,
7985 \OCP \Server::get (IL10NFactory::class)->get (Application::APP_ID ),
8086 \OCP \Server::get (IDateTimeZone::class),
8187 \OCP \Server::get (IRequest::class),
8288 \OCP \Server::get (IUserSession::class),
89+ $ urlGenerator ,
8390 \OCP \Server::get (LoggerInterface::class),
8491 );
8592
You can’t perform that action at this time.
0 commit comments