Skip to content

Commit 13a5b3e

Browse files
committed
v3.2.0 - guzzle ~6.0 support release
1 parent d7b7a46 commit 13a5b3e

File tree

4 files changed

+27
-14
lines changed

4 files changed

+27
-14
lines changed

CHANGELOG.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ documented in this file.
66
The format is based on [Keep a Changelog](http://keepachangelog.com/)
77
and this project adheres to [Semantic Versioning](http://semver.org/).
88

9+
## [3.2.0] - 2017-10-17 - Guzzle 6.0 support release
10+
11+
- Updated `guzzlehttp/guzzle` requirement from `~4.0||~5.0` to `~6.0`. We are
12+
considering dropping `guzzlehttp` as a requirement altogether and have it as
13+
`suggested` packages instead, as it is only required when using remote xdebug.
14+
We are looking for feedback regarding this on
15+
https://github.com/leanphp/behat-code-coverage/issues/15
16+
917
## [3.1.0] - 2017-10-17 - Legacy maintenance release
1018

1119
- Update PHP requirement to `>=5.6` (from `>=5.3.10`)
@@ -48,7 +56,8 @@ disappear, this extension would still work.
4856
- Updated `vfsStream` from `1.2.*` to `1.3.*` to fix failing/skipped test
4957
- Updated versions of dependencies and code is tested to run with Behat `2.5`.
5058

51-
[3.2.x-dev]: https://github.com/leanphp/behat-code-coverage/compare/v3.1.0...master
59+
[3.2.x-dev]: https://github.com/leanphp/behat-code-coverage/compare/v3.2.0...master
60+
[3.2.0]: https://github.com/leanphp/behat-code-coverage/releases/tag/v3.2.0
5261
[3.1.0]: https://github.com/leanphp/behat-code-coverage/releases/tag/v3.1.0
5362
[3.0.0]: https://github.com/leanphp/behat-code-coverage/releases/tag/v3.0.0
5463
[2.5.5]: https://github.com/leanphp/behat-code-coverage/releases/tag/v2.5.5

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"php": ">=5.6",
2929
"phpunit/php-code-coverage": "~4.0||~5.0",
3030
"behat/behat": "~3.0",
31-
"guzzlehttp/guzzle": "~4.0||~5.0",
31+
"guzzlehttp/guzzle": "~6.0",
3232
"symfony/config": "~2.3||~3.0",
3333
"symfony/dependency-injection": "~2.2||~3.0",
3434
"symfony/expression-language": "~2.2||~3.0",

src/Driver/RemoteXdebug.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
namespace LeanPHP\Behat\CodeCoverage\Driver;
1010

1111
use GuzzleHttp\Client;
12-
use GuzzleHttp\Message\Response;
12+
use GuzzleHttp\Psr7\Response;
1313
use SebastianBergmann\CodeCoverage\Driver\Driver as DriverInterface;
1414

1515
/**
@@ -80,7 +80,7 @@ public function start($determineUnusedAndDead = true)
8080
*/
8181
public function stop()
8282
{
83-
$response = $this->sendRequest('read', ['Accept' => 'application/json']);
83+
$response = $this->sendRequest('read', ['headers' => ['Accept' => 'application/json']]);
8484

8585
if ($response->getStatusCode() !== 200) {
8686
throw new \Exception('remote driver fetch failed: ' . $response->getReasonPhrase());
@@ -97,7 +97,7 @@ public function stop()
9797
* @param string $endpoint
9898
* @param array $headers
9999
*
100-
* @return GuzzleHttp\Message\Response
100+
* @return GuzzleHttp\Psr7\Response
101101
*/
102102
private function sendRequest($endpoint, $headers = array())
103103
{
@@ -108,14 +108,14 @@ private function sendRequest($endpoint, $headers = array())
108108
}
109109

110110
if (isset($this->config['auth'])) {
111-
$response = $this->client->$method(
111+
$response = $this->client->request($method,
112112
$this->config[$endpoint]['path'], [
113113
'auth' => [$this->config['auth']['user'], $this->config['auth']['password']],
114114
'headers' => $headers,
115115
]
116116
);
117117
} else {
118-
$response = $this->client->$method(
118+
$response = $this->client->request($method,
119119
$this->config[$endpoint]['path'], [
120120
'headers' => $headers
121121
]

tests/Driver/RemoteXdebugTest.php

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,30 +48,34 @@ protected function setUp()
4848
),
4949
);
5050

51-
$this->response = $this->getMockBuilder('GuzzleHttp\Message\Response')
51+
$this->response = $this->getMockBuilder('GuzzleHttp\Psr7\Response')
5252
->disableOriginalConstructor()
5353
->getMock();
5454

55-
$request = $this->getMockBuilder('GuzzleHttp\Message\Request')
55+
$request = $this->getMockBuilder('GuzzleHttp\Psr7\Request')
5656
->disableOriginalConstructor()
5757
->getMock();
5858

59-
$response = $this->getMockBuilder('GuzzleHttp\Message\Response')
59+
$response = $this->getMockBuilder('GuzzleHttp\Psr7\Response')
6060
->disableOriginalConstructor()
6161
->getMock();
6262

63+
$response->expects($this->any())
64+
->method('getStatusCode')
65+
->will($this->returnValue('302'));
66+
6367
$this->client = $this->createMock('GuzzleHttp\Client');
6468
$this->client->expects($this->any())
65-
->method('post')
69+
->method('request')
6670
->will($this->returnValue($response));
6771
$this->client->expects($this->any())
68-
->method('put')
72+
->method('request')
6973
->will($this->returnValue($response));
7074
$this->client->expects($this->any())
71-
->method('get')
75+
->method('request')
7276
->will($this->returnValue($response));
7377
$this->client->expects($this->any())
74-
->method('delete')
78+
->method('request')
7579
->will($this->returnValue($response));
7680
}
7781

0 commit comments

Comments
 (0)