From 5d3a43786a687388a5ca7345d8ac90b4ee01f9ec Mon Sep 17 00:00:00 2001 From: Pete Sloman Date: Thu, 17 Sep 2020 02:41:18 +0100 Subject: [PATCH] support use of guzzle 7 --- src/Codeception/Module/REST.php | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/Codeception/Module/REST.php b/src/Codeception/Module/REST.php index cc82617..1e6cc1b 100644 --- a/src/Codeception/Module/REST.php +++ b/src/Codeception/Module/REST.php @@ -35,7 +35,7 @@ * * shortDebugResponse *optional* - amount of chars to limit the api response length * * This module requires PHPBrowser or any of Framework modules enabled. - * + * * In case you need to configure low-level HTTP fields, that's done on the PHPBrowser level. * Check the example below for details. * @@ -358,12 +358,9 @@ public function amNTLMAuthenticated($username, $password) if ($this->isFunctional) { throw new ModuleException(__METHOD__, 'Not supported by functional modules'); } - if (!defined('\GuzzleHttp\Client::VERSION')) { + if (!defined('\GuzzleHttp\Client::MAJOR_VERSION') && !defined('\GuzzleHttp\Client::VERSION')) { throw new ModuleException(__METHOD__, 'Not supported if not using a Guzzle client'); } - if (version_compare(\GuzzleHttp\Client::VERSION, '6.2.1', 'lt')) { - throw new ModuleException(__METHOD__, 'Guzzle ' . \GuzzleHttp\Client::VERSION . ' found. Requires Guzzle >=6.3.0 for NTLM auth option'); - } $this->client->setAuth($username, $password, 'ntlm'); } @@ -1602,11 +1599,11 @@ public function startFollowingRedirects() { $this->client->followRedirects(true); } - + /** * Sets SERVER parameters valid for all next requests. * this will remove old ones. - * + * * ```php * $I->setServerParameters([]); * ``` @@ -1615,10 +1612,10 @@ public function setServerParameters(array $params) { $this->client->setServerParameters($params); } - + /** * Sets SERVER parameter valid for all next requests. - * + * * ```php * $I->haveServerParameter('name', 'value'); * ```