diff options
Diffstat (limited to 'build/integration/features/bootstrap/CardDavContext.php')
-rw-r--r-- | build/integration/features/bootstrap/CardDavContext.php | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/build/integration/features/bootstrap/CardDavContext.php b/build/integration/features/bootstrap/CardDavContext.php index dbac4e2254f..d971c42755a 100644 --- a/build/integration/features/bootstrap/CardDavContext.php +++ b/build/integration/features/bootstrap/CardDavContext.php @@ -86,7 +86,7 @@ class CardDavContext implements \Behat\Behat\Context\Context { $password = ($user === 'admin') ? 'admin' : '123456'; try { - $request = $this->client->createRequest( + $this->response = $this->client->request( 'PROPFIND', $davUrl, [ @@ -96,7 +96,6 @@ class CardDavContext implements \Behat\Behat\Context\Context { ], ] ); - $this->response = $this->client->send($request); } catch (\GuzzleHttp\Exception\ClientException $e) { $this->response = $e->getResponse(); } @@ -130,7 +129,7 @@ class CardDavContext implements \Behat\Behat\Context\Context { $davUrl = $this->baseUrl . '/remote.php/dav/addressbooks/users/'.$user.'/'.$addressBook; $password = ($user === 'admin') ? 'admin' : '123456'; - $request = $this->client->createRequest( + $this->response = $this->client->request( 'MKCOL', $davUrl, [ @@ -154,8 +153,6 @@ class CardDavContext implements \Behat\Behat\Context\Context { ] ); - $this->response = $this->client->send($request); - if($this->response->getStatusCode() !== (int)$statusCode) { throw new \Exception( sprintf( @@ -212,7 +209,7 @@ class CardDavContext implements \Behat\Behat\Context\Context { $davUrl = $this->baseUrl . '/remote.php/dav/addressbooks/users/'.$user.'/'.$addressBook . '/' . $fileName; $password = ($user === 'admin') ? 'admin' : '123456'; - $request = $this->client->createRequest( + $this->response = $this->client->request( 'PUT', $davUrl, [ @@ -227,8 +224,6 @@ class CardDavContext implements \Behat\Behat\Context\Context { ] ); - $this->response = $this->client->send($request); - if($this->response->getStatusCode() !== 201) { throw new \Exception( sprintf( @@ -248,7 +243,7 @@ class CardDavContext implements \Behat\Behat\Context\Context { $password = ($user === 'admin') ? 'admin' : '123456'; try { - $request = $this->client->createRequest( + $this->response = $this->client->request( 'GET', $davUrl, [ @@ -261,7 +256,6 @@ class CardDavContext implements \Behat\Behat\Context\Context { ], ] ); - $this->response = $this->client->send($request); } catch (\GuzzleHttp\Exception\ClientException $e) { $this->response = $e->getResponse(); } @@ -275,7 +269,7 @@ class CardDavContext implements \Behat\Behat\Context\Context { $password = ($user === 'admin') ? 'admin' : '123456'; try { - $request = $this->client->createRequest( + $this->response = $this->client->request( 'GET', $davUrl, [ @@ -288,7 +282,6 @@ class CardDavContext implements \Behat\Behat\Context\Context { ], ] ); - $this->response = $this->client->send($request); } catch (\GuzzleHttp\Exception\ClientException $e) { $this->response = $e->getResponse(); } @@ -303,7 +296,7 @@ class CardDavContext implements \Behat\Behat\Context\Context { foreach($table->getTable() as $header) { $headerName = $header[0]; $expectedHeaderValue = $header[1]; - $returnedHeader = $this->response->getHeader($headerName); + $returnedHeader = $this->response->getHeader($headerName)[0]; if($returnedHeader !== $expectedHeaderValue) { throw new \Exception( sprintf( |