Passed
Pull Request — master (#306)
by Tobias
02:05
created

CurlIntegrationTest::testSendRequest()   A

Complexity

Conditions 4
Paths 4

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 4
eloc 5
nc 4
nop 4
dl 0
loc 9
rs 9.2
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Buzz\Test\Integration;
6
7
use Buzz\Client\Curl;
8
9
class CurlIntegrationTest extends BaseIntegrationTest
10
{
11
    protected function createHttpAdapter()
12
    {
13
        $client = new Curl();
14
15
        return $client;
16
    }
17
18
    /**
19
     * @dataProvider requestProvider
20
     * @group        integration
21
     */
22
    public function testSendRequest($method, $uri, array $headers, $body)
23
    {
24
        if (defined('HHVM_VERSION')) {
25
            static::markTestSkipped('This test can not run under HHVM');
26
        }
27
        if (null !== $body && in_array($method, ['GET', 'HEAD', 'TRACE'], true)) {
28
            static::markTestSkipped('cURL can not send body using '.$method);
29
        }
30
        parent::testSendRequest($method, $uri, $headers, $body);
31
    }
32
33
    /**
34
     * @dataProvider requestWithOutcomeProvider
35
     * @group        integration
36
     */
37
    public function testSendRequestWithOutcome($uriAndOutcome, $protocolVersion, array $headers, $body)
38
    {
39
        if (null !== $body && '1.0' !== $protocolVersion) {
40
            $this->markTestSkipped('cURL can not send body using GET');
41
        }
42
43
        parent::testSendRequestWithOutcome($uriAndOutcome, $protocolVersion, $headers, $body);
44
    }
45
}
46