@@ 210-227 (lines=18) @@ | ||
207 | } |
|
208 | ||
209 | /** @test */ |
|
210 | public function it_will_trow_an_exception_when_unsubscribe_someone() |
|
211 | { |
|
212 | $this->response->shouldReceive('success')->andReturn(false); |
|
213 | ||
214 | $this->client->shouldReceive('post')->withArgs([ |
|
215 | Resources::$ContactslistManagecontact,[ |
|
216 | 'id' => '123', |
|
217 | 'body' => [ |
|
218 | 'Email' => "testtest.fr", |
|
219 | 'Action' => "unsub", |
|
220 | ] |
|
221 | ] |
|
222 | ||
223 | ])->andReturn($this->response); |
|
224 | ||
225 | $this->expectExceptionObject(ApiError::responseError('Error', 'mailjet', 400)); |
|
226 | $this->newsletter->unsubscribe('testtest.fr'); |
|
227 | } |
|
228 | ||
229 | /** @test */ |
|
230 | public function it_can_delete_someone() |
|
@@ 249-267 (lines=19) @@ | ||
246 | } |
|
247 | ||
248 | /** @test */ |
|
249 | public function it_will_trow_an_exception_when_delete_someone() |
|
250 | { |
|
251 | $this->response->shouldReceive('success')->andReturn(false); |
|
252 | ||
253 | $this->client->shouldReceive('post')->withArgs([ |
|
254 | Resources::$ContactslistManagecontact,[ |
|
255 | 'id' => '123', |
|
256 | 'body' => [ |
|
257 | 'Email' => "[email protected]", |
|
258 | 'Action' => "remove", |
|
259 | ] |
|
260 | ] |
|
261 | ||
262 | ])->andReturn($this->response); |
|
263 | ||
264 | ||
265 | $this->expectExceptionObject(ApiError::responseError('Error', 'mailjet', 400)); |
|
266 | $this->newsletter->delete('[email protected]'); |
|
267 | } |
|
268 | ||
269 | /** @test */ |
|
270 | public function it_exposes_the_api() |