protected function findMail($type, $value)
{
$criterias = array($type => $value);
$message = $this->getMailCatcherClient()->searchOne($criterias);
if (null === $message) {
throw new \InvalidArgumentException(sprintf('Unable to find a message with criterias "%s".', json_encode($criterias)));
}
return $message;
}