Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Steur <thomas.steur@googlemail.com>2014-10-05 15:05:47 +0400
committerThomas Steur <thomas.steur@googlemail.com>2014-10-05 15:05:47 +0400
commit5a1eab97f54b44f57356b4276b9c9df2a8eef51b (patch)
tree83864ece2806ccf6e6bb49abf3fd65de92c13ad8 /plugins/Proxy
parent19bcd2d262343eae9d553378e4c66ce7e033b4d8 (diff)
refs #5940 put tests in correct folders, better testsuite names, some tests still fail and I cannot figure out why
Diffstat (limited to 'plugins/Proxy')
-rw-r--r--plugins/Proxy/tests/ProxyTest.php48
1 files changed, 48 insertions, 0 deletions
diff --git a/plugins/Proxy/tests/ProxyTest.php b/plugins/Proxy/tests/ProxyTest.php
new file mode 100644
index 0000000000..8b460a35cc
--- /dev/null
+++ b/plugins/Proxy/tests/ProxyTest.php
@@ -0,0 +1,48 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+namespace Piwik\Plugins\Proxy\tests;
+
+use Piwik\Plugins\Proxy\Controller;
+
+/**
+ * @group Proxy
+ * @group ProxyTest
+ * @group Plugins
+ */
+class ProxyTest extends \PHPUnit_Framework_TestCase
+{
+ public function getAcceptableRemoteUrls()
+ {
+ return array(
+ // piwik white list (and used in homepage)
+ array('http://piwik.org/', true),
+
+ array('http://piwik.org', true),
+ array('http://qa.piwik.org/', true),
+ array('http://forum.piwik.org/', true),
+ array('http://dev.piwik.org/', true),
+ array('http://demo.piwik.org/', true),
+
+ // not in the piwik white list
+ array('http://www.piwik.org/', false),
+ array('https://piwik.org/', false),
+ array('http://example.org/', false),
+ );
+ }
+
+ /**
+ * @dataProvider getAcceptableRemoteUrls
+ * @group Plugins
+ */
+ public function testIsAcceptableRemoteUrl($url, $expected)
+ {
+ $this->assertEquals($expected, Controller::isPiwikUrl($url));
+ }
+}
+