Conditions | 1 |
Paths | 1 |
Total Lines | 15 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
10 | function it_gets_a_response_from_an_endpoint() |
||
11 | { |
||
12 | $this->createEndpoint( |
||
13 | DummyHttpClient::METHOD_GET, |
||
14 | 'http://api.test.com/', |
||
15 | 'application/hal+xml', |
||
16 | '{"name":"value"}' |
||
17 | ); |
||
18 | |||
19 | $response = $this->get('http://api.test.com/'); |
||
20 | |||
21 | $response->getHeader('content-type')->shouldHaveCount(1); |
||
22 | $response->getHeader('content-type')[0]->shouldReturn('application/hal+xml'); |
||
23 | $response->getBody()->__toString()->shouldReturn('{"name":"value"}'); |
||
24 | } |
||
25 | } |
||
26 |