From 538b88952e635563fe31c459464356161405cf3e Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Sun, 31 Aug 2014 16:57:59 +0200 Subject: [PATCH] Added EmailService --- src/Services/EmailService.php | 14 ++++++++++++++ tests/Services/EmailServiceTest.php | 28 ++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 src/Services/EmailService.php create mode 100644 tests/Services/EmailServiceTest.php diff --git a/src/Services/EmailService.php b/src/Services/EmailService.php new file mode 100644 index 00000000..f05bfcfe --- /dev/null +++ b/src/Services/EmailService.php @@ -0,0 +1,14 @@ +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')); + } +}