|
19 | 19 | use OC\Authentication\Token\IToken; |
20 | 20 | use OC\Avatar\GuestAvatar; |
21 | 21 | use OC\Http\Client\Client; |
22 | | -use OC_Util; |
23 | 22 | use OCA\GroupFolders\Folder\FolderManager; |
24 | 23 | use OCA\OpenProject\AppInfo\Application; |
25 | 24 | use OCA\OpenProject\Exception\OpenprojectErrorException; |
@@ -639,53 +638,37 @@ private function getOpenProjectAPIService( |
639 | 638 | $ocClient = null; |
640 | 639 | $client = new GuzzleClient(); |
641 | 640 | $clientConfigMock = $this->getMockBuilder(IConfig::class)->getMock(); |
642 | | - |
643 | | - if (version_compare(OC_Util::getVersionString(), '27') >= 0) { |
644 | | - $clientConfigMock |
645 | | - ->method('getSystemValueBool') |
646 | | - ->withConsecutive( |
647 | | - ['allow_local_remote_servers', false], |
648 | | - ['installed', false], |
649 | | - ['allow_local_remote_servers', false], |
650 | | - ['allow_local_remote_servers', false], |
651 | | - ['installed', false], |
652 | | - ['allow_local_remote_servers', false], |
653 | | - ['allow_local_remote_servers', false], |
654 | | - ['installed', false], |
655 | | - ['allow_local_remote_servers', false] |
656 | | - ) |
657 | | - ->willReturnOnConsecutiveCalls( |
658 | | - true, |
659 | | - true, |
660 | | - true, |
661 | | - true, |
662 | | - true, |
663 | | - true, |
664 | | - true, |
665 | | - true, |
666 | | - true |
667 | | - ); |
668 | | - //changed from nextcloud 26 |
669 | | - $ocClient = new Client( |
670 | | - $clientConfigMock, |
671 | | - $certificateManager, |
672 | | - $client, |
673 | | - $this->createMock(IRemoteHostValidator::class), |
674 | | - $this->createMock(LoggerInterface::class)); |
675 | | - } elseif (version_compare(OC_Util::getVersionString(), '26') >= 0) { |
676 | | - $clientConfigMock |
| 641 | + $clientConfigMock |
677 | 642 | ->method('getSystemValueBool') |
678 | | - ->with('allow_local_remote_servers', false) |
679 | | - ->willReturn(true); |
680 | | - |
681 | | - //changed from nextcloud 26 |
682 | | - $ocClient = new Client( |
683 | | - $clientConfigMock, |
684 | | - $certificateManager, |
685 | | - $client, |
686 | | - $this->createMock(IRemoteHostValidator::class) |
| 643 | + ->withConsecutive( |
| 644 | + ['allow_local_remote_servers', false], |
| 645 | + ['installed', false], |
| 646 | + ['allow_local_remote_servers', false], |
| 647 | + ['allow_local_remote_servers', false], |
| 648 | + ['installed', false], |
| 649 | + ['allow_local_remote_servers', false], |
| 650 | + ['allow_local_remote_servers', false], |
| 651 | + ['installed', false], |
| 652 | + ['allow_local_remote_servers', false] |
| 653 | + ) |
| 654 | + ->willReturnOnConsecutiveCalls( |
| 655 | + true, |
| 656 | + true, |
| 657 | + true, |
| 658 | + true, |
| 659 | + true, |
| 660 | + true, |
| 661 | + true, |
| 662 | + true, |
| 663 | + true |
687 | 664 | ); |
688 | | - } |
| 665 | + //changed from nextcloud 26 |
| 666 | + $ocClient = new Client( |
| 667 | + $clientConfigMock, |
| 668 | + $certificateManager, |
| 669 | + $client, |
| 670 | + $this->createMock(IRemoteHostValidator::class), |
| 671 | + $this->createMock(LoggerInterface::class)); |
689 | 672 |
|
690 | 673 | $clientService = $this->getMockBuilder('\OCP\Http\Client\IClientService')->getMock(); |
691 | 674 | $clientService->method('newClient')->willReturn($ocClient); |
|
0 commit comments