| @@ 284-296 (lines=13) @@ | ||
| 281 | /** |
|
| 282 | * @Then /^the email should (not |)be sent from "([^"]*)"$/ |
|
| 283 | */ |
|
| 284 | public function theEmailSentFrom($negate, $from) |
|
| 285 | { |
|
| 286 | if(!$this->lastMatchedEmail) { |
|
| 287 | throw new \LogicException('No matched email found from previous step'); |
|
| 288 | } |
|
| 289 | ||
| 290 | $match = $this->lastMatchedEmail; |
|
| 291 | if(trim($negate)) { |
|
| 292 | assertNotContains($from, $match->From); |
|
| 293 | } else { |
|
| 294 | assertContains($from, $match->From); |
|
| 295 | } |
|
| 296 | } |
|
| 297 | ||
| 298 | /** |
|
| 299 | * @Then /^the email should (not |)be sent to "([^"]*)"$/ |
|
| @@ 301-313 (lines=13) @@ | ||
| 298 | /** |
|
| 299 | * @Then /^the email should (not |)be sent to "([^"]*)"$/ |
|
| 300 | */ |
|
| 301 | public function theEmailSentTo($negate, $to) |
|
| 302 | { |
|
| 303 | if(!$this->lastMatchedEmail) { |
|
| 304 | throw new \LogicException('No matched email found from previous step'); |
|
| 305 | } |
|
| 306 | ||
| 307 | $match = $this->lastMatchedEmail; |
|
| 308 | if(trim($negate)) { |
|
| 309 | assertNotContains($to, $match->To); |
|
| 310 | } else { |
|
| 311 | assertContains($to, $match->To); |
|
| 312 | } |
|
| 313 | } |
|
| 314 | } |
|
| 315 | ||