Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 2 additions & 10 deletions .github/workflows/shared_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@ jobs:
name: unit tests and linting
strategy:
matrix:
nextcloudVersion: [ stable26, stable27, stable28, stable29, stable30 ]
nextcloudVersion: [ stable27, stable28, stable29, stable30 ]
phpVersion: [ 8.0, 8.1, 8.2, 8.3]
exclude:
- nextcloudVersion: stable26
phpVersion: 8.3
- nextcloudVersion: stable27
phpVersion: 8.3
- nextcloudVersion: stable30
Expand Down Expand Up @@ -180,15 +178,13 @@ jobs:
name: API tests
strategy:
matrix:
nextcloudVersion: [ stable26, stable27, stable28, stable29, stable30 ]
nextcloudVersion: [ stable27, stable28, stable29, stable30 ]
phpVersionMajor: [ 8 ]
phpVersionMinor: [ 0, 1, 2, 3 ]
database: [pgsql, mysql]
isScheduledEventNightly:
- ${{github.event_name == 'schedule'}}
exclude:
- nextcloudVersion: stable26
phpVersionMinor: 3
- nextcloudVersion: stable27
phpVersionMinor: 3
- nextcloudVersion: stable30
Expand Down Expand Up @@ -297,10 +293,6 @@ jobs:
- name: API Tests
env:
NEXTCLOUD_BASE_URL: http://nextcloud
BEHAT_FILTER_TAGS: ${{
matrix.nextcloudVersion == 'stable26' && '~@skipOnStable26' ||
''
}}
run: |
# The following if block can be removed once Nextcloud no longer supports PHP 8.0
if [ "${{matrix.phpVersionMajor}}" -eq 8 ] && [ "${{matrix.phpVersionMinor}}" -eq 0 ]; then
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Fix random deactivation of automatically managed project folder
- Fix avatar not found in openproject
- Enhance project search when creating workpackages from Nextcloud
- Drop application's support for Nextcloud 26

## 2.6.4 - 2024-08-15
### Changed
Expand Down
2 changes: 1 addition & 1 deletion appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ For more information on how to set up and use the OpenProject application, pleas
<screenshot>https://github.com/nextcloud/integration_openproject/raw/master/img/screenshot1.png</screenshot>
<screenshot>https://github.com/nextcloud/integration_openproject/raw/master/img/screenshot2.png</screenshot>
<dependencies>
<nextcloud min-version="26" max-version="30" />
<nextcloud min-version="27" max-version="30" />
</dependencies>
<background-jobs>
<job>OCA\OpenProject\BackgroundJob\RemoveExpiredDirectUploadTokens</job>
Expand Down
8 changes: 2 additions & 6 deletions tests/acceptance/features/api/setup.feature
Original file line number Diff line number Diff line change
Expand Up @@ -678,9 +678,7 @@ Feature: setup the integration through an API
When user "OpenProject" sends a "PROPFIND" request to "/remote.php/webdav" using old app password
Then the HTTP status code should be "401"

# to locally run this test the "project folder" needs to be setup already
# issue of group folder https://github.com/nextcloud/groupfolders/issues/2718
@skipOnStable25 @skipOnStable26

Scenario: check version of uploaded file inside a group folder
Given user "Carol" has been created
And user "Carol" has been added to the group "OpenProject"
Expand All @@ -693,9 +691,7 @@ Feature: setup the integration through an API
When user "Carol" deletes folder "/OpenProject/OpenProject/project-demo"
Then the HTTP status code should be 204

# to locally run this test the "project folder" needs to be setup already
# issue of group folder https://github.com/nextcloud/groupfolders/issues/2718
@skipOnStable25 @skipOnStable26

Scenario: check version of uploaded file after an update inside a group folder
Given user "Carol" has been created
And user "Carol" has been added to the group "OpenProject"
Expand Down
7 changes: 0 additions & 7 deletions tests/lib/Reference/WorkPackageReferenceProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
namespace OCA\OpenProject\Reference;

use OC\Collaboration\Reference\ReferenceManager;
use OC_Util;
use OCA\OpenProject\AppInfo\Application;
use OCA\OpenProject\Service\OpenProjectAPIService;
use OCP\IConfig;
Expand All @@ -34,12 +33,6 @@
use PHPUnit\Framework\TestCase;

class WorkPackageReferenceProviderTest extends TestCase {
protected function setUp(): void {
if (version_compare(OC_Util::getVersionString(), '26') < 0) {
$this->markTestSkipped('WorkPackageReferenceProvider is only available from nextcloud 26 so skip the tests on versions below');
}
}

/**
*
* @param array<string> $onlyMethods
Expand Down
75 changes: 29 additions & 46 deletions tests/lib/Service/OpenProjectAPIServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
use OC\Authentication\Token\IToken;
use OC\Avatar\GuestAvatar;
use OC\Http\Client\Client;
use OC_Util;
use OCA\GroupFolders\Folder\FolderManager;
use OCA\OpenProject\AppInfo\Application;
use OCA\OpenProject\Exception\OpenprojectErrorException;
Expand Down Expand Up @@ -639,53 +638,37 @@ private function getOpenProjectAPIService(
$ocClient = null;
$client = new GuzzleClient();
$clientConfigMock = $this->getMockBuilder(IConfig::class)->getMock();

if (version_compare(OC_Util::getVersionString(), '27') >= 0) {
$clientConfigMock
->method('getSystemValueBool')
->withConsecutive(
['allow_local_remote_servers', false],
['installed', false],
['allow_local_remote_servers', false],
['allow_local_remote_servers', false],
['installed', false],
['allow_local_remote_servers', false],
['allow_local_remote_servers', false],
['installed', false],
['allow_local_remote_servers', false]
)
->willReturnOnConsecutiveCalls(
true,
true,
true,
true,
true,
true,
true,
true,
true
);
//changed from nextcloud 26
$ocClient = new Client(
$clientConfigMock,
$certificateManager,
$client,
$this->createMock(IRemoteHostValidator::class),
$this->createMock(LoggerInterface::class));
} elseif (version_compare(OC_Util::getVersionString(), '26') >= 0) {
$clientConfigMock
$clientConfigMock
->method('getSystemValueBool')
->with('allow_local_remote_servers', false)
->willReturn(true);

//changed from nextcloud 26
$ocClient = new Client(
$clientConfigMock,
$certificateManager,
$client,
$this->createMock(IRemoteHostValidator::class)
->withConsecutive(
['allow_local_remote_servers', false],
['installed', false],
['allow_local_remote_servers', false],
['allow_local_remote_servers', false],
['installed', false],
['allow_local_remote_servers', false],
['allow_local_remote_servers', false],
['installed', false],
['allow_local_remote_servers', false]
)
->willReturnOnConsecutiveCalls(
true,
true,
true,
true,
true,
true,
true,
true,
true
);
}
//changed from nextcloud 26
$ocClient = new Client(
$clientConfigMock,
$certificateManager,
$client,
$this->createMock(IRemoteHostValidator::class),
$this->createMock(LoggerInterface::class));

$clientService = $this->getMockBuilder('\OCP\Http\Client\IClientService')->getMock();
$clientService->method('newClient')->willReturn($ocClient);
Expand Down