Completed
Push — develop ( 2d2214...2a74ad )
by Adam
02:43
created

ApiTest::testPut()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace IBM\Watson\Common\Tests;
4
5
use Mockery as m;
6
use IBM\Watson\Common\stubs\Api;
7
use Psr\Http\Message\RequestInterface;
8
use Psr\Http\Message\ResponseInterface;
9
10
class ApiTest extends AbstractTestCase
11
{
12
    /**
13
     * @var \IBM\Watson\Common\Api\ApiInterface
14
     */
15
    private $api;
16
17
    public function setUp()
18
    {
19
        parent::setUp();
20
21
        $this->api = new Api($this->httpClient, $this->requestBuilder);
22
23
        $this->requestBuilder
24
            ->shouldReceive('create')
25
            ->once()
26
            ->andReturn(m::mock(RequestInterface::class));
27
28
        $this->httpClient
29
            ->shouldReceive('sendRequest')
30
            ->once()
31
            ->andReturn(m::mock(ResponseInterface::class));
32
    }
33
34
    public function testGet()
35
    {
36
        $this->assertInstanceOf(ResponseInterface::class, $this->api->httpMethodGet());
37
    }
38
39
    public function testHead()
40
    {
41
        $this->assertInstanceOf(ResponseInterface::class, $this->api->httpMethodHead());
42
    }
43
44
    public function testTrace()
45
    {
46
        $this->assertInstanceOf(ResponseInterface::class, $this->api->httpMethodTrace());
47
    }
48
49
    public function testPost()
50
    {
51
        $this->assertInstanceOf(ResponseInterface::class, $this->api->httpMethodPost());
52
    }
53
54
    public function testPut()
55
    {
56
        $this->assertInstanceOf(ResponseInterface::class, $this->api->httpMethodPut());
57
    }
58
59
    public function testPatch()
60
    {
61
        $this->assertInstanceOf(ResponseInterface::class, $this->api->httpMethodPatch());
62
    }
63
64
    public function testDelete()
65
    {
66
        $this->assertInstanceOf(ResponseInterface::class, $this->api->httpMethodDelete());
67
    }
68
69
    public function testOptions()
70
    {
71
        $this->assertInstanceOf(ResponseInterface::class, $this->api->httpMethodOptions());
72
    }
73
}
74