function test_getLossyUrl() { $urls = array('example.com' => 'example.com', 'm.example.com' => 'example.com', 'www.example.com' => 'example.com', 'search.example.com' => 'example.com', 'example.ca' => 'example.{}', 'us.example.com' => '{}.example.com', 'www.m.example.ca' => 'example.{}', 'www.google.com.af' => 'google.{}', 'www.google.co.uk' => 'google.{}', 'images.de.ask.com' => 'images.{}.ask.com'); foreach ($urls as $input => $expected) { $this->assertEqual(Piwik_Common::getLossyUrl($input), $expected); } }
/** * @dataProvider getLossyUrls * @group Core * @group Common * @group getLossyUrl */ public function testGetLossyUrl($input, $expected) { $this->assertEquals($expected, Piwik_Common::getLossyUrl($input)); }