Files
Phraseanet/tests/Alchemy/Tests/Phrasea/Notification/Mail/MailInfoValidationReminderTest.php
2013-01-29 09:34:18 +01:00

54 lines
1.3 KiB
PHP

<?php
namespace Alchemy\Tests\Phrasea\Notification\Mail;
use Alchemy\Phrasea\Exception\LogicException;
use Alchemy\Phrasea\Notification\Mail\MailInfoValidationReminder;
/**
* @covers Alchemy\Phrasea\Notification\Mail\MailInfoValidationReminder
*/
class MailInfoValidationReminderTest extends MailWithLinkTestCase
{
/**
* @covers Alchemy\Phrasea\Notification\Mail\MailInfoValidationReminder::setTitle
*/
public function testSetTitle()
{
$this->assertContainsString('Hulk Hogan', $this->getMail()->getSubject());
}
public function testShouldThrowALogicExceptionIfNoTitleProvided()
{
$mail = MailInfoValidationReminder::create(
$this->getApp(),
$this->getReceiverMock(),
$this->getEmitterMock(),
$this->getMessage()
);
try {
$mail->getSubject();
$this->fail('Should have raised an exception');
} catch (LogicException $e) {
}
}
public function getMail()
{
$mail = MailInfoValidationReminder::create(
$this->getApp(),
$this->getReceiverMock(),
$this->getEmitterMock(),
$this->getMessage(),
$this->getUrl(),
$this->getExpiration()
);
$mail->setTitle('Hulk hogan');
return $mail;
}
}