File tree Expand file tree Collapse file tree 3 files changed +42
-0
lines changed Expand file tree Collapse file tree 3 files changed +42
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ namespace Redmine \Tests \Behat \Bootstrap ;
6+
7+ use Redmine \Api \CustomField ;
8+
9+ trait CustomFieldContextTrait
10+ {
11+ /**
12+ * @When I list all custom fields
13+ */
14+ public function iListAllCustomFields ()
15+ {
16+ /** @var CustomField */
17+ $ api = $ this ->getNativeCurlClient ()->getApi ('custom_fields ' );
18+
19+ $ this ->registerClientResponse (
20+ $ api ->list (),
21+ $ api ->getLastResponse (),
22+ );
23+ }
24+ }
Original file line number Diff line number Diff line change 2323final class FeatureContext extends TestCase implements Context
2424{
2525 use AttachmentContextTrait;
26+ use CustomFieldContextTrait;
2627 use GroupContextTrait;
2728 use IssueCategoryContextTrait;
2829 use IssueContextTrait;
Original file line number Diff line number Diff line change 1+ @custom_field
2+ Feature : Interacting with the REST API for custom fields
3+ In order to interact with REST API for custom fields
4+ As a user
5+ I want to make sure the Redmine server replies with the correct response
6+
7+ Scenario : Listing of zero custom fields
8+ Given I have a "NativeCurlClient" client
9+ When I list all custom fields
10+ Then the response has the status code "200"
11+ And the response has the content type "application/json"
12+ And the returned data has only the following properties
13+ """
14+ custom_fields
15+ """
16+ And the returned data "custom_fields" property is an array
17+ And the returned data "custom_fields" property contains "0" items
You can’t perform that action at this time.
0 commit comments