assertEquals($expectedEmail, $transparentEmail->getPrimaryEmail(new Email($email, $caseSensitive))); } public function providerGetPrimaryEmail() { $emptyServiceCollector = $this->createServiceCollector(); $tlenServiceCollector = $this->createServiceCollector([TlenPl::class]); return [ [ new TransparentEmail($tlenServiceCollector), 'john.doe+alias@gmail.com', 'john.doe+alias@gmail.com' ], [new TransparentEmail(), 'john.doe+alias@gmail.com', 'johndoe@gmail.com'], [new TransparentEmail($emptyServiceCollector), 'John.Doe@example.com', 'john.doe@example.com'], [new TransparentEmail($emptyServiceCollector), 'John.Doe@example.com', 'John.Doe@example.com', true], [new TransparentEmail(), 'John.Doe@gmail.com', 'johndoe@gmail.com', true], [new TransparentEmail(), 'Jane.Doe+receipts@hotmail.com', 'jane.doe@hotmail.com'], [new TransparentEmail(), 'Jane.Doe-receipts@yahoo.com', 'jane.doe@yahoo.com'], ]; } private function createServiceCollector(array $classes = []) : ServiceCollectorInterface { $collector = new ServiceCollector(); foreach ($classes as $class) { $collector->addService(new $class()); } return $collector; } }