Skip to content

Commit b4d46f0

Browse files
authored
Removed the "prepend" strategy for finding PSR7 (#13)
* Removed the "prepend" strategy for finding PSR7 * Bumping depdendencies * Update * minor
1 parent 6bf2620 commit b4d46f0

File tree

5 files changed

+10
-28
lines changed

5 files changed

+10
-28
lines changed

.travis.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ language: php
22
sudo: false
33

44
php:
5-
- 7.0
5+
- 7.2
66

77
before_install:
88
- echo "Disable xdebug" && phpenv config-rm xdebug.ini
@@ -12,4 +12,3 @@ install:
1212

1313
script:
1414
- ./vendor/bin/phpunit
15-

composer.json

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,23 @@
22
"name": "geocoder-php/provider-integration-tests",
33
"type": "library",
44
"description": "Integration tests Geocoder provider",
5-
"keywords": [
6-
"geocoder",
7-
"provider",
8-
"test"
9-
],
5+
"keywords": ["geocoder", "provider", "test"],
106
"license": "MIT",
117
"minimum-stability": "dev",
12-
"authors": [
8+
"authors":
9+
[
1310
{
1411
"name": "Tobias Nyholm",
1512
"email": "tobias.nyholm@gmail.com",
1613
"homepage": "https://github.com/nyholm"
1714
}
1815
],
1916
"require": {
20-
"php": "^7.0",
21-
"phpunit/phpunit": "^6.1",
17+
"php": "^7.1",
18+
"phpunit/phpunit": "^7.5",
2219
"psr/http-message-implementation": "^1.0",
23-
"php-http/mock-client": "^1.0",
24-
"nyholm/psr7": "^0.2.2|^1.0.0"
20+
"php-http/mock-client": "^1.1",
21+
"nyholm/psr7": "^1.0.0"
2522
},
2623
"require-dev": {
2724
"php-http/curl-client": "^1.7",

src/BaseTestCase.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
use Http\Client\Curl\Client as HttplugClient;
1414
use Http\Client\HttpClient;
15-
use Http\Discovery\ClassDiscovery;
1615
use Http\Mock\Client as MockedHttpClient;
1716
use Nyholm\Psr7\Response;
1817
use PHPUnit\Framework\TestCase;
@@ -29,12 +28,6 @@ abstract class BaseTestCase extends TestCase
2928
*/
3029
abstract protected function getCacheDir();
3130

32-
public static function setUpBeforeClass()
33-
{
34-
parent::setUpBeforeClass();
35-
ClassDiscovery::prependStrategy('\Nyholm\Psr7\Httplug\DiscoveryStrategy');
36-
}
37-
3831
/**
3932
* Get a real HTTP client. If a cache dir is set to a path it will use cached responses.
4033
*

src/CachedResponseClient.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
namespace Geocoder\IntegrationTest;
1212

1313
use Http\Client\HttpClient;
14-
use Nyholm\Psr7\Factory\StreamFactory;
14+
use Nyholm\Psr7\Factory\HttplugFactory;
1515
use Nyholm\Psr7\Response;
1616
use Psr\Http\Message\RequestInterface;
1717

@@ -75,7 +75,7 @@ public function sendRequest(RequestInterface $request)
7575

7676
$file = sprintf('%s/%s_%s', $this->cacheDir, $host, sha1($cacheKey));
7777
if (is_file($file) && is_readable($file)) {
78-
return new Response(200, [], (new StreamFactory())->createStream(unserialize(file_get_contents($file))));
78+
return new Response(200, [], (new HttplugFactory())->createStream(unserialize(file_get_contents($file))));
7979
}
8080

8181
$response = $this->delegate->sendRequest($request);

src/ProviderIntegrationTest.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
use Geocoder\Query\GeocodeQuery;
2424
use Geocoder\Query\ReverseQuery;
2525
use Http\Client\HttpClient;
26-
use Http\Discovery\ClassDiscovery;
2726
use Http\Discovery\HttpClientDiscovery;
2827
use Nyholm\Psr7\Response;
2928
use PHPUnit\Framework\TestCase;
@@ -60,12 +59,6 @@ abstract protected function getCacheDir();
6059
*/
6160
abstract protected function getApiKey();
6261

63-
public static function setUpBeforeClass()
64-
{
65-
parent::setUpBeforeClass();
66-
ClassDiscovery::prependStrategy('\Nyholm\Psr7\Httplug\DiscoveryStrategy');
67-
}
68-
6962
/**
7063
* @param ResponseInterface $response
7164
*

0 commit comments

Comments
 (0)