mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-14 21:43:18 +00:00
48 lines
1.1 KiB
PHP
48 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace Alchemy\Tests\Phrasea\Notification\Mail;
|
|
|
|
use Alchemy\Phrasea\Exception\LogicException;
|
|
use Alchemy\Phrasea\Notification\Mail\MailSuccessFTPSender;
|
|
|
|
/**
|
|
* @covers Alchemy\Phrasea\Notification\Mail\MailSuccessFTPSender
|
|
*/
|
|
class MailSuccessFTPSenderTest extends MailTestCase
|
|
{
|
|
public function testSetServer()
|
|
{
|
|
$this->assertTrue(false !== stripos($this->getMail()->getSubject(), 'ftp://example.com'));
|
|
}
|
|
|
|
public function testThatALgicExceptionIsThrownIfNoServerSet()
|
|
{
|
|
$mail = MailSuccessFTPSender::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 = MailSuccessFTPSender::create(
|
|
$this->getApp(),
|
|
$this->getReceiverMock(),
|
|
$this->getEmitterMock(),
|
|
$this->getMessage()
|
|
);
|
|
$mail->setServer('ftp://example.com');
|
|
|
|
return $mail;
|
|
}
|
|
}
|