1 | <?php |
||
9 | final class RequestTest extends \PHPUnit_Framework_TestCase |
||
10 | { |
||
11 | /** |
||
12 | * Verify basic functionality of the request object. |
||
13 | * |
||
14 | * @test |
||
15 | * @covers ::__construct |
||
16 | * @covers ::getUrl |
||
17 | * @covers ::getBody |
||
18 | * @covers ::getMethod |
||
19 | * @covers ::getHeaders |
||
20 | * |
||
21 | * @return void |
||
22 | */ |
||
23 | public function construct() |
||
35 | |||
36 | /** |
||
37 | * Verify invalid constructor parameters cause exceptions. |
||
38 | * |
||
39 | * @param mixed $url The url of the request. |
||
40 | * @param mixed $method The http method of the request. |
||
41 | * @param array $headers The headers of the request. |
||
42 | * @param array $body The body of the request. |
||
43 | * |
||
44 | * @test |
||
45 | * @covers ::__construct |
||
46 | * @dataProvider badData |
||
47 | * @expectedException \InvalidArgumentException |
||
48 | * |
||
49 | * @return void |
||
50 | */ |
||
51 | public function constructWithInvalidParameters($url, $method, array $headers = [], array $body = []) |
||
55 | |||
56 | /** |
||
57 | * Provides data for __construct test. |
||
58 | * |
||
59 | * @return array |
||
60 | */ |
||
61 | public function badData() |
||
76 | } |
||
77 |