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