mirror of
https://github.com/retailcrm/transparent-email.git
synced 2024-11-24 14:26:05 +03:00
Test coverage
This commit is contained in:
parent
f7e1b62e81
commit
4614dcd7aa
@ -5,6 +5,7 @@ declare(strict_types=1);
|
|||||||
namespace bkrukowski\TransparentEmail\Tests;
|
namespace bkrukowski\TransparentEmail\Tests;
|
||||||
|
|
||||||
use bkrukowski\TransparentEmail\Emails\Email;
|
use bkrukowski\TransparentEmail\Emails\Email;
|
||||||
|
use bkrukowski\TransparentEmail\Emails\EmailInterface;
|
||||||
use bkrukowski\TransparentEmail\ServiceCollector;
|
use bkrukowski\TransparentEmail\ServiceCollector;
|
||||||
use bkrukowski\TransparentEmail\ServiceCollectorInterface;
|
use bkrukowski\TransparentEmail\ServiceCollectorInterface;
|
||||||
use bkrukowski\TransparentEmail\Services\TlenPl;
|
use bkrukowski\TransparentEmail\Services\TlenPl;
|
||||||
@ -49,6 +50,28 @@ class TransparentEmailTest extends \PHPUnit_Framework_TestCase
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @dataProvider providerDefault
|
||||||
|
*
|
||||||
|
* @param EmailInterface $inputEmail
|
||||||
|
* @param string $expectedEmail
|
||||||
|
*/
|
||||||
|
public function testDefault(EmailInterface $inputEmail, string $expectedEmail)
|
||||||
|
{
|
||||||
|
$this->assertEquals($expectedEmail, (new TransparentEmail())->getPrimaryEmail($inputEmail));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function providerDefault()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
[new Email('John.Doe+spam@gmail.com', true), 'johndoe@gmail.com'],
|
||||||
|
[new Email('Jane.Doe+spam@outlook.com', true), 'jane.doe@outlook.com'],
|
||||||
|
[new Email('John.Doe@tlen.pl', true), 'john.doe@o2.pl'],
|
||||||
|
[new Email('ALIAS@janedoe.33mail.com', true), 'janedoe@janedoe.33mail.com'],
|
||||||
|
[new Email('John.Doe-facebook@yahoo.com', true), 'john.doe@yahoo.com'],
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
private function createServiceCollector(array $classes = []) : ServiceCollectorInterface
|
private function createServiceCollector(array $classes = []) : ServiceCollectorInterface
|
||||||
{
|
{
|
||||||
$collector = new ServiceCollector();
|
$collector = new ServiceCollector();
|
||||||
|
Loading…
Reference in New Issue
Block a user