diff options
author | Thomas Steur <thomas.steur@gmail.com> | 2015-10-15 16:43:35 +0300 |
---|---|---|
committer | Thomas Steur <thomas.steur@gmail.com> | 2015-10-15 16:43:35 +0300 |
commit | bb80b8f831e10f037c8d2722c9967943defef95e (patch) | |
tree | 3ce0a28cb1d15148cd15d48b83a39e0c92bf38b8 /plugins/Resolution | |
parent | 713a124cc2c118697f3f2801679bc0e2bb5c5dc3 (diff) | |
parent | 1e139be2c8c3c6f974e740dd1c9f905e8f673f98 (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/Resolution')
6 files changed, 187 insertions, 0 deletions
diff --git a/plugins/Resolution/Resolution.php b/plugins/Resolution/Resolution.php index 5ab7692ccf..7bd8cc3be0 100644 --- a/plugins/Resolution/Resolution.php +++ b/plugins/Resolution/Resolution.php @@ -23,6 +23,7 @@ class Resolution extends \Piwik\Plugin { return array( 'Live.getAllVisitorDetails' => 'extendVisitorDetails', + 'Request.getRenamedModuleAndAction' => 'renameUserSettingsModuleAndAction', ); } @@ -32,4 +33,11 @@ class Resolution extends \Piwik\Plugin $visitor['resolution'] = $instance->getResolution(); } + + public function renameUserSettingsModuleAndAction(&$module, &$action) + { + if ($module == 'UserSettings' && ($action == 'getResolution' || $action == 'getConfiguration')) { + $module = 'Resolution'; + } + } } diff --git a/plugins/Resolution/tests/System/UserSettingsBCTest.php b/plugins/Resolution/tests/System/UserSettingsBCTest.php new file mode 100644 index 0000000000..beae888701 --- /dev/null +++ b/plugins/Resolution/tests/System/UserSettingsBCTest.php @@ -0,0 +1,79 @@ +<?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\Resolution\tests\System; + +use Piwik\Tests\Fixtures\OneVisitorTwoVisits; +use Piwik\Tests\Framework\TestCase\SystemTestCase; + +/** + * @group Resolution + * @group Resolution_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.getResolution', + 'UserSettings.getConfiguration', + ); + + $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 Resolution & overwrite the module & action w/ otherRequestParameters) + $result[] = array('Resolution.getResolution', 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/Resolution/tests/System/expected/test_UserSettingsBCTestUserSettings_UserSettings.getConfiguration___API.getMetadata_day.xml b/plugins/Resolution/tests/System/expected/test_UserSettingsBCTestUserSettings_UserSettings.getConfiguration___API.getMetadata_day.xml new file mode 100644 index 0000000000..01fee59915 --- /dev/null +++ b/plugins/Resolution/tests/System/expected/test_UserSettingsBCTestUserSettings_UserSettings.getConfiguration___API.getMetadata_day.xml @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <row> + <category>Visitor Settings</category> + <name>Visitor Configuration</name> + <module>Resolution</module> + <action>getConfiguration</action> + <dimension>Configuration</dimension> + <documentation>This report shows the most common overall configurations that your visitors had. A configuration is the combination of an operating system, a browser type and a screen resolution.</documentation> + <metrics> + <nb_visits>Visits</nb_visits> + <nb_uniq_visitors>Unique visitors</nb_uniq_visitors> + <nb_actions>Actions</nb_actions> + <nb_users>Users</nb_users> + </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> + <nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors> + <nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions> + <nb_users>The number of users logged in your website. It is the number of unique active users that have a User ID set (via the Tracking code function 'setUserId').</nb_users> + <nb_actions_per_visit>The average number of actions (page views, site searches, downloads or outlinks) that were performed during the visits.</nb_actions_per_visit> + <avg_time_on_site>The average duration of a visit.</avg_time_on_site> + <bounce_rate>The percentage of visits that only had a single pageview. This means, that the visitor left the website directly from the entrance page.</bounce_rate> + <conversion_rate>The percentage of visits that triggered a goal conversion.</conversion_rate> + </metricsDocumentation> + <processedMetrics> + <nb_actions_per_visit>Actions per Visit</nb_actions_per_visit> + <avg_time_on_site>Avg. Time on Website</avg_time_on_site> + <bounce_rate>Bounce Rate</bounce_rate> + <conversion_rate>Conversion Rate</conversion_rate> + </processedMetrics> + <imageGraphUrl>index.php?module=API&method=ImageGraph.get&idSite=1&apiModule=Resolution&apiAction=getConfiguration&period=day&date=2010-03-06</imageGraphUrl> + <imageGraphEvolutionUrl>index.php?module=API&method=ImageGraph.get&idSite=1&apiModule=Resolution&apiAction=getConfiguration&period=day&date=2010-02-05,2010-03-06</imageGraphEvolutionUrl> + <uniqueId>Resolution_getConfiguration</uniqueId> + </row> +</result>
\ No newline at end of file diff --git a/plugins/Resolution/tests/System/expected/test_UserSettingsBCTestUserSettings_UserSettings.getConfiguration___Resolution.getResolution_day.xml b/plugins/Resolution/tests/System/expected/test_UserSettingsBCTestUserSettings_UserSettings.getConfiguration___Resolution.getResolution_day.xml new file mode 100644 index 0000000000..a4804d3e5d --- /dev/null +++ b/plugins/Resolution/tests/System/expected/test_UserSettingsBCTestUserSettings_UserSettings.getConfiguration___Resolution.getResolution_day.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <row> + <label>Windows / Firefox / 1024x768</label> + <nb_uniq_visitors>1</nb_uniq_visitors> + <nb_visits>2</nb_visits> + <nb_actions>8</nb_actions> + <nb_users>0</nb_users> + <max_actions>7</max_actions> + <sum_visit_length>1621</sum_visit_length> + <bounce_count>1</bounce_count> + <nb_visits_converted>2</nb_visits_converted> + </row> +</result>
\ No newline at end of file diff --git a/plugins/Resolution/tests/System/expected/test_UserSettingsBCTestUserSettings_UserSettings.getResolution___API.getMetadata_day.xml b/plugins/Resolution/tests/System/expected/test_UserSettingsBCTestUserSettings_UserSettings.getResolution___API.getMetadata_day.xml new file mode 100644 index 0000000000..b99815c557 --- /dev/null +++ b/plugins/Resolution/tests/System/expected/test_UserSettingsBCTestUserSettings_UserSettings.getResolution___API.getMetadata_day.xml @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <row> + <category>Visitor Settings</category> + <name>Screen Resolution</name> + <module>Resolution</module> + <action>getResolution</action> + <dimension>Resolution</dimension> + <metrics> + <nb_visits>Visits</nb_visits> + <nb_uniq_visitors>Unique visitors</nb_uniq_visitors> + <nb_actions>Actions</nb_actions> + <nb_users>Users</nb_users> + </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> + <nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors> + <nb_actions>The number of actions performed by your visitors. Actions can be page views, internal site searches, downloads or outlinks.</nb_actions> + <nb_users>The number of users logged in your website. It is the number of unique active users that have a User ID set (via the Tracking code function 'setUserId').</nb_users> + <nb_actions_per_visit>The average number of actions (page views, site searches, downloads or outlinks) that were performed during the visits.</nb_actions_per_visit> + <avg_time_on_site>The average duration of a visit.</avg_time_on_site> + <bounce_rate>The percentage of visits that only had a single pageview. This means, that the visitor left the website directly from the entrance page.</bounce_rate> + <conversion_rate>The percentage of visits that triggered a goal conversion.</conversion_rate> + </metricsDocumentation> + <processedMetrics> + <nb_actions_per_visit>Actions per Visit</nb_actions_per_visit> + <avg_time_on_site>Avg. Time on Website</avg_time_on_site> + <bounce_rate>Bounce Rate</bounce_rate> + <conversion_rate>Conversion Rate</conversion_rate> + </processedMetrics> + <imageGraphUrl>index.php?module=API&method=ImageGraph.get&idSite=1&apiModule=Resolution&apiAction=getResolution&period=day&date=2010-03-06</imageGraphUrl> + <imageGraphEvolutionUrl>index.php?module=API&method=ImageGraph.get&idSite=1&apiModule=Resolution&apiAction=getResolution&period=day&date=2010-02-05,2010-03-06</imageGraphEvolutionUrl> + <uniqueId>Resolution_getResolution</uniqueId> + </row> +</result>
\ No newline at end of file diff --git a/plugins/Resolution/tests/System/expected/test_UserSettingsBCTestUserSettings_UserSettings.getResolution___Resolution.getResolution_day.xml b/plugins/Resolution/tests/System/expected/test_UserSettingsBCTestUserSettings_UserSettings.getResolution___Resolution.getResolution_day.xml new file mode 100644 index 0000000000..2d97656958 --- /dev/null +++ b/plugins/Resolution/tests/System/expected/test_UserSettingsBCTestUserSettings_UserSettings.getResolution___Resolution.getResolution_day.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="utf-8" ?> +<result> + <row> + <label>1024x768</label> + <nb_uniq_visitors>1</nb_uniq_visitors> + <nb_visits>2</nb_visits> + <nb_actions>8</nb_actions> + <nb_users>0</nb_users> + <max_actions>7</max_actions> + <sum_visit_length>1621</sum_visit_length> + <bounce_count>1</bounce_count> + <nb_visits_converted>2</nb_visits_converted> + <segment>resolution==1024x768</segment> + </row> +</result>
\ No newline at end of file |