Skip to content

Commit 14029a5

Browse files
committed
1 parent 876e483 commit 14029a5

File tree

2 files changed

+35
-16
lines changed

2 files changed

+35
-16
lines changed

tests/Client/CurlClientTest.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
/**
3+
* Class HTTPClientTest
4+
*
5+
* @filesource HTTPClientTest.php
6+
* @created 28.08.2018
7+
* @package chillerlan\HTTPTest
8+
* @author smiley <smiley@chillerlan.net>
9+
* @copyright 2018 smiley
10+
* @license MIT
11+
*/
12+
13+
namespace chillerlan\HTTPTest\Client;
14+
15+
use chillerlan\HTTP\{CurlClient, HTTPOptions};
16+
17+
class CurlClientTest extends HTTPClientTestAbstract{
18+
19+
protected function setUp(){
20+
$options = new HTTPOptions([
21+
'ca_info' => __DIR__.'/../cacert.pem',
22+
'user_agent' => $this::USER_AGENT,
23+
]);
24+
25+
$this->http = new CurlClient($options);
26+
}
27+
28+
}

tests/CurlClientTest.php renamed to tests/Client/HTTPClientTestAbstract.php

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
<?php
22
/**
3-
* Class HTTPClientTest
3+
* Class HTTPClientTestAbstract
44
*
5-
* @filesource HTTPClientTest.php
6-
* @created 28.08.2018
7-
* @package chillerlan\HTTPTest
5+
* @filesource HTTPClientTestAbstract.php
6+
* @created 10.11.2018
7+
* @package chillerlan\HTTPTest\Client
88
* @author smiley <smiley@chillerlan.net>
99
* @copyright 2018 smiley
1010
* @license MIT
1111
*/
1212

13-
namespace chillerlan\HTTPTest;
13+
namespace chillerlan\HTTPTest\Client;
1414

15-
use chillerlan\HTTP\{CurlClient, HTTPOptions, Psr7\Request};
15+
use chillerlan\HTTP\Psr7\Request;
1616
use PHPUnit\Framework\TestCase;
1717

18-
class CurlClientTest extends TestCase{
18+
abstract class HTTPClientTestAbstract extends TestCase{
1919

2020
protected const USER_AGENT = 'chillerlanHttpTest/2.0';
2121

@@ -24,15 +24,6 @@ class CurlClientTest extends TestCase{
2424
*/
2525
protected $http;
2626

27-
protected function setUp(){
28-
$options = new HTTPOptions([
29-
'ca_info' => __DIR__.'/cacert.pem',
30-
'user_agent' => $this::USER_AGENT,
31-
]);
32-
33-
$this->http = new CurlClient($options);
34-
}
35-
3627
public function testSendRequest(){
3728

3829
try{

0 commit comments

Comments
 (0)