| @@ 105-123 (lines=19) @@ | ||
| 102 | /** |
|
| 103 | * @test |
|
| 104 | */ |
|
| 105 | public function canMakeGetRequestsWithAuthentication() |
|
| 106 | { |
|
| 107 | $this->setClient(['authToken' => 'myToken']); |
|
| 108 | ||
| 109 | $query = ['foo' => 'bar']; |
|
| 110 | ||
| 111 | $this->mockClient()->request( |
|
| 112 | 'GET', |
|
| 113 | $this->url('/foo'), |
|
| 114 | [ |
|
| 115 | 'auth' => ['myToken', ''], |
|
| 116 | 'query' => $query, |
|
| 117 | ] |
|
| 118 | )->willReturn($this->fooBarResponse()); |
|
| 119 | ||
| 120 | $data = $this->client->get('/foo', $query); |
|
| 121 | ||
| 122 | $this->assertFooBarResponse($data); |
|
| 123 | } |
|
| 124 | ||
| 125 | /** |
|
| 126 | * @test |
|
| @@ 128-146 (lines=19) @@ | ||
| 125 | /** |
|
| 126 | * @test |
|
| 127 | */ |
|
| 128 | public function canMakeGetRequestsWithBasicAuthentication() |
|
| 129 | { |
|
| 130 | $this->setClient(['basicAuth' => ['username', 'password']]); |
|
| 131 | ||
| 132 | $query = ['foo' => 'bar']; |
|
| 133 | ||
| 134 | $this->mockClient()->request( |
|
| 135 | 'GET', |
|
| 136 | $this->url('/foo'), |
|
| 137 | [ |
|
| 138 | 'auth' => ['username', 'password'], |
|
| 139 | 'query' => $query, |
|
| 140 | ] |
|
| 141 | )->willReturn($this->fooBarResponse()); |
|
| 142 | ||
| 143 | $data = $this->client->get('/foo', $query); |
|
| 144 | ||
| 145 | $this->assertFooBarResponse($data); |
|
| 146 | } |
|
| 147 | ||
| 148 | /** |
|
| 149 | * @test |
|