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:
authordiosmosis <benaka@piwik.pro>2015-10-08 18:17:11 +0300
committerdiosmosis <benaka@piwik.pro>2015-10-08 19:54:11 +0300
commitc12c7792361d785fb7ccc0fef0befda9c3a7d742 (patch)
tree4585a646ebfd5563e2a5ba547a4fd217a7a564ba /plugins/DevicePlugins/tests/System/UserSettingsBCTest.php
parent99e84a563a610d2dfd0587e6d2d04e4cbaaf89b0 (diff)
Split up UserSettings BC (move request forwarding to appropriate plugins) & split up the tests for that BC.
Diffstat (limited to 'plugins/DevicePlugins/tests/System/UserSettingsBCTest.php')
-rw-r--r--plugins/DevicePlugins/tests/System/UserSettingsBCTest.php78
1 files changed, 78 insertions, 0 deletions
diff --git a/plugins/DevicePlugins/tests/System/UserSettingsBCTest.php b/plugins/DevicePlugins/tests/System/UserSettingsBCTest.php
new file mode 100644
index 0000000000..1901960abb
--- /dev/null
+++ b/plugins/DevicePlugins/tests/System/UserSettingsBCTest.php
@@ -0,0 +1,78 @@
+<?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\DevicePlugins\tests\System;
+
+use Piwik\Tests\Fixtures\OneVisitorTwoVisits;
+use Piwik\Tests\Framework\TestCase\SystemTestCase;
+
+/**
+ * @group DevicePlugins
+ * @group DevicePlugins_System
+ */
+class UserSettingsBCTest extends SystemTestCase
+{
+ /**
+ * @var OneVisitorTwoVisits
+ */
+ public static $fixture;
+
+ /**
+ * @dataProvider getApiForTesting
+ */
+ public function test_Api($api, $params)
+ {
+ $this->runApiTests($api, $params);
+ }
+
+ public function getApiForTesting()
+ {
+ $idSite = self::$fixture->idSite;
+ $dateTime = self::$fixture->dateTime;
+
+ $api = array(
+ 'UserSettings.getPlugin',
+ );
+
+ $result = array();
+
+
+ foreach ($api as $method) {
+ list($module, $action) = explode('.', $method);
+
+ // api test (uses hack to test UserSettings which doesn't exist anymore. we say we're testing
+ // against DevicePlugins & overwrite the module & action w/ otherRequestParameters)
+ $result[] = array('DevicePlugins.getPlugin', array('idSite' => $idSite,
+ 'date' => $dateTime,
+ 'periods' => array('day'),
+ 'testSuffix' => $module . '_' . $method . '_',
+ 'otherRequestParameters' => array(
+ 'method' => $method,
+ ),
+ ));
+
+ // api metadata tests
+ $result[] = array('API.getMetadata', array(
+ 'idSite' => $idSite,
+ 'date' => $dateTime,
+ 'apiModule' => $module,
+ 'apiAction' => $action,
+ 'testSuffix' => $module . '_' . $method . '_',
+ ));
+ }
+
+ return $result;
+ }
+
+ public static function getPathToTestDirectory()
+ {
+ return dirname(__FILE__);
+ }
+}
+
+UserSettingsBCTest::$fixture = new OneVisitorTwoVisits(); \ No newline at end of file