Beispiel #1
0
 public function test_isAcceptableRemoteUrl()
 {
     Piwik::createConfigObject();
     Piwik_Config::getInstance()->setTestEnvironment();
     $data = array('http://piwik.org/' => array(true), 'http://piwik.org' => array(true), 'http://qa.piwik.org/' => array(true), 'http://forum.piwik.org/' => array(true), 'http://dev.piwik.org/' => array(true), 'http://demo.piwik.org/' => array(true), 'http://www.piwik.org/' => array(false), 'https://piwik.org/' => array(false), 'http://example.org/' => array(false));
     foreach ($data as $url => $expected) {
         $this->assertEqual(Piwik_Proxy_Controller::isPiwikUrl($url), $expected[0], $url);
     }
 }
	function outputImage()
	{
		Piwik_Proxy_Controller::outputBinaryImage();
	}
Beispiel #3
0
 /**
  * @dataProvider getAcceptableRemoteUrls
  * @group Plugins
  * @group Proxy
  */
 public function testIsAcceptableRemoteUrl($url, $expected)
 {
     $this->assertEquals($expected, Piwik_Proxy_Controller::isPiwikUrl($url));
 }