@@ 447-466 (lines=20) @@ | ||
444 | } |
|
445 | ||
446 | /** @test */ |
|
447 | public function it_can_delete_someone() |
|
448 | { |
|
449 | $this->client->shouldReceive('success')->andReturn(true); |
|
450 | ||
451 | $email = '[email protected]'; |
|
452 | ||
453 | $subscriberHash = 'abc123'; |
|
454 | ||
455 | $this->client->shouldReceive('subscriberHash') |
|
456 | ->once() |
|
457 | ->withArgs([$email]) |
|
458 | ->andReturn($subscriberHash); |
|
459 | ||
460 | $this->client |
|
461 | ->shouldReceive('delete') |
|
462 | ->once() |
|
463 | ->withArgs(["lists/123/members/{$subscriberHash}"]); |
|
464 | ||
465 | $this->newsletter->delete('[email protected]'); |
|
466 | } |
|
467 | ||
468 | /** @test */ |
|
469 | public function it_can_delete_someone_from_a_specific_list() |
|
@@ 469-488 (lines=20) @@ | ||
466 | } |
|
467 | ||
468 | /** @test */ |
|
469 | public function it_can_delete_someone_from_a_specific_list() |
|
470 | { |
|
471 | $this->client->shouldReceive('success')->andReturn(true); |
|
472 | ||
473 | $email = '[email protected]'; |
|
474 | ||
475 | $subscriberHash = 'abc123'; |
|
476 | ||
477 | $this->client->shouldReceive('subscriberHash') |
|
478 | ->once() |
|
479 | ->withArgs([$email]) |
|
480 | ->andReturn($subscriberHash); |
|
481 | ||
482 | $this->client |
|
483 | ->shouldReceive('delete') |
|
484 | ->once() |
|
485 | ->withArgs(["lists/456/members/{$subscriberHash}"]); |
|
486 | ||
487 | $this->newsletter->delete('[email protected]', 'list2'); |
|
488 | } |
|
489 | ||
490 | /** @test */ |
|
491 | public function it_exposes_the_api() |
|
@@ 512-531 (lines=20) @@ | ||
509 | } |
|
510 | ||
511 | /** @test */ |
|
512 | public function it_can_get_the_member() |
|
513 | { |
|
514 | $this->client->shouldReceive('success')->andReturn(true); |
|
515 | ||
516 | $email = '[email protected]'; |
|
517 | ||
518 | $subscriberHash = 'abc123'; |
|
519 | ||
520 | $this->client->shouldReceive('subscriberHash') |
|
521 | ->once() |
|
522 | ->withArgs([$email]) |
|
523 | ->andReturn($subscriberHash); |
|
524 | ||
525 | $this->client |
|
526 | ->shouldReceive('get') |
|
527 | ->once() |
|
528 | ->withArgs(["lists/123/members/{$subscriberHash}"]); |
|
529 | ||
530 | $this->newsletter->getMember($email); |
|
531 | } |
|
532 | ||
533 | ||
534 | /** @test */ |
|
@@ 535-554 (lines=20) @@ | ||
532 | ||
533 | ||
534 | /** @test */ |
|
535 | public function it_can_get_the_member_from_a_specific_list() |
|
536 | { |
|
537 | $this->client->shouldReceive('success')->andReturn(true); |
|
538 | ||
539 | $email = '[email protected]'; |
|
540 | ||
541 | $subscriberHash = 'abc123'; |
|
542 | ||
543 | $this->client->shouldReceive('subscriberHash') |
|
544 | ->once() |
|
545 | ->withArgs([$email]) |
|
546 | ->andReturn($subscriberHash); |
|
547 | ||
548 | $this->client |
|
549 | ->shouldReceive('get') |
|
550 | ->once() |
|
551 | ->withArgs(["lists/456/members/{$subscriberHash}"]); |
|
552 | ||
553 | $this->newsletter->getMember($email, 'list2'); |
|
554 | } |
|
555 | } |
|
556 |