diff --git a/README.md b/README.md index 6a2a61cb..bb604c92 100644 --- a/README.md +++ b/README.md @@ -27,14 +27,15 @@ like [Guzzle](https://github.com/guzzle/guzzle) for handling http connections ## Supported Redmine versions -We support (and run tests against) the [latest Redmine versions](https://www.redmine.org/projects/redmine/wiki/Download#Latest-releases) -that are actively maintained. +We support (and run tests against) the [latest supported Redmine versions](https://www.redmine.org/projects/redmine/wiki/Download#Versions-status-and-releases-policy) +that receive security updates. - Redmine 5.1.x - Redmine 5.0.x +- Redmine 4.2.x Nevertheless, you can also use this library for all older Redmine versions. -In this case, however, be aware that some features may not yet be supported by your Redmine server. +In this case, however, be aware that some features might not be supported by your Redmine server. If a new Redmine version enables new features that are not yet supported with this library, you are welcome to [create an issue](https://github.com/kbsali/php-redmine-api/issues). diff --git a/docker-compose.yml b/docker-compose.yml index b09ce221..08ae3b72 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -51,3 +51,17 @@ services: volumes: - ./.docker/redmine-50009_data/files:/usr/src/redmine/files - ./.docker/redmine-50009_data/sqlite:/usr/src/redmine/sqlite + + redmine-40210: + # Redmine 4.2.11 is not available on Docker Hub + # @link https://hub.docker.com/_/redmine/tags?page=&page_size=&ordering=&name=4.2.11 + image: redmine:4.2.10 + user: "1000:1000" + ports: + - "4210:3000" + environment: + REDMINE_SECRET_KEY_BASE: supersecretkey + REDMINE_PLUGINS_MIGRATE: true + volumes: + - ./.docker/redmine-40210_data/files:/usr/src/redmine/files + - ./.docker/redmine-40210_data/sqlite:/usr/src/redmine/sqlite diff --git a/tests/Behat/Bootstrap/FeatureContext.php b/tests/Behat/Bootstrap/FeatureContext.php index 79977857..9de9dc61 100644 --- a/tests/Behat/Bootstrap/FeatureContext.php +++ b/tests/Behat/Bootstrap/FeatureContext.php @@ -290,6 +290,24 @@ public function theReturnedDataPropertyContainsTheFollowingData($property, Table $this->assertTableNodeIsSameAsArray($table, $returnData); } + /** + * @Then the returned data :property property contains the following data with Redmine version :versionComparision + */ + public function theReturnedDataPropertyContainsTheFollowingDataWithRedmineVersion($property, string $versionComparision, TableNode $table) + { + $parts = explode(' ', $versionComparision); + + $redmineVersion = RedmineVersion::tryFrom($parts[1]); + + if ($redmineVersion === null) { + throw new InvalidArgumentException('Comparison with Redmine ' . $versionComparision . ' is not supported.'); + } + + if (version_compare($this->redmine->getVersionString(), $parts[1], $parts[0])) { + $this->theReturnedDataPropertyContainsTheFollowingData($property, $table); + } + } + /** * @Then the returned data :property property has only the following properties */ diff --git a/tests/Behat/README.md b/tests/Behat/README.md new file mode 100644 index 00000000..4920052d --- /dev/null +++ b/tests/Behat/README.md @@ -0,0 +1,133 @@ +# Behaviour tests + +This folder contains BDD tests using Docker and Behat. + +## How to run the tests + +Pull the Redmine docker images and start them by running: + +```bash +docker compose up -d +``` + +Now you can run the tests: + +```bash +# all tests +docker compose exec php composer behat +# only a specific redmine version +docker compose exec php composer behat -- --suite=redmine_50103 +# only specific endpoints +docker compose exec php composer behat -- --tags=issue,group +# only specific endpoints on a specific redmine version +docker compose exec php composer behat -- --suite=redmine_50103 --tags=issue,group +``` + +## Redmine specific features + +Some Redmine features are specific for a Redmine version. There are two ways to handle this situations. + +### Modified Rest-API Responses + +It is possible that a new Redmine version returns new or changed elements in a response. +This can be handled on the `step` layer: + +``` + And the returned data "projects.0" property has only the following properties with Redmine version ">= 5.1.0" + """ + id + name + identifier + description + homepage + status + is_public + inherit_members + created_on + updated_on + """ + But the returned data "projects.0" property has only the following properties with Redmine version "< 5.1.0" + """ + id + name + identifier + description + status + is_public + inherit_members + created_on + updated_on + """ +``` + +### New Rest-API Endpoints + +A new Redmine version could be introduce new REST-API endpoints that are missing in the older version. +This can be handled on the `scenario` or `feature` layer. + +1. Tag features or scenarios e.g. with `@since50000`. + +``` +@since50000 +Feature: Interacting with the new REST API endpoint + [...] +``` + +or + +``` + @since50000 + Scenario: Using a new feature + Given I have a "NativeCurlClient" client + And I create a project with name "Test Project" and identifier "test-project" + [...] +``` + +2. Exclude the tag from the specific suite in the `behat.yml` (note the `~` prefix): + +``` +default: + suites: + [...] + redmine_40210: + [...] + filters: + tags: "~@since50000" + +``` + +### Removed Rest-API Endpoints + +A new Redmine version could remove REST-API endpoints that are missing in the newer versions. +This can be handled on the `scenario` or `feature` layer. + +1. Tag features or scenarios e.g. with `@until60000`. + +``` +@until60000 +Feature: Interacting with the a REST API endpoint removed in 6.0.0 + [...] +``` + +or + +``` + @until60000 + Scenario: Using a deprecated feature + Given I have a "NativeCurlClient" client + And I create a project with name "Test Project" and identifier "test-project" + [...] +``` + +2. Exclude the tag from the specific suite in the `behat.yml` (note the `~` prefix): + +``` +default: + suites: + [...] + redmine_60000: + [...] + filters: + tags: "~@until60000" + +``` diff --git a/tests/Behat/behat.yml b/tests/Behat/behat.yml index 67306fa4..c61984ad 100644 --- a/tests/Behat/behat.yml +++ b/tests/Behat/behat.yml @@ -12,3 +12,11 @@ default: contexts: - Redmine\Tests\Behat\Bootstrap\FeatureContext: redmineVersion: '5.0.9' + redmine_40210: + paths: + - '%paths.base%/features' + contexts: + - Redmine\Tests\Behat\Bootstrap\FeatureContext: + redmineVersion: '4.2.10' + filters: + tags: "~@since50000" diff --git a/tests/Behat/features/attachments.feature b/tests/Behat/features/attachments.feature index 475e91fb..215b4243 100644 --- a/tests/Behat/features/attachments.feature +++ b/tests/Behat/features/attachments.feature @@ -1,9 +1,9 @@ +@attachment Feature: Interacting with the REST API for attachments In order to interact with REST API for attachments As a user I want to make sure the Redmine server replies with the correct response - @attachment Scenario: Uploading an attachment Given I have a "NativeCurlClient" client When I upload the content of the file "%tests_dir%/Fixtures/testfile_01.txt" with the following data @@ -26,7 +26,7 @@ Feature: Interacting with the REST API for attachments | id | 1 | | token | 1.7b962f8af22e26802b87abfa0b07b21dbd03b984ec8d6888dabd3f69cff162f8 | - @attachment + Scenario: Updating the details of an attachment Given I have a "NativeCurlClient" client And I create a project with name "Test Project" and identifier "test-project" @@ -41,7 +41,6 @@ Feature: Interacting with the REST API for attachments And the response has the content "" And the returned data is true - @attachment Scenario: Showing the details of an attachment Given I have a "NativeCurlClient" client And I upload the content of the file "%tests_dir%/Fixtures/testfile_01.txt" with the following data @@ -80,7 +79,7 @@ Feature: Interacting with the REST API for attachments | id | 1 | | name | Redmine Admin | - @attachment @error + @error Scenario: Try to show details of a non-existing attachment Given I have a "NativeCurlClient" client When I show the attachment with the id "1" @@ -89,7 +88,6 @@ Feature: Interacting with the REST API for attachments And the response has the content "" And the returned data is false - @attachment Scenario: Downloading an attachment Given I have a "NativeCurlClient" client And I upload the content of the file "%tests_dir%/Fixtures/testfile_01.txt" with the following data @@ -111,7 +109,7 @@ Feature: Interacting with the REST API for attachments """ - @attachment @error + @error Scenario: Try to download a non-existing attachment Given I have a "NativeCurlClient" client When I download the attachment with the id "1" @@ -121,7 +119,6 @@ Feature: Interacting with the REST API for attachments # And the response has the content "..." And the returned data is false - @attachment Scenario: Deleting an attachment Given I have a "NativeCurlClient" client And I upload the content of the file "%tests_dir%/Fixtures/testfile_01.txt" with the following data diff --git a/tests/Behat/features/groups.feature b/tests/Behat/features/groups.feature index ec72b9c5..a1971547 100644 --- a/tests/Behat/features/groups.feature +++ b/tests/Behat/features/groups.feature @@ -1,9 +1,9 @@ +@group Feature: Interacting with the REST API for groups In order to interact with REST API for groups As a user I want to make sure the Redmine server replies with the correct response - @group Scenario: Creating a group with minimal parameters Given I have a "NativeCurlClient" client When I create a group with name "Test Group" @@ -20,7 +20,6 @@ Feature: Interacting with the REST API for groups | id | 4 | | name | Test Group | - @group Scenario: Listing of zero groups Given I have a "NativeCurlClient" client When I list all groups @@ -33,7 +32,6 @@ Feature: Interacting with the REST API for groups And the returned data "groups" property is an array And the returned data "groups" property contains "0" items - @group Scenario: Listing of one group Given I have a "NativeCurlClient" client And I create a group with name "Test Group" @@ -57,7 +55,6 @@ Feature: Interacting with the REST API for groups | id | 4 | | name | Test Group | - @group Scenario: Listing names of all groups Given I have a "NativeCurlClient" client And I create a group with name "Test Group 1" @@ -78,7 +75,6 @@ Feature: Interacting with the REST API for groups | 7 | Test Group 4 | | 8 | Test Group 5 | - @group Scenario: Showing a specific group Given I have a "NativeCurlClient" client And I create a group with name "Test Group" @@ -100,7 +96,7 @@ Feature: Interacting with the REST API for groups | id | 4 | | name | Test Group | - @group @error + @error Scenario: Try to show a non-existing group Given I have a "NativeCurlClient" client When I show the group with id "40" @@ -109,7 +105,6 @@ Feature: Interacting with the REST API for groups And the response has the content "" And the returned data is false - @group Scenario: Updating a group Given I have a "NativeCurlClient" client And I create a group with the following data @@ -123,7 +118,6 @@ Feature: Interacting with the REST API for groups And the response has the content "" And the returned data is exactly "" - @group Scenario: Adding an user to a group Given I have a "NativeCurlClient" client And I create a group with name "Test Group" @@ -133,7 +127,6 @@ Feature: Interacting with the REST API for groups And the response has the content "" And the returned data is exactly "" - @group Scenario: Removing an user from a group Given I have a "NativeCurlClient" client And I create a group with name "Test Group" @@ -144,7 +137,6 @@ Feature: Interacting with the REST API for groups And the response has the content "" And the returned data is exactly "" - @group Scenario: Deleting a group Given I have a "NativeCurlClient" client And I create a group with name "Test Group" diff --git a/tests/Behat/features/issue.feature b/tests/Behat/features/issue.feature index 79d2af15..842fc576 100644 --- a/tests/Behat/features/issue.feature +++ b/tests/Behat/features/issue.feature @@ -1,9 +1,9 @@ +@issue Feature: Interacting with the REST API for issues In order to interact with REST API for issues As a user I want to make sure the Redmine server replies with the correct response - @issue Scenario: Creating an issue with miminal data Given I have a "NativeCurlClient" client And I have an issue status with the name "New" @@ -77,17 +77,26 @@ Feature: Interacting with the REST API for issues And the returned data "status" property is an array And the returned data "status" property contains "1" items And the returned data "status.@attributes" property is an array - And the returned data "status.@attributes" property has only the following properties + And the returned data "status.@attributes" property has only the following properties with Redmine version ">= 5.0.0" """ id name is_closed """ - And the returned data "status.@attributes" property contains the following data + But the returned data "status.@attributes" property has only the following properties with Redmine version "< 5.0.0" + """ + id + name + """ + And the returned data "status.@attributes" property contains the following data with Redmine version ">= 5.0.0" | property | value | | id | 1 | | name | New | | is_closed | false | + But the returned data "status.@attributes" property contains the following data with Redmine version "< 5.0.0" + | property | value | + | id | 1 | + | name | New | And the returned data "priority" property is an array And the returned data "priority" property contains "1" items And the returned data "priority.@attributes" property is an array @@ -113,7 +122,6 @@ Feature: Interacting with the REST API for issues | id | 1 | | name | Redmine Admin | - @issue Scenario: Updating an issue Given I have a "NativeCurlClient" client And I have an issue status with the name "New" @@ -139,7 +147,7 @@ Feature: Interacting with the REST API for issues And the response has the content "" And the returned data is exactly "" - @issue @error + @error Scenario: Showing a not existing issue Given I have a "NativeCurlClient" client When I show the issue with id "10" @@ -148,7 +156,6 @@ Feature: Interacting with the REST API for issues And the response has the content "" And the returned data is false - @issue Scenario: Adding a watcher to an issue Given I have a "NativeCurlClient" client And I have an issue status with the name "New" @@ -168,7 +175,6 @@ Feature: Interacting with the REST API for issues And the response has the content "" And the returned data is exactly "" - @issue Scenario: Removing a watcher from an issue Given I have a "NativeCurlClient" client And I have an issue status with the name "New" @@ -189,7 +195,6 @@ Feature: Interacting with the REST API for issues And the response has the content "" And the returned data is exactly "" - @issue Scenario: Removing an issue Given I have a "NativeCurlClient" client And I have an issue status with the name "New" diff --git a/tests/Behat/features/issue_category.feature b/tests/Behat/features/issue_category.feature index 3f1c068c..1714c348 100644 --- a/tests/Behat/features/issue_category.feature +++ b/tests/Behat/features/issue_category.feature @@ -1,9 +1,9 @@ +@issue_category Feature: Interacting with the REST API for issue categories In order to interact with REST API for issue categories As a user I want to make sure the Redmine server replies with the correct response - @issue_category Scenario: Creating an issue category with miminal data Given I have a "NativeCurlClient" client And I create a project with name "Test Project" and identifier "test-project" @@ -36,7 +36,6 @@ Feature: Interacting with the REST API for issue categories | id | 1 | | name | Test Project | - @issue_category Scenario: Creating an issue category with all data Given I have a "NativeCurlClient" client And I create a project with name "Test Project" and identifier "test-project" @@ -83,7 +82,6 @@ Feature: Interacting with the REST API for issue categories | id | 1 | | name | Redmine Admin | - @issue_category Scenario: Updating an issue category with all data Given I have a "NativeCurlClient" client And I create a project with name "Test Project" and identifier "test-project" @@ -100,7 +98,6 @@ Feature: Interacting with the REST API for issue categories And the response has the content "" And the returned data is exactly "" - @issue_category Scenario: Deleting an issue category Given I have a "NativeCurlClient" client And I create a project with name "Test Project" and identifier "test-project" diff --git a/tests/Behat/features/issue_relation.feature b/tests/Behat/features/issue_relation.feature index 2f8b3921..c356fd84 100644 --- a/tests/Behat/features/issue_relation.feature +++ b/tests/Behat/features/issue_relation.feature @@ -1,9 +1,9 @@ +@issue_relation Feature: Interacting with the REST API for issue relations In order to interact with REST API for issue relations As a user I want to make sure the Redmine server replies with the correct response - @issue_relation Scenario: Creating an issue relation with miminal data Given I have a "NativeCurlClient" client And I have an issue status with the name "New" @@ -50,7 +50,6 @@ Feature: Interacting with the REST API for issue relations | relation_type | relates | | delay | null | - @issue_relation Scenario: Deleting an issue relation Given I have a "NativeCurlClient" client And I have an issue status with the name "New" diff --git a/tests/Behat/features/membership.feature b/tests/Behat/features/membership.feature index bbdf77aa..ba409fd1 100644 --- a/tests/Behat/features/membership.feature +++ b/tests/Behat/features/membership.feature @@ -1,9 +1,9 @@ +@membership Feature: Interacting with the REST API for memberships In order to interact with REST API for memberships As a user I want to make sure the Redmine server replies with the correct response - @membership Scenario: Creating a membership Given I have a "NativeCurlClient" client And I have a role with the name "Developer" @@ -16,7 +16,6 @@ Feature: Interacting with the REST API for memberships And the response has the content type "application/xml" And the returned data is an instance of "SimpleXMLElement" - @membership Scenario: Updating a membership Given I have a "NativeCurlClient" client And I have a role with the name "Developer" @@ -34,7 +33,6 @@ Feature: Interacting with the REST API for memberships And the response has the content "" And the returned data is exactly "" - @membership Scenario: Removing a membership Given I have a "NativeCurlClient" client And I have a role with the name "Developer" @@ -49,7 +47,6 @@ Feature: Interacting with the REST API for memberships And the response has the content "" And the returned data is exactly "" - @membership Scenario: Removing an user from a project Given I have a "NativeCurlClient" client And I have a role with the name "Developer" diff --git a/tests/Behat/features/projects.feature b/tests/Behat/features/projects.feature index 84660ab1..996f7774 100644 --- a/tests/Behat/features/projects.feature +++ b/tests/Behat/features/projects.feature @@ -1,9 +1,9 @@ +@project Feature: Interacting with the REST API for projects In order to interact with REST API for projects As a user I want to make sure the Redmine server replies with the correct response - @project Scenario: Creating a project with minimal parameters Given I have a "NativeCurlClient" client When I create a project with name "Test Project" and identifier "test-project" @@ -29,7 +29,6 @@ Feature: Interacting with the REST API for projects | name | Test Project | | identifier | test-project | - @project Scenario: Creating a project with multiple parameters Given I have a "NativeCurlClient" client When I create a project with the following data @@ -51,7 +50,6 @@ Feature: Interacting with the REST API for projects | is_public | true | | inherit_members | false | - @project Scenario: Showing a specific project Given I have a "NativeCurlClient" client And I create a project with name "Test Project" and identifier "test-project" @@ -91,7 +89,6 @@ Feature: Interacting with the REST API for projects | trackers | [] | | issue_categories | [] | - @project Scenario: Listing of zero projects Given I have a "NativeCurlClient" client When I list all projects @@ -112,7 +109,6 @@ Feature: Interacting with the REST API for projects | offset | 0 | | limit | 25 | - @project Scenario: Listing of one project Given I have a "NativeCurlClient" client And I create a project with name "Test Project" and identifier "test-project" @@ -154,7 +150,6 @@ Feature: Interacting with the REST API for projects updated_on """ - @project Scenario: Updating a project Given I have a "NativeCurlClient" client And I create a project with name "Test Project" and identifier "test-project" @@ -167,7 +162,7 @@ Feature: Interacting with the REST API for projects And the response has the content "" And the returned data is exactly "" - @project + @since50000 Scenario: Closing a project Given I have a "NativeCurlClient" client And I create a project with name "Test Project" and identifier "test-project" @@ -181,7 +176,7 @@ Feature: Interacting with the REST API for projects | property | value | | status | 5 | - @project + @since50000 Scenario: Reopening a project Given I have a "NativeCurlClient" client And I create a project with name "Test Project" and identifier "test-project" @@ -196,7 +191,7 @@ Feature: Interacting with the REST API for projects | property | value | | status | 1 | - @project + @since50000 Scenario: Archiving a project Given I have a "NativeCurlClient" client And I create a project with name "Test Project" and identifier "test-project" @@ -206,7 +201,7 @@ Feature: Interacting with the REST API for projects And the response has the content "" And the returned data is true - @project @error + @since50000 @error Scenario: Showing an archived project is not possible Given I have a "NativeCurlClient" client And I create a project with name "Test Project" and identifier "test-project" @@ -217,7 +212,7 @@ Feature: Interacting with the REST API for projects And the response has the content "" And the returned data is false - @project + @since50000 Scenario: Unarchiving a project Given I have a "NativeCurlClient" client And I create a project with name "Test Project" and identifier "test-project" @@ -232,7 +227,6 @@ Feature: Interacting with the REST API for projects | property | value | | status | 1 | - @project Scenario: Removing a project Given I have a "NativeCurlClient" client And I create a project with name "Test Project" and identifier "test-project" diff --git a/tests/Behat/features/time_entry.feature b/tests/Behat/features/time_entry.feature index afa3d6b8..bf0a5eba 100644 --- a/tests/Behat/features/time_entry.feature +++ b/tests/Behat/features/time_entry.feature @@ -1,9 +1,9 @@ +@time_entry Feature: Interacting with the REST API for time_entries In order to interact with REST API for time_entries As a user I want to make sure the Redmine server replies with the correct response - @time_entry Scenario: Creating a time_entry to a project Given I have a "NativeCurlClient" client And I have a time entry activiy with name "development" @@ -69,7 +69,6 @@ Feature: Interacting with the REST API for time_entries | id | 1 | | name | development | - @time_entry Scenario: Updating a time_entry to a project Given I have a "NativeCurlClient" client And I have a time entry activiy with name "development" @@ -87,7 +86,6 @@ Feature: Interacting with the REST API for time_entries And the response has the content "" And the returned data is exactly "" - @time_entry Scenario: Showing a time_entry to a project Given I have a "NativeCurlClient" client And I have a time entry activiy with name "development" @@ -151,7 +149,7 @@ Feature: Interacting with the REST API for time_entries | id | 1 | | name | development | - @time_entry @entry + @error Scenario: Try to show a non-existing time_entry Given I have a "NativeCurlClient" client And I have a time entry activiy with name "development" @@ -162,7 +160,6 @@ Feature: Interacting with the REST API for time_entries And the response has the content "" And the returned data is false - @time_entry Scenario: Removing a time_entry to a project Given I have a "NativeCurlClient" client And I have a time entry activiy with name "development" diff --git a/tests/Behat/features/user.feature b/tests/Behat/features/user.feature index f987cf7f..b4d7b969 100644 --- a/tests/Behat/features/user.feature +++ b/tests/Behat/features/user.feature @@ -1,9 +1,10 @@ +@user Feature: Interacting with the REST API for users In order to interact with REST API for users As a user I want to make sure the Redmine server replies with the correct response - @user + Scenario: Creating an user Given I have a "NativeCurlClient" client When I create a user with the following data @@ -44,7 +45,6 @@ Feature: Interacting with the REST API for users | twofa_scheme | [] | | status | 1 | - @user Scenario: Updating an user Given I have a "NativeCurlClient" client And I create a user with the following data @@ -63,7 +63,6 @@ Feature: Interacting with the REST API for users And the response has the content "" And the returned data is exactly "" - @user Scenario: Showing a user Given I have a "NativeCurlClient" client When I show the user with id "1" @@ -105,7 +104,7 @@ Feature: Interacting with the REST API for users | groups | [] | | memberships | [] | - @user @error + @error Scenario: Showing a not existing user Given I have a "NativeCurlClient" client When I show the user with id "10" @@ -114,7 +113,6 @@ Feature: Interacting with the REST API for users And the response has the content "" And the returned data is false - @user Scenario: Removing an user Given I have a "NativeCurlClient" client And I create a user with the following data diff --git a/tests/Behat/features/version.feature b/tests/Behat/features/version.feature index 67f779ae..72ac2434 100644 --- a/tests/Behat/features/version.feature +++ b/tests/Behat/features/version.feature @@ -1,9 +1,9 @@ +@version Feature: Interacting with the REST API for versions In order to interact with REST API for versions As a user I want to make sure the Redmine server replies with the correct response - @version Scenario: Creating a version Given I have a "NativeCurlClient" client And I create a project with name "Test Project" and identifier "test-project" @@ -52,7 +52,6 @@ Feature: Interacting with the REST API for versions | id | 1 | | name | Test Project | - @version Scenario: Updating a version Given I have a "NativeCurlClient" client And I create a project with name "Test Project" and identifier "test-project" @@ -67,7 +66,6 @@ Feature: Interacting with the REST API for versions And the response has the content "" And the returned data is exactly "" - @version Scenario: Showing a version Given I have a "NativeCurlClient" client And I create a project with name "Test Project" and identifier "test-project" @@ -107,7 +105,7 @@ Feature: Interacting with the REST API for versions | estimated_hours | 0.0 | | spent_hours | 0.0 | - @version @error + @error Scenario: Showing a not existing version Given I have a "NativeCurlClient" client And I create a project with name "Test Project" and identifier "test-project" @@ -117,7 +115,6 @@ Feature: Interacting with the REST API for versions And the response has the content "" And the returned data is false - @version Scenario: Removing a version Given I have a "NativeCurlClient" client And I create a project with name "Test Project" and identifier "test-project" diff --git a/tests/Behat/features/wiki.feature b/tests/Behat/features/wiki.feature index 961788b4..2d28610f 100644 --- a/tests/Behat/features/wiki.feature +++ b/tests/Behat/features/wiki.feature @@ -1,9 +1,9 @@ +@wiki Feature: Interacting with the REST API for wikis In order to interact with REST API for wiki As a user I want to make sure the Redmine server replies with the correct response - @wiki Scenario: Creating a wiki page Given I have a "NativeCurlClient" client And I create a project with name "Test Project" and identifier "test-project" @@ -42,7 +42,7 @@ Feature: Interacting with the REST API for wikis | id | 1 | | name | Redmine Admin | - @wiki @attachment + @attachment Scenario: Creating a wiki page with attachment upload Given I have a "NativeCurlClient" client And I create a project with name "Test Project" and identifier "test-project" @@ -85,7 +85,6 @@ Feature: Interacting with the REST API for wikis | id | 1 | | name | Redmine Admin | - @wiki Scenario: Showing a wiki page Given I have a "NativeCurlClient" client And I create a project with name "Test Project" and identifier "test-project" @@ -129,7 +128,7 @@ Feature: Interacting with the REST API for wikis | id | 1 | | name | Redmine Admin | - @wiki @error + @error Scenario: Try to show a not existing wiki page Given I have a "NativeCurlClient" client And I create a project with name "Test Project" and identifier "test-project" @@ -139,7 +138,7 @@ Feature: Interacting with the REST API for wikis And the response has the content "" And the returned data is false - @wiki @attachment + @attachment Scenario: Showing a wiki page with uploaded attachment Given I have a "NativeCurlClient" client And I create a project with name "Test Project" and identifier "test-project" @@ -218,7 +217,6 @@ Feature: Interacting with the REST API for wikis | id | 1 | | name | Redmine Admin | - @wiki Scenario: Updating a wiki page Given I have a "NativeCurlClient" client And I create a project with name "Test Project" and identifier "test-project" @@ -233,7 +231,6 @@ Feature: Interacting with the REST API for wikis And the response has the content "" And the returned data is exactly "" - @wiki Scenario: Removing a wiki page Given I have a "NativeCurlClient" client And I create a project with name "Test Project" and identifier "test-project" diff --git a/tests/RedmineExtension/RedmineInstance.php b/tests/RedmineExtension/RedmineInstance.php index 8dd08797..fa07f2b3 100644 --- a/tests/RedmineExtension/RedmineInstance.php +++ b/tests/RedmineExtension/RedmineInstance.php @@ -19,6 +19,7 @@ public static function getSupportedVersions(): array return [ RedmineVersion::V5_1_3, RedmineVersion::V5_0_9, + RedmineVersion::V4_2_10, ]; } diff --git a/tests/RedmineExtension/RedmineVersion.php b/tests/RedmineExtension/RedmineVersion.php index 5857a613..58e3cde4 100644 --- a/tests/RedmineExtension/RedmineVersion.php +++ b/tests/RedmineExtension/RedmineVersion.php @@ -120,6 +120,22 @@ enum RedmineVersion: string */ case V5_0_0 = '5.0.0'; + /** + * Redmine 4.2.11 + * + * @link https://www.redmine.org/versions/187 + * @link https://www.redmine.org/projects/redmine/wiki/Changelog_4_2#4211-2023-09-30 + */ + case V4_2_11 = '4.2.11'; + + /** + * Redmine 4.2.10 + * + * @link https://www.redmine.org/versions/185 + * @link https://www.redmine.org/projects/redmine/wiki/Changelog_4_2#4210-2023-03-05 + */ + case V4_2_10 = '4.2.10'; + public function asString(): string { return $this->value;