public function assertEmail($subject, $address) {
    $message = $this->getMailCatcherClient()->searchOne([
      Message::SUBJECT_CRITERIA => $subject,
      Message::TO_CRITERIA => $address
    ]);
    if (is_null($message)) {
      throw new Exception("Message not found.");
    }
  }
public function assertEmail($subject, $address) {
    $message = $this->getMailCatcherClient()->searchOne([
      Message::SUBJECT_CRITERIA => $subject,
      Message::TO_CRITERIA => $address
    ]);
    if (is_null($message)) {
      throw new Exception("Message not found.");
    }
  }
public function assertEmail ( $ subject , $ address ) { $ message = $ this -> getMailCatcherClient ( ) -> searchOne ( [ Message :: SUBJECT_CRITERIA => $ subject , Message :: TO_CRITERIA => $ address ] ) ; if ( is_null ( $ message ) ) { throw new Exception ( "Message not found." ) ; } }
Check for email.

@Then :subject should be emailed to :address

@throws Exception When no matching message is found.
Check for email .