Skip to content

Instantly share code, notes, and snippets.

@SebSept
Created January 23, 2015 14:46
Show Gist options
  • Save SebSept/25bc5523f5611020767a to your computer and use it in GitHub Desktop.
Save SebSept/25bc5523f5611020767a to your computer and use it in GitHub Desktop.
blog_debug_mails
<?php
public function testEnvoi_destinataires_du_mail()
{
$this->assertUsePhpMail();
$this->assertTrue($this->module->envoiMail());
$mail = json_decode(file_get_contents('/tmp/lastmail'));
$destinataires = $mail->bcc;
// -- verif que plus de 5 destinataires :le listing principal
$this->assertTrue(count($destinataires) > 50);
// -- verif que je suis bien dans les destinataires
$moi_present = false;
foreach ($destinataires as $destinataire)
{
$moi_present = 'sebastien***@yahoo.fr' === $destinataire->address;
if ($moi_present)
{
break;
}
}
$this->assertTrue($moi_present);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment