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

Commit b77828b

Browse files
committed
Adapt tests for speratation of async / sync test
1 parent 27e36f9 commit b77828b

5 files changed

+125
-1
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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\Handler\CurlHandler;
15+
16+
/**
17+
* @requires PHP 5.5
18+
*
19+
* @author GeLo <[email protected]>
20+
*/
21+
class Guzzle6CurlHttpAsyncAdapterTest extends Guzzle6HttpAsyncAdapterTest
22+
{
23+
/**
24+
* {@inheritdoc}
25+
*/
26+
protected function createHandler()
27+
{
28+
return new CurlHandler();
29+
}
30+
}

tests/Guzzle6HttpAdapterTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@
1313

1414
use GuzzleHttp\Client;
1515
use Http\Adapter\Guzzle6HttpAdapter;
16+
use Http\Client\Tests\HttpClientTest;
1617

1718
/**
1819
* @author GeLo <[email protected]>
1920
*/
20-
abstract class Guzzle6HttpAdapterTest extends HttpAdapterTest
21+
abstract class Guzzle6HttpAdapterTest extends HttpClientTest
2122
{
2223
/**
2324
* {@inheritdoc}

tests/Guzzle6HttpAsyncAdapterTest.php

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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\Client;
15+
use Http\Adapter\Guzzle6HttpAdapter;
16+
use Http\Client\Tests\HttpAsyncClientTest;
17+
18+
/**
19+
* @author GeLo <[email protected]>
20+
*/
21+
abstract class Guzzle6HttpAsyncAdapterTest extends HttpAsyncClientTest
22+
{
23+
/**
24+
* {@inheritdoc}
25+
*/
26+
protected function createHttpAsyncClient()
27+
{
28+
return new Guzzle6HttpAdapter(new Client(['handler' => $this->createHandler()]));
29+
}
30+
31+
/**
32+
* Returns a handler for the client
33+
*
34+
* @return object
35+
*/
36+
abstract protected function createHandler();
37+
}
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\Handler\CurlMultiHandler;
15+
16+
/**
17+
* @author GeLo <[email protected]>
18+
*/
19+
class Guzzle6MultiCurlHttpAsyncAdapterTest extends Guzzle6HttpAsyncAdapterTest
20+
{
21+
/**
22+
* {@inheritdoc}
23+
*/
24+
protected function createHandler()
25+
{
26+
return new CurlMultiHandler();
27+
}
28+
}
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\Handler\StreamHandler;
15+
16+
/**
17+
* @author GeLo <[email protected]>
18+
*/
19+
class Guzzle6StreamHttpAsyncAdapterTest extends Guzzle6HttpAsyncAdapterTest
20+
{
21+
/**
22+
* {@inheritdoc}
23+
*/
24+
protected function createHandler()
25+
{
26+
return new StreamHandler();
27+
}
28+
}

0 commit comments

Comments
 (0)