From 0afd7a54d195ea85cdc6cef46a713f194fefbbd4 Mon Sep 17 00:00:00 2001 From: Nyholm Date: Sat, 29 Dec 2018 16:07:51 +0100 Subject: [PATCH 1/4] Support for clients --- .travis.yml | 2 +- composer.json | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7ebc80af..816baa67 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,7 +15,7 @@ env: branches: except: - - /^analysis-.*$/ + - /^patch-.*$/ matrix: fast_finish: true diff --git a/composer.json b/composer.json index 23a028a8..e4a2b0b5 100644 --- a/composer.json +++ b/composer.json @@ -38,10 +38,10 @@ "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/buzz-adapter": "^1.0", "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/mock-client": "^1.0 || ^2.0", "php-http/promise": "^1.0", "php-http/react-adapter": "^0.2.1", "php-http/socket-client": "^1.0", From 73749d1b0d7ae0007c74a953e013d72294ef8e87 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Sun, 30 Dec 2018 09:20:09 +0100 Subject: [PATCH 2/4] Removed most clients from composer.json --- .travis.yml | 8 ++++++++ Tests/Resources/app/config/config_test.yml | 2 +- Tests/Unit/ClientFactory/BuzzFactoryTest.php | 4 ++++ Tests/Unit/ClientFactory/CurlFactoryTest.php | 4 ++++ Tests/Unit/ClientFactory/Guzzle6FactoryTest.php | 4 ++++ Tests/Unit/ClientFactory/ReactFactoryTest.php | 4 ++++ Tests/Unit/ClientFactory/SocketFactoryTest.php | 4 ++++ composer.json | 6 +----- 8 files changed, 30 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 816baa67..45b4d0ec 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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/mock-client:^1.0 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 php-http/mock-client:^2.0" + # 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 e4a2b0b5..020f58db 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": "^1.0", - "php-http/curl-client": "^1.0", "php-http/guzzle6-adapter": "^1.1.1 || ^2.0.1", - "php-http/mock-client": "^1.0 || ^2.0", "php-http/promise": "^1.0", - "php-http/react-adapter": "^0.2.1", - "php-http/socket-client": "^1.0", + "php-http/mock-client": "^1.0 || ^2.0", "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", From 72ee879a6fb486ce3100602ec7c2ad7a2a37b298 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Sun, 30 Dec 2018 09:36:51 +0100 Subject: [PATCH 3/4] Use mock-client 1.2 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 020f58db..a0a4b834 100644 --- a/composer.json +++ b/composer.json @@ -40,7 +40,7 @@ "nyholm/nsa": "^1.1", "php-http/guzzle6-adapter": "^1.1.1 || ^2.0.1", "php-http/promise": "^1.0", - "php-http/mock-client": "^1.0 || ^2.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", From 18266d457e8f6d75a9c5a5380cea7abcb562eb0a Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Sun, 30 Dec 2018 09:42:10 +0100 Subject: [PATCH 4/4] minor --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 45b4d0ec..6d778e49 100644 --- a/.travis.yml +++ b/.travis.yml @@ -45,11 +45,11 @@ matrix: # 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/mock-client:^1.0 php-http/react-adapter:^0.2.1 php-http/socket-client:^1.0" + 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 php-http/mock-client:^2.0" + env: DEPENDENCIES="php-http/guzzle6-adapter:^2.0.1" # Latest commit to master - php: 7.3