2014-08-31 16:57:59 +02:00
|
|
|
<?php
|
|
|
|
namespace Szurubooru\Tests\Services;
|
|
|
|
|
2014-09-01 20:51:59 +02:00
|
|
|
class EmailServiceTest extends \Szurubooru\Tests\AbstractTestCase
|
2014-08-31 16:57:59 +02:00
|
|
|
{
|
|
|
|
public function testEmailWithoutAt()
|
|
|
|
{
|
|
|
|
$emailService = new \Szurubooru\Services\EmailService();
|
|
|
|
|
|
|
|
$this->setExpectedException(\DomainException::class);
|
|
|
|
$emailService->validateEmail('ghost');
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testEmailWithoutDotInDomain()
|
|
|
|
{
|
|
|
|
$emailService = new \Szurubooru\Services\EmailService();
|
|
|
|
|
|
|
|
$this->setExpectedException(\DomainException::class);
|
|
|
|
$emailService->validateEmail('ghost@cemetery');
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testValidEmail()
|
|
|
|
{
|
|
|
|
$emailService = new \Szurubooru\Services\EmailService();
|
|
|
|
|
|
|
|
$this->assertNull($emailService->validateEmail('ghost@cemetery.consulting'));
|
|
|
|
}
|
|
|
|
}
|