Skip to content

Commit

Permalink
Support for more clients versions (#294)
Browse files Browse the repository at this point in the history
* Support for clients

* Removed most clients from composer.json

* Use mock-client 1.2

* minor
  • Loading branch information
Nyholm committed Dec 30, 2018
1 parent 599e7d4 commit 9d208e2
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 8 deletions.
10 changes: 9 additions & 1 deletion .travis.yml
Expand Up @@ -15,7 +15,7 @@ env:

branches:
except:
- /^analysis-.*$/
- /^patch-.*$/

matrix:
fast_finish: true
Expand Down Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion Tests/Resources/app/config/config_test.yml
Expand Up @@ -7,7 +7,7 @@ httplug:
async_client: auto
clients:
acme:
factory: httplug.factory.curl
factory: httplug.factory.guzzle6
plugins:
-
decoder:
Expand Down
4 changes: 4 additions & 0 deletions Tests/Unit/ClientFactory/BuzzFactoryTest.php
Expand Up @@ -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();

Expand Down
4 changes: 4 additions & 0 deletions Tests/Unit/ClientFactory/CurlFactoryTest.php
Expand Up @@ -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()
Expand Down
4 changes: 4 additions & 0 deletions Tests/Unit/ClientFactory/Guzzle6FactoryTest.php
Expand Up @@ -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();

Expand Down
4 changes: 4 additions & 0 deletions Tests/Unit/ClientFactory/ReactFactoryTest.php
Expand Up @@ -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();

Expand Down
4 changes: 4 additions & 0 deletions Tests/Unit/ClientFactory/SocketFactoryTest.php
Expand Up @@ -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();

Expand Down
8 changes: 2 additions & 6 deletions composer.json
Expand Up @@ -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",
Expand Down

0 comments on commit 9d208e2

Please sign in to comment.