| @@ 77-95 (lines=19) @@ | ||
| 74 | /** |
|
| 75 | * @test |
|
| 76 | */ |
|
| 77 | public function canMakeGetRequestsWithAuthentication() |
|
| 78 | { |
|
| 79 | $this->setClient(['authToken' => 'myToken']); |
|
| 80 | ||
| 81 | $query = ['foo' => 'bar']; |
|
| 82 | ||
| 83 | $this->mockClient()->request( |
|
| 84 | 'GET', |
|
| 85 | $this->url('/foo'), |
|
| 86 | [ |
|
| 87 | 'auth' => ['myToken', ''], |
|
| 88 | 'query' => $query, |
|
| 89 | ] |
|
| 90 | )->willReturn($this->fooBarResponse()); |
|
| 91 | ||
| 92 | $data = $this->client->get('/foo', $query); |
|
| 93 | ||
| 94 | $this->assertFooBarResponse($data); |
|
| 95 | } |
|
| 96 | ||
| 97 | /** |
|
| 98 | * @test |
|
| @@ 100-118 (lines=19) @@ | ||
| 97 | /** |
|
| 98 | * @test |
|
| 99 | */ |
|
| 100 | public function canMakeGetRequestsWithBasicAuthentication() |
|
| 101 | { |
|
| 102 | $this->setClient(['basicAuth' => ['username', 'password']]); |
|
| 103 | ||
| 104 | $query = ['foo' => 'bar']; |
|
| 105 | ||
| 106 | $this->mockClient()->request( |
|
| 107 | 'GET', |
|
| 108 | $this->url('/foo'), |
|
| 109 | [ |
|
| 110 | 'auth' => ['username', 'password'], |
|
| 111 | 'query' => $query, |
|
| 112 | ] |
|
| 113 | )->willReturn($this->fooBarResponse()); |
|
| 114 | ||
| 115 | $data = $this->client->get('/foo', $query); |
|
| 116 | ||
| 117 | $this->assertFooBarResponse($data); |
|
| 118 | } |
|
| 119 | ||
| 120 | /** |
|
| 121 | * @test |
|