From 567df9fb5ba326aab90198f5a22f6bbe3143ebf9 Mon Sep 17 00:00:00 2001 From: bkrukowski Date: Sat, 10 Sep 2016 01:45:42 +0200 Subject: [PATCH] Case sensitive tests --- tests/Services/MultiDomainTest.php | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/tests/Services/MultiDomainTest.php b/tests/Services/MultiDomainTest.php index e9151d6..564fa81 100644 --- a/tests/Services/MultiDomainTest.php +++ b/tests/Services/MultiDomainTest.php @@ -23,6 +23,7 @@ class MultiDomainTest extends \PHPUnit_Framework_TestCase return [ [$this->getMultiDomainMock('foo.bar', ['foo.bar']), 'gmail.com', false], [$this->getMultiDomainMock('foo.bar', ['foo.bar', 'gmail.com']), 'gmail.com', true], + [$this->getMultiDomainMock('Foo.Bar', ['foo.bar', 'gmail.com']), 'gmail.com', true], ]; } @@ -42,21 +43,29 @@ class MultiDomainTest extends \PHPUnit_Framework_TestCase { return [ [$this->getMultiDomainMock('foo.bar', ['foo.bar', 'foo.bar2']), 'name@foo.bar', 'name@foo.bar'], + [$this->getMultiDomainMock('foo.bar', ['foo.bar', 'foo.bar2'], true), 'Name@foo.bar', 'Name@foo.bar'], [$this->getMultiDomainMock('foo.bar', ['foo.bar', 'foo.bar2']), 'name@foo.bar2', 'name@foo.bar'], ]; } - private function getMultiDomainMock(string $primaryDomain, array $supportedDomains) : MultiDomain + private function getMultiDomainMock( + string $primaryDomain, + array $supportedDomains, + bool $caseSensitive = false) : MultiDomain { - return new class ($primaryDomain, $supportedDomains) extends MultiDomain { + return new class ($primaryDomain, $supportedDomains, $caseSensitive) extends MultiDomain { + private $primaryDomain; private $supportedDomains; - public function __construct(string $primaryDomain, array $supportedDomains) + private $caseSensitive; + + public function __construct(string $primaryDomain, array $supportedDomains, bool $caseSensitive) { $this->primaryDomain = $primaryDomain; $this->supportedDomains = $supportedDomains; + $this->caseSensitive = $caseSensitive; } protected function getDomainList() : array @@ -68,6 +77,11 @@ class MultiDomainTest extends \PHPUnit_Framework_TestCase { return $this->primaryDomain; } + + protected function isCaseSensitive() : bool + { + return $this->caseSensitive; + } }; } } \ No newline at end of file