protected function runProviderTest(ProviderInterface $provider) { $this->assertTrue($provider->isSpamReferrer($this->parser->parseUrl('http://example.org'))); $this->assertTrue($provider->isSpamReferrer($this->parser->parseUrl('http://dev.example.org'))); $this->assertTrue($provider->isSpamReferrer($this->parser->parseUrl('http://dev.example.com'))); $this->assertFalse($provider->isSpamReferrer($this->parser->parseUrl('http://xyz.example.com'))); }
/** * @param string|Url $url * @return bool */ public function isSpamReferrer($url) { if (!$url instanceof Url) { try { $url = $this->domainParser->parseUrl($url); } catch (\Exception $exp) { return false; } } return $this->provider->isSpamReferrer($url); }