コード例 #1
0
ファイル: Common.test.php プロジェクト: nnnnathann/piwik
 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);
     }
 }
コード例 #2
0
ファイル: CommonTest.php プロジェクト: nnnnathann/piwik
 /**
  * @dataProvider getLossyUrls
  * @group Core
  * @group Common
  * @group getLossyUrl
  */
 public function testGetLossyUrl($input, $expected)
 {
     $this->assertEquals($expected, Piwik_Common::getLossyUrl($input));
 }