Skip to content

Commit f57e6fe

Browse files
[HttpClient] fix issues in tests
1 parent 5eb7dd0 commit f57e6fe

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

Tests/DataCollector/HttpClientDataCollectorTest.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
* file that was distributed with this source code.
1010
*/
1111

12+
namespace Symfony\Component\HttpClient\Tests\DataCollector;
13+
1214
use PHPUnit\Framework\TestCase;
1315
use Symfony\Component\HttpClient\DataCollector\HttpClientDataCollector;
1416
use Symfony\Component\HttpClient\NativeHttpClient;
@@ -19,9 +21,13 @@
1921

2022
class HttpClientDataCollectorTest extends TestCase
2123
{
22-
public function testItCollectsRequestCount()
24+
public static function setUpBeforeClass(): void
2325
{
2426
TestHttpServer::start();
27+
}
28+
29+
public function testItCollectsRequestCount()
30+
{
2531
$httpClient1 = $this->httpClientThatHasTracedRequests([
2632
[
2733
'method' => 'GET',
@@ -50,7 +56,6 @@ public function testItCollectsRequestCount()
5056

5157
public function testItCollectsErrorCount()
5258
{
53-
TestHttpServer::start();
5459
$httpClient1 = $this->httpClientThatHasTracedRequests([
5560
[
5661
'method' => 'GET',
@@ -80,7 +85,6 @@ public function testItCollectsErrorCount()
8085

8186
public function testItCollectsErrorCountByClient()
8287
{
83-
TestHttpServer::start();
8488
$httpClient1 = $this->httpClientThatHasTracedRequests([
8589
[
8690
'method' => 'GET',
@@ -113,7 +117,6 @@ public function testItCollectsErrorCountByClient()
113117

114118
public function testItCollectsTracesByClient()
115119
{
116-
TestHttpServer::start();
117120
$httpClient1 = $this->httpClientThatHasTracedRequests([
118121
[
119122
'method' => 'GET',
@@ -146,7 +149,6 @@ public function testItCollectsTracesByClient()
146149

147150
public function testItIsEmptyAfterReset()
148151
{
149-
TestHttpServer::start();
150152
$httpClient1 = $this->httpClientThatHasTracedRequests([
151153
[
152154
'method' => 'GET',

Tests/HttplugClientTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222

2323
class HttplugClientTest extends TestCase
2424
{
25-
private static $server;
26-
2725
public static function setUpBeforeClass(): void
2826
{
2927
TestHttpServer::start();

Tests/Psr18ClientTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121

2222
class Psr18ClientTest extends TestCase
2323
{
24-
private static $server;
25-
2624
public static function setUpBeforeClass(): void
2725
{
2826
TestHttpServer::start();

0 commit comments

Comments
 (0)