domainResolver = new SimpleDomainResolver(); } /** * @test * @dataProvider provideDomains */ public function resolvesExpectedDomain(?string $domain): void { $result = $this->domainResolver->resolveDomain($domain); if ($domain === null) { $this->assertNull($result); } else { $this->assertInstanceOf(Domain::class, $result); $this->assertEquals($domain, $result->getAuthority()); } } public function provideDomains(): iterable { yield 'with empty domain' => [null]; yield 'with non-empty domain' => ['domain.com']; } }