| @@ 230-247 (lines=18) @@ | ||
| 227 | } |
|
| 228 | ||
| 229 | /** @test */ |
|
| 230 | public function it_can_get_the_member() |
|
| 231 | { |
|
| 232 | $email = '[email protected]'; |
|
| 233 | ||
| 234 | $subscriberHash = 'abc123'; |
|
| 235 | ||
| 236 | $this->mailChimpApi->shouldReceive('subscriberHash') |
|
| 237 | ->once() |
|
| 238 | ->withArgs([$email]) |
|
| 239 | ->andReturn($subscriberHash); |
|
| 240 | ||
| 241 | $this->mailChimpApi |
|
| 242 | ->shouldReceive('get') |
|
| 243 | ->once() |
|
| 244 | ->withArgs(["lists/123/members/{$subscriberHash}"]); |
|
| 245 | ||
| 246 | $this->newsletter->getMember($email); |
|
| 247 | } |
|
| 248 | ||
| 249 | /** @test */ |
|
| 250 | public function it_can_get_the_member_from_a_specific_list() |
|
| @@ 250-267 (lines=18) @@ | ||
| 247 | } |
|
| 248 | ||
| 249 | /** @test */ |
|
| 250 | public function it_can_get_the_member_from_a_specific_list() |
|
| 251 | { |
|
| 252 | $email = '[email protected]'; |
|
| 253 | ||
| 254 | $subscriberHash = 'abc123'; |
|
| 255 | ||
| 256 | $this->mailChimpApi->shouldReceive('subscriberHash') |
|
| 257 | ->once() |
|
| 258 | ->withArgs([$email]) |
|
| 259 | ->andReturn($subscriberHash); |
|
| 260 | ||
| 261 | $this->mailChimpApi |
|
| 262 | ->shouldReceive('get') |
|
| 263 | ->once() |
|
| 264 | ->withArgs(["lists/456/members/{$subscriberHash}"]); |
|
| 265 | ||
| 266 | $this->newsletter->getMember($email, 'list2'); |
|
| 267 | } |
|
| 268 | ||
| 269 | /** @test */ |
|
| 270 | public function is_can_create_a_campaign() |
|