File tree Expand file tree Collapse file tree 1 file changed +28
-6
lines changed
src/Symfony/Contracts/HttpClient/Test Expand file tree Collapse file tree 1 file changed +28
-6
lines changed Original file line number Diff line number Diff line change 21
21
* A reference test suite for HttpClientInterface implementations.
22
22
*
23
23
* @experimental in 1.1
24
+ *
25
+ * @internal
24
26
*/
25
- abstract class HttpClientTestCase extends TestCase
27
+ trait HttpClientTestCaseTrait
26
28
{
27
29
private static $ server ;
28
30
29
- public static function setUpBeforeClass ()
30
- {
31
- TestHttpServer::start ();
32
- }
33
-
34
31
abstract protected function getHttpClient (string $ testCase ): HttpClientInterface ;
35
32
36
33
public function testGetRequest ()
@@ -788,3 +785,28 @@ public function testGzipBroken()
788
785
$ response ->getContent ();
789
786
}
790
787
}
788
+
789
+ if (method_exists (\ReflectionMethod::class, 'hasReturnType ' ) && (new \ReflectionMethod (TestCase::class, 'setUpBeforeClass ' ))->hasReturnType ()) {
790
+ abstract class HttpClientTestCase extends TestCase
791
+ {
792
+ use HttpClientTestCaseTrait;
793
+
794
+ public static function setUpBeforeClass (): void
795
+ {
796
+ TestHttpServer::start ();
797
+ }
798
+ }
799
+ } else {
800
+ abstract class HttpClientTestCase extends TestCase
801
+ {
802
+ use HttpClientTestCaseTrait;
803
+
804
+ /**
805
+ * @return void
806
+ */
807
+ public static function setUpBeforeClass ()
808
+ {
809
+ TestHttpServer::start ();
810
+ }
811
+ }
812
+ }
You can’t perform that action at this time.
0 commit comments