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