Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit84a6690

Browse files
committed
Make HttpClientTestCase compatible with PHPUnit8
1 parentfda49e6 commit84a6690

File tree

1 file changed

+28
-6
lines changed

1 file changed

+28
-6
lines changed

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

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,13 @@
2121
* A reference test suite for HttpClientInterface implementations.
2222
*
2323
* @experimental in 1.1
24+
*
25+
* @internal
2426
*/
25-
abstractclass HttpClientTestCaseextends TestCase
27+
trait HttpClientTestCaseTrait
2628
{
2729
privatestatic$server;
2830

29-
publicstaticfunctionsetUpBeforeClass()
30-
{
31-
TestHttpServer::start();
32-
}
33-
3431
abstractprotectedfunctiongetHttpClient(string$testCase):HttpClientInterface;
3532

3633
publicfunctiontestGetRequest()
@@ -788,3 +785,28 @@ public function testGzipBroken()
788785
$response->getContent();
789786
}
790787
}
788+
789+
if (method_exists(\ReflectionMethod::class,'hasReturnType') && (new \ReflectionMethod(TestCase::class,'setUpBeforeClass'))->hasReturnType()) {
790+
abstractclass HttpClientTestCaseextends TestCase
791+
{
792+
use HttpClientTestCaseTrait;
793+
794+
publicstaticfunctionsetUpBeforeClass():void
795+
{
796+
TestHttpServer::start();
797+
}
798+
}
799+
}else {
800+
abstractclass HttpClientTestCaseextends TestCase
801+
{
802+
use HttpClientTestCaseTrait;
803+
804+
/**
805+
* @return void
806+
*/
807+
publicstaticfunctionsetUpBeforeClass()
808+
{
809+
TestHttpServer::start();
810+
}
811+
}
812+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp