Skip to content
This repository was archived by the owner on Jan 6, 2024. It is now read-only.

Commit 2b3b65d

Browse files
committed
Make tests full and green
1 parent 2b7632a commit 2b3b65d

6 files changed

+63
-9
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ matrix:
2121
install:
2222
- travis_retry composer self-update
2323
- travis_retry composer update ${COMPOSER_FLAGS} --prefer-source --no-interaction
24+
- php -S 127.0.0.1:10000 -t vendor/php-http/adapter-integration-tests/fixture
2425

2526
script: vendor/bin/phpunit ${PHPUNIT_FLAGS}
2627

src/Guzzle5HttpAdapter.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ protected function sendInternalRequest(InternalRequestInterface $internalRequest
5858
try {
5959
$response = $this->client->send($this->createRequest($internalRequest));
6060
} catch (\Exception $e) {
61-
var_dump($e); exit;
6261
throw HttpAdapterException::cannotFetchUri(
6362
$e->getRequest()->getUrl(),
6463
$this->getName(),

tests/Guzzle5CurlHttpAdapterTest.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Http Adapter package.
5+
*
6+
* (c) Eric GELOEN <[email protected]>
7+
*
8+
* For the full copyright and license information, please read the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Http\Adapter\Tests;
13+
14+
use GuzzleHttp\Ring\Client\CurlHandler;
15+
16+
/**
17+
* @author GeLo <[email protected]>
18+
*/
19+
class Guzzle5CurlHttpAdapterTest extends Guzzle5HttpAdapterTest
20+
{
21+
/**
22+
* {@inheritdoc}
23+
*/
24+
protected function createHandler()
25+
{
26+
return new CurlHandler();
27+
}
28+
}

tests/Guzzle5HttpAdapterTest.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,12 @@
1212
namespace Http\Adapter\Tests;
1313

1414
use GuzzleHttp\Client;
15-
use GuzzleHttp\Ring\Client\CurlHandler;
1615
use Http\Adapter\Guzzle5HttpAdapter;
1716

1817
/**
1918
* @author GeLo <[email protected]>
2019
*/
21-
class Guzzle5HttpAdapterTest extends HttpAdapterTest
20+
abstract class Guzzle5HttpAdapterTest extends HttpAdapterTest
2221
{
2322
public function testGetName()
2423
{
@@ -35,9 +34,8 @@ protected function createHttpAdapter()
3534

3635
/**
3736
* Returns a handler for the client
37+
*
38+
* @return object
3839
*/
39-
protected function createHandler()
40-
{
41-
return new CurlHandler();
42-
}
40+
abstract protected function createHandler();
4341
}

tests/Guzzle5MultiHttpAdapterTest.php renamed to tests/Guzzle5MultiCurlHttpAdapterTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
/**
1717
* @author GeLo <[email protected]>
1818
*/
19-
class Guzzle5MultiHttpAdapterTest extends Guzzle5HttpAdapterTest
19+
class Guzzle5MultiCurlHttpAdapterTest extends Guzzle5HttpAdapterTest
2020
{
2121
/**
22-
* Returns a handler for the client
22+
* {@inheritdoc}
2323
*/
2424
protected function createHandler()
2525
{
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Http Adapter package.
5+
*
6+
* (c) Eric GELOEN <[email protected]>
7+
*
8+
* For the full copyright and license information, please read the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Http\Adapter\Tests;
13+
14+
use GuzzleHttp\Ring\Client\StreamHandler;
15+
16+
/**
17+
* @author GeLo <[email protected]>
18+
*/
19+
class Guzzle5StreamHttpAdapterTest extends Guzzle5HttpAdapterTest
20+
{
21+
/**
22+
* {@inheritdoc}
23+
*/
24+
protected function createHandler()
25+
{
26+
return new StreamHandler();
27+
}
28+
}

0 commit comments

Comments
 (0)