-
Notifications
You must be signed in to change notification settings - Fork 182
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Redmine\Tests\Behat\Bootstrap; | ||
|
||
use Behat\Behat\Tester\Exception\PendingException; | ||
use Behat\Gherkin\Node\TableNode; | ||
use Redmine\Api\Group; | ||
|
||
trait GroupContextTrait | ||
{ | ||
/** | ||
* @When I create a group with name :groupName | ||
*/ | ||
public function iCreateAGroupWithName(string $groupName) | ||
{ | ||
$data = [ | ||
'name' => $groupName, | ||
]; | ||
|
||
/** @var Group */ | ||
$groupApi = $this->getNativeCurlClient()->getApi('group'); | ||
|
||
$this->registerClientResponse( | ||
$groupApi->create($data), | ||
$groupApi->getLastResponse() | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
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 | ||
|
||
Scenario: Creating a group with minimal parameters | ||
Given I have a "NativeCurlClient" client | ||
When I create a group with name "Test Group" | ||
Then the response has the status code "201" | ||
And the response has the content type "application/xml" | ||
And the returned data is an instance of "SimpleXMLElement" | ||
And the returned data has only the following properties | ||
""" | ||
id | ||
name | ||
""" | ||
And the returned data has proterties with the following data | ||
| property | value | | ||
| id | 4 | | ||
| name | Test Group | |