diff --git a/.travis.yml b/.travis.yml index 7ebc80af..6d778e49 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,7 +15,7 @@ env: branches: except: - - /^analysis-.*$/ + - /^patch-.*$/ matrix: fast_finish: true @@ -43,6 +43,14 @@ matrix: - php: 7.3 env: DEPENDENCIES="dunglas/symfony-lock:^4" + # Test with httplug 1.x clients + - php: 7.2 + env: DEPENDENCIES="php-http/buzz-adapter:^1.0 php-http/curl-client:^1.0 php-http/guzzle6-adapter:^1.1.1 php-http/react-adapter:^0.2.1 php-http/socket-client:^1.0" + + # Test with httplug 2.x clients + - php: 7.2 + env: DEPENDENCIES="php-http/guzzle6-adapter:^2.0.1" + # Latest commit to master - php: 7.3 env: STABILITY="dev" diff --git a/Tests/Resources/app/config/config_test.yml b/Tests/Resources/app/config/config_test.yml index 464a959b..3535e9de 100644 --- a/Tests/Resources/app/config/config_test.yml +++ b/Tests/Resources/app/config/config_test.yml @@ -7,7 +7,7 @@ httplug: async_client: auto clients: acme: - factory: httplug.factory.curl + factory: httplug.factory.guzzle6 plugins: - decoder: diff --git a/Tests/Unit/ClientFactory/BuzzFactoryTest.php b/Tests/Unit/ClientFactory/BuzzFactoryTest.php index e427c669..c1c8d19a 100644 --- a/Tests/Unit/ClientFactory/BuzzFactoryTest.php +++ b/Tests/Unit/ClientFactory/BuzzFactoryTest.php @@ -14,6 +14,10 @@ class BuzzFactoryTest extends TestCase { public function testCreateClient() { + if (!class_exists(\Http\Adapter\Buzz\Client::class)) { + $this->markTestSkipped('Buzz adapter is not installed'); + } + $factory = new BuzzFactory($this->getMockBuilder(MessageFactory::class)->getMock()); $client = $factory->createClient(); diff --git a/Tests/Unit/ClientFactory/CurlFactoryTest.php b/Tests/Unit/ClientFactory/CurlFactoryTest.php index 5016b436..e5c83f71 100644 --- a/Tests/Unit/ClientFactory/CurlFactoryTest.php +++ b/Tests/Unit/ClientFactory/CurlFactoryTest.php @@ -15,6 +15,10 @@ class CurlFactoryTest extends TestCase { public function testCreateClient() { + if (!class_exists(\Http\Client\Curl\Client::class)) { + $this->markTestSkipped('Curl client is not installed'); + } + $factory = new CurlFactory( $this->getMockBuilder(MessageFactory::class)->getMock(), $this->getMockBuilder(StreamFactory::class)->getMock() diff --git a/Tests/Unit/ClientFactory/Guzzle6FactoryTest.php b/Tests/Unit/ClientFactory/Guzzle6FactoryTest.php index b818bb17..fae1c294 100644 --- a/Tests/Unit/ClientFactory/Guzzle6FactoryTest.php +++ b/Tests/Unit/ClientFactory/Guzzle6FactoryTest.php @@ -13,6 +13,10 @@ class Guzzle6FactoryTest extends TestCase { public function testCreateClient() { + if (!class_exists(\Http\Adapter\Guzzle6\Client::class)) { + $this->markTestSkipped('Guzzle6 adapter is not installed'); + } + $factory = new Guzzle6Factory(); $client = $factory->createClient(); diff --git a/Tests/Unit/ClientFactory/ReactFactoryTest.php b/Tests/Unit/ClientFactory/ReactFactoryTest.php index 7f5d728b..4a8ce9a7 100644 --- a/Tests/Unit/ClientFactory/ReactFactoryTest.php +++ b/Tests/Unit/ClientFactory/ReactFactoryTest.php @@ -14,6 +14,10 @@ class ReactFactoryTest extends TestCase { public function testCreateClient() { + if (!class_exists(\Http\Adapter\React\Client::class)) { + $this->markTestSkipped('React adapter is not installed'); + } + $factory = new ReactFactory($this->getMockBuilder(MessageFactory::class)->getMock()); $client = $factory->createClient(); diff --git a/Tests/Unit/ClientFactory/SocketFactoryTest.php b/Tests/Unit/ClientFactory/SocketFactoryTest.php index 8fc6b89c..86fb6bd8 100644 --- a/Tests/Unit/ClientFactory/SocketFactoryTest.php +++ b/Tests/Unit/ClientFactory/SocketFactoryTest.php @@ -14,6 +14,10 @@ class SocketFactoryTest extends TestCase { public function testCreateClient() { + if (!class_exists(\Http\Client\Socket\Client::class)) { + $this->markTestSkipped('Socket client is not installed'); + } + $factory = new SocketFactory($this->getMockBuilder(MessageFactory::class)->getMock()); $client = $factory->createClient(); diff --git a/composer.json b/composer.json index 23a028a8..a0a4b834 100644 --- a/composer.json +++ b/composer.json @@ -38,13 +38,9 @@ "guzzlehttp/psr7": "^1.0", "matthiasnoback/symfony-dependency-injection-test": "^1.1 || ^2.3", "nyholm/nsa": "^1.1", - "php-http/buzz-adapter": "^0.3", - "php-http/curl-client": "^1.0", - "php-http/guzzle6-adapter": "^1.1.1", - "php-http/mock-client": "^1.0", + "php-http/guzzle6-adapter": "^1.1.1 || ^2.0.1", "php-http/promise": "^1.0", - "php-http/react-adapter": "^0.2.1", - "php-http/socket-client": "^1.0", + "php-http/mock-client": "^1.2", "polishsymfonycommunity/symfony-mocker-container": "^1.0", "symfony/browser-kit": "^2.8.49 || ^3.0.9 || ^3.1.10 || ^3.2.14 || ^3.3.18 || ^3.4.20 || ^4.0.15 || ^4.1.9 || ^4.2.1", "symfony/cache": "^3.1.10 || ^3.2.14 || ^3.3.18 || ^3.4.20 || ^4.0.15 || ^4.1.9 || ^4.2.1",