| @@ 346-363 (lines=18) @@ | ||
| 343 | } |
|
| 344 | ||
| 345 | /** @test */ |
|
| 346 | public function it_can_delete_someone() |
|
| 347 | { |
|
| 348 | $email = '[email protected]'; |
|
| 349 | ||
| 350 | $subscriberHash = 'abc123'; |
|
| 351 | ||
| 352 | $this->mailChimpApi->shouldReceive('subscriberHash') |
|
| 353 | ->once() |
|
| 354 | ->withArgs([$email]) |
|
| 355 | ->andReturn($subscriberHash); |
|
| 356 | ||
| 357 | $this->mailChimpApi |
|
| 358 | ->shouldReceive('delete') |
|
| 359 | ->once() |
|
| 360 | ->withArgs(["lists/123/members/{$subscriberHash}"]); |
|
| 361 | ||
| 362 | $this->newsletter->delete('[email protected]'); |
|
| 363 | } |
|
| 364 | ||
| 365 | /** @test */ |
|
| 366 | public function it_can_delete_someone_from_a_specific_list() |
|
| @@ 366-383 (lines=18) @@ | ||
| 363 | } |
|
| 364 | ||
| 365 | /** @test */ |
|
| 366 | public function it_can_delete_someone_from_a_specific_list() |
|
| 367 | { |
|
| 368 | $email = '[email protected]'; |
|
| 369 | ||
| 370 | $subscriberHash = 'abc123'; |
|
| 371 | ||
| 372 | $this->mailChimpApi->shouldReceive('subscriberHash') |
|
| 373 | ->once() |
|
| 374 | ->withArgs([$email]) |
|
| 375 | ->andReturn($subscriberHash); |
|
| 376 | ||
| 377 | $this->mailChimpApi |
|
| 378 | ->shouldReceive('delete') |
|
| 379 | ->once() |
|
| 380 | ->withArgs(["lists/456/members/{$subscriberHash}"]); |
|
| 381 | ||
| 382 | $this->newsletter->delete('[email protected]', 'list2'); |
|
| 383 | } |
|
| 384 | ||
| 385 | /** @test */ |
|
| 386 | public function it_exposes_the_api() |
|
| @@ 405-422 (lines=18) @@ | ||
| 402 | } |
|
| 403 | ||
| 404 | /** @test */ |
|
| 405 | public function it_can_get_the_member() |
|
| 406 | { |
|
| 407 | $email = '[email protected]'; |
|
| 408 | ||
| 409 | $subscriberHash = 'abc123'; |
|
| 410 | ||
| 411 | $this->mailChimpApi->shouldReceive('subscriberHash') |
|
| 412 | ->once() |
|
| 413 | ->withArgs([$email]) |
|
| 414 | ->andReturn($subscriberHash); |
|
| 415 | ||
| 416 | $this->mailChimpApi |
|
| 417 | ->shouldReceive('get') |
|
| 418 | ->once() |
|
| 419 | ->withArgs(["lists/123/members/{$subscriberHash}"]); |
|
| 420 | ||
| 421 | $this->newsletter->getMember($email); |
|
| 422 | } |
|
| 423 | ||
| 424 | /** @test */ |
|
| 425 | public function it_can_get_the_member_activity() |
|
| @@ 425-442 (lines=18) @@ | ||
| 422 | } |
|
| 423 | ||
| 424 | /** @test */ |
|
| 425 | public function it_can_get_the_member_activity() |
|
| 426 | { |
|
| 427 | $email = '[email protected]'; |
|
| 428 | ||
| 429 | $subscriberHash = 'abc123'; |
|
| 430 | ||
| 431 | $this->mailChimpApi->shouldReceive('subscriberHash') |
|
| 432 | ->once() |
|
| 433 | ->withArgs([$email]) |
|
| 434 | ->andReturn($subscriberHash); |
|
| 435 | ||
| 436 | $this->mailChimpApi |
|
| 437 | ->shouldReceive('get') |
|
| 438 | ->once() |
|
| 439 | ->withArgs(["lists/123/members/{$subscriberHash}/activity"]); |
|
| 440 | ||
| 441 | $this->newsletter->getMemberActivity($email); |
|
| 442 | } |
|
| 443 | ||
| 444 | /** @test */ |
|
| 445 | public function it_can_get_the_member_from_a_specific_list() |
|
| @@ 445-462 (lines=18) @@ | ||
| 442 | } |
|
| 443 | ||
| 444 | /** @test */ |
|
| 445 | public function it_can_get_the_member_from_a_specific_list() |
|
| 446 | { |
|
| 447 | $email = '[email protected]'; |
|
| 448 | ||
| 449 | $subscriberHash = 'abc123'; |
|
| 450 | ||
| 451 | $this->mailChimpApi->shouldReceive('subscriberHash') |
|
| 452 | ->once() |
|
| 453 | ->withArgs([$email]) |
|
| 454 | ->andReturn($subscriberHash); |
|
| 455 | ||
| 456 | $this->mailChimpApi |
|
| 457 | ->shouldReceive('get') |
|
| 458 | ->once() |
|
| 459 | ->withArgs(["lists/456/members/{$subscriberHash}"]); |
|
| 460 | ||
| 461 | $this->newsletter->getMember($email, 'list2'); |
|
| 462 | } |
|
| 463 | ||
| 464 | /** @test */ |
|
| 465 | public function is_can_create_a_campaign() |
|