@@ -56,32 +56,33 @@ public static function setUpBeforeClass(): void {
5656 parent ::setUpBeforeClass ();
5757 $ backend = new Dummy ();
5858 $ backend ->createUser (self ::TEST_USER1 , self ::TEST_USER1 );
59- \OC :: $ server -> get (\OCP \IUserManager::class)->registerBackend ($ backend );
59+ \OCP \Server:: get (\OCP \IUserManager::class)->registerBackend ($ backend );
6060 }
6161
6262 protected function setUp (): void {
6363 parent ::setUp ();
6464
6565 $ this ->loginAsUser (self ::TEST_USER1 );
6666
67- $ this ->openAiSettingsService = \OC :: $ server -> get (OpenAiSettingsService::class);
67+ $ this ->openAiSettingsService = \OCP \Server:: get (OpenAiSettingsService::class);
6868
69- $ this ->chunkService = \OC :: $ server -> get (ChunkService::class);
69+ $ this ->chunkService = \OCP \Server:: get (ChunkService::class);
7070
71- $ this ->quotaUsageMapper = \OC :: $ server -> get (QuotaUsageMapper::class);
71+ $ this ->quotaUsageMapper = \OCP \Server:: get (QuotaUsageMapper::class);
7272
7373 // We'll hijack the client service and subsequently iClient to return a mock response from the OpenAI API
7474 $ clientService = $ this ->createMock (IClientService::class);
7575 $ this ->iClient = $ this ->createMock (IClient::class);
7676 $ clientService ->method ('newClient ' )->willReturn ($ this ->iClient );
7777
7878 $ this ->openAiApiService = new OpenAiAPIService (
79- \OC :: $ server -> get (\Psr \Log \LoggerInterface::class),
79+ \OCP \Server:: get (\Psr \Log \LoggerInterface::class),
8080 $ this ->createMock (\OCP \IL10N ::class),
81- \OC :: $ server -> get (IAppConfig::class),
82- \OC :: $ server -> get (ICacheFactory::class),
83- \OC :: $ server -> get (QuotaUsageMapper::class),
81+ \OCP \Server:: get (IAppConfig::class),
82+ \OCP \Server:: get (ICacheFactory::class),
83+ \OCP \Server:: get (QuotaUsageMapper::class),
8484 $ this ->openAiSettingsService ,
85+ $ this ->createMock (\OCP \Notification \IManager::class),
8586 $ clientService ,
8687 );
8788
@@ -90,7 +91,7 @@ protected function setUp(): void {
9091
9192 public static function tearDownAfterClass (): void {
9293 // Delete quota usage for test user
93- $ quotaUsageMapper = \OC :: $ server -> get (QuotaUsageMapper::class);
94+ $ quotaUsageMapper = \OCP \Server:: get (QuotaUsageMapper::class);
9495 try {
9596 $ quotaUsageMapper ->deleteUserQuotaUsages (self ::TEST_USER1 );
9697 } catch (\OCP \Db \Exception |\RuntimeException |\Exception |\Throwable $ e ) {
@@ -99,15 +100,15 @@ public static function tearDownAfterClass(): void {
99100
100101 $ backend = new \Test \Util \User \Dummy ();
101102 $ backend ->deleteUser (self ::TEST_USER1 );
102- \OC :: $ server -> get (\OCP \IUserManager::class)->removeBackend ($ backend );
103+ \OCP \Server:: get (\OCP \IUserManager::class)->removeBackend ($ backend );
103104
104105 parent ::tearDownAfterClass ();
105106 }
106107
107108 public function testFreePromptProvider (): void {
108109 $ freePromptProvider = new TextToTextProvider (
109110 $ this ->openAiApiService ,
110- \OC :: $ server -> get (IAppConfig::class),
111+ \OCP \Server:: get (IAppConfig::class),
111112 $ this ->openAiSettingsService ,
112113 $ this ->createMock (\OCP \IL10N ::class),
113114 self ::TEST_USER1 ,
@@ -170,7 +171,7 @@ public function testFreePromptProvider(): void {
170171 public function testEmojiProvider (): void {
171172 $ emojiProvider = new EmojiProvider (
172173 $ this ->openAiApiService ,
173- \OC :: $ server -> get (IAppConfig::class),
174+ \OCP \Server:: get (IAppConfig::class),
174175 $ this ->openAiSettingsService ,
175176 $ this ->createMock (\OCP \IL10N ::class),
176177 self ::TEST_USER1 ,
@@ -235,7 +236,7 @@ public function testEmojiProvider(): void {
235236 public function testHeadlineProvider (): void {
236237 $ headlineProvider = new HeadlineProvider (
237238 $ this ->openAiApiService ,
238- \OC :: $ server -> get (IAppConfig::class),
239+ \OCP \Server:: get (IAppConfig::class),
239240 $ this ->openAiSettingsService ,
240241 $ this ->createMock (\OCP \IL10N ::class),
241242 self ::TEST_USER1 ,
@@ -299,7 +300,7 @@ public function testHeadlineProvider(): void {
299300 public function testChangeToneProvider (): void {
300301 $ changeToneProvider = new ChangeToneProvider (
301302 $ this ->openAiApiService ,
302- \OC :: $ server -> get (IAppConfig::class),
303+ \OCP \Server:: get (IAppConfig::class),
303304 $ this ->openAiSettingsService ,
304305 $ this ->createMock (\OCP \IL10N ::class),
305306 $ this ->chunkService ,
@@ -366,7 +367,7 @@ public function testChangeToneProvider(): void {
366367 public function testSummaryProvider (): void {
367368 $ summaryProvider = new SummaryProvider (
368369 $ this ->openAiApiService ,
369- \OC :: $ server -> get (IAppConfig::class),
370+ \OCP \Server:: get (IAppConfig::class),
370371 $ this ->openAiSettingsService ,
371372 $ this ->createMock (\OCP \IL10N ::class),
372373 $ this ->chunkService ,
@@ -435,7 +436,7 @@ public function testSummaryProvider(): void {
435436 public function testProofreadProvider (): void {
436437 $ proofreadProvider = new ProofreadProvider (
437438 $ this ->openAiApiService ,
438- \OC :: $ server -> get (IAppConfig::class),
439+ \OCP \Server:: get (IAppConfig::class),
439440 $ this ->openAiSettingsService ,
440441 $ this ->createMock (\OCP \IL10N ::class),
441442 $ this ->chunkService ,
@@ -503,10 +504,10 @@ public function testProofreadProvider(): void {
503504 public function testTranslationProvider (): void {
504505 $ translationProvider = new TranslateProvider (
505506 $ this ->openAiApiService ,
506- \OC :: $ server -> get (IAppConfig::class),
507+ \OCP \Server:: get (IAppConfig::class),
507508 $ this ->openAiSettingsService ,
508509 $ this ->createMock (\OCP \IL10N ::class),
509- \OC :: $ server -> get (\OCP \L10N \IFactory::class),
510+ \OCP \Server:: get (\OCP \L10N \IFactory::class),
510511 $ this ->createMock (\OCP \ICacheFactory::class),
511512 $ this ->createMock (\Psr \Log \LoggerInterface::class),
512513 $ this ->chunkService ,
@@ -576,7 +577,7 @@ public function testTextToSpeechProvider(): void {
576577 $ this ->openAiApiService ,
577578 $ this ->createMock (\OCP \IL10N ::class),
578579 $ this ->createMock (\Psr \Log \LoggerInterface::class),
579- \OC :: $ server -> get (IAppConfig::class),
580+ \OCP \Server:: get (IAppConfig::class),
580581 self ::TEST_USER1 ,
581582 );
582583
0 commit comments