assertEquals($outputEmail, (new YandexRu())->getPrimaryEmail(new Email($inputEmail))); } public function providerGetPrimaryEmail() : array { return [ ['foobar@YANDEX.RU', 'foobar@yandex.ru'], ['fOObar@YAndEX.ru', 'foobar@yandex.ru'], ['foobar+alias@yandex.ru', 'foobar@yandex.ru'], ['JaneDoe@ya.ru', 'janedoe@yandex.ru'], ['Jane.Doe@ya.ru', 'jane-doe@yandex.ru'], ['foobar@yandex.com', 'foobar@yandex.ru'], ['foobar@yandex.by', 'foobar@yandex.ru'], ['foobar@yandex.kz', 'foobar@yandex.ru'], ['foobar@yandex.ua', 'foobar@yandex.ru'], ]; } /** * @dataProvider providerIsSupported * * @param string $domain * @param bool $result */ public function testIsSupported(string $domain, bool $result) { $this->assertSame($result, (new YandexRu())->isSupported(new Email('Jane.Doe@' . $domain))); } public function providerIsSupported() : array { return [ ['yandex.ru', true], ['yandex.com', true], ['yandex.by', true], ['yandex.kz', true], ['yandex.ua', true], ['yandex.RU', true], ['yan.dex.ru', false], ['YANDEX.RU', true], ]; } }