mirror of
https://github.com/retailcrm/transparent-email.git
synced 2024-11-28 16:26:03 +03:00
Case sensitive tests
This commit is contained in:
parent
270cc2d831
commit
567df9fb5b
@ -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;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user