Add integration tests for sharing permissions

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2020-12-30 17:38:17 +01:00
parent 609a7b275f
commit 6f040d030f
5 changed files with 83 additions and 145 deletions

View File

@@ -1,18 +1,14 @@
<?php
use Behat\Behat\Context\Context;
use Behat\Behat\Hook\Scope\BeforeScenarioScope;
use Behat\Gherkin\Node\TableNode;
use GuzzleHttp\Client;
use Behat\Gherkin\Node\PyStringNode;
use GuzzleHttp\Cookie\CookieJar;
use GuzzleHttp\Exception\ClientException;
use PHPUnit\Framework\Assert;
require_once __DIR__ . '/../../vendor/autoload.php';
trait RequestTrait {
private $baseUrl;
private $adminUser;
private $regularUser;
@@ -30,8 +26,7 @@ trait RequestTrait {
private $serverContext;
/** @BeforeScenario */
public function gatherContexts(BeforeScenarioScope $scope)
{
public function gatherContexts(BeforeScenarioScope $scope) {
$environment = $scope->getEnvironment();
$this->serverContext = $environment->getContext('ServerContext');
@@ -106,7 +101,6 @@ trait RequestTrait {
}
private function sendJSONrequest($method, $url, $data = []) {
$client = new Client;
try {
$this->response = $client->request(