| @@ 382-399 (lines=18) @@ | ||
| 379 | } |
|
| 380 | ||
| 381 | /** @test */ |
|
| 382 | public function it_can_get_the_member() |
|
| 383 | { |
|
| 384 | $email = '[email protected]'; |
|
| 385 | ||
| 386 | $subscriberHash = 'abc123'; |
|
| 387 | ||
| 388 | $this->mailChimpApi->shouldReceive('subscriberHash') |
|
| 389 | ->once() |
|
| 390 | ->withArgs([$email]) |
|
| 391 | ->andReturn($subscriberHash); |
|
| 392 | ||
| 393 | $this->mailChimpApi |
|
| 394 | ->shouldReceive('get') |
|
| 395 | ->once() |
|
| 396 | ->withArgs(["lists/123/members/{$subscriberHash}"]); |
|
| 397 | ||
| 398 | $this->newsletter->getMember($email); |
|
| 399 | } |
|
| 400 | ||
| 401 | /** @test */ |
|
| 402 | public function it_can_get_the_member_activity() |
|
| @@ 422-439 (lines=18) @@ | ||
| 419 | } |
|
| 420 | ||
| 421 | /** @test */ |
|
| 422 | public function it_can_get_the_member_from_a_specific_list() |
|
| 423 | { |
|
| 424 | $email = '[email protected]'; |
|
| 425 | ||
| 426 | $subscriberHash = 'abc123'; |
|
| 427 | ||
| 428 | $this->mailChimpApi->shouldReceive('subscriberHash') |
|
| 429 | ->once() |
|
| 430 | ->withArgs([$email]) |
|
| 431 | ->andReturn($subscriberHash); |
|
| 432 | ||
| 433 | $this->mailChimpApi |
|
| 434 | ->shouldReceive('get') |
|
| 435 | ->once() |
|
| 436 | ->withArgs(["lists/456/members/{$subscriberHash}"]); |
|
| 437 | ||
| 438 | $this->newsletter->getMember($email, 'list2'); |
|
| 439 | } |
|
| 440 | ||
| 441 | /** @test */ |
|
| 442 | public function is_can_create_a_campaign() |
|