Skip to content

Commit 36345e0

Browse files
committed
stop all server processes after tests have run
1 parent 7ba3d8e commit 36345e0

File tree

9 files changed

+40
-2
lines changed

9 files changed

+40
-2
lines changed

src/Symfony/Component/HttpClient/Tests/DataCollector/HttpClientDataCollectorTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ public static function setUpBeforeClass(): void
2424
TestHttpServer::start();
2525
}
2626

27+
public static function tearDownAfterClass(): void
28+
{
29+
TestHttpServer::stop();
30+
}
31+
2732
public function testItCollectsRequestCount()
2833
{
2934
$httpClient1 = $this->httpClientThatHasTracedRequests([

src/Symfony/Component/HttpClient/Tests/HttplugClientTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ public static function setUpBeforeClass(): void
3232
TestHttpServer::start();
3333
}
3434

35+
public static function tearDownAfterClass(): void
36+
{
37+
TestHttpServer::stop();
38+
}
39+
3540
public function testSendRequest()
3641
{
3742
$client = new HttplugClient(new NativeHttpClient());

src/Symfony/Component/HttpClient/Tests/Psr18ClientTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ public static function setUpBeforeClass(): void
2828
TestHttpServer::start();
2929
}
3030

31+
public static function tearDownAfterClass(): void
32+
{
33+
TestHttpServer::stop();
34+
}
35+
3136
public function testSendRequest()
3237
{
3338
$factory = new Psr17Factory();

src/Symfony/Component/HttpClient/Tests/RetryableHttpClientTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@
2727

2828
class RetryableHttpClientTest extends TestCase
2929
{
30+
public static function tearDownAfterClass(): void
31+
{
32+
TestHttpServer::stop();
33+
}
34+
3035
public function testRetryOnError()
3136
{
3237
$client = new RetryableHttpClient(

src/Symfony/Component/HttpClient/Tests/TraceableHttpClientTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ public static function setUpBeforeClass(): void
2929
TestHttpServer::start();
3030
}
3131

32+
public static function tearDownAfterClass(): void
33+
{
34+
TestHttpServer::stop();
35+
}
36+
3237
public function testItTracesRequest()
3338
{
3439
$httpClient = $this->createMock(HttpClientInterface::class);

src/Symfony/Component/HttpClient/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"php": ">=7.2.5",
2626
"psr/log": "^1|^2|^3",
2727
"symfony/deprecation-contracts": "^2.1|^3",
28-
"symfony/http-client-contracts": "^2.4",
28+
"symfony/http-client-contracts": "^2.6",
2929
"symfony/polyfill-php73": "^1.11",
3030
"symfony/polyfill-php80": "^1.16",
3131
"symfony/service-contracts": "^1.0|^2|^3"

src/Symfony/Contracts/HttpClient/Test/HttpClientTestCase.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ public static function setUpBeforeClass(): void
2828
TestHttpServer::start();
2929
}
3030

31+
public static function tearDownAfterClass(): void
32+
{
33+
TestHttpServer::stop(8067);
34+
TestHttpServer::stop(8077);
35+
}
36+
3137
abstract protected function getHttpClient(string $testCase): HttpClientInterface;
3238

3339
public function testGetRequest()

src/Symfony/Contracts/HttpClient/Test/TestHttpServer.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,11 @@ public static function start(int $port = 8057)
4343

4444
return $process;
4545
}
46+
47+
public static function stop(int $port = 8057)
48+
{
49+
if (isset(self::$process[$port])) {
50+
self::$process[$port]->stop();
51+
}
52+
}
4653
}

src/Symfony/Contracts/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
"minimum-stability": "dev",
5353
"extra": {
5454
"branch-alias": {
55-
"dev-main": "2.5-dev"
55+
"dev-main": "2.6-dev"
5656
}
5757
}
5858
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy