Skip to content

Commit aecd193

Browse files
committed
stop all server processes after tests have run
1 parent 8a0f1c4 commit aecd193

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

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()

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
}

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)