assertEquals($expected, Url::matchesHost($source, $target, $expected)); } #[TestWith(["http://a-valid-http-url.com", true])] #[TestWith(["ht://an-invalid-url.com", false])] #[TestWith(["https://no-tld./", false])] #[TestWith(["https://a-valid-https.com", true])] #[TestWith(["ftp://wrong-protocol.com", false])] public function testItValidatesAUrl(string $url, bool $expected) { $this->assertEquals($expected, Url::validateUrl($url)); } }