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@gmail.com>2015-10-15 16:43:35 +0300
committerThomas Steur <thomas.steur@gmail.com>2015-10-15 16:43:35 +0300
commitbb80b8f831e10f037c8d2722c9967943defef95e (patch)
tree3ce0a28cb1d15148cd15d48b83a39e0c92bf38b8 /plugins/DevicePlugins
parent713a124cc2c118697f3f2801679bc0e2bb5c5dc3 (diff)
parent1e139be2c8c3c6f974e740dd1c9f905e8f673f98 (diff)
Merge branch 'master' into 3.0
Conflicts: CHANGELOG.md core/Plugin/Controller.php core/Version.php plugins/API/ProcessedReport.php plugins/CoreHome/CoreHome.php plugins/CoreHome/javascripts/corehome.js plugins/CoreHome/javascripts/menu.js plugins/CoreHome/javascripts/menu_init.js plugins/CoreHome/lang/en.json plugins/CoreHome/stylesheets/zen-mode.less plugins/CoreHome/templates/ReportsByDimension/_reportsByDimension.twig plugins/CoreHome/templates/_indexContent.twig plugins/CoreHome/templates/getDefaultIndexView.twig plugins/Dashboard/Menu.php plugins/Dashboard/javascripts/dashboard.js plugins/Dashboard/javascripts/dashboardObject.js plugins/Goals/templates/_titleAndEvolutionGraph.twig plugins/Goals/templates/getOverviewView.twig plugins/Morpheus/javascripts/piwikHelper.js plugins/Referrers/templates/index.twig plugins/UserCountry/templates/index.twig plugins/VisitFrequency/templates/_sparklines.twig plugins/ZenMode/ZenMode.php plugins/ZenMode/javascripts/zen-mode.js tests/PHPUnit/Fixtures/UITestFixture.php tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getReportMetadata_day.xml tests/UI/expected-ui-screenshots tests/UI/specs/Dashboard_spec.js tests/UI/specs/Menus_spec.js tests/UI/specs/UIIntegration_spec.js
Diffstat (limited to 'plugins/DevicePlugins')
-rw-r--r--plugins/DevicePlugins/DevicePlugins.php7
-rw-r--r--plugins/DevicePlugins/tests/System/UserSettingsBCTest.php78
-rw-r--r--plugins/DevicePlugins/tests/System/expected/test_UserSettingsBCTestUserSettings_UserSettings.getPlugin___API.getMetadata_day.xml23
-rw-r--r--plugins/DevicePlugins/tests/System/expected/test_UserSettingsBCTestUserSettings_UserSettings.getPlugin___DevicePlugins.getPlugin_day.xml63
4 files changed, 171 insertions, 0 deletions
diff --git a/plugins/DevicePlugins/DevicePlugins.php b/plugins/DevicePlugins/DevicePlugins.php
index 3ac882e8ce..5ddc6d15d3 100644
--- a/plugins/DevicePlugins/DevicePlugins.php
+++ b/plugins/DevicePlugins/DevicePlugins.php
@@ -25,6 +25,7 @@ class DevicePlugins extends \Piwik\Plugin
return array(
'Metrics.getDefaultMetricTranslations' => 'addMetricTranslations',
'Live.getAllVisitorDetails' => 'extendVisitorDetails',
+ 'Request.getRenamedModuleAndAction' => 'renameUserSettingsModuleAndAction',
);
}
@@ -45,4 +46,10 @@ class DevicePlugins extends \Piwik\Plugin
$translations = array_merge($translations, $metrics);
}
+ public function renameUserSettingsModuleAndAction(&$module, &$action)
+ {
+ if ($module == 'UserSettings' && $action == 'getPlugin') {
+ $module = 'DevicePlugins';
+ }
+ }
}
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
diff --git a/plugins/DevicePlugins/tests/System/expected/test_UserSettingsBCTestUserSettings_UserSettings.getPlugin___API.getMetadata_day.xml b/plugins/DevicePlugins/tests/System/expected/test_UserSettingsBCTestUserSettings_UserSettings.getPlugin___API.getMetadata_day.xml
new file mode 100644
index 0000000000..9a4f403963
--- /dev/null
+++ b/plugins/DevicePlugins/tests/System/expected/test_UserSettingsBCTestUserSettings_UserSettings.getPlugin___API.getMetadata_day.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<result>
+ <row>
+ <category>Visitor Settings</category>
+ <name>Browser Plugins</name>
+ <module>DevicePlugins</module>
+ <action>getPlugin</action>
+ <dimension>Plugin</dimension>
+ <documentation>This report shows which browser plugins your visitors had enabled. This information might be important for choosing the right way to deliver your content.</documentation>
+ <metrics>
+ <nb_visits>Visits</nb_visits>
+ </metrics>
+ <metricsDocumentation>
+ <nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits>
+ </metricsDocumentation>
+ <processedMetrics>
+ <nb_visits_percentage>% Visits</nb_visits_percentage>
+ </processedMetrics>
+ <constantRowsCount>1</constantRowsCount>
+ <imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=DevicePlugins&amp;apiAction=getPlugin&amp;period=day&amp;date=2010-03-06</imageGraphUrl>
+ <uniqueId>DevicePlugins_getPlugin</uniqueId>
+ </row>
+</result> \ No newline at end of file
diff --git a/plugins/DevicePlugins/tests/System/expected/test_UserSettingsBCTestUserSettings_UserSettings.getPlugin___DevicePlugins.getPlugin_day.xml b/plugins/DevicePlugins/tests/System/expected/test_UserSettingsBCTestUserSettings_UserSettings.getPlugin___DevicePlugins.getPlugin_day.xml
new file mode 100644
index 0000000000..72728977e1
--- /dev/null
+++ b/plugins/DevicePlugins/tests/System/expected/test_UserSettingsBCTestUserSettings_UserSettings.getPlugin___DevicePlugins.getPlugin_day.xml
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<result>
+ <row>
+ <label>Cookie</label>
+ <nb_visits>2</nb_visits>
+ <nb_visits_percentage>100%</nb_visits_percentage>
+ <logo>plugins/DevicePlugins/images/plugins/cookie.gif</logo>
+ </row>
+ <row>
+ <label>Flash</label>
+ <nb_visits>2</nb_visits>
+ <nb_visits_percentage>100%</nb_visits_percentage>
+ <logo>plugins/DevicePlugins/images/plugins/flash.gif</logo>
+ </row>
+ <row>
+ <label>Java</label>
+ <nb_visits>2</nb_visits>
+ <nb_visits_percentage>100%</nb_visits_percentage>
+ <logo>plugins/DevicePlugins/images/plugins/java.gif</logo>
+ </row>
+ <row>
+ <label>Director</label>
+ <nb_visits>0</nb_visits>
+ <nb_visits_percentage>0%</nb_visits_percentage>
+ <logo>plugins/DevicePlugins/images/plugins/director.gif</logo>
+ </row>
+ <row>
+ <label>Gears</label>
+ <nb_visits>0</nb_visits>
+ <nb_visits_percentage>0%</nb_visits_percentage>
+ <logo>plugins/DevicePlugins/images/plugins/gears.gif</logo>
+ </row>
+ <row>
+ <label>Pdf</label>
+ <nb_visits>0</nb_visits>
+ <nb_visits_percentage>0%</nb_visits_percentage>
+ <logo>plugins/DevicePlugins/images/plugins/pdf.gif</logo>
+ </row>
+ <row>
+ <label>Quicktime</label>
+ <nb_visits>0</nb_visits>
+ <nb_visits_percentage>0%</nb_visits_percentage>
+ <logo>plugins/DevicePlugins/images/plugins/quicktime.gif</logo>
+ </row>
+ <row>
+ <label>Realplayer</label>
+ <nb_visits>0</nb_visits>
+ <nb_visits_percentage>0%</nb_visits_percentage>
+ <logo>plugins/DevicePlugins/images/plugins/realplayer.gif</logo>
+ </row>
+ <row>
+ <label>Silverlight</label>
+ <nb_visits>0</nb_visits>
+ <nb_visits_percentage>0%</nb_visits_percentage>
+ <logo>plugins/DevicePlugins/images/plugins/silverlight.gif</logo>
+ </row>
+ <row>
+ <label>Windowsmedia</label>
+ <nb_visits>0</nb_visits>
+ <nb_visits_percentage>0%</nb_visits_percentage>
+ <logo>plugins/DevicePlugins/images/plugins/windowsmedia.gif</logo>
+ </row>
+</result> \ No newline at end of file