CurlOnlyPostHttpClientTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 11
c 1
b 0
f 0
dl 0
loc 24
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testCallInvokeSuccessfully() 0 13 1
A testCallInvokeShouldThrowException() 0 7 1
1
<?php
2
3
namespace Tests\Classes\Http;
4
5
use Ipag\Classes\Http\CurlOnlyPostHttpClient;
6
use PHPUnit\Framework\TestCase;
7
8
class CurlOnlyPostHttpClientTest extends TestCase
9
{
10
    public function testCallInvokeShouldThrowException()
11
    {
12
        $this->expectException(\Exception::class);
13
14
        $onlyPost = new CurlOnlyPostHttpClient();
15
16
        $onlyPost('', [], []);
17
    }
18
19
    public function testCallInvokeSuccessfully()
20
    {
21
        $onlyPost = new CurlOnlyPostHttpClient();
22
23
        $response = $onlyPost(\Ipag\Classes\Endpoint::SANDBOX, [
24
            'Content-Type' => 'application/xml',
25
            'Accept'       => 'application/xml',
26
        ], [
27
            'id'   => 1,
28
            'name' => 'teste',
29
        ]);
30
31
        $this->assertNotEmpty($response);
32
    }
33
}
34