Completed
Push — master ( 22d3fd...d7530b )
by Risan Bagja
02:43
created

HttpClientTest::http_client_has_base_uri()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 6
rs 9.4285
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
3
use Ktp\HttpClient;
4
use Psr\Http\Message\ResponseInterface;
5
6
class HttpClientTest extends PHPUnit_Framework_TestCase {
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
7
    /** @test */
8
    function http_client_has_base_uri()
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
9
    {
10
        $httpClient = new HttpClient('http://foo.bar');
11
12
        $this->assertEquals('http://foo.bar', $httpClient->baseUri());
13
    }
14
15
    /** @test */
16
    function http_client_has_post_request()
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
17
    {
18
        $httpClient = new HttpClient('http://www.mocky.io/v2/');
19
20
        $response = $httpClient->post('5678638b0f00006a2a500861');
21
22
        $this->assertInstanceOf(ResponseInterface::class, $response);
23
    }
24
}
25