Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [3.2.0] - 2017-10-17 - Guzzle 6.0 support release

- Updated `guzzlehttp/guzzle` requirement from `~4.0||~5.0` to `~6.0`. We are
considering dropping `guzzlehttp` as a requirement altogether and have it as
`suggested` packages instead, as it is only required when using remote xdebug.
We are looking for feedback regarding this on
https://github.com/leanphp/behat-code-coverage/issues/15

## [3.1.0] - 2017-10-17 - Legacy maintenance release

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

[3.2.x-dev]: https://github.com/leanphp/behat-code-coverage/compare/v3.1.0...master
[3.2.x-dev]: https://github.com/leanphp/behat-code-coverage/compare/v3.2.0...master
[3.2.0]: https://github.com/leanphp/behat-code-coverage/releases/tag/v3.2.0
[3.1.0]: https://github.com/leanphp/behat-code-coverage/releases/tag/v3.1.0
[3.0.0]: https://github.com/leanphp/behat-code-coverage/releases/tag/v3.0.0
[2.5.5]: https://github.com/leanphp/behat-code-coverage/releases/tag/v2.5.5
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"php": ">=5.6",
"phpunit/php-code-coverage": "~4.0||~5.0",
"behat/behat": "~3.0",
"guzzlehttp/guzzle": "~4.0||~5.0",
"guzzlehttp/guzzle": "~6.0",
"symfony/config": "~2.3||~3.0",
"symfony/dependency-injection": "~2.2||~3.0",
"symfony/expression-language": "~2.2||~3.0",
Expand Down
10 changes: 5 additions & 5 deletions src/Driver/RemoteXdebug.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
namespace LeanPHP\Behat\CodeCoverage\Driver;

use GuzzleHttp\Client;
use GuzzleHttp\Message\Response;
use GuzzleHttp\Psr7\Response;
use SebastianBergmann\CodeCoverage\Driver\Driver as DriverInterface;

/**
Expand Down Expand Up @@ -80,7 +80,7 @@ public function start($determineUnusedAndDead = true)
*/
public function stop()
{
$response = $this->sendRequest('read', ['Accept' => 'application/json']);
$response = $this->sendRequest('read', ['headers' => ['Accept' => 'application/json']]);

if ($response->getStatusCode() !== 200) {
throw new \Exception('remote driver fetch failed: ' . $response->getReasonPhrase());
Expand All @@ -97,7 +97,7 @@ public function stop()
* @param string $endpoint
* @param array $headers
*
* @return GuzzleHttp\Message\Response
* @return GuzzleHttp\Psr7\Response
*/
private function sendRequest($endpoint, $headers = array())
{
Expand All @@ -108,14 +108,14 @@ private function sendRequest($endpoint, $headers = array())
}

if (isset($this->config['auth'])) {
$response = $this->client->$method(
$response = $this->client->request($method,
$this->config[$endpoint]['path'], [
'auth' => [$this->config['auth']['user'], $this->config['auth']['password']],
'headers' => $headers,
]
);
} else {
$response = $this->client->$method(
$response = $this->client->request($method,
$this->config[$endpoint]['path'], [
'headers' => $headers
]
Expand Down
18 changes: 11 additions & 7 deletions tests/Driver/RemoteXdebugTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,30 +48,34 @@ protected function setUp()
),
);

$this->response = $this->getMockBuilder('GuzzleHttp\Message\Response')
$this->response = $this->getMockBuilder('GuzzleHttp\Psr7\Response')
->disableOriginalConstructor()
->getMock();

$request = $this->getMockBuilder('GuzzleHttp\Message\Request')
$request = $this->getMockBuilder('GuzzleHttp\Psr7\Request')
->disableOriginalConstructor()
->getMock();

$response = $this->getMockBuilder('GuzzleHttp\Message\Response')
$response = $this->getMockBuilder('GuzzleHttp\Psr7\Response')
->disableOriginalConstructor()
->getMock();

$response->expects($this->any())
->method('getStatusCode')
->will($this->returnValue('302'));

$this->client = $this->createMock('GuzzleHttp\Client');
$this->client->expects($this->any())
->method('post')
->method('request')
->will($this->returnValue($response));
$this->client->expects($this->any())
->method('put')
->method('request')
->will($this->returnValue($response));
$this->client->expects($this->any())
->method('get')
->method('request')
->will($this->returnValue($response));
$this->client->expects($this->any())
->method('delete')
->method('request')
->will($this->returnValue($response));
}

Expand Down