public function testIsUrl() { $this->assertTrue(StringUtils::isUrl('http://www.michaldudek.pl')); $this->assertTrue(StringUtils::isUrl('https://michaldudek.pl/some/thing/wicked/this/way/comes.html')); $this->assertTrue(StringUtils::isUrl('http://www.michaldudek.pl/?show=news&id=1')); $this->assertTrue(StringUtils::isUrl('http://www.michaldudek.pl/?show=news&id=123&title=something+wicked+this+way+comes&categories[]=1&categories[]=2&categories[]=3&tags[main][0]=&tags[main][1]=&something=%20%20%20')); $this->assertTrue(StringUtils::isUrl('https://localhost/whatever.html')); $this->assertTrue(StringUtils::isUrl('http://127.0.0.1/haha.html')); $this->assertTrue(StringUtils::isUrl('http://just-pretending')); $this->assertFalse(StringUtils::isUrl('')); $this->assertFalse(StringUtils::isUrl('just.a.string')); }