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:
-rw-r--r--.travis.yml4
-rw-r--r--LEGALNOTICE2
-rw-r--r--composer.json2
-rw-r--r--config/global.ini.php2
-rw-r--r--core/API/DataTableGenericFilter.php22
-rw-r--r--core/API/DataTableManipulator/LabelFilter.php15
-rw-r--r--core/API/ResponseBuilder.php8
-rw-r--r--core/ArchiveProcessor.php2
-rw-r--r--core/Common.php2
-rw-r--r--core/CronArchive.php2
-rw-r--r--core/DataAccess/ArchiveWriter.php2
-rw-r--r--core/Db/Schema/Mysql.php2
-rw-r--r--core/Log.php6
-rw-r--r--core/Period/Factory.php2
-rw-r--r--core/Plugin/ControllerAdmin.php4
-rw-r--r--core/Tracker/Action.php4
-rw-r--r--core/Updater.php19
-rw-r--r--core/Updates/0.2.10.php14
-rw-r--r--core/Updates/0.2.12.php4
-rw-r--r--core/Updates/0.2.13.php2
-rw-r--r--core/Updates/0.2.24.php8
-rw-r--r--core/Updates/0.2.27.php10
-rw-r--r--core/Updates/0.4.2.php6
-rw-r--r--core/Updates/0.4.php8
-rw-r--r--core/Updates/0.5.5.php8
-rw-r--r--core/Updates/0.5.php18
-rw-r--r--core/Updates/0.6-rc1.php32
-rw-r--r--core/Updates/0.6.3.php4
-rw-r--r--core/Updates/1.2-rc1.php24
-rw-r--r--core/Updates/1.2.3.php4
-rw-r--r--core/Updates/1.2.5-rc1.php4
-rw-r--r--core/Updates/1.2.5-rc7.php2
-rw-r--r--core/Updates/1.4-rc1.php2
-rw-r--r--core/Updates/1.4-rc2.php6
-rw-r--r--core/Updates/1.5-b1.php4
-rw-r--r--core/Updates/1.5-b4.php2
-rw-r--r--core/Updates/1.5-b5.php2
-rw-r--r--core/Updates/1.6-b1.php2
-rw-r--r--core/Updates/1.7-b1.php2
-rwxr-xr-xcore/Updates/1.7.2-rc7.php2
-rw-r--r--core/Updates/2.0.4-b5.php5
-rw-r--r--core/Version.php2
-rw-r--r--lang/cs.json1
-rw-r--r--lang/da.json1
-rw-r--r--lang/de.json1
-rw-r--r--lang/el.json1
-rw-r--r--lang/en.json4
-rw-r--r--lang/es.json1
-rw-r--r--lang/fr.json1
-rw-r--r--lang/it.json1
-rw-r--r--lang/ro.json1
-rw-r--r--lang/sr.json1
-rwxr-xr-xmisc/log-analytics/import_logs.py2
-rw-r--r--misc/others/test_cookies_GenerateHundredsWebsitesAndVisits.php2
-rwxr-xr-xmisc/package/build.sh2
-rw-r--r--plugins/API/API.php1
-rw-r--r--plugins/API/ProcessedReport.php2
-rw-r--r--plugins/API/RowEvolution.php7
-rw-r--r--plugins/CoreConsole/Commands/CoreArchiver.php2
-rw-r--r--plugins/CoreConsole/Commands/TestsSetupFixture.php169
-rw-r--r--plugins/CoreHome/angularjs/anchorLinkFix.js2
-rw-r--r--plugins/CoreHome/javascripts/dataTable_rowactions.js6
-rw-r--r--plugins/CoreHome/stylesheets/cloud.less2
m---------plugins/CustomAlerts0
-rw-r--r--plugins/CustomVariables/tests/CustomVariablesIntegrationTest.php4
-rw-r--r--plugins/CustomVariables/tests/Fixtures/VisitWithManyCustomVariables.php3
-rw-r--r--plugins/ExampleAPI/API.php3
-rw-r--r--plugins/ExamplePlugin/tests/SimpleIntegrationTest.php7
-rw-r--r--plugins/ExamplePlugin/tests/fixtures/SimpleFixtureTrackFewVisits.php7
-rw-r--r--plugins/Feedback/templates/index.twig8
-rw-r--r--plugins/ImageGraph/StaticGraph/GridGraph.php2
-rw-r--r--plugins/Insights/tests/ApiTest.php17
-rw-r--r--plugins/Insights/tests/Fixtures/SomeVisitsDifferentPathsOnTwoDays.php6
-rw-r--r--plugins/Insights/tests/ModelTest.php3
-rw-r--r--plugins/Live/javascripts/visitorLog.js2
-rw-r--r--plugins/MultiSites/angularjs/dashboard/dashboard-model.js2
-rw-r--r--plugins/Transitions/javascripts/transitions.js5
-rw-r--r--tests/PHPUnit/ConsoleCommandTestCase.php2
-rw-r--r--tests/PHPUnit/Core/DateTest.php2
-rw-r--r--tests/PHPUnit/Core/ReleaseCheckListTest.php2
-rw-r--r--tests/PHPUnit/Core/ServeStaticFileTest.php1
-rw-r--r--tests/PHPUnit/DatabaseTestCase.php1
-rw-r--r--tests/PHPUnit/FakeAccess.php3
-rw-r--r--tests/PHPUnit/Fixture.php37
-rw-r--r--tests/PHPUnit/Fixtures/FewVisitsWithSetVisitorId.php9
-rw-r--r--tests/PHPUnit/Fixtures/InvalidVisits.php8
-rw-r--r--tests/PHPUnit/Fixtures/ManySitesImportedLogs.php13
-rw-r--r--tests/PHPUnit/Fixtures/ManySitesImportedLogsWithXssAttempts.php7
-rw-r--r--tests/PHPUnit/Fixtures/ManyVisitsWithGeoIP.php10
-rw-r--r--tests/PHPUnit/Fixtures/ManyVisitsWithMockLocationProvider.php11
-rw-r--r--tests/PHPUnit/Fixtures/ManyVisitsWithSubDirReferrersAndCustomVars.php8
-rw-r--r--tests/PHPUnit/Fixtures/OmniFixture.php33
-rw-r--r--tests/PHPUnit/Fixtures/OneVisitSeveralPageViews.php19
-rw-r--r--tests/PHPUnit/Fixtures/OneVisitWithAbnormalPageviewUrls.php7
-rw-r--r--tests/PHPUnit/Fixtures/OneVisitorTwoVisits.php7
-rw-r--r--tests/PHPUnit/Fixtures/SomeVisitsAllConversions.php7
-rw-r--r--tests/PHPUnit/Fixtures/SomeVisitsCustomVariablesCampaignsNotHeuristics.php8
-rw-r--r--tests/PHPUnit/Fixtures/SomeVisitsManyPageviewsWithTransitions.php7
-rw-r--r--tests/PHPUnit/Fixtures/SomeVisitsWithLongUrls.php7
-rw-r--r--tests/PHPUnit/Fixtures/SomeVisitsWithNonUnicodePageTitles.php7
-rw-r--r--tests/PHPUnit/Fixtures/SqlDump.php6
-rw-r--r--tests/PHPUnit/Fixtures/ThreeGoalsOnePageview.php7
-rw-r--r--tests/PHPUnit/Fixtures/ThreeSitesWithManyVisitsWithSiteSearch.php9
-rw-r--r--tests/PHPUnit/Fixtures/TwoSitesEcommerceOrderWithItems.php11
-rw-r--r--tests/PHPUnit/Fixtures/TwoSitesManyVisitsOverSeveralDaysWithSearchEngineReferrers.php7
-rw-r--r--tests/PHPUnit/Fixtures/TwoSitesTwoVisitorsDifferentDays.php9
-rw-r--r--tests/PHPUnit/Fixtures/TwoSitesVisitsInPast.php7
-rw-r--r--tests/PHPUnit/Fixtures/TwoSitesWithAnnotations.php8
-rw-r--r--tests/PHPUnit/Fixtures/TwoVisitsNoKeywordWithBot.php8
-rw-r--r--tests/PHPUnit/Fixtures/TwoVisitsWithCustomEvents.php9
-rw-r--r--tests/PHPUnit/Fixtures/TwoVisitsWithCustomVariables.php7
-rw-r--r--tests/PHPUnit/Fixtures/UITestFixture.php28
-rw-r--r--tests/PHPUnit/Fixtures/VisitOverSeveralDaysImportedLogs.php8
-rw-r--r--tests/PHPUnit/Fixtures/VisitsInDifferentTimezones.php5
-rw-r--r--tests/PHPUnit/Fixtures/VisitsOverSeveralDays.php7
-rwxr-xr-xtests/PHPUnit/Integration/AnnotationsTest.php49
-rwxr-xr-xtests/PHPUnit/Integration/ApiGetReportMetadataTest.php13
-rwxr-xr-xtests/PHPUnit/Integration/ApiGetReportMetadataYearTest.php (renamed from tests/PHPUnit/Integration/ApiGetReportMetadata_yearTest.php)15
-rw-r--r--tests/PHPUnit/Integration/ArchiveCronTest.php19
-rw-r--r--tests/PHPUnit/Integration/ArchiveWebTest.php14
-rw-r--r--tests/PHPUnit/Integration/AutoSuggestAPITest.php17
-rw-r--r--tests/PHPUnit/Integration/BackwardsCompatibility1XTest.php39
-rwxr-xr-xtests/PHPUnit/Integration/BlobReportLimitingTest.php19
-rw-r--r--tests/PHPUnit/Integration/Core/ArchiveProcessingTest.php2
-rw-r--r--tests/PHPUnit/Integration/Core/CliMultiTest.php2
-rw-r--r--tests/PHPUnit/Integration/Core/JsProxyTest.php11
-rw-r--r--tests/PHPUnit/Integration/Core/SegmentTest.php9
-rw-r--r--tests/PHPUnit/Integration/Core/Tracker/ActionTest.php6
-rw-r--r--tests/PHPUnit/Integration/Core/TrackerTest.php2
-rw-r--r--tests/PHPUnit/Integration/Core/UpdaterTest.php26
-rw-r--r--tests/PHPUnit/Integration/Core/WidgetsListTest.php1
-rwxr-xr-xtests/PHPUnit/Integration/CsvExportTest.php19
-rw-r--r--tests/PHPUnit/Integration/CustomEventsTest.php14
-rwxr-xr-xtests/PHPUnit/Integration/EcommerceOrderWithItemsTest.php18
-rw-r--r--tests/PHPUnit/Integration/FlattenReportsTest.php15
-rwxr-xr-xtests/PHPUnit/Integration/ImportLogsTest.php16
-rw-r--r--tests/PHPUnit/Integration/LabelFilterTest.php55
-rwxr-xr-xtests/PHPUnit/Integration/ManyVisitorsOneWebsiteTest.php12
-rwxr-xr-xtests/PHPUnit/Integration/NoVisitTest.php13
-rwxr-xr-xtests/PHPUnit/Integration/NonUnicodeTest.php14
-rw-r--r--tests/PHPUnit/Integration/OneVisitorLongUrlsTruncatedTest.php (renamed from tests/PHPUnit/Integration/OneVisitor_LongUrlsTruncatedTest.php)14
-rwxr-xr-xtests/PHPUnit/Integration/OneVisitorNoKeywordSpecifiedTest.php (renamed from tests/PHPUnit/Integration/OneVisitor_NoKeywordSpecifiedTest.php)13
-rwxr-xr-xtests/PHPUnit/Integration/OneVisitorOneWebsiteSeveralDaysDateRangeArchivingTestsTest.php (renamed from tests/PHPUnit/Integration/OneVisitorOneWebsite_SeveralDaysDateRange_ArchivingTestsTest.php)19
-rwxr-xr-xtests/PHPUnit/Integration/OneVisitorOneWebsiteSeveralDaysDateRangeTest.php (renamed from tests/PHPUnit/Integration/OneVisitorOneWebsite_SeveralDaysDateRangeTest.php)14
-rw-r--r--tests/PHPUnit/Integration/OneVisitorSeveralDaysImportedInRandomOrderTest.php (renamed from tests/PHPUnit/Integration/OneVisitor_SeveralDays_ImportedInRandomOrderTest.php)22
-rwxr-xr-xtests/PHPUnit/Integration/OneVisitorTwoVisitsTest.php24
-rwxr-xr-xtests/PHPUnit/Integration/OneVisitorTwoVisitsWithCookieSupportTest.php (renamed from tests/PHPUnit/Integration/OneVisitorTwoVisits_withCookieSupportTest.php)19
-rwxr-xr-xtests/PHPUnit/Integration/PeriodIsRangeDateIsLastNMetadataAndNormalAPITest.php (renamed from tests/PHPUnit/Integration/PeriodIsRange_DateIsLastN_MetadataAndNormalAPITest.php)16
-rw-r--r--tests/PHPUnit/Integration/Plugins/UsersManagerTest.php6
-rw-r--r--tests/PHPUnit/Integration/PrivacyManagerTest.php40
-rwxr-xr-xtests/PHPUnit/Integration/PurgeDataTest.php11
-rwxr-xr-xtests/PHPUnit/Integration/RowEvolutionTest.php13
-rwxr-xr-xtests/PHPUnit/Integration/SiteSearchTest.php13
-rw-r--r--tests/PHPUnit/Integration/TimezonesTest.php12
-rwxr-xr-xtests/PHPUnit/Integration/TrackCustomVariablesAndCampaignsForceUsingVisitIdNotHeuristicsTest.php (renamed from tests/PHPUnit/Integration/TrackCustomVariablesAndCampaigns_ForceUsingVisitIdNotHeuristicsTest.php)15
-rwxr-xr-xtests/PHPUnit/Integration/TrackGoalsAllowMultipleConversionsPerVisitTest.php (renamed from tests/PHPUnit/Integration/TrackGoals_AllowMultipleConversionsPerVisitTest.php)14
-rw-r--r--tests/PHPUnit/Integration/TrackerWindowLookBackTest.php13
-rw-r--r--tests/PHPUnit/Integration/TrackingAPISetVisitorIdTest.php (renamed from tests/PHPUnit/Integration/TrackingAPI_SetVisitorIdTest.php)17
-rw-r--r--tests/PHPUnit/Integration/TransitionsTest.php19
-rwxr-xr-xtests/PHPUnit/Integration/TwoVisitorsTwoWebsitesDifferentDaysArchivingDisabledTest.php (renamed from tests/PHPUnit/Integration/TwoVisitors_TwoWebsites_DifferentDays_ArchivingDisabledTest.php)19
-rwxr-xr-xtests/PHPUnit/Integration/TwoVisitorsTwoWebsitesDifferentDaysConversionsTest.php (renamed from tests/PHPUnit/Integration/TwoVisitors_TwoWebsites_DifferentDays_ConversionsTest.php)16
-rwxr-xr-xtests/PHPUnit/Integration/TwoVisitorsTwoWebsitesDifferentDaysTest.php (renamed from tests/PHPUnit/Integration/TwoVisitors_TwoWebsites_DifferentDaysTest.php)17
-rwxr-xr-xtests/PHPUnit/Integration/TwoVisitsWithCustomVariablesSegmentContainsTest.php (renamed from tests/PHPUnit/Integration/TwoVisitsWithCustomVariables_SegmentContainsTest.php)16
-rwxr-xr-xtests/PHPUnit/Integration/TwoVisitsWithCustomVariablesSegmentMatchALLNoGoalDataTest.php (renamed from tests/PHPUnit/Integration/TwoVisitsWithCustomVariables_SegmentMatchALL_NoGoalDataTest.php)17
-rwxr-xr-xtests/PHPUnit/Integration/TwoVisitsWithCustomVariablesSegmentMatchNONETest.php (renamed from tests/PHPUnit/Integration/TwoVisitsWithCustomVariables_SegmentMatchNONETest.php)17
-rwxr-xr-xtests/PHPUnit/Integration/TwoVisitsWithCustomVariablesSegmentMatchVisitorTypeTest.php (renamed from tests/PHPUnit/Integration/TwoVisitsWithCustomVariables_SegmentMatchVisitorTypeTest.php)15
-rwxr-xr-xtests/PHPUnit/Integration/TwoVisitsWithCustomVariablesTest.php13
-rw-r--r--tests/PHPUnit/Integration/UrlNormalizationTest.php22
-rw-r--r--tests/PHPUnit/Integration/VisitsInPastInvalidateOldReportsTest.php (renamed from tests/PHPUnit/Integration/VisitsInPast_InvalidateOldReportsTest.php)15
-rw-r--r--tests/PHPUnit/Integration/expected/test_LabelFilter_dir2sub0filephp__Actions.getPageUrls_day.xml4
-rw-r--r--tests/PHPUnit/Integration/expected/test_LabelFilter_dir__Actions.getPageUrls_day.xml14
-rw-r--r--tests/PHPUnit/Integration/expected/test_LabelFilter_dir_range__Actions.getPageUrls_day.xml14
-rw-r--r--tests/PHPUnit/Integration/expected/test_LabelFilter_keywords_html__Referrers.getSearchEngines_day.xml4
-rw-r--r--tests/PHPUnit/Integration/expected/test_LabelFilter_terminalOperator_selectBranch__Actions.getPageTitles_day.xml16
-rw-r--r--tests/PHPUnit/Integration/expected/test_LabelFilter_terminalOperator_selectTerminal__Actions.getPageTitles_day.xml17
-rw-r--r--tests/PHPUnit/Integration/expected/test_LabelFilter_terminalOperator_selectTerminal__Actions.getPageUrls_day.xml18
-rw-r--r--tests/PHPUnit/Integration/expected/test_LabelFilter_thisiscool__Actions.getPageUrls_day.xml2
-rw-r--r--tests/PHPUnit/Integration/expected/test_LabelFilter_titles__Actions.getPageTitles_day.xml6
-rwxr-xr-xtests/PHPUnit/IntegrationTestCase.php5
-rw-r--r--tests/PHPUnit/bootstrap.php2
-rw-r--r--tests/javascript/SQLite.php1
-rw-r--r--tests/resources/OmniFixture-dump.sql.gzbin0 -> 624382 bytes
-rw-r--r--tests/resources/extractSearchEngineInformationFromUrlTests.yml4
183 files changed, 1212 insertions, 704 deletions
diff --git a/.travis.yml b/.travis.yml
index 4eb7e54bec..25286e1e14 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -87,8 +87,8 @@ before_script:
- mysql -e "SHOW GLOBAL VARIABLES;"
# Setup Piwik stack
- ./tests/travis/initiate_ui_tests.sh
- - composer self-update
- - composer install
+ - travis_retry composer self-update
+ - travis_retry composer install
- uname -a
- date
- php -r "var_dump(gd_info());"
diff --git a/LEGALNOTICE b/LEGALNOTICE
index f6ad6267c9..93c2f03493 100644
--- a/LEGALNOTICE
+++ b/LEGALNOTICE
@@ -40,7 +40,7 @@ CREDITS
For detailed contribution history, refer to the source, tickets,
patches, and Git revision history, available at
- http://dev.piwik.org/trac/
+ https://github.com/piwik/piwik/issues
https://github.com/piwik/piwik
diff --git a/composer.json b/composer.json
index 61397de411..ada8661192 100644
--- a/composer.json
+++ b/composer.json
@@ -14,7 +14,7 @@
],
"support": {
"forum": "http://forum.piwik.org/",
- "issues": "http://dev.piwik.org/trac/roadmap",
+ "issues": "https://github.com/piwik/piwik/issues",
"wiki": "http://dev.piwik.org/",
"source": "https://github.com/piwik/piwik"
},
diff --git a/config/global.ini.php b/config/global.ini.php
index 51dbba90cb..19fbef68bc 100644
--- a/config/global.ini.php
+++ b/config/global.ini.php
@@ -548,7 +548,7 @@ bulk_requests_use_transaction = 1
; Comma separated list of known Referrer Spammers, ie. bot visits that set a fake Referrer field.
; All Visits with a Referrer URL host set to one of these will be excluded.
-; If you find new spam entries in Referrers>Websites, please report them here: http://dev.piwik.org/trac/ticket/5099
+; If you find new spam entries in Referrers>Websites, please report them here: https://github.com/piwik/piwik/issues/5099
referrer_urls_spam = "semalt.com"
; DO NOT USE THIS SETTING ON PUBLICLY AVAILABLE PIWIK SERVER
diff --git a/core/API/DataTableGenericFilter.php b/core/API/DataTableGenericFilter.php
index 6db2f2b476..2d43f67b51 100644
--- a/core/API/DataTableGenericFilter.php
+++ b/core/API/DataTableGenericFilter.php
@@ -16,6 +16,13 @@ use Piwik\DataTable;
class DataTableGenericFilter
{
/**
+ * List of filter names not to run.
+ *
+ * @var string[]
+ */
+ private $disabledFilters = array();
+
+ /**
* Constructor
*
* @param $request
@@ -36,6 +43,16 @@ class DataTableGenericFilter
}
/**
+ * Makes sure a set of filters are not run.
+ *
+ * @param string[] $filterNames The name of each filter to disable.
+ */
+ public function disableFilters($filterNames)
+ {
+ $this->disabledFilters = array_unique(array_merge($this->disabledFilters, $filterNames));
+ }
+
+ /**
* Returns an array containing the information of the generic Filter
* to be applied automatically to the data resulting from the API calls.
*
@@ -117,6 +134,11 @@ class DataTableGenericFilter
$filterParams = $filterMeta[1];
$filterParameters = array();
$exceptionRaised = false;
+
+ if (in_array($filterName, $this->disabledFilters)) {
+ continue;
+ }
+
foreach ($filterParams as $name => $info) {
// parameter type to cast to
$type = $info[0];
diff --git a/core/API/DataTableManipulator/LabelFilter.php b/core/API/DataTableManipulator/LabelFilter.php
index 3c50e67ff2..cd8300991b 100644
--- a/core/API/DataTableManipulator/LabelFilter.php
+++ b/core/API/DataTableManipulator/LabelFilter.php
@@ -24,6 +24,7 @@ use Piwik\DataTable\Row;
class LabelFilter extends DataTableManipulator
{
const SEPARATOR_RECURSIVE_LABEL = '>';
+ const TERMINAL_OPERATOR = '@';
private $labels;
private $addLabelIndex;
@@ -118,9 +119,15 @@ class LabelFilter extends DataTableManipulator
{
static $pageTitleReports = array('getPageTitles', 'getEntryPageTitles', 'getExitPageTitles');
+ $originalLabel = trim($originalLabel);
+
+ $isTerminal = substr($originalLabel, 0, 1) == self::TERMINAL_OPERATOR;
+ if ($isTerminal) {
+ $originalLabel = substr($originalLabel, 1);
+ }
+
$variations = array();
- $label = urldecode($originalLabel);
- $label = trim($label);
+ $label = trim(urldecode($originalLabel));
$sanitizedLabel = Common::sanitizeInputValue($label);
$variations[] = $sanitizedLabel;
@@ -128,9 +135,7 @@ class LabelFilter extends DataTableManipulator
if ($this->apiModule == 'Actions'
&& in_array($this->apiMethod, $pageTitleReports)
) {
- // temporary workaround for #4363, if a '%20' is at the end of this label, we assume it is a
- // terminal label and only check for a terminal row.
- if (substr($originalLabel, -3) == '%20') {
+ if ($isTerminal) {
array_unshift($variations, ' ' . $sanitizedLabel);
array_unshift($variations, ' ' . $label);
} else {
diff --git a/core/API/ResponseBuilder.php b/core/API/ResponseBuilder.php
index 63d3f8f728..bb387765ad 100644
--- a/core/API/ResponseBuilder.php
+++ b/core/API/ResponseBuilder.php
@@ -295,6 +295,9 @@ class ResponseBuilder
*/
protected function handleDataTable($datatable)
{
+ // process request
+ $label = $this->getLabelFromRequest($this->request);
+
// if requested, flatten nested tables
if (Common::getRequestVar('flat', '0', 'string', $this->request) == '1') {
$flattener = new Flattener($this->apiModule, $this->apiMethod, $this->request);
@@ -312,6 +315,10 @@ class ResponseBuilder
// if the flag disable_generic_filters is defined we skip the generic filters
if (0 == Common::getRequestVar('disable_generic_filters', '0', 'string', $this->request)) {
$genericFilter = new DataTableGenericFilter($this->request);
+ if (!empty($label)) {
+ $genericFilter->disableFilters(array('Limit', 'Truncate'));
+ }
+
$genericFilter->filter($datatable);
}
@@ -332,7 +339,6 @@ class ResponseBuilder
}
// apply label filter: only return rows matching the label parameter (more than one if more than one label)
- $label = $this->getLabelFromRequest($this->request);
if (!empty($label)) {
$addLabelIndex = Common::getRequestVar('labelFilterAddLabelIndex', 0, 'int', $this->request) == 1;
diff --git a/core/ArchiveProcessor.php b/core/ArchiveProcessor.php
index c15ea5dd54..10374f18c4 100644
--- a/core/ArchiveProcessor.php
+++ b/core/ArchiveProcessor.php
@@ -337,7 +337,7 @@ class ArchiveProcessor
}
if ($dataTable instanceof Map) {
- // see http://dev.piwik.org/trac/ticket/4377
+ // see https://github.com/piwik/piwik/issues/4377
$self = $this;
$dataTable->filter(function ($table) use ($self, $columnsToRenameAfterAggregation) {
$self->renameColumnsAfterAggregation($table, $columnsToRenameAfterAggregation);
diff --git a/core/Common.php b/core/Common.php
index 64bf6926a1..7ac908ad1e 100644
--- a/core/Common.php
+++ b/core/Common.php
@@ -1066,7 +1066,7 @@ class Common
/**
* Marks an orphaned object for garbage collection.
*
- * For more information: {@link http://dev.piwik.org/trac/ticket/374}
+ * For more information: {@link https://github.com/piwik/piwik/issues/374}
* @param $var The object to destroy.
* @api
*/
diff --git a/core/CronArchive.php b/core/CronArchive.php
index 7ca9389f85..86d5bd4cff 100644
--- a/core/CronArchive.php
+++ b/core/CronArchive.php
@@ -12,6 +12,7 @@ use Exception;
use Piwik\ArchiveProcessor\Rules;
use Piwik\CronArchive\FixedSiteIds;
use Piwik\CronArchive\SharedSiteIds;
+use Piwik\Period\Factory;
use Piwik\Plugins\CoreAdminHome\API as APICoreAdminHome;
use Piwik\Plugins\SitesManager\API as APISitesManager;
@@ -1256,6 +1257,7 @@ class CronArchive
$restrictToPeriods = explode(',', $restrictToPeriods);
$restrictToPeriods = array_map('trim', $restrictToPeriods);
$restrictToPeriods = array_intersect($restrictToPeriods, $this->getDefaultPeriodsToProcess());
+ $restrictToPeriods = array_intersect($restrictToPeriods, Factory::getPeriodsEnabledForAPI());
return $restrictToPeriods;
}
diff --git a/core/DataAccess/ArchiveWriter.php b/core/DataAccess/ArchiveWriter.php
index ad51698d83..f4c8424855 100644
--- a/core/DataAccess/ArchiveWriter.php
+++ b/core/DataAccess/ArchiveWriter.php
@@ -266,7 +266,7 @@ class ArchiveWriter
$tableName = $this->getTableNameToInsert($value);
- // duplicate idarchives are Ignored, see http://dev.piwik.org/trac/ticket/987
+ // duplicate idarchives are Ignored, see https://github.com/piwik/piwik/issues/987
$query = "INSERT IGNORE INTO " . $tableName . "
(" . implode(", ", $this->getInsertFields()) . ")
VALUES (?,?,?,?,?,?,?,?)";
diff --git a/core/Db/Schema/Mysql.php b/core/Db/Schema/Mysql.php
index 80356c1794..76c7f17ce7 100644
--- a/core/Db/Schema/Mysql.php
+++ b/core/Db/Schema/Mysql.php
@@ -408,7 +408,7 @@ class Mysql implements SchemaInterface
Db::exec($statement);
} catch (Exception $e) {
// mysql code error 1050:table already exists
- // see bug #153 http://dev.piwik.org/trac/ticket/153
+ // see bug #153 https://github.com/piwik/piwik/issues/153
if (!Db::get()->isErrNo($e, '1050')) {
throw $e;
}
diff --git a/core/Log.php b/core/Log.php
index 5dc22d37c2..a28032be9b 100644
--- a/core/Log.php
+++ b/core/Log.php
@@ -386,9 +386,11 @@ class Log extends Singleton
return;
}
- if(!file_put_contents($this->logToFilePath, $message, FILE_APPEND)) {
+ if (!@file_put_contents($this->logToFilePath, $message, FILE_APPEND)
+ && !defined('PIWIK_TEST_MODE')
+ ) {
$message = Filechecks::getErrorMessageMissingPermissions($this->logToFilePath);
- throw new \Exception( $message );
+ throw new \Exception($message);
}
}
diff --git a/core/Period/Factory.php b/core/Period/Factory.php
index 11d5203ab7..4b3f899002 100644
--- a/core/Period/Factory.php
+++ b/core/Period/Factory.php
@@ -125,7 +125,7 @@ class Factory
/**
* @return array
*/
- private static function getPeriodsEnabledForAPI()
+ public static function getPeriodsEnabledForAPI()
{
$enabledPeriodsInAPI = Config::getInstance()->General['enabled_periods_API'];
$enabledPeriodsInAPI = explode(",", $enabledPeriodsInAPI);
diff --git a/core/Plugin/ControllerAdmin.php b/core/Plugin/ControllerAdmin.php
index 0212a3769c..a8e9b7b1dd 100644
--- a/core/Plugin/ControllerAdmin.php
+++ b/core/Plugin/ControllerAdmin.php
@@ -102,7 +102,7 @@ abstract class ControllerAdmin extends Controller
}
/**
- * See http://dev.piwik.org/trac/ticket/4439#comment:8 and https://github.com/eaccelerator/eaccelerator/issues/12
+ * See https://github.com/piwik/piwik/issues/4439#comment:8 and https://github.com/eaccelerator/eaccelerator/issues/12
*
* Eaccelerator does not support closures and is known to be not comptabile with Piwik. Therefore we are disabling
* it automatically. At this point it looks like Eaccelerator is no longer under development and the bug has not
@@ -125,7 +125,7 @@ abstract class ControllerAdmin extends Controller
$message = sprintf("You are using the PHP accelerator & optimizer eAccelerator which is known to be not compatible with Piwik.
We have disabled eAccelerator, which might affect the performance of Piwik.
Read the %srelated ticket%s for more information and how to fix this problem.",
- '<a target="_blank" href="http://dev.piwik.org/trac/ticket/4439">', '</a>');
+ '<a target="_blank" href="https://github.com/piwik/piwik/issues/4439">', '</a>');
$notification = new Notification($message);
$notification->context = Notification::CONTEXT_WARNING;
diff --git a/core/Tracker/Action.php b/core/Tracker/Action.php
index 16ed954f9c..22c0107aec 100644
--- a/core/Tracker/Action.php
+++ b/core/Tracker/Action.php
@@ -106,9 +106,11 @@ abstract class Action
}
/**
+ * Public so that events listener can access it
+ *
* @var Request
*/
- protected $request;
+ public $request;
private $idLinkVisitAction;
private $actionIdsCached = array();
diff --git a/core/Updater.php b/core/Updater.php
index 2e2d4cc6ab..e10c6bf33c 100644
--- a/core/Updater.php
+++ b/core/Updater.php
@@ -360,12 +360,29 @@ class Updater
public static function handleQueryError($e, $updateSql, $errorToIgnore, $file)
{
if (($errorToIgnore === false)
- || !Db::get()->isErrNo($e, $errorToIgnore)
+ || !self::isDbErrorOneOf($e, $errorToIgnore)
) {
$message = $file . ":\nError trying to execute the query '" . $updateSql . "'.\nThe error was: " . $e->getMessage();
throw new UpdaterErrorException($message);
}
}
+
+ /**
+ * Returns whether an exception is a DB error with a code in the $errorCodesToIgnore list.
+ *
+ * @param int $error
+ * @param int|int[] $errorCodesToIgnore
+ */
+ public static function isDbErrorOneOf($error, $errorCodesToIgnore)
+ {
+ $errorCodesToIgnore = is_array($errorCodesToIgnore) ? $errorCodesToIgnore : array($errorCodesToIgnore);
+ foreach ($errorCodesToIgnore as $code) {
+ if (Db::get()->isErrNo($error, $code)) {
+ return true;
+ }
+ }
+ return false;
+ }
}
/**
diff --git a/core/Updates/0.2.10.php b/core/Updates/0.2.10.php
index b42449aacc..1ab471e32d 100644
--- a/core/Updates/0.2.10.php
+++ b/core/Updates/0.2.10.php
@@ -26,27 +26,27 @@ class Updates_0_2_10 extends Updates
option_name VARCHAR( 64 ) NOT NULL ,
option_value LONGTEXT NOT NULL ,
PRIMARY KEY ( idoption , option_name )
- )' => false,
+ )' => 1050,
// 0.1.7 [463]
'ALTER IGNORE TABLE `' . Common::prefixTable('log_visit') . '`
- CHANGE `location_provider` `location_provider` VARCHAR( 100 ) DEFAULT NULL' => '1054',
+ CHANGE `location_provider` `location_provider` VARCHAR( 100 ) DEFAULT NULL' => 1054,
// 0.1.7 [470]
'ALTER TABLE `' . Common::prefixTable('logger_api_call') . '`
CHANGE `parameter_names_default_values` `parameter_names_default_values` TEXT,
CHANGE `parameter_values` `parameter_values` TEXT,
- CHANGE `returned_value` `returned_value` TEXT' => false,
+ CHANGE `returned_value` `returned_value` TEXT' => array(1054, 1146),
'ALTER TABLE `' . Common::prefixTable('logger_error') . '`
- CHANGE `message` `message` TEXT' => false,
+ CHANGE `message` `message` TEXT' => array(1054, 1146),
'ALTER TABLE `' . Common::prefixTable('logger_exception') . '`
- CHANGE `message` `message` TEXT' => false,
+ CHANGE `message` `message` TEXT' => array(1054, 1146),
'ALTER TABLE `' . Common::prefixTable('logger_message') . '`
- CHANGE `message` `message` TEXT' => false,
+ CHANGE `message` `message` TEXT' => 1054,
// 0.2.2 [489]
'ALTER IGNORE TABLE `' . Common::prefixTable('site') . '`
- CHANGE `feedburnerName` `feedburnerName` VARCHAR( 100 ) DEFAULT NULL' => '1054',
+ CHANGE `feedburnerName` `feedburnerName` VARCHAR( 100 ) DEFAULT NULL' => 1054,
);
}
diff --git a/core/Updates/0.2.12.php b/core/Updates/0.2.12.php
index 975ba373cd..0cf0fed8ea 100644
--- a/core/Updates/0.2.12.php
+++ b/core/Updates/0.2.12.php
@@ -23,11 +23,11 @@ class Updates_0_2_12 extends Updates
'ALTER TABLE `' . Common::prefixTable('site') . '`
CHANGE `ts_created` `ts_created` TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL' => false,
'ALTER TABLE `' . Common::prefixTable('log_visit') . '`
- DROP `config_color_depth`' => false,
+ DROP `config_color_depth`' => 1091,
// 0.2.12 [673]
// Note: requires INDEX privilege
- 'DROP INDEX index_idaction ON `' . Common::prefixTable('log_action') . '`' => '1091',
+ 'DROP INDEX index_idaction ON `' . Common::prefixTable('log_action') . '`' => 1091,
);
}
diff --git a/core/Updates/0.2.13.php b/core/Updates/0.2.13.php
index eb65347c45..e73acf0b77 100644
--- a/core/Updates/0.2.13.php
+++ b/core/Updates/0.2.13.php
@@ -27,7 +27,7 @@ class Updates_0_2_13 extends Updates
option_value LONGTEXT NOT NULL ,
autoload TINYINT NOT NULL DEFAULT '1',
PRIMARY KEY ( option_name )
- )" => false,
+ )" => 1050,
);
}
diff --git a/core/Updates/0.2.24.php b/core/Updates/0.2.24.php
index b4762ad15d..23bf21274e 100644
--- a/core/Updates/0.2.24.php
+++ b/core/Updates/0.2.24.php
@@ -21,11 +21,11 @@ class Updates_0_2_24 extends Updates
{
return array(
'CREATE INDEX index_type_name
- ON ' . Common::prefixTable('log_action') . ' (type, name(15))' => false,
+ ON ' . Common::prefixTable('log_action') . ' (type, name(15))' => 1072,
'CREATE INDEX index_idsite_date
- ON ' . Common::prefixTable('log_visit') . ' (idsite, visit_server_date)' => false,
- 'DROP INDEX index_idsite ON ' . Common::prefixTable('log_visit') => false,
- 'DROP INDEX index_visit_server_date ON ' . Common::prefixTable('log_visit') => false,
+ ON ' . Common::prefixTable('log_visit') . ' (idsite, visit_server_date)' => 1072,
+ 'DROP INDEX index_idsite ON ' . Common::prefixTable('log_visit') => 1091,
+ 'DROP INDEX index_visit_server_date ON ' . Common::prefixTable('log_visit') => 1091,
);
}
diff --git a/core/Updates/0.2.27.php b/core/Updates/0.2.27.php
index 483d915a0f..615709e599 100644
--- a/core/Updates/0.2.27.php
+++ b/core/Updates/0.2.27.php
@@ -22,10 +22,10 @@ class Updates_0_2_27 extends Updates
{
$sqlarray = array(
'ALTER TABLE `' . Common::prefixTable('log_visit') . '`
- ADD `visit_goal_converted` VARCHAR( 1 ) NOT NULL AFTER `visit_total_time`' => false,
+ ADD `visit_goal_converted` VARCHAR( 1 ) NOT NULL AFTER `visit_total_time`' => 1060,
// 0.2.27 [826]
'ALTER IGNORE TABLE `' . Common::prefixTable('log_visit') . '`
- CHANGE `visit_goal_converted` `visit_goal_converted` TINYINT(1) NOT NULL' => false,
+ CHANGE `visit_goal_converted` `visit_goal_converted` TINYINT(1) NOT NULL' => 1060,
'CREATE TABLE `' . Common::prefixTable('goal') . "` (
`idsite` int(11) NOT NULL,
@@ -38,7 +38,7 @@ class Updates_0_2_27 extends Updates
`revenue` float NOT NULL,
`deleted` tinyint(4) NOT NULL default '0',
PRIMARY KEY (`idsite`,`idgoal`)
- )" => false,
+ )" => 1050,
'CREATE TABLE `' . Common::prefixTable('log_conversion') . '` (
`idvisit` int(10) unsigned NOT NULL,
@@ -61,13 +61,13 @@ class Updates_0_2_27 extends Updates
`revenue` float default NULL,
PRIMARY KEY (`idvisit`,`idgoal`),
KEY `index_idsite_date` (`idsite`,`visit_server_date`)
- )' => false,
+ )' => 1050,
);
$tables = DbHelper::getTablesInstalled();
foreach ($tables as $tableName) {
if (preg_match('/archive_/', $tableName) == 1) {
- $sqlarray['CREATE INDEX index_all ON ' . $tableName . ' (`idsite`,`date1`,`date2`,`name`,`ts_archived`)'] = false;
+ $sqlarray['CREATE INDEX index_all ON ' . $tableName . ' (`idsite`,`date1`,`date2`,`name`,`ts_archived`)'] = 1072;
}
}
diff --git a/core/Updates/0.4.2.php b/core/Updates/0.4.2.php
index f19dda34be..d3cac21d21 100644
--- a/core/Updates/0.4.2.php
+++ b/core/Updates/0.4.2.php
@@ -21,12 +21,12 @@ class Updates_0_4_2 extends Updates
{
return array(
'ALTER TABLE `' . Common::prefixTable('log_visit') . '`
- ADD `config_java` TINYINT(1) NOT NULL AFTER `config_flash`' => '1060',
+ ADD `config_java` TINYINT(1) NOT NULL AFTER `config_flash`' => 1060,
'ALTER TABLE `' . Common::prefixTable('log_visit') . '`
- ADD `config_quicktime` TINYINT(1) NOT NULL AFTER `config_director`' => '1060',
+ ADD `config_quicktime` TINYINT(1) NOT NULL AFTER `config_director`' => 1060,
'ALTER TABLE `' . Common::prefixTable('log_visit') . '`
ADD `config_gears` TINYINT(1) NOT NULL AFTER `config_windowsmedia`,
- ADD `config_silverlight` TINYINT(1) NOT NULL AFTER `config_gears`' => '1060',
+ ADD `config_silverlight` TINYINT(1) NOT NULL AFTER `config_gears`' => 1060,
);
}
diff --git a/core/Updates/0.4.php b/core/Updates/0.4.php
index fe3f1426d2..ce86db2cee 100644
--- a/core/Updates/0.4.php
+++ b/core/Updates/0.4.php
@@ -22,13 +22,13 @@ class Updates_0_4 extends Updates
return array(
// 0.4 [1140]
'UPDATE `' . Common::prefixTable('log_visit') . '`
- SET location_ip=location_ip+CAST(POW(2,32) AS UNSIGNED) WHERE location_ip < 0' => false,
+ SET location_ip=location_ip+CAST(POW(2,32) AS UNSIGNED) WHERE location_ip < 0' => false,
'ALTER TABLE `' . Common::prefixTable('log_visit') . '`
- CHANGE `location_ip` `location_ip` BIGINT UNSIGNED NOT NULL' => false,
+ CHANGE `location_ip` `location_ip` BIGINT UNSIGNED NOT NULL' => 1054,
'UPDATE `' . Common::prefixTable('logger_api_call') . '`
- SET caller_ip=caller_ip+CAST(POW(2,32) AS UNSIGNED) WHERE caller_ip < 0' => false,
+ SET caller_ip=caller_ip+CAST(POW(2,32) AS UNSIGNED) WHERE caller_ip < 0' => 1146,
'ALTER TABLE `' . Common::prefixTable('logger_api_call') . '`
- CHANGE `caller_ip` `caller_ip` BIGINT UNSIGNED' => false,
+ CHANGE `caller_ip` `caller_ip` BIGINT UNSIGNED' => 1146,
);
}
diff --git a/core/Updates/0.5.5.php b/core/Updates/0.5.5.php
index 28822ddbea..50f6236caa 100644
--- a/core/Updates/0.5.5.php
+++ b/core/Updates/0.5.5.php
@@ -21,17 +21,17 @@ class Updates_0_5_5 extends Updates
static function getSql()
{
$sqlarray = array(
- 'DROP INDEX index_idsite_date ON ' . Common::prefixTable('log_visit') => '1091',
- 'CREATE INDEX index_idsite_date_config ON ' . Common::prefixTable('log_visit') . ' (idsite, visit_server_date, config_md5config(8))' => '1061',
+ 'DROP INDEX index_idsite_date ON ' . Common::prefixTable('log_visit') => 1091,
+ 'CREATE INDEX index_idsite_date_config ON ' . Common::prefixTable('log_visit') . ' (idsite, visit_server_date, config_md5config(8))' => array(1061,1072),
);
$tables = DbHelper::getTablesInstalled();
foreach ($tables as $tableName) {
if (preg_match('/archive_/', $tableName) == 1) {
- $sqlarray['DROP INDEX index_all ON ' . $tableName] = '1091';
+ $sqlarray['DROP INDEX index_all ON ' . $tableName] = 1091;
}
if (preg_match('/archive_numeric_/', $tableName) == 1) {
- $sqlarray['CREATE INDEX index_idsite_dates_period ON ' . $tableName . ' (idsite, date1, date2, period)'] = '1061';
+ $sqlarray['CREATE INDEX index_idsite_dates_period ON ' . $tableName . ' (idsite, date1, date2, period)'] = 1061;
}
}
diff --git a/core/Updates/0.5.php b/core/Updates/0.5.php
index 81d73db841..6c7a51af4e 100644
--- a/core/Updates/0.5.php
+++ b/core/Updates/0.5.php
@@ -20,16 +20,16 @@ class Updates_0_5 extends Updates
static function getSql()
{
return array(
- 'ALTER TABLE ' . Common::prefixTable('log_action') . ' ADD COLUMN `hash` INTEGER(10) UNSIGNED NOT NULL AFTER `name`;' => '1060',
- 'ALTER TABLE ' . Common::prefixTable('log_visit') . ' CHANGE visit_exit_idaction visit_exit_idaction_url INTEGER(11) NOT NULL;' => '1054',
- 'ALTER TABLE ' . Common::prefixTable('log_visit') . ' CHANGE visit_entry_idaction visit_entry_idaction_url INTEGER(11) NOT NULL;' => '1054',
- 'ALTER TABLE ' . Common::prefixTable('log_link_visit_action') . ' CHANGE `idaction_ref` `idaction_url_ref` INTEGER(10) UNSIGNED NOT NULL;' => '1054',
- 'ALTER TABLE ' . Common::prefixTable('log_link_visit_action') . ' CHANGE `idaction` `idaction_url` INTEGER(10) UNSIGNED NOT NULL;' => '1054',
- 'ALTER TABLE ' . Common::prefixTable('log_link_visit_action') . ' ADD COLUMN `idaction_name` INTEGER(10) UNSIGNED AFTER `idaction_url_ref`;' => '1060',
- 'ALTER TABLE ' . Common::prefixTable('log_conversion') . ' CHANGE `idaction` `idaction_url` INTEGER(11) UNSIGNED NOT NULL;' => '1054',
+ 'ALTER TABLE ' . Common::prefixTable('log_action') . ' ADD COLUMN `hash` INTEGER(10) UNSIGNED NOT NULL AFTER `name`;' => 1060,
+ 'ALTER TABLE ' . Common::prefixTable('log_visit') . ' CHANGE visit_exit_idaction visit_exit_idaction_url INTEGER(11) NOT NULL;' => 1054,
+ 'ALTER TABLE ' . Common::prefixTable('log_visit') . ' CHANGE visit_entry_idaction visit_entry_idaction_url INTEGER(11) NOT NULL;' => 1054,
+ 'ALTER TABLE ' . Common::prefixTable('log_link_visit_action') . ' CHANGE `idaction_ref` `idaction_url_ref` INTEGER(10) UNSIGNED NOT NULL;' => 1054,
+ 'ALTER TABLE ' . Common::prefixTable('log_link_visit_action') . ' CHANGE `idaction` `idaction_url` INTEGER(10) UNSIGNED NOT NULL;' => 1054,
+ 'ALTER TABLE ' . Common::prefixTable('log_link_visit_action') . ' ADD COLUMN `idaction_name` INTEGER(10) UNSIGNED AFTER `idaction_url_ref`;' => 1060,
+ 'ALTER TABLE ' . Common::prefixTable('log_conversion') . ' CHANGE `idaction` `idaction_url` INTEGER(11) UNSIGNED NOT NULL;' => 1054,
'UPDATE ' . Common::prefixTable('log_action') . ' SET `hash` = CRC32(name);' => false,
- 'CREATE INDEX index_type_hash ON ' . Common::prefixTable('log_action') . ' (type, hash);' => '1061',
- 'DROP INDEX index_type_name ON ' . Common::prefixTable('log_action') . ';' => '1091',
+ 'CREATE INDEX index_type_hash ON ' . Common::prefixTable('log_action') . ' (type, hash);' => 1061,
+ 'DROP INDEX index_type_name ON ' . Common::prefixTable('log_action') . ';' => 1091,
);
}
diff --git a/core/Updates/0.6-rc1.php b/core/Updates/0.6-rc1.php
index cac08f47d6..9f293dda97 100644
--- a/core/Updates/0.6-rc1.php
+++ b/core/Updates/0.6-rc1.php
@@ -22,19 +22,19 @@ class Updates_0_6_rc1 extends Updates
$defaultTimezone = 'UTC';
$defaultCurrency = 'USD';
return array(
- 'ALTER TABLE ' . Common::prefixTable('user') . ' CHANGE date_registered date_registered TIMESTAMP NULL' => false,
- 'ALTER TABLE ' . Common::prefixTable('site') . ' CHANGE ts_created ts_created TIMESTAMP NULL' => false,
- 'ALTER TABLE ' . Common::prefixTable('site') . ' ADD `timezone` VARCHAR( 50 ) NOT NULL AFTER `ts_created` ;' => false,
- 'UPDATE ' . Common::prefixTable('site') . ' SET `timezone` = "' . $defaultTimezone . '";' => false,
- 'ALTER TABLE ' . Common::prefixTable('site') . ' ADD currency CHAR( 3 ) NOT NULL AFTER `timezone` ;' => false,
- 'UPDATE ' . Common::prefixTable('site') . ' SET `currency` = "' . $defaultCurrency . '";' => false,
- 'ALTER TABLE ' . Common::prefixTable('site') . ' ADD `excluded_ips` TEXT NOT NULL AFTER `currency` ;' => false,
- 'ALTER TABLE ' . Common::prefixTable('site') . ' ADD excluded_parameters VARCHAR( 255 ) NOT NULL AFTER `excluded_ips` ;' => false,
- 'ALTER TABLE ' . Common::prefixTable('log_visit') . ' ADD INDEX `index_idsite_datetime_config` ( `idsite` , `visit_last_action_time` , `config_md5config` ( 8 ) ) ;' => false,
- 'ALTER TABLE ' . Common::prefixTable('log_visit') . ' ADD INDEX index_idsite_idvisit (idsite, idvisit) ;' => false,
- 'ALTER TABLE ' . Common::prefixTable('log_conversion') . ' DROP INDEX index_idsite_date' => false,
- 'ALTER TABLE ' . Common::prefixTable('log_conversion') . ' DROP visit_server_date;' => false,
- 'ALTER TABLE ' . Common::prefixTable('log_conversion') . ' ADD INDEX index_idsite_datetime ( `idsite` , `server_time` )' => false,
+ 'ALTER TABLE ' . Common::prefixTable('user') . ' CHANGE date_registered date_registered TIMESTAMP NULL' => 1054,
+ 'ALTER TABLE ' . Common::prefixTable('site') . ' CHANGE ts_created ts_created TIMESTAMP NULL' => 1054,
+ 'ALTER TABLE ' . Common::prefixTable('site') . ' ADD `timezone` VARCHAR( 50 ) NOT NULL AFTER `ts_created` ;' => 1060,
+ 'UPDATE ' . Common::prefixTable('site') . ' SET `timezone` = "' . $defaultTimezone . '";' => 1060,
+ 'ALTER TABLE ' . Common::prefixTable('site') . ' ADD currency CHAR( 3 ) NOT NULL AFTER `timezone` ;' => 1060,
+ 'UPDATE ' . Common::prefixTable('site') . ' SET `currency` = "' . $defaultCurrency . '";' => 1060,
+ 'ALTER TABLE ' . Common::prefixTable('site') . ' ADD `excluded_ips` TEXT NOT NULL AFTER `currency` ;' => 1060,
+ 'ALTER TABLE ' . Common::prefixTable('site') . ' ADD excluded_parameters VARCHAR( 255 ) NOT NULL AFTER `excluded_ips` ;' => 1060,
+ 'ALTER TABLE ' . Common::prefixTable('log_visit') . ' ADD INDEX `index_idsite_datetime_config` ( `idsite` , `visit_last_action_time` , `config_md5config` ( 8 ) ) ;' => array(1061, 1072),
+ 'ALTER TABLE ' . Common::prefixTable('log_visit') . ' ADD INDEX index_idsite_idvisit (idsite, idvisit) ;' => array(1061, 1072),
+ 'ALTER TABLE ' . Common::prefixTable('log_conversion') . ' DROP INDEX index_idsite_date' => 1091,
+ 'ALTER TABLE ' . Common::prefixTable('log_conversion') . ' DROP visit_server_date;' => 1091,
+ 'ALTER TABLE ' . Common::prefixTable('log_conversion') . ' ADD INDEX index_idsite_datetime ( `idsite` , `server_time` )' => array(1072, 1061),
);
}
@@ -42,8 +42,8 @@ class Updates_0_6_rc1 extends Updates
{
// first we disable the plugins and keep an array of warnings messages
$pluginsToDisableMessage = array(
- 'SearchEnginePosition' => "SearchEnginePosition plugin was disabled, because it is not compatible with the new Piwik 0.6. \n You can download the latest version of the plugin, compatible with Piwik 0.6.\n<a target='_blank' href='?module=Proxy&action=redirect&url=http://dev.piwik.org/trac/ticket/502'>Click here.</a>",
- 'GeoIP' => "GeoIP plugin was disabled, because it is not compatible with the new Piwik 0.6. \nYou can download the latest version of the plugin, compatible with Piwik 0.6.\n<a target='_blank' href='?module=Proxy&action=redirect&url=http://dev.piwik.org/trac/ticket/45'>Click here.</a>"
+ 'SearchEnginePosition' => "SearchEnginePosition plugin was disabled, because it is not compatible with the new Piwik 0.6. \n You can download the latest version of the plugin, compatible with Piwik 0.6.\n<a target='_blank' href='?module=Proxy&action=redirect&url=https://github.com/piwik/piwik/issues/502'>Click here.</a>",
+ 'GeoIP' => "GeoIP plugin was disabled, because it is not compatible with the new Piwik 0.6. \nYou can download the latest version of the plugin, compatible with Piwik 0.6.\n<a target='_blank' href='?module=Proxy&action=redirect&url=https://github.com/piwik/piwik/issues/45'>Click here.</a>"
);
$disabledPlugins = array();
foreach ($pluginsToDisableMessage as $pluginToDisable => $warningMessage) {
@@ -64,4 +64,4 @@ class Updates_0_6_rc1 extends Updates
"</li></ul>");
}
}
-}
+} \ No newline at end of file
diff --git a/core/Updates/0.6.3.php b/core/Updates/0.6.3.php
index 2a24329038..56488304ff 100644
--- a/core/Updates/0.6.3.php
+++ b/core/Updates/0.6.3.php
@@ -22,9 +22,9 @@ class Updates_0_6_3 extends Updates
{
return array(
'ALTER TABLE `' . Common::prefixTable('log_visit') . '`
- CHANGE `location_ip` `location_ip` INT UNSIGNED NOT NULL' => false,
+ CHANGE `location_ip` `location_ip` INT UNSIGNED NOT NULL' => 1054,
'ALTER TABLE `' . Common::prefixTable('logger_api_call') . '`
- CHANGE `caller_ip` `caller_ip` INT UNSIGNED' => false,
+ CHANGE `caller_ip` `caller_ip` INT UNSIGNED' => array(1054, 1146),
);
}
diff --git a/core/Updates/1.2-rc1.php b/core/Updates/1.2-rc1.php
index 1be12c9e17..31d8ba58bc 100644
--- a/core/Updates/1.2-rc1.php
+++ b/core/Updates/1.2-rc1.php
@@ -27,7 +27,7 @@ class Updates_1_2_rc1 extends Updates
DROP INDEX `index_idsite_datetime_config`,
ADD `idvisitor` BINARY(8) NOT NULL AFTER `idsite`,
ADD `config_id` BINARY(8) NOT NULL AFTER `config_md5config`
- ' => false,
+ ' => array(1054, 1091),
'ALTER TABLE `' . Common::prefixTable('log_visit') . '`
ADD `visit_entry_idaction_name` INT UNSIGNED NOT NULL AFTER `visit_entry_idaction_url`,
ADD `visit_exit_idaction_name` INT UNSIGNED NOT NULL AFTER `visit_exit_idaction_url`,
@@ -54,7 +54,7 @@ class Updates_1_2_rc1 extends Updates
ADD `idsite` INT( 10 ) UNSIGNED NOT NULL AFTER `idlink_va` ,
ADD `idvisitor` BINARY(8) NOT NULL AFTER `idsite`,
ADD `idaction_name_ref` INT UNSIGNED NOT NULL AFTER `idaction_name`
- ' => false,
+ ' => 1060,
'ALTER TABLE `' . Common::prefixTable('log_link_visit_action') . '`
ADD `server_time` DATETIME AFTER `idsite`,
ADD INDEX `index_idsite_servertime` ( `idsite` , `server_time` )
@@ -63,7 +63,7 @@ class Updates_1_2_rc1 extends Updates
'ALTER TABLE `' . Common::prefixTable('log_conversion') . '`
DROP `referer_idvisit`,
ADD `idvisitor` BINARY(8) NOT NULL AFTER `idsite`
- ' => false,
+ ' => array(1060, 1091),
'ALTER TABLE `' . Common::prefixTable('log_conversion') . '`
ADD visitor_count_visits SMALLINT(5) UNSIGNED NOT NULL,
ADD visitor_days_since_first SMALLINT(5) UNSIGNED NOT NULL
@@ -79,30 +79,30 @@ class Updates_1_2_rc1 extends Updates
ADD custom_var_v4 VARCHAR(100) DEFAULT NULL,
ADD custom_var_k5 VARCHAR(100) DEFAULT NULL,
ADD custom_var_v5 VARCHAR(100) DEFAULT NULL
- ' => 1060,
+ ' => array(1060, 1061),
// Migrate 128bits IDs inefficiently stored as 8bytes (256 bits) into 64bits
'UPDATE ' . Common::prefixTable('log_visit') . '
SET idvisitor = binary(unhex(substring(visitor_idcookie,1,16))),
config_id = binary(unhex(substring(config_md5config,1,16)))
- ' => false,
+ ' => 1054,
'UPDATE ' . Common::prefixTable('log_conversion') . '
SET idvisitor = binary(unhex(substring(visitor_idcookie,1,16)))
- ' => false,
+ ' => 1054,
// Drop migrated fields
'ALTER TABLE `' . Common::prefixTable('log_visit') . '`
DROP visitor_idcookie,
DROP config_md5config
- ' => false,
+ ' => 1091,
'ALTER TABLE `' . Common::prefixTable('log_conversion') . '`
DROP visitor_idcookie
- ' => false,
+ ' => 1091,
// Recreate INDEX on new field
'ALTER TABLE `' . Common::prefixTable('log_visit') . '`
ADD INDEX `index_idsite_datetime_config` (idsite, visit_last_action_time, config_id)
- ' => false,
+ ' => 1061,
// Backfill action logs as best as we can
'UPDATE ' . Common::prefixTable('log_link_visit_action') . ' as action,
@@ -118,10 +118,10 @@ class Updates_1_2_rc1 extends Updates
' => false,
// New index used max once per request, in case this table grows significantly in the future
- 'ALTER TABLE `' . Common::prefixTable('option') . '` ADD INDEX ( `autoload` ) ' => false,
+ 'ALTER TABLE `' . Common::prefixTable('option') . '` ADD INDEX ( `autoload` ) ' => 1061,
// new field for websites
- 'ALTER TABLE `' . Common::prefixTable('site') . '` ADD `group` VARCHAR( 250 ) NOT NULL' => false,
+ 'ALTER TABLE `' . Common::prefixTable('site') . '` ADD `group` VARCHAR( 250 ) NOT NULL' => 1060,
);
}
@@ -129,7 +129,7 @@ class Updates_1_2_rc1 extends Updates
{
// first we disable the plugins and keep an array of warnings messages
$pluginsToDisableMessage = array(
- 'GeoIP' => "GeoIP plugin was disabled, because it is not compatible with the new Piwik 1.2. \nYou can download the latest version of the plugin, compatible with Piwik 1.2.\n<a target='_blank' href='?module=Proxy&action=redirect&url=http://dev.piwik.org/trac/ticket/45'>Click here.</a>",
+ 'GeoIP' => "GeoIP plugin was disabled, because it is not compatible with the new Piwik 1.2. \nYou can download the latest version of the plugin, compatible with Piwik 1.2.\n<a target='_blank' href='?module=Proxy&action=redirect&url=https://github.com/piwik/piwik/issues/45'>Click here.</a>",
'EntryPage' => "EntryPage plugin is not compatible with this version of Piwik, it was disabled.",
);
$disabledPlugins = array();
diff --git a/core/Updates/1.2.3.php b/core/Updates/1.2.3.php
index ae28ee7e9e..d240462468 100644
--- a/core/Updates/1.2.3.php
+++ b/core/Updates/1.2.3.php
@@ -22,14 +22,14 @@ class Updates_1_2_3 extends Updates
{
return array(
// LOAD DATA INFILE uses the database's charset
- 'ALTER DATABASE `' . Config::getInstance()->database['dbname'] . '` DEFAULT CHARACTER SET utf8' => false,
+ 'ALTER DATABASE `' . Config::getInstance()->database['dbname'] . '` DEFAULT CHARACTER SET utf8' => false,
// Various performance improvements schema updates
'ALTER TABLE `' . Common::prefixTable('log_visit') . '`
DROP INDEX index_idsite_datetime_config,
DROP INDEX index_idsite_idvisit,
ADD INDEX index_idsite_config_datetime (idsite, config_id, visit_last_action_time),
- ADD INDEX index_idsite_datetime (idsite, visit_last_action_time)' => false,
+ ADD INDEX index_idsite_datetime (idsite, visit_last_action_time)' => array(1061, 1091),
);
}
diff --git a/core/Updates/1.2.5-rc1.php b/core/Updates/1.2.5-rc1.php
index a4f6ee02bb..af6308ad8a 100644
--- a/core/Updates/1.2.5-rc1.php
+++ b/core/Updates/1.2.5-rc1.php
@@ -21,11 +21,11 @@ class Updates_1_2_5_rc1 extends Updates
{
return array(
'ALTER TABLE `' . Common::prefixTable('goal') . '`
- ADD `allow_multiple` tinyint(4) NOT NULL AFTER case_sensitive' => false,
+ ADD `allow_multiple` tinyint(4) NOT NULL AFTER case_sensitive' => 1060,
'ALTER TABLE `' . Common::prefixTable('log_conversion') . '`
ADD buster int unsigned NOT NULL AFTER revenue,
DROP PRIMARY KEY,
- ADD PRIMARY KEY (idvisit, idgoal, buster)' => false,
+ ADD PRIMARY KEY (idvisit, idgoal, buster)' => 1060,
);
}
diff --git a/core/Updates/1.2.5-rc7.php b/core/Updates/1.2.5-rc7.php
index 08284dd07f..94671da038 100644
--- a/core/Updates/1.2.5-rc7.php
+++ b/core/Updates/1.2.5-rc7.php
@@ -21,7 +21,7 @@ class Updates_1_2_5_rc7 extends Updates
{
return array(
'ALTER TABLE `' . Common::prefixTable('log_visit') . '`
- ADD INDEX index_idsite_idvisitor (idsite, idvisitor)' => false,
+ ADD INDEX index_idsite_idvisitor (idsite, idvisitor)' => 1061,
);
}
diff --git a/core/Updates/1.4-rc1.php b/core/Updates/1.4-rc1.php
index 3697864ce1..5290e8d24b 100644
--- a/core/Updates/1.4-rc1.php
+++ b/core/Updates/1.4-rc1.php
@@ -21,7 +21,7 @@ class Updates_1_4_rc1 extends Updates
{
return array(
'UPDATE `' . Common::prefixTable('pdf') . '`
- SET format = "pdf"' => '42S22',
+ SET format = "pdf"' => '42S22',
'ALTER TABLE `' . Common::prefixTable('pdf') . '`
ADD COLUMN `format` VARCHAR(10)' => '42S22',
);
diff --git a/core/Updates/1.4-rc2.php b/core/Updates/1.4-rc2.php
index b2a3b3176c..a54ab231c0 100644
--- a/core/Updates/1.4-rc2.php
+++ b/core/Updates/1.4-rc2.php
@@ -20,20 +20,20 @@ class Updates_1_4_rc2 extends Updates
static function getSql()
{
return array(
- "SET sql_mode=''" => false,
+ "SET sql_mode=''" => false,
// this converts the 32-bit UNSIGNED INT column to a 16 byte VARBINARY;
// _but_ MySQL does string conversion! (e.g., integer 1 is converted to 49 -- the ASCII code for "1")
'ALTER TABLE ' . Common::prefixTable('log_visit') . '
MODIFY location_ip VARBINARY(16) NOT NULL' => false,
'ALTER TABLE ' . Common::prefixTable('logger_api_call') . '
- MODIFY caller_ip VARBINARY(16) NOT NULL' => false,
+ MODIFY caller_ip VARBINARY(16) NOT NULL' => 1146,
// fortunately, 2^32 is 10 digits long and fits in the VARBINARY(16) without truncation;
// to fix this, we cast to an integer, convert to hex, pad out leading zeros, and unhex it
'UPDATE ' . Common::prefixTable('log_visit') . "
SET location_ip = UNHEX(LPAD(HEX(CONVERT(location_ip, UNSIGNED)), 8, '0'))" => false,
'UPDATE ' . Common::prefixTable('logger_api_call') . "
- SET caller_ip = UNHEX(LPAD(HEX(CONVERT(caller_ip, UNSIGNED)), 8, '0'))" => false,
+ SET caller_ip = UNHEX(LPAD(HEX(CONVERT(caller_ip, UNSIGNED)), 8, '0'))" => 1146,
);
}
diff --git a/core/Updates/1.5-b1.php b/core/Updates/1.5-b1.php
index 23bfbe2f84..9a8ed9653d 100644
--- a/core/Updates/1.5-b1.php
+++ b/core/Updates/1.5-b1.php
@@ -37,7 +37,7 @@ class Updates_1_5_b1 extends Updates
PRIMARY KEY(idvisit, idorder, idaction_sku),
INDEX index_idsite_servertime ( idsite, server_time )
- ) DEFAULT CHARSET=utf8 ' => false,
+ ) DEFAULT CHARSET=utf8 ' => 1050,
'ALTER IGNORE TABLE `' . Common::prefixTable('log_visit') . '`
ADD visitor_days_since_order SMALLINT(5) UNSIGNED NOT NULL AFTER visitor_days_since_last,
@@ -53,7 +53,7 @@ class Updates_1_5_b1 extends Updates
ADD revenue_shipping float default NULL,
ADD revenue_discount float default NULL,
ADD UNIQUE KEY unique_idsite_idorder (idsite, idorder),
- MODIFY idgoal int(10) NOT NULL' => false,
+ MODIFY idgoal int(10) NOT NULL' => 1060,
);
}
diff --git a/core/Updates/1.5-b4.php b/core/Updates/1.5-b4.php
index 318552e3b7..802992f6ae 100644
--- a/core/Updates/1.5-b4.php
+++ b/core/Updates/1.5-b4.php
@@ -21,7 +21,7 @@ class Updates_1_5_b4 extends Updates
{
return array(
'ALTER TABLE `' . Common::prefixTable('site') . '`
- ADD ecommerce TINYINT DEFAULT 0' => false,
+ ADD ecommerce TINYINT DEFAULT 0' => 1060,
);
}
diff --git a/core/Updates/1.5-b5.php b/core/Updates/1.5-b5.php
index 8f3ef447f2..5b13385fd8 100644
--- a/core/Updates/1.5-b5.php
+++ b/core/Updates/1.5-b5.php
@@ -26,7 +26,7 @@ class Updates_1_5_b5 extends Updates
lifetime INTEGER,
data TEXT,
PRIMARY KEY ( id )
- ) DEFAULT CHARSET=utf8' => false,
+ ) DEFAULT CHARSET=utf8' => 1050,
);
}
diff --git a/core/Updates/1.6-b1.php b/core/Updates/1.6-b1.php
index c200e5bf12..f28fc487cc 100644
--- a/core/Updates/1.6-b1.php
+++ b/core/Updates/1.6-b1.php
@@ -24,7 +24,7 @@ class Updates_1_6_b1 extends Updates
ADD idaction_category2 INTEGER(10) UNSIGNED NOT NULL AFTER idaction_category,
ADD idaction_category3 INTEGER(10) UNSIGNED NOT NULL,
ADD idaction_category4 INTEGER(10) UNSIGNED NOT NULL,
- ADD idaction_category5 INTEGER(10) UNSIGNED NOT NULL' => false,
+ ADD idaction_category5 INTEGER(10) UNSIGNED NOT NULL' => 1060,
'ALTER TABLE `' . Common::prefixTable('log_visit') . '`
CHANGE custom_var_k1 custom_var_k1 VARCHAR(200) DEFAULT NULL,
CHANGE custom_var_v1 custom_var_v1 VARCHAR(200) DEFAULT NULL,
diff --git a/core/Updates/1.7-b1.php b/core/Updates/1.7-b1.php
index 91f63e0309..676065d3bd 100644
--- a/core/Updates/1.7-b1.php
+++ b/core/Updates/1.7-b1.php
@@ -21,7 +21,7 @@ class Updates_1_7_b1 extends Updates
{
return array(
'ALTER TABLE `' . Common::prefixTable('pdf') . '`
- ADD COLUMN `aggregate_reports_format` TINYINT(1) NOT NULL AFTER `reports`' => false,
+ ADD COLUMN `aggregate_reports_format` TINYINT(1) NOT NULL AFTER `reports`' => 1060,
'UPDATE `' . Common::prefixTable('pdf') . '`
SET `aggregate_reports_format` = 1' => false,
);
diff --git a/core/Updates/1.7.2-rc7.php b/core/Updates/1.7.2-rc7.php
index 2f479c0522..87ae2fc035 100755
--- a/core/Updates/1.7.2-rc7.php
+++ b/core/Updates/1.7.2-rc7.php
@@ -22,7 +22,7 @@ class Updates_1_7_2_rc7 extends Updates
{
return array(
'ALTER TABLE `' . Common::prefixTable('user_dashboard') . '`
- ADD `name` VARCHAR( 100 ) NULL DEFAULT NULL AFTER `iddashboard`' => false,
+ ADD `name` VARCHAR( 100 ) NULL DEFAULT NULL AFTER `iddashboard`' => 1060,
);
}
diff --git a/core/Updates/2.0.4-b5.php b/core/Updates/2.0.4-b5.php
index 24c0e0d589..94e6a6529d 100644
--- a/core/Updates/2.0.4-b5.php
+++ b/core/Updates/2.0.4-b5.php
@@ -56,7 +56,10 @@ class Updates_2_0_4_b5 extends Updates
$superUser = null;
}
- if (!empty($superUser['bridge']) || empty($superUser)) {
+ if (!empty($superUser['bridge'])
+ || empty($superUser)
+ || empty($superUser['login'])
+ ) {
// there is a super user which is not from the config but from the bridge, that means we already have
// a super user in the database
return;
diff --git a/core/Version.php b/core/Version.php
index 68a8887f57..b11fa037d4 100644
--- a/core/Version.php
+++ b/core/Version.php
@@ -21,5 +21,5 @@ final class Version
* The current Piwik version.
* @var string
*/
- const VERSION = '2.5.0-b1';
+ const VERSION = '2.4.0';
}
diff --git a/lang/cs.json b/lang/cs.json
index c8853a2bdb..2cc8872ca9 100644
--- a/lang/cs.json
+++ b/lang/cs.json
@@ -437,7 +437,6 @@
"ContactThePiwikTeam": "Kontaktujte tým Piwiku",
"DoYouHaveBugReportOrFeatureRequest": "Máte hlášení chyby, nebo námět na vylepšení?",
"GetInTouch": "Jsme rádi za vaši zpětnou vazbu a vždy čteme všechny zprávy. Možná chcete nabídnout podnikatelskou příležitost, najmout Piwik konzultanta, podělit se o váš úspěch, nebo prostě pozdravit.",
- "HowToCreateIssue": "Prosím, přečtěte si doporučení, jak psát dobré %1$shlášení chyby%2$s nebo %3$sžádost o vlastnost%4$s. Potom %5$sse zaregistrujte%6$s nebo %7$spřihlaste%8$s v našem systému sledování problémů a vytvořte %9$snový problém%10$s.",
"IWantTo": "Chci:",
"LearnWaysToParticipate": "Naučit způsoby jak %s spolupracovat %s",
"ManuallySendEmailTo": "Prosím pošlete ručně zprávu",
diff --git a/lang/da.json b/lang/da.json
index 7770291eeb..72eadb045d 100644
--- a/lang/da.json
+++ b/lang/da.json
@@ -449,7 +449,6 @@
"ContactThePiwikTeam": "Kontakt Piwik holdet",
"DoYouHaveBugReportOrFeatureRequest": "Har du en fejlrapport eller en anmodning om en funktion?",
"GetInTouch": "Vi værdsætter din feedback og læser altid alle meddelelser uanset om du har en forretningsidé, ønsker at finde en Piwik konsulent, fortæl os en succeshistorie eller blot sige hej!",
- "HowToCreateIssue": "Læs anbefalingerne om at skrive en god %1$sfejlrapport%2$s eller %3$sfunktionsforslag%4$s. Derefter %5$sregister%6$s eller %7$slogind%8$s på vores emne tracker og opret en %9$snyt emne%10$s.",
"IWantTo": "Jeg ønsker at:",
"LearnWaysToParticipate": "Lær om alle de måder, du kan %s bidrage%s",
"ManuallySendEmailTo": "Send din besked manuelt til",
diff --git a/lang/de.json b/lang/de.json
index 1ea591646a..482dee7270 100644
--- a/lang/de.json
+++ b/lang/de.json
@@ -446,7 +446,6 @@
"ContactThePiwikTeam": "Kontaktieren Sie das Piwik Team!",
"DoYouHaveBugReportOrFeatureRequest": "Möchten Sie einen Fehler melden oder haben Sie eine Idee für eine neue Funktion?",
"GetInTouch": "Wir wissen Ihr Feedback zu schätzen und lesen alle Nachrichten. Vielleicht wollen Sie ja eine Geschäftsmöglichkeit teilen, einen Piwik-Berater buchen, uns eine Erfolgsgeschichte erzählen oder einfach nur Hallo sagen!",
- "HowToCreateIssue": "Bitte lesen Sie die Empfehlungen, wie man einen guten %1$sFehlerbericht%2$s oder %3$sVorschlag für eine neue Funktion%4$s schreibt.Im Anschluss %5$sregistrieren%6$s Sie sich oder %7$smelden%8$s sich an unserem Issue Tracker an und erstellen eine %9$sneue Meldung%10$s.",
"IWantTo": "Ich möchte:",
"LearnWaysToParticipate": "Lernen Sie alle Möglichkeiten kennen, wie Sie %s uns unterstützen können%s",
"ManuallySendEmailTo": "Senden Sie Ihre Nachricht manuell an",
diff --git a/lang/el.json b/lang/el.json
index 2fe13a93f9..12b2d2dd3a 100644
--- a/lang/el.json
+++ b/lang/el.json
@@ -448,7 +448,6 @@
"ContactThePiwikTeam": "Επικοινωνήστε με την ομάδα του Piwik!",
"DoYouHaveBugReportOrFeatureRequest": "Έχετε να αναφέρετε ένα πρόβλημα ή ένα αίτημα για χαρακτηριστικό;",
"GetInTouch": "Ευχαριστούμε για τα σχόλιά σας και να ξέρετε ότι διαβάζουμε όλα τα μηνύματα. Μπορεί να θέλετε να μοιραστείτε μαζί μας μια επιχειρηματική ευκαιρία εργασίας, να μας πείτε την ιστορία επιτυχίας σας ή απλά να πείτε ένα Γεια!",
- "HowToCreateIssue": "Παρακαλούμε διαβάστε τις προτάσεις για το πως να γράφετε μια καλή %1$sαναφορά σφάλματος%2$s ή ένα %3$sαίτημα για νέο χαρακτηριστικό%4$s. Στη συνέχεια, %5$sεγγραφείτε%6$s ή %7$sκάνετε είσοδο%8$s στην παρακολούθηση σφαλμάτων και δημιουργήστε ένα %9$sνέο αίτημα%10$s.",
"IWantTo": "Θέλω να:",
"LearnWaysToParticipate": "Μάθετε όλους του τρόπους που μπορείτε να %sσυμμετέχετε%s",
"ManuallySendEmailTo": "Στείλτε χειροκίνητα το μήνυμά σας στον\/στην",
diff --git a/lang/en.json b/lang/en.json
index 3f9f4a6aed..b9699f9226 100644
--- a/lang/en.json
+++ b/lang/en.json
@@ -451,7 +451,7 @@
"ContactThePiwikTeam": "Contact the Piwik team!",
"DoYouHaveBugReportOrFeatureRequest": "Do you have a bug to report or a feature request?",
"GetInTouch": "We appreciate your feedback and always read all messages. Maybe you would like to share a business opportunity, hire a Piwik consultant, tell us a success story or simply say Hello!",
- "HowToCreateIssue": "Please read the recommendations on writing a good %1$sbug report%2$s or %3$sfeature request%4$s. Then %5$sregister%6$s or %7$slogin%8$s on our issue tracker and create a %9$snew issue%10$s.",
+ "HowToCreateTicket": "Please read the recommendations on writing a good %1$sbug report%2$s or %3$sfeature request%4$s. Then register or login on %5$sour issue tracker%6$s and create a %7$snew issue%8$s.",
"IWantTo": "I want to:",
"LearnWaysToParticipate": "Learn about all the ways you can %s participate%s",
"ManuallySendEmailTo": "Please manually send your message to",
@@ -2021,7 +2021,7 @@
"GeoIPServerVarsFound": "Piwik detects the following GeoIP %s variables",
"GeoIPUpdaterInstructions": "Enter the download links for your databases below. If you've purchased databases from %3$sMaxMind%4$s, you can find these links %1$shere%2$s. Please contact %3$sMaxMind%4$s if you have trouble accessing them.",
"GeoIPUpdaterIntro": "Piwik is currently managing updates for the following GeoIP databases",
- "GeoLiteCityLink": "If you're using the GeoLite City database, use this link: %1$s%2$s%3$s.",
+ "GeoLiteCityLink": "If you're using the GeoLite City database, use this link: %1$s%2$s%3$s",
"Geolocation": "Geolocation",
"GeolocationPageDesc": "On this page you can change how Piwik determines visitor locations.",
"getCityDocumentation": "This report shows the cities your visitors were in when they accessed your website.",
diff --git a/lang/es.json b/lang/es.json
index ed5b80b73f..f9d8c789cf 100644
--- a/lang/es.json
+++ b/lang/es.json
@@ -447,7 +447,6 @@
"ContactThePiwikTeam": "Contacta al equipo de Piwik!",
"DoYouHaveBugReportOrFeatureRequest": "Tienes un error que reportar o una nueva característica?",
"GetInTouch": "Agradecemos tu feedback, nosotros leemos siempre todos los mensajes. Quizá te gustaría compartir una oportunidad comercial, contratar un consultor de Piwik, o contarnos sobre un éxito empresarial interesante o simplemente mandarnos un saludo!",
- "HowToCreateIssue": "Por favor lee las recomendaciones para escribir un %1$sinforme de errores%2$s o una %3$ssolicitud de función%4$s correctamente. Luego debes %5$sregistrarte%6$s o %7$siniciar sesión%8$s en nuestro seguidor de incidentes para crear un %9$snuevo incidente%10$s.",
"IWantTo": "Yo quiero:",
"LearnWaysToParticipate": "Aprende sobre todas las formas de %sparticipar%s",
"ManuallySendEmailTo": "Por favor envíe su mensaje manualmente a",
diff --git a/lang/fr.json b/lang/fr.json
index 1c689e60a2..160b09386a 100644
--- a/lang/fr.json
+++ b/lang/fr.json
@@ -449,7 +449,6 @@
"ContactThePiwikTeam": "Contactez l’Équipe Piwik!",
"DoYouHaveBugReportOrFeatureRequest": "Avez-vous un bug à rapporter ou une fonctionnalité à demander?",
"GetInTouch": "Nous apprécions vos commentaires et lisons tous les messages. Peut-être voudriez vous nous informer d'une opportunité commerciale, employer un consultant, nous raconter un succès ou simplement dire bonjour!",
- "HowToCreateIssue": "Merci de lire la documentation sur la bonne manière d'écrire un %1$srapport de bug%2$s ou %3$sune demande de nouvelle fonctionnalité%4$s. Ensuite, %5$senregistrez-vous%6$s ou %7$sconnectez-vous%8$s sur notre gestionnaire d'incidents puis créez un %9$snouveau ticket%10$s.",
"IWantTo": "Je veux:",
"LearnWaysToParticipate": "Renseignez vous sur les manières dont vous pouvez %s participer%s",
"ManuallySendEmailTo": "Merci d'envoyer manuellement votre message à",
diff --git a/lang/it.json b/lang/it.json
index e9cdc1dcb7..fe98305035 100644
--- a/lang/it.json
+++ b/lang/it.json
@@ -449,7 +449,6 @@
"ContactThePiwikTeam": "Contatta il team Piwik!",
"DoYouHaveBugReportOrFeatureRequest": "Hai un bug da segnalare o una richiesta di funzionalità?",
"GetInTouch": "Apprezziamo il tuo feedback e leggiamo sempre tutti i messaggi. Ma forse vorresti condividere qualche opportunità commerciale, ingaggiare un consulente di Piwik, raccontarci una storia di successi o semplicemente dirci Ciao!",
- "HowToCreateIssue": "Si prega di leggere le raccomandazioni su come scrivere un buon %1$srapporto sui bugs%2$s o una %3$srichiesta di funzionalità%4$s. Quindi %5$sregistrati%6$s o %7$saccedi%8$s al nostro tracker dei problemi e crea un %9$snuovo problema%10$s.",
"IWantTo": "Vorrei:",
"LearnWaysToParticipate": "Impara tutti i modi attraverso i quali puoi %s partecipare %s",
"ManuallySendEmailTo": "Perfavore invia manualmente il messaggio a",
diff --git a/lang/ro.json b/lang/ro.json
index 5d9626b458..4b4b0c6b8f 100644
--- a/lang/ro.json
+++ b/lang/ro.json
@@ -448,7 +448,6 @@
"ContactThePiwikTeam": "Contactează echipa Piwik!",
"DoYouHaveBugReportOrFeatureRequest": "Doreşti să raportezi o problemă sau să propui o înbunătăţire?",
"GetInTouch": "Noi apreciem parerea dvs si citim intotdeauna toate mesajele. Poate ca doriti sa ne propuneti o oportunitate de afacere, sa angajati un consultant Piwik, sa ne spuneti o poveste de succes sau doar sa ne spuneti un simplu Salut!",
- "HowToCreateIssue": "Va rugam cititi recomandarile pentru a scrie un bun %1$sbug report%2$s sau %3$sfeature request%4$s. Apoi %5$sinregistrati-va%6$s or %7$sautentificati-va%8$s pe pagina noastra unde urmarim problemele aparute si creati un %9$snou ticket%10$s.",
"IWantTo": "Doresc să:",
"LearnWaysToParticipate": "Invata despre toate modalitatile in care poti %s participa%s",
"ManuallySendEmailTo": "Va rugam trimiteti manual mesajul dvs catre",
diff --git a/lang/sr.json b/lang/sr.json
index 5f8306ae63..424dd8f357 100644
--- a/lang/sr.json
+++ b/lang/sr.json
@@ -446,7 +446,6 @@
"ContactThePiwikTeam": "Kontaktirajte Piwik tim!",
"DoYouHaveBugReportOrFeatureRequest": "Da li želite da prijavite grešku u programu ili imate neku želju?",
"GetInTouch": "Zahvaljujemo vam na interesovanju, mi uvek pročitamo sve poruke. Možda želite da podelite sa nama poslovnu ponudu, unajmite Piwik konsultanta, da nam ispričate uspešnu priču ili jednostavno da nas pozdravite!",
- "HowToCreateIssue": "Molimo vas da prvo pročitate preporuke kako se piše dobar %1$sizveštaj o grešci%2$s ili %3$szahtev za novom funkcionalnošću%4$s. Zatim se %5$sregistrujte%6$s ili %7$sprijavite%8$s na naš sajt i otvorite %9$snovi tiket%10$s.",
"IWantTo": "Želim da:",
"LearnWaysToParticipate": "Pogledajte kako sve možete da %s uzmete učešće%s",
"ManuallySendEmailTo": "Molimo vas da pošaljete poruku na",
diff --git a/misc/log-analytics/import_logs.py b/misc/log-analytics/import_logs.py
index a007ab1d85..f986e580b4 100755
--- a/misc/log-analytics/import_logs.py
+++ b/misc/log-analytics/import_logs.py
@@ -933,7 +933,7 @@ class Piwik(object):
args.update(kwargs)
# Convert lists into appropriate format.
- # See: http://dev.piwik.org/trac/wiki/API/Reference#PassinganArrayParameter
+ # See: http://developer.piwik.org/api-reference/reporting-api#passing-an-array-of-data-as-a-parameter
# Warning: we have to pass the parameters in order: foo[0], foo[1], foo[2]
# and not foo[1], foo[0], foo[2] (it will break Piwik otherwise.)
final_args = []
diff --git a/misc/others/test_cookies_GenerateHundredsWebsitesAndVisits.php b/misc/others/test_cookies_GenerateHundredsWebsitesAndVisits.php
index 70040f497e..b8030333a2 100644
--- a/misc/others/test_cookies_GenerateHundredsWebsitesAndVisits.php
+++ b/misc/others/test_cookies_GenerateHundredsWebsitesAndVisits.php
@@ -1,6 +1,6 @@
<?php
// Script that creates 100 websites, then outputs a IMG that records a pageview in each website
-// Used initially to test how to handle cookies for this use case (see http://dev.piwik.org/trac/ticket/409)
+// Used initially to test how to handle cookies for this use case (see https://github.com/piwik/piwik/issues/409)
use Piwik\Common;
use Piwik\FrontController;
use Piwik\Piwik;
diff --git a/misc/package/build.sh b/misc/package/build.sh
index de6ae59d99..35b230f47a 100755
--- a/misc/package/build.sh
+++ b/misc/package/build.sh
@@ -104,7 +104,7 @@ fi
echo "Starting build...."
############################
-# Setting umask so it works for most users, see http://dev.piwik.org/trac/ticket/3869
+# Setting umask so it works for most users, see https://github.com/piwik/piwik/issues/3869
UMASK=`umask`
umask 0022
diff --git a/plugins/API/API.php b/plugins/API/API.php
index 7e4f7eb62d..3253ae5f21 100644
--- a/plugins/API/API.php
+++ b/plugins/API/API.php
@@ -55,7 +55,6 @@ class API extends \Piwik\Plugin\API
public function getPiwikVersion()
{
Piwik::checkUserHasSomeViewAccess();
- Piwik::checkUserIsNotAnonymous();
return Version::VERSION;
}
diff --git a/plugins/API/ProcessedReport.php b/plugins/API/ProcessedReport.php
index ad25c5aa0b..86a7fd1698 100644
--- a/plugins/API/ProcessedReport.php
+++ b/plugins/API/ProcessedReport.php
@@ -697,7 +697,7 @@ class ProcessedReport
// generate 'human readable' metric values
// if we handle MultiSites.getAll we do not always have the same idSite but different ones for
- // each site, see http://dev.piwik.org/trac/ticket/5006
+ // each site, see https://github.com/piwik/piwik/issues/5006
$idSiteForRow = $idSite;
if ($row->getMetadata('idsite') && is_numeric($row->getMetadata('idsite'))) {
$idSiteForRow = (int) $row->getMetadata('idsite');
diff --git a/plugins/API/RowEvolution.php b/plugins/API/RowEvolution.php
index 705bdb2a6e..69bb5e2f56 100644
--- a/plugins/API/RowEvolution.php
+++ b/plugins/API/RowEvolution.php
@@ -204,10 +204,13 @@ class RowEvolution
$replaceRegex = "/\\s*" . preg_quote(LabelFilter::SEPARATOR_RECURSIVE_LABEL) . "\\s*/";
$cleanLabel = preg_replace($replaceRegex, '/', $label);
- return $mainUrlHost . '/' . $cleanLabel . '/';
+ $result = $mainUrlHost . '/' . $cleanLabel . '/';
} else {
- return str_replace(LabelFilter::SEPARATOR_RECURSIVE_LABEL, ' - ', $label);
+ $result = str_replace(LabelFilter::SEPARATOR_RECURSIVE_LABEL, ' - ', $label);
}
+
+ // remove @ terminal operator occurances
+ return str_replace(LabelFilter::TERMINAL_OPERATOR, '', $result);
}
/**
diff --git a/plugins/CoreConsole/Commands/CoreArchiver.php b/plugins/CoreConsole/Commands/CoreArchiver.php
index 570b1dc74d..89b6bd9a9b 100644
--- a/plugins/CoreConsole/Commands/CoreArchiver.php
+++ b/plugins/CoreConsole/Commands/CoreArchiver.php
@@ -31,7 +31,7 @@ class CoreArchiver extends ConsoleCommand
}
if (is_string($url) && $url && in_array($url, array('http://', 'https://'))) {
- // see http://dev.piwik.org/trac/ticket/5180 and http://forum.piwik.org/read.php?2,115274
+ // see https://github.com/piwik/piwik/issues/5180 and http://forum.piwik.org/read.php?2,115274
throw new \InvalidArgumentException('No valid URL given. If you have specified a valid URL try --piwik-domain instead of --url');
}
diff --git a/plugins/CoreConsole/Commands/TestsSetupFixture.php b/plugins/CoreConsole/Commands/TestsSetupFixture.php
index c04d057217..1d38f9f3bf 100644
--- a/plugins/CoreConsole/Commands/TestsSetupFixture.php
+++ b/plugins/CoreConsole/Commands/TestsSetupFixture.php
@@ -11,6 +11,7 @@ namespace Piwik\Plugins\CoreConsole\Commands;
use Piwik\Config;
use Piwik\Plugin\ConsoleCommand;
use Piwik\Url;
+use Piwik\Tests\Fixture;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
@@ -18,6 +19,28 @@ use Symfony\Component\Console\Output\OutputInterface;
/**
* Console commands that sets up a fixture either in a local MySQL database or a remote one.
+ *
+ * Examples:
+ *
+ * To setup a fixture provided by Piwik:
+ *
+ * ./console tests:setup-fixture UITestFixture
+ *
+ * To setup your own fixture created solely for test purposes and stored outside of Piwik:
+ *
+ * ./console tests:setup-fixture MyFixtureType --file=../devfixtures/MyFixtureType.php
+ *
+ * To setup a fixture or use existing data if present:
+ *
+ * ./console tests:setup-fixture UITestFixture --persist-fixture-data
+ *
+ * To re-setup a fixture that is already present:
+ *
+ * ./console tests:setup-fixture UITestFixture --persist-fixture-data --drop
+ *
+ * To create an SQL dump for a fixture:
+ *
+ * ./console tests:setup-fixture OmniFixture --sqldump=OmniFixtureDump.sql
*/
class TestsSetupFixture extends ConsoleCommand
{
@@ -49,6 +72,8 @@ class TestsSetupFixture extends ConsoleCommand
$this->addOption('drop', null, InputOption::VALUE_NONE,
"Forces the database to be dropped before setting up the fixture. Should be used in conjunction with" .
" --persist-fixture-data when updating a pre-existing test database.");
+ $this->addOption('sqldump', null, InputOption::VALUE_REQUIRED,
+ "Creates an SQL dump after setting up the fixture and outputs the dump to the file specified by this option.");
$this->addOption('set-phantomjs-symlinks', null, InputOption::VALUE_NONE,
"Used by UI tests. Creates symlinks to root directory in tests/PHPUnit/proxy.");
$this->addOption('server-global', null, InputOption::VALUE_REQUIRED,
@@ -64,26 +89,88 @@ class TestsSetupFixture extends ConsoleCommand
$_SERVER = json_decode($serverGlobal, true);
}
- $this->requireFixtureFiles();
+ $this->requireFixtureFiles($input);
$this->setIncludePathAsInTestBootstrap();
- $file = $input->getOption('file');
- if ($file) {
- if (is_file($file)) {
- require_once $file;
- } else if (is_file(PIWIK_INCLUDE_PATH . '/' . $file)) {
- require_once PIWIK_INCLUDE_PATH . '/' . $file;
- } else {
- throw new \Exception("Cannot find --file option file '$file'.");
- }
- }
-
$host = Url::getHost();
if (empty($host)) {
Url::setHost('localhost');
}
- // get the fixture class
+ $fixture = $this->createFixture($input);
+
+ $this->setupDatabaseOverrides($input, $fixture);
+
+ // perform setup and/or teardown
+ if ($input->getOption('teardown')) {
+ $fixture->getTestEnvironment()->save();
+ $fixture->performTearDown();
+ } else {
+ $fixture->performSetUp();
+ }
+
+ if ($input->getOption('set-phantomjs-symlinks')) {
+ $this->createSymbolicLinksForUITests();
+ }
+
+ $this->writeSuccessMessage($output, array("Fixture successfully setup!"));
+
+ $sqlDumpPath = $input->getOption('sqldump');
+ if ($sqlDumpPath) {
+ $this->createSqlDump($sqlDumpPath, $output);
+ }
+ }
+
+ private function createSymbolicLinksForUITests()
+ {
+ // make sure symbolic links exist (phantomjs doesn't support symlink-ing yet)
+ foreach (array('libs', 'plugins', 'tests', 'piwik.js') as $linkName) {
+ $linkPath = PIWIK_INCLUDE_PATH . '/tests/PHPUnit/proxy/' . $linkName;
+ if (!file_exists($linkPath)) {
+ symlink(PIWIK_INCLUDE_PATH . '/' . $linkName, $linkPath);
+ }
+ }
+ }
+
+ private function createSqlDump($sqlDumpPath, OutputInterface $output)
+ {
+ $output->write("<info>Creating SQL dump...</info>");
+
+ $databaseConfig = Config::getInstance()->database;
+ $dbUser = $databaseConfig['username'];
+ $dbPass = $databaseConfig['password'];
+ $dbHost = $databaseConfig['host'];
+ $dbName = $databaseConfig['dbname'];
+
+ $command = "mysqldump --user='$dbUser' --password='$dbPass' --host='$dbHost' '$dbName' > '$sqlDumpPath'";
+ passthru($command);
+
+ $this->writeSuccessMessage($output, array("SQL dump created!"));
+ }
+
+ private function setupDatabaseOverrides(InputInterface $input, Fixture $fixture)
+ {
+ $testingEnvironment = $fixture->getTestEnvironment();
+
+ $optionsToOverride = array(
+ 'dbname' => $fixture->getDbName(),
+ 'host' => $input->getOption('db-host'),
+ 'username' => $input->getOption('db-user'),
+ 'password' => $input->getOption('db-pass')
+ );
+ foreach ($optionsToOverride as $configOption => $value) {
+ if ($value) {
+ $configOverride = $testingEnvironment->configOverride;
+ $configOverride['database_tests'][$configOption] = $configOverride['database'][$configOption] = $value;
+ $testingEnvironment->configOverride = $configOverride;
+
+ Config::getInstance()->database[$configOption] = $value;
+ }
+ }
+ }
+
+ private function createFixture(InputInterface $input)
+ {
$fixtureClass = $input->getArgument('fixture');
if (class_exists("Piwik\\Tests\\Fixtures\\" . $fixtureClass)) {
$fixtureClass = "Piwik\\Tests\\Fixtures\\" . $fixtureClass;
@@ -93,7 +180,6 @@ class TestsSetupFixture extends ConsoleCommand
throw new \Exception("Cannot find fixture class '$fixtureClass'.");
}
- // create the fixture
$fixture = new $fixtureClass();
$fixture->printToScreen = true;
@@ -115,52 +201,16 @@ class TestsSetupFixture extends ConsoleCommand
$fixture->extraPluginsToLoad = explode(',', $extraPluginsToLoad);
}
- if($fixture->createConfig) {
+ if ($fixture->createConfig) {
Config::getInstance()->setTestEnvironment();
}
- $fixture->createConfig = false;
-
- // setup database overrides
- $testingEnvironment = $fixture->getTestEnvironment();
-
- $optionsToOverride = array(
- 'dbname' => $fixture->getDbName(),
- 'host' => $input->getOption('db-host'),
- 'user' => $input->getOption('db-user'),
- 'password' => $input->getOption('db-pass')
- );
- foreach ($optionsToOverride as $configOption => $value) {
- if ($value) {
- $configOverride = $testingEnvironment->configOverride;
- $configOverride['database_tests'][$configOption] = $configOverride['database'][$configOption] = $value;
- $testingEnvironment->configOverride = $configOverride;
- Config::getInstance()->database[$configOption] = $value;
- }
- }
-
- // perform setup and/or teardown
- if ($input->getOption('teardown')) {
- $testingEnvironment->save();
- $fixture->performTearDown();
- } else {
- $fixture->performSetUp();
- }
-
- if ($input->getOption('set-phantomjs-symlinks')) {
- // make sure symbolic links exist (phantomjs doesn't support symlink-ing yet)
- foreach (array('libs', 'plugins', 'tests', 'piwik.js') as $linkName) {
- $linkPath = PIWIK_INCLUDE_PATH . '/tests/PHPUnit/proxy/' . $linkName;
- if (!file_exists($linkPath)) {
- symlink(PIWIK_INCLUDE_PATH . '/' . $linkName, $linkPath);
- }
- }
- }
+ $fixture->createConfig = false;
- $this->writeSuccessMessage($output, array("Fixture successfully setup!"));
+ return $fixture;
}
- private function requireFixtureFiles()
+ private function requireFixtureFiles(InputInterface $input)
{
require_once PIWIK_INCLUDE_PATH . '/libs/PiwikTracker/PiwikTracker.php';
require_once PIWIK_INCLUDE_PATH . '/tests/PHPUnit/FakeAccess.php';
@@ -180,6 +230,17 @@ class TestsSetupFixture extends ConsoleCommand
require_once $file;
}
}
+
+ $file = $input->getOption('file');
+ if ($file) {
+ if (is_file($file)) {
+ require_once $file;
+ } else if (is_file(PIWIK_INCLUDE_PATH . '/' . $file)) {
+ require_once PIWIK_INCLUDE_PATH . '/' . $file;
+ } else {
+ throw new \Exception("Cannot find --file option file '$file'.");
+ }
+ }
}
private function setIncludePathAsInTestBootstrap()
diff --git a/plugins/CoreHome/angularjs/anchorLinkFix.js b/plugins/CoreHome/angularjs/anchorLinkFix.js
index 9764d362ba..59d8114a56 100644
--- a/plugins/CoreHome/angularjs/anchorLinkFix.js
+++ b/plugins/CoreHome/angularjs/anchorLinkFix.js
@@ -6,7 +6,7 @@
*/
/**
- * See http://dev.piwik.org/trac/ticket/4795 "linking to #hash tag does not work after merging AngularJS"
+ * See https://github.com/piwik/piwik/issues/4795 "linking to #hash tag does not work after merging AngularJS"
*/
(function () {
diff --git a/plugins/CoreHome/javascripts/dataTable_rowactions.js b/plugins/CoreHome/javascripts/dataTable_rowactions.js
index b5e7140b8e..4d717938ab 100644
--- a/plugins/CoreHome/javascripts/dataTable_rowactions.js
+++ b/plugins/CoreHome/javascripts/dataTable_rowactions.js
@@ -215,11 +215,9 @@ DataTable_RowAction.prototype.getLabelFromTr = function (tr) {
value = value.trim();
value = encodeURIComponent(value);
- // if tr is a terminal node, we add a '%20' to signfy this. Piwik will notice this and make sure to
- // look for a terminal, even if there's a sibling branch node w/ the same label. this is a workaround
- // for #4363.
+ // if tr is a terminal node, we use the @ operator to distinguish it from branch nodes w/ the same name
if (!tr.hasClass('subDataTable')) {
- value = value + '%20';
+ value = '@' + value;
}
return value;
diff --git a/plugins/CoreHome/stylesheets/cloud.less b/plugins/CoreHome/stylesheets/cloud.less
index fc71f9650d..a0750c6497 100644
--- a/plugins/CoreHome/stylesheets/cloud.less
+++ b/plugins/CoreHome/stylesheets/cloud.less
@@ -1,6 +1,6 @@
@-moz-document url-prefix() {
// see bug in Firefox 30+
- // http://dev.piwik.org/trac/ticket/5242
+ // https://github.com/piwik/piwik/issues/5242
// https://bugzilla.mozilla.org/show_bug.cgi?id=1012640
.tagCloud + .dataTableFeatures {
clear: left;
diff --git a/plugins/CustomAlerts b/plugins/CustomAlerts
-Subproject defaa73836af7da37bff85c74de336ff6b1edcd
+Subproject f3d046a6949bdeee8974d5b8293f7e7cf1533c2
diff --git a/plugins/CustomVariables/tests/CustomVariablesIntegrationTest.php b/plugins/CustomVariables/tests/CustomVariablesIntegrationTest.php
index b72ded9a0e..2a3e6a8ae5 100644
--- a/plugins/CustomVariables/tests/CustomVariablesIntegrationTest.php
+++ b/plugins/CustomVariables/tests/CustomVariablesIntegrationTest.php
@@ -8,12 +8,14 @@
namespace Piwik\Plugins\CustomVariables\tests;
+use Piwik\Tests\IntegrationTestCase;
+
/**
* @group CustomVariables
* @group CustomVariablesTest
* @group Database
*/
-class CustomVariablesIntegrationTest extends \IntegrationTestCase
+class CustomVariablesIntegrationTest extends IntegrationTestCase
{
/**
* @var Fixtures\VisitWithManyCustomVariables
diff --git a/plugins/CustomVariables/tests/Fixtures/VisitWithManyCustomVariables.php b/plugins/CustomVariables/tests/Fixtures/VisitWithManyCustomVariables.php
index 11ca605297..8060eb25a7 100644
--- a/plugins/CustomVariables/tests/Fixtures/VisitWithManyCustomVariables.php
+++ b/plugins/CustomVariables/tests/Fixtures/VisitWithManyCustomVariables.php
@@ -9,11 +9,12 @@ namespace Piwik\Plugins\CustomVariables\tests\Fixtures;
use Piwik\Plugins\CustomVariables\Model;
use Piwik\Plugins\Goals\API;
+use Piwik\Tests\Fixture;
/**
* Adds one site with two goals and tracks two visits with custom variables.
*/
-class VisitWithManyCustomVariables extends \Fixture
+class VisitWithManyCustomVariables extends Fixture
{
public $dateTime = '2010-01-03 11:22:33';
public $idSite = 1;
diff --git a/plugins/ExampleAPI/API.php b/plugins/ExampleAPI/API.php
index f7cb0424ce..63e66fac9b 100644
--- a/plugins/ExampleAPI/API.php
+++ b/plugins/ExampleAPI/API.php
@@ -16,7 +16,7 @@ use Piwik\Version;
/**
* The ExampleAPI is useful to developers building a custom Piwik plugin.
*
- * Please see the <a href='http://dev.piwik.org/trac/browser/trunk/plugins/ExampleAPI/API.php#L1' target='_blank'>source code in in the file plugins/ExampleAPI/API.php</a> for more documentation.
+ * Please see the <a href='https://github.com/piwik/piwik/blob/master/plugins/ExampleAPI/API.php' target='_blank'>source code in in the file plugins/ExampleAPI/API.php</a> for more documentation.
* @method static \Piwik\Plugins\ExampleAPI\API getInstance()
*/
class API extends \Piwik\Plugin\API
@@ -28,7 +28,6 @@ class API extends \Piwik\Plugin\API
public function getPiwikVersion()
{
Piwik::checkUserHasSomeViewAccess();
- Piwik::checkUserIsNotAnonymous();
return Version::VERSION;
}
diff --git a/plugins/ExamplePlugin/tests/SimpleIntegrationTest.php b/plugins/ExamplePlugin/tests/SimpleIntegrationTest.php
index 3debdd9829..f9cebb8c72 100644
--- a/plugins/ExamplePlugin/tests/SimpleIntegrationTest.php
+++ b/plugins/ExamplePlugin/tests/SimpleIntegrationTest.php
@@ -7,14 +7,16 @@
*/
namespace Piwik\Plugins\ExamplePlugin\tests;
+
use Piwik\Plugins\ExamplePlugin\tests\fixtures\SimpleFixtureTrackFewVisits;
+use Piwik\Tests\IntegrationTestCase;
/**
* @group ExamplePlugin
* @group SimpleIntegrationTest
* @group Plugins
*/
-class SimpleIntegrationTest extends \IntegrationTestCase
+class SimpleIntegrationTest extends IntegrationTestCase
{
/**
* @var SimpleFixtureTrackFewVisits
@@ -59,5 +61,4 @@ class SimpleIntegrationTest extends \IntegrationTestCase
}
-SimpleIntegrationTest::$fixture = new SimpleFixtureTrackFewVisits();
-
+SimpleIntegrationTest::$fixture = new SimpleFixtureTrackFewVisits(); \ No newline at end of file
diff --git a/plugins/ExamplePlugin/tests/fixtures/SimpleFixtureTrackFewVisits.php b/plugins/ExamplePlugin/tests/fixtures/SimpleFixtureTrackFewVisits.php
index 40aff52ad8..f0515abfb1 100644
--- a/plugins/ExamplePlugin/tests/fixtures/SimpleFixtureTrackFewVisits.php
+++ b/plugins/ExamplePlugin/tests/fixtures/SimpleFixtureTrackFewVisits.php
@@ -8,13 +8,14 @@
namespace Piwik\Plugins\ExamplePlugin\tests\fixtures;
use Piwik\Date;
+use Piwik\Tests\Fixture;
/**
* Generates tracker testing data for our SimpleIntegrationTest
*
* This Simple fixture adds one website and tracks one visit with couple pageviews and an ecommerce conversion
*/
-class SimpleFixtureTrackFewVisits extends \Fixture
+class SimpleFixtureTrackFewVisits extends Fixture
{
public $dateTime = '2013-01-23 01:23:45';
public $idSite = 1;
@@ -75,6 +76,4 @@ class SimpleFixtureTrackFewVisits extends \Fixture
self::checkResponse($t->doTrackEcommerceCartUpdate($grandTotal = 33 * 77));
}
-
-}
-
+} \ No newline at end of file
diff --git a/plugins/Feedback/templates/index.twig b/plugins/Feedback/templates/index.twig
index dba9db49d4..e72ad2a5da 100644
--- a/plugins/Feedback/templates/index.twig
+++ b/plugins/Feedback/templates/index.twig
@@ -37,16 +37,14 @@
<h2>{{ 'Feedback_DoYouHaveBugReportOrFeatureRequest'|translate }}</h2>
<div class="header_full">
- <p>{{ 'Feedback_HowToCreateIssue'|translate(
+ <p>{{ 'Feedback_HowToCreateTicket'|translate(
"<a target='_blank' href='?module=Proxy&action=redirect&url=http://developer.piwik.org/guides/core-team-workflow%23submitting-a-bug-report'>",
"</a>",
"<a target='_blank' href='?module=Proxy&action=redirect&url=http://developer.piwik.org/guides/core-team-workflow%23submitting-a-feature-request'>",
"</a>",
- "<a target='_blank' href='?module=Proxy&action=redirect&url=http://dev.piwik.org/trac/register'>",
+ "<a target='_blank' href='?module=Proxy&action=redirect&url=https://github.com/piwik/piwik/issues'>",
"</a>",
- "<a target='_blank' href='?module=Proxy&action=redirect&url=http://dev.piwik.org/trac/login'>",
- "</a>",
- "<a target='_blank' href='?module=Proxy&action=redirect&url=http://dev.piwik.org/trac/newticket'>",
+ "<a target='_blank' href='?module=Proxy&action=redirect&url=https://github.com/piwik/piwik/issues/new'>",
"</a>"
)|raw }}</p>
<br/>
diff --git a/plugins/ImageGraph/StaticGraph/GridGraph.php b/plugins/ImageGraph/StaticGraph/GridGraph.php
index b136f80ed0..3eeb1393db 100644
--- a/plugins/ImageGraph/StaticGraph/GridGraph.php
+++ b/plugins/ImageGraph/StaticGraph/GridGraph.php
@@ -416,7 +416,7 @@ abstract class GridGraph extends StaticGraph
// can not currently be used because pChart's label design is not flexible enough
// e.g: it is not possible to remove the box border & the square icon
// it would require modifying pChart code base which we try to avoid
- // see http://dev.piwik.org/trac/ticket/3396
+ // see https://github.com/piwik/piwik/issues/3396
// protected function displayMinMaxValues()
// {
// if($displayMinMax)
diff --git a/plugins/Insights/tests/ApiTest.php b/plugins/Insights/tests/ApiTest.php
index 3dfcf47a64..e769252e9d 100644
--- a/plugins/Insights/tests/ApiTest.php
+++ b/plugins/Insights/tests/ApiTest.php
@@ -12,6 +12,7 @@ use Piwik\DataTable;
use Piwik\DataTable\Row;
use Piwik\Plugins\Insights\API;
use Piwik\Plugins\Insights\tests\Fixtures\SomeVisitsDifferentPathsOnTwoDays;
+use Piwik\Tests\IntegrationTestCase;
/**
* @group Insights
@@ -19,7 +20,7 @@ use Piwik\Plugins\Insights\tests\Fixtures\SomeVisitsDifferentPathsOnTwoDays;
* @group Database
* @group Plugins
*/
-class ApiTest extends \IntegrationTestCase
+class ApiTest extends IntegrationTestCase
{
/**
* @var SomeVisitsDifferentPathsOnTwoDays
@@ -40,13 +41,13 @@ class ApiTest extends \IntegrationTestCase
}
/**
- '/Mover1' => 2, +8 // 400%
- '/Old1' => 9, -9 // -100%
- '/Mover2' => 24, -11 // -50%
- '/Mover3' => 21, -1 // -5%
- '/Old2' => 3 -3 // -100%
- '/New1', +5 // 100%
- '/New2' +2 // 100%
+ * '/Mover1' => 2, +8 // 400%
+ * '/Old1' => 9, -9 // -100%
+ * '/Mover2' => 24, -11 // -50%
+ * '/Mover3' => 21, -1 // -5%
+ * '/Old2' => 3 -3 // -100%
+ * '/New1', +5 // 100%
+ * '/New2' +2 // 100%
*/
public function test_getInsights_ShouldReturnCorrectMetadata()
{
diff --git a/plugins/Insights/tests/Fixtures/SomeVisitsDifferentPathsOnTwoDays.php b/plugins/Insights/tests/Fixtures/SomeVisitsDifferentPathsOnTwoDays.php
index a665a06d96..c5314d3aa3 100644
--- a/plugins/Insights/tests/Fixtures/SomeVisitsDifferentPathsOnTwoDays.php
+++ b/plugins/Insights/tests/Fixtures/SomeVisitsDifferentPathsOnTwoDays.php
@@ -9,12 +9,13 @@
namespace Piwik\Plugins\Insights\tests\Fixtures;
use Piwik\Date;
+use Piwik\Tests\Fixture;
/**
* Adds one website and tracks several visits from one visitor on
* different days that span about a month apart.
*/
-class SomeVisitsDifferentPathsOnTwoDays extends \Test_Piwik_BaseFixture
+class SomeVisitsDifferentPathsOnTwoDays extends Fixture
{
public $idSite = 1;
public $date1 = '2010-12-14';
@@ -75,6 +76,5 @@ class SomeVisitsDifferentPathsOnTwoDays extends \Test_Piwik_BaseFixture
$numPageViews++;
}
}
-
}
-}
+} \ No newline at end of file
diff --git a/plugins/Insights/tests/ModelTest.php b/plugins/Insights/tests/ModelTest.php
index 1dd70150ee..12bd283949 100644
--- a/plugins/Insights/tests/ModelTest.php
+++ b/plugins/Insights/tests/ModelTest.php
@@ -11,6 +11,7 @@ namespace Piwik\Plugins\Insights\tests;
use Piwik\DataTable;
use Piwik\Plugins\Insights\Model;
use Piwik\Plugins\Insights\tests\Fixtures\SomeVisitsDifferentPathsOnTwoDays;
+use Piwik\Tests\IntegrationTestCase;
/**
* @group Insights
@@ -18,7 +19,7 @@ use Piwik\Plugins\Insights\tests\Fixtures\SomeVisitsDifferentPathsOnTwoDays;
* @group Database
* @group Plugins
*/
-class ModelTest extends \IntegrationTestCase
+class ModelTest extends IntegrationTestCase
{
/**
* @var SomeVisitsDifferentPathsOnTwoDays
diff --git a/plugins/Live/javascripts/visitorLog.js b/plugins/Live/javascripts/visitorLog.js
index 0b5f8fefbb..3f30f9e9ab 100644
--- a/plugins/Live/javascripts/visitorLog.js
+++ b/plugins/Live/javascripts/visitorLog.js
@@ -64,7 +64,7 @@
var tooltipIsOpened = false;
$('a', $this).on('focus', function () {
- // see http://dev.piwik.org/trac/ticket/4099
+ // see https://github.com/piwik/piwik/issues/4099
if (tooltipIsOpened) {
$this.tooltip('close');
}
diff --git a/plugins/MultiSites/angularjs/dashboard/dashboard-model.js b/plugins/MultiSites/angularjs/dashboard/dashboard-model.js
index 802e1dfe8f..52c66bd687 100644
--- a/plugins/MultiSites/angularjs/dashboard/dashboard-model.js
+++ b/plugins/MultiSites/angularjs/dashboard/dashboard-model.js
@@ -97,7 +97,7 @@ angular.module('piwikApp').factory('multisitesDashboardModel', function (piwikAp
site.idsite = reportMetadata[index].idsite;
site.group = reportMetadata[index].group;
site.main_url = reportMetadata[index].main_url;
- // casting evolution to int fixes sorting, see: http://dev.piwik.org/trac/ticket/4885
+ // casting evolution to int fixes sorting, see: https://github.com/piwik/piwik/issues/4885
site.visits_evolution = parseInt(site.visits_evolution, 10);
site.pageviews_evolution = parseInt(site.pageviews_evolution, 10);
site.revenue_evolution = parseInt(site.revenue_evolution, 10);
diff --git a/plugins/Transitions/javascripts/transitions.js b/plugins/Transitions/javascripts/transitions.js
index eef37f4320..174bce2474 100644
--- a/plugins/Transitions/javascripts/transitions.js
+++ b/plugins/Transitions/javascripts/transitions.js
@@ -46,11 +46,12 @@ DataTable_RowActions_Transitions.prototype.trigger = function (tr, e, subTableLa
}
};
-DataTable_RowAction.prototype.performAction = function (label, tr, e) {
+DataTable_RowActions_Transitions.prototype.performAction = function (label, tr, e) {
var separator = ' > '; // LabelFilter::SEPARATOR_RECURSIVE_LABEL
var labelParts = label.split(separator);
for (var i = 0; i < labelParts.length; i++) {
- labelParts[i] = $.trim(decodeURIComponent(labelParts[i]));
+ var labelPart = labelParts[i].replace('@', '');
+ labelParts[i] = $.trim(decodeURIComponent(labelPart));
}
label = labelParts.join(piwik.config.action_url_category_delimiter);
this.openPopover('title:' + label);
diff --git a/tests/PHPUnit/ConsoleCommandTestCase.php b/tests/PHPUnit/ConsoleCommandTestCase.php
index 4ff21b4caf..504d37da95 100644
--- a/tests/PHPUnit/ConsoleCommandTestCase.php
+++ b/tests/PHPUnit/ConsoleCommandTestCase.php
@@ -33,7 +33,7 @@ use Symfony\Component\Console\Tester\ApplicationTester;
* // other checks
* }
*/
-class ConsoleCommandTestCase extends \IntegrationTestCase
+class ConsoleCommandTestCase extends IntegrationTestCase
{
protected $applicationTester = null;
diff --git a/tests/PHPUnit/Core/DateTest.php b/tests/PHPUnit/Core/DateTest.php
index 436b27ef59..f208e90c28 100644
--- a/tests/PHPUnit/Core/DateTest.php
+++ b/tests/PHPUnit/Core/DateTest.php
@@ -61,8 +61,8 @@ class DateTest extends PHPUnit_Framework_TestCase
$this->assertEquals($dateExpected->getDatetime(), $date->getDatetime());
// Congo is in UTC+1 all year long (no DST)
- $date = Date::factory('now', 'Africa/Brazzaville');
$dateExpected = Date::factory('now')->addHour(1);
+ $date = Date::factory('now', 'Africa/Brazzaville');
$this->assertEquals($dateExpected->getDatetime(), $date->getDatetime());
// yesterday same time in Congo is the same as today in Congo - 24 hours
diff --git a/tests/PHPUnit/Core/ReleaseCheckListTest.php b/tests/PHPUnit/Core/ReleaseCheckListTest.php
index 67dc9efe28..97aeace84a 100644
--- a/tests/PHPUnit/Core/ReleaseCheckListTest.php
+++ b/tests/PHPUnit/Core/ReleaseCheckListTest.php
@@ -306,7 +306,7 @@ class ReleaseCheckListTest extends PHPUnit_Framework_TestCase
public function testPiwikJavaScript()
{
// check source against Snort rule 8443
- // @see http://dev.piwik.org/trac/ticket/2203
+ // @see https://github.com/piwik/piwik/issues/2203
$pattern = '/\x5b\x5c{2}.*\x5c{2}[\x22\x27]/';
$contents = file_get_contents(PIWIK_DOCUMENT_ROOT . '/js/piwik.js');
diff --git a/tests/PHPUnit/Core/ServeStaticFileTest.php b/tests/PHPUnit/Core/ServeStaticFileTest.php
index dd872cfae6..ef65358d6b 100644
--- a/tests/PHPUnit/Core/ServeStaticFileTest.php
+++ b/tests/PHPUnit/Core/ServeStaticFileTest.php
@@ -15,6 +15,7 @@
use Piwik\ProxyHttp;
use Piwik\SettingsServer;
+use Piwik\Tests\Fixture;
define("TEST_FILE_LOCATION", realpath(dirname(__FILE__) . "/../../resources/lipsum.txt"));
define("TEST_FILE_CONTENT_TYPE", "text/plain");
diff --git a/tests/PHPUnit/DatabaseTestCase.php b/tests/PHPUnit/DatabaseTestCase.php
index 123f01acaa..21d695e751 100644
--- a/tests/PHPUnit/DatabaseTestCase.php
+++ b/tests/PHPUnit/DatabaseTestCase.php
@@ -6,6 +6,7 @@
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
use Piwik\Db;
+use Piwik\Tests\Fixture;
/**
* Tests extending DatabaseTestCase are much slower to run: the setUp will
diff --git a/tests/PHPUnit/FakeAccess.php b/tests/PHPUnit/FakeAccess.php
index 7f652f0ae5..d576da702f 100644
--- a/tests/PHPUnit/FakeAccess.php
+++ b/tests/PHPUnit/FakeAccess.php
@@ -169,5 +169,4 @@ class FakeAccess
}
return $result;
}
-
-}
+} \ No newline at end of file
diff --git a/tests/PHPUnit/Fixture.php b/tests/PHPUnit/Fixture.php
index e68ff787e9..b12516136d 100644
--- a/tests/PHPUnit/Fixture.php
+++ b/tests/PHPUnit/Fixture.php
@@ -5,6 +5,8 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests;
+
use Piwik\Access;
use Piwik\Common;
use Piwik\Config;
@@ -29,6 +31,11 @@ use Piwik\Site;
use Piwik\Tracker\Cache;
use Piwik\Translate;
use Piwik\Url;
+use PHPUnit_Framework_Assert;
+use Piwik_TestingEnvironment;
+use FakeAccess;
+use PiwikTracker;
+use Piwik_LocalTracker;
use Piwik\Updater;
use Piwik\Plugins\CoreUpdater\CoreUpdater;
@@ -794,15 +801,35 @@ class Fixture extends PHPUnit_Framework_Assert
}
return $result;
}
-}
-// TODO: remove when other plugins don't use BaseFixture
-class Test_Piwik_BaseFixture extends Fixture
-{
+ public static function updateDatabase($force = false)
+ {
+ if ($force) {
+ // remove version options to force update
+ Option::deleteLike('version%');
+ Option::set('version_core', '0.0');
+ }
+
+ $updater = new Updater();
+ $componentsWithUpdateFile = CoreUpdater::getComponentUpdates($updater);
+ if (empty($componentsWithUpdateFile)) {
+ return false;
+ }
+
+ $result = CoreUpdater::updateComponents($updater, $componentsWithUpdateFile);
+ if (!empty($result['coreError'])
+ || !empty($result['warnings'])
+ || !empty($result['errors'])
+ ) {
+ throw new \Exception("Failed to update database (errors or warnings found): " . print_r($result, true));
+ }
+
+ return $result;
+ }
}
// needed by tests that use stored segments w/ the proxy index.php
-class Test_Access_OverrideLogin extends Access
+class OverrideLogin extends Access
{
public function getLogin()
{
diff --git a/tests/PHPUnit/Fixtures/FewVisitsWithSetVisitorId.php b/tests/PHPUnit/Fixtures/FewVisitsWithSetVisitorId.php
index ab5e02a7ed..8d895228b4 100644
--- a/tests/PHPUnit/Fixtures/FewVisitsWithSetVisitorId.php
+++ b/tests/PHPUnit/Fixtures/FewVisitsWithSetVisitorId.php
@@ -5,13 +5,18 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Fixtures;
+
use Piwik\Date;
use Piwik\Tracker\Visit;
+use Piwik\Tests\Fixture;
+use PiwikTracker;
+use Exception;
/**
* Adds one site and tracks a couple visits using a custom visitor ID.
*/
-class Test_Piwik_Fixture_FewVisitsWithSetVisitorId extends Fixture
+class FewVisitsWithSetVisitorId extends Fixture
{
public $idSite = 1;
public $dateTime = '2010-03-06 11:22:33';
@@ -87,4 +92,4 @@ class Test_Piwik_Fixture_FewVisitsWithSetVisitorId extends Fixture
//OK
}
}
-}
+} \ No newline at end of file
diff --git a/tests/PHPUnit/Fixtures/InvalidVisits.php b/tests/PHPUnit/Fixtures/InvalidVisits.php
index 75015a0766..adf068d5d3 100644
--- a/tests/PHPUnit/Fixtures/InvalidVisits.php
+++ b/tests/PHPUnit/Fixtures/InvalidVisits.php
@@ -5,14 +5,18 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Fixtures;
+
use Piwik\Http;
use Piwik\Plugins\SitesManager\API;
+use Piwik\Tests\Fixture;
+use Exception;
/**
* Adds one site and sends several invalid tracking requests. The result should be
* one website with no visits.
*/
-class Test_Piwik_Fixture_InvalidVisits extends Fixture
+class InvalidVisits extends Fixture
{
public $idSite = 1;
public $dateTime = '2009-01-04 00:11:42';
@@ -107,4 +111,4 @@ class Test_Piwik_Fixture_InvalidVisits extends Fixture
$t->setAttributionInfo(json_encode(array()));
}
-}
+} \ No newline at end of file
diff --git a/tests/PHPUnit/Fixtures/ManySitesImportedLogs.php b/tests/PHPUnit/Fixtures/ManySitesImportedLogs.php
index a43d12661d..33e13f7999 100644
--- a/tests/PHPUnit/Fixtures/ManySitesImportedLogs.php
+++ b/tests/PHPUnit/Fixtures/ManySitesImportedLogs.php
@@ -5,16 +5,20 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Fixtures;
+
use Piwik\Access;
use Piwik\Plugins\Goals\API as APIGoals;
use Piwik\Plugins\SegmentEditor\API as APISegmentEditor;
use Piwik\Plugins\UserCountry\LocationProvider\GeoIp;
use Piwik\Plugins\UserCountry\LocationProvider;
+use Piwik\Tests\Fixture;
+use Piwik\Tests\OverrideLogin;
/**
* Imports visits from several log files using the python log importer.
*/
-class Test_Piwik_Fixture_ManySitesImportedLogs extends Fixture
+class ManySitesImportedLogs extends Fixture
{
public $dateTime = '2012-08-09 11:22:33';
public $idSite = 1;
@@ -26,7 +30,7 @@ class Test_Piwik_Fixture_ManySitesImportedLogs extends Fixture
public static function createAccessInstance()
{
- Access::setSingletonInstance($access = new Test_Access_OverrideLogin());
+ Access::setSingletonInstance($access = new OverrideLogin());
\Piwik\Piwik::postEvent('Request.initAuthenticationObject');
}
@@ -47,7 +51,7 @@ class Test_Piwik_Fixture_ManySitesImportedLogs extends Fixture
{
LocationProvider::$providers = null;
GeoIp::$geoIPDatabaseDir = 'tests/lib/geoip-files';
- Test_Piwik_Fixture_ManyVisitsWithGeoIP::unsetLocationProvider();
+ ManyVisitsWithGeoIP::unsetLocationProvider();
}
public function setUpWebsitesAndGoals()
@@ -225,5 +229,4 @@ class Test_Piwik_Fixture_ManySitesImportedLogs extends Fixture
self::executeLogImporter($logFile, $opts);
}
-
-}
+} \ No newline at end of file
diff --git a/tests/PHPUnit/Fixtures/ManySitesImportedLogsWithXssAttempts.php b/tests/PHPUnit/Fixtures/ManySitesImportedLogsWithXssAttempts.php
index 83695ef531..4ed24f8573 100644
--- a/tests/PHPUnit/Fixtures/ManySitesImportedLogsWithXssAttempts.php
+++ b/tests/PHPUnit/Fixtures/ManySitesImportedLogsWithXssAttempts.php
@@ -5,10 +5,13 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Fixtures;
+
use Piwik\Date;
use Piwik\Db;
use Piwik\Plugins\Annotations\API as APIAnnotations;
use Piwik\Plugins\Goals\API as APIGoals;
+use Piwik\Tests\Fixture;
require_once PIWIK_INCLUDE_PATH . '/tests/PHPUnit/Fixtures/ManySitesImportedLogs.php';
@@ -16,7 +19,7 @@ require_once PIWIK_INCLUDE_PATH . '/tests/PHPUnit/Fixtures/ManySitesImportedLogs
* Imports visits from several log files using the python log importer &
* adds goals/sites/etc. attempting to create XSS.
*/
-class Test_Piwik_Fixture_ManySitesImportedLogsWithXssAttempts extends Test_Piwik_Fixture_ManySitesImportedLogs
+class ManySitesImportedLogsWithXssAttempts extends ManySitesImportedLogs
{
public $now = null;
@@ -117,4 +120,4 @@ class Test_Piwik_Fixture_ManySitesImportedLogsWithXssAttempts extends Test_Piwik
$t->setLongitude(-46.64);
self::checkResponse($t->doTrackPageView('incredible title!'));
}
-}
+} \ No newline at end of file
diff --git a/tests/PHPUnit/Fixtures/ManyVisitsWithGeoIP.php b/tests/PHPUnit/Fixtures/ManyVisitsWithGeoIP.php
index e938edb86c..3e064ae095 100644
--- a/tests/PHPUnit/Fixtures/ManyVisitsWithGeoIP.php
+++ b/tests/PHPUnit/Fixtures/ManyVisitsWithGeoIP.php
@@ -5,11 +5,14 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Fixtures;
use Piwik\Date;
use Piwik\Plugins\Goals\API;
use Piwik\Plugins\UserCountry\LocationProvider\GeoIp;
use Piwik\Plugins\UserCountry\LocationProvider;
+use Piwik\Tests\Fixture;
+use Exception;
require_once PIWIK_INCLUDE_PATH . '/tests/PHPUnit/MockLocationProvider.php';
@@ -17,7 +20,7 @@ require_once PIWIK_INCLUDE_PATH . '/tests/PHPUnit/MockLocationProvider.php';
* Adds one new website and tracks 35 visits from 18 visitors with geolocation using
* free GeoIP databases. The GeoIP databases are downloaded if they do not exist already.
*/
-class Test_Piwik_Fixture_ManyVisitsWithGeoIP extends Fixture
+class ManyVisitsWithGeoIP extends Fixture
{
const GEOIP_IMPL_TO_TEST = 'geoip_php';
@@ -207,7 +210,7 @@ class Test_Piwik_Fixture_ManyVisitsWithGeoIP extends Fixture
{
LocationProvider::$providers = null;
LocationProvider::setCurrentProvider('mock_provider');
- MockLocationProvider::$locations = array(
+ \MockLocationProvider::$locations = array(
self::makeLocation('Stratford-upon-Avon', 'P3', 'gb', 123.456, 21.321), // template location
// same region, different city, same country
@@ -251,5 +254,4 @@ class Test_Piwik_Fixture_ManyVisitsWithGeoIP extends Fixture
// ignore error
}
}
-
-}
+} \ No newline at end of file
diff --git a/tests/PHPUnit/Fixtures/ManyVisitsWithMockLocationProvider.php b/tests/PHPUnit/Fixtures/ManyVisitsWithMockLocationProvider.php
index ebbaf380f3..b53d88d25f 100644
--- a/tests/PHPUnit/Fixtures/ManyVisitsWithMockLocationProvider.php
+++ b/tests/PHPUnit/Fixtures/ManyVisitsWithMockLocationProvider.php
@@ -5,16 +5,18 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Fixtures;
use Piwik\Date;
use Piwik\Plugins\UserCountry\LocationProvider;
+use Piwik\Tests\Fixture;
require_once PIWIK_INCLUDE_PATH . '/tests/PHPUnit/MockLocationProvider.php';
/**
* Adds one site and tracks 60 visits (15 visitors, one action per visit).
*/
-class Test_Piwik_Fixture_ManyVisitsWithMockLocationProvider extends Fixture
+class ManyVisitsWithMockLocationProvider extends Fixture
{
public $idSite = 1;
public $dateTime = '2010-01-03 01:22:33';
@@ -34,7 +36,7 @@ class Test_Piwik_Fixture_ManyVisitsWithMockLocationProvider extends Fixture
public function tearDown()
{
- Test_Piwik_Fixture_ManyVisitsWithGeoIP::unsetLocationProvider();
+ ManyVisitsWithGeoIP::unsetLocationProvider();
}
private function setUpWebsitesAndGoals()
@@ -208,7 +210,7 @@ class Test_Piwik_Fixture_ManyVisitsWithMockLocationProvider extends Fixture
private function setMockLocationProvider()
{
LocationProvider::setCurrentProvider('mock_provider');
- MockLocationProvider::$locations = array(
+ \MockLocationProvider::$locations = array(
self::makeLocation('Toronto', 'ON', 'CA', $lat = null, $long = null, $isp = 'comcast.net'),
self::makeLocation('Nice', 'B8', 'FR', $lat = null, $long = null, $isp = 'comcast.net'),
@@ -218,5 +220,4 @@ class Test_Piwik_Fixture_ManyVisitsWithMockLocationProvider extends Fixture
self::makeLocation('Yokohama', '19', 'JP'),
);
}
-
-}
+} \ No newline at end of file
diff --git a/tests/PHPUnit/Fixtures/ManyVisitsWithSubDirReferrersAndCustomVars.php b/tests/PHPUnit/Fixtures/ManyVisitsWithSubDirReferrersAndCustomVars.php
index 95eddf823f..88f673831c 100644
--- a/tests/PHPUnit/Fixtures/ManyVisitsWithSubDirReferrersAndCustomVars.php
+++ b/tests/PHPUnit/Fixtures/ManyVisitsWithSubDirReferrersAndCustomVars.php
@@ -5,14 +5,16 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
-#
+namespace Piwik\Tests\Fixtures;
+
use Piwik\Date;
+use Piwik\Tests\Fixture;
/**
* Adds one site and tracks 13 visits all with custom variables and referrer URLs
* w/ sub-dirs (ie, /path/to/page/has/many/dirs.htm).
*/
-class Test_Piwik_Fixture_ManyVisitsWithSubDirReferrersAndCustomVars extends Fixture
+class ManyVisitsWithSubDirReferrersAndCustomVars extends Fixture
{
public $dateTime = '2010-03-05 11:22:33';
public $idSite = 1;
@@ -65,4 +67,4 @@ class Test_Piwik_Fixture_ManyVisitsWithSubDirReferrersAndCustomVars extends Fixt
$t->setUrl('http://example.org/page1.html');
self::checkResponse($t->doTrackPageView('title'));
}
-}
+} \ No newline at end of file
diff --git a/tests/PHPUnit/Fixtures/OmniFixture.php b/tests/PHPUnit/Fixtures/OmniFixture.php
index 0de39fd69f..406deb77bc 100644
--- a/tests/PHPUnit/Fixtures/OmniFixture.php
+++ b/tests/PHPUnit/Fixtures/OmniFixture.php
@@ -8,13 +8,18 @@
namespace Piwik\Tests\Fixtures;
use Piwik\Date;
+use Piwik\Access;
+use Piwik\Option;
use ReflectionClass;
+use Piwik\Plugins\VisitsSummary\API as VisitsSummaryAPI;
+use Piwik\Tests\Fixture;
+use Piwik\Tests\OverrideLogin;
/**
* This fixture is the combination of every other fixture defined by Piwik. Should be used
* with year periods.
*/
-class OmniFixture extends \Fixture
+class OmniFixture extends Fixture
{
public $month = '2012-01';
public $idSite = 'all';
@@ -42,10 +47,11 @@ class OmniFixture extends \Fixture
&& $className != __CLASS__
&& $className != "Piwik_Test_Fixture_SqlDump"
&& $className != "Piwik\\Tests\\Fixtures\\UpdaterTestFixture"
+ && $className != "Piwik\\Tests\\Fixtures\\UITestFixture"
) {
$klassReflect = new ReflectionClass($className);
if (!strpos($klassReflect->getFilename(), "tests/PHPUnit/Fixtures")
- && $className != "Test_Piwik_Fixture_CustomAlerts"
+ && $className != "CustomAlerts"
&& $className != "Piwik\\Plugins\\Insights\\tests\\Fixtures\\SomeVisitsDifferentPathsOnTwoDays"
) {
continue;
@@ -64,12 +70,12 @@ class OmniFixture extends \Fixture
}
}
- $this->now = $this->fixtures['Test_Piwik_Fixture_ManySitesImportedLogsWithXssAttempts']->now;
+ $this->now = $this->fixtures['ManySitesImportedLogsWithXssAttempts']->now;
- // make sure Test_Piwik_Fixture_ManySitesImportedLogsWithXssAttempts is the first fixture
- $fixture = $this->fixtures['Test_Piwik_Fixture_ManySitesImportedLogsWithXssAttempts'];
- unset($this->fixtures['Test_Piwik_Fixture_ManySitesImportedLogsWithXssAttempts']);
- $this->fixtures = array_merge(array('Test_Piwik_Fixture_ManySitesImportedLogsWithXssAttempts' => $fixture), $this->fixtures);
+ // make sure ManySitesImportedLogsWithXssAttempts is the first fixture
+ $fixture = $this->fixtures['Piwik\\Tests\\Fixtures\\ManySitesImportedLogsWithXssAttempts'];
+ unset($this->fixtures['Piwik\\Tests\\Fixtures\\ManySitesImportedLogsWithXssAttempts']);
+ $this->fixtures = array_merge(array('Piwik\\Tests\\Fixtures\\ManySitesImportedLogsWithXssAttempts' => $fixture), $this->fixtures);
}
private function adjustDateTime($dateTime, $adjustToDate)
@@ -87,6 +93,13 @@ class OmniFixture extends \Fixture
foreach ($this->fixtures as $fixture) {
$fixture->setUp();
}
+
+ Option::set("Tests.forcedNowTimestamp", $this->now->getTimestamp());
+
+ // launch archiving so tests don't run out of time
+ $date = Date::factory($this->dateTime)->toString();
+ VisitsSummaryAPI::getInstance()->get($this->idSite, 'year', $date);
+ VisitsSummaryAPI::getInstance()->get($this->idSite, 'year', $date, urlencode($this->segment));
}
public function tearDown()
@@ -95,4 +108,10 @@ class OmniFixture extends \Fixture
$fixture->tearDown();
}
}
+
+ public static function createAccessInstance()
+ {
+ Access::setSingletonInstance($access = new OverrideLogin());
+ \Piwik\Piwik::postEvent('Request.initAuthenticationObject');
+ }
} \ No newline at end of file
diff --git a/tests/PHPUnit/Fixtures/OneVisitSeveralPageViews.php b/tests/PHPUnit/Fixtures/OneVisitSeveralPageViews.php
index ae0618d5c5..c4ed1564a0 100644
--- a/tests/PHPUnit/Fixtures/OneVisitSeveralPageViews.php
+++ b/tests/PHPUnit/Fixtures/OneVisitSeveralPageViews.php
@@ -5,12 +5,15 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Fixtures;
+
use Piwik\Date;
+use Piwik\Tests\Fixture;
/**
* Adds one site and tracks one visit with several pageviews.
*/
-class Test_Piwik_Fixture_OneVisitSeveralPageViews extends Fixture
+class OneVisitSeveralPageViews extends Fixture
{
public $dateTime = '2010-03-06 11:22:33';
public $idSite = 1;
@@ -66,16 +69,24 @@ class Test_Piwik_Fixture_OneVisitSeveralPageViews extends Fixture
$t->setUrl('http://example.org/dir2/sub/0/file.php');
$t->setForceVisitDateTime(Date::factory($dateTime)->addHour(0.4)->getDatetime());
-
// Very high Generation time should be ignored
$t->setGenerationTime(6350000);
self::checkResponse($t->doTrackPageView('incredible title! <>,;'));
+ // visit terminal & branch pages w/ the same name so we can test the ! label filter query operator
+ $t->setUrl('http://example.org/dir/subdir/');
+ $t->setForceVisitDateTime(Date::factory($dateTime)->addHour(0.41)->getDatetime());
+ $t->setGenerationTime(233);
+ self::checkResponse($t->doTrackPageView('check <> / @one@ / two'));
+
+ $t->setUrl('http://example.org/dir/subdir');
+ $t->setForceVisitDateTime(Date::factory($dateTime)->addHour(0.42)->getDatetime());
+ $t->setGenerationTime(333);
+ self::checkResponse($t->doTrackPageView('check <> / @one@'));
$t->setUrl('http://example.org/0');
$t->setForceVisitDateTime(Date::factory($dateTime)->addHour(0.4)->getDatetime());
$t->setGenerationTime(635);
self::checkResponse($t->doTrackPageView('I am URL zero!'));
-
}
-}
+} \ No newline at end of file
diff --git a/tests/PHPUnit/Fixtures/OneVisitWithAbnormalPageviewUrls.php b/tests/PHPUnit/Fixtures/OneVisitWithAbnormalPageviewUrls.php
index 0dcacc45a9..7a316bcc78 100644
--- a/tests/PHPUnit/Fixtures/OneVisitWithAbnormalPageviewUrls.php
+++ b/tests/PHPUnit/Fixtures/OneVisitWithAbnormalPageviewUrls.php
@@ -5,13 +5,16 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Fixtures;
+
use Piwik\Date;
+use Piwik\Tests\Fixture;
/**
* Adds one site and tracks one visit w/ pageview URLs that are not normalized.
* These URLs use different protocols and a mix of lowercase & uppercase letters.
*/
-class Test_Piwik_Fixture_OneVisitWithAbnormalPageviewUrls extends Fixture
+class OneVisitWithAbnormalPageviewUrls extends Fixture
{
public $dateTime = '2010-03-06 11:22:33';
public $idSite = 1;
@@ -64,4 +67,4 @@ class Test_Piwik_Fixture_OneVisitWithAbnormalPageviewUrls extends Fixture
$t->setForceVisitDateTime(Date::factory($dateTime)->addHour(0.6)->getDatetime());
self::checkResponse($t->doTrackPageView('incredible.title/'));
}
-}
+} \ No newline at end of file
diff --git a/tests/PHPUnit/Fixtures/OneVisitorTwoVisits.php b/tests/PHPUnit/Fixtures/OneVisitorTwoVisits.php
index 5626d5e9ed..50f576b33f 100644
--- a/tests/PHPUnit/Fixtures/OneVisitorTwoVisits.php
+++ b/tests/PHPUnit/Fixtures/OneVisitorTwoVisits.php
@@ -5,14 +5,17 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Fixtures;
+
use Piwik\Date;
use Piwik\Plugins\Goals\API as APIGoals;
use Piwik\Plugins\SitesManager\API as APISitesManager;
+use Piwik\Tests\Fixture;
/**
* This fixture adds one website and tracks two visits by one visitor.
*/
-class Test_Piwik_Fixture_OneVisitorTwoVisits extends Fixture
+class OneVisitorTwoVisits extends Fixture
{
public $idSite = 1;
public $idSiteEmptyBis;
@@ -175,4 +178,4 @@ class Test_Piwik_Fixture_OneVisitorTwoVisits extends Fixture
// -
// End of second visit
}
-}
+} \ No newline at end of file
diff --git a/tests/PHPUnit/Fixtures/SomeVisitsAllConversions.php b/tests/PHPUnit/Fixtures/SomeVisitsAllConversions.php
index 462fd2a4b2..74254a586e 100644
--- a/tests/PHPUnit/Fixtures/SomeVisitsAllConversions.php
+++ b/tests/PHPUnit/Fixtures/SomeVisitsAllConversions.php
@@ -5,13 +5,16 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Fixtures;
+
use Piwik\Date;
use Piwik\Plugins\Goals\API;
+use Piwik\Tests\Fixture;
/**
* Adds one site and tracks a couple conversions.
*/
-class Piwik_Test_Fixture_SomeVisitsAllConversions extends Fixture
+class SomeVisitsAllConversions extends Fixture
{
public $dateTime = '2009-01-04 00:11:42';
public $idSite = 1;
@@ -91,4 +94,4 @@ class Piwik_Test_Fixture_SomeVisitsAllConversions extends Fixture
$t->setForceNewVisit();
$t->doTrackPageView('This is tracked in a new visit.');
}
-}
+} \ No newline at end of file
diff --git a/tests/PHPUnit/Fixtures/SomeVisitsCustomVariablesCampaignsNotHeuristics.php b/tests/PHPUnit/Fixtures/SomeVisitsCustomVariablesCampaignsNotHeuristics.php
index 6e295b45ba..53db8ca2f5 100644
--- a/tests/PHPUnit/Fixtures/SomeVisitsCustomVariablesCampaignsNotHeuristics.php
+++ b/tests/PHPUnit/Fixtures/SomeVisitsCustomVariablesCampaignsNotHeuristics.php
@@ -5,14 +5,18 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Fixtures;
+
use Piwik\Date;
use Piwik\Plugins\Goals\API;
+use Piwik\Tests\Fixture;
+use PiwikTracker;
/**
* Add one site and track many visits with custom variables & campaign IDs and
* use visit ID instead of heuristics.
*/
-class Test_Piwik_Fixture_SomeVisitsCustomVariablesCampaignsNotHeuristics extends Fixture
+class SomeVisitsCustomVariablesCampaignsNotHeuristics extends Fixture
{
public $dateTime = '2009-01-04 00:11:42';
public $idSite = 1;
@@ -164,4 +168,4 @@ class Test_Piwik_Fixture_SomeVisitsCustomVariablesCampaignsNotHeuristics extends
unset($_COOKIE[$refCookieName]);
unset($_COOKIE[$customVarCookieName]);
}
-}
+} \ No newline at end of file
diff --git a/tests/PHPUnit/Fixtures/SomeVisitsManyPageviewsWithTransitions.php b/tests/PHPUnit/Fixtures/SomeVisitsManyPageviewsWithTransitions.php
index 01748bb907..1791b43750 100644
--- a/tests/PHPUnit/Fixtures/SomeVisitsManyPageviewsWithTransitions.php
+++ b/tests/PHPUnit/Fixtures/SomeVisitsManyPageviewsWithTransitions.php
@@ -5,13 +5,16 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Fixtures;
+
use Piwik\Date;
+use Piwik\Tests\Fixture;
/**
* Adds one site and tracks a couple visits with many pageviews. The
* pageviews are designed to have many transitions between pages.
*/
-class Test_Piwik_Fixture_SomeVisitsManyPageviewsWithTransitions extends Fixture
+class SomeVisitsManyPageviewsWithTransitions extends Fixture
{
public $dateTime = '2010-03-06 11:22:33';
public $idSite = 1;
@@ -150,4 +153,4 @@ class Test_Piwik_Fixture_SomeVisitsManyPageviewsWithTransitions extends Fixture
self::assertTrue($visit->doTrackEvent($searchCategory, "event name", $searchKeyword, $this->prefixCounter));
}
}
-}
+} \ No newline at end of file
diff --git a/tests/PHPUnit/Fixtures/SomeVisitsWithLongUrls.php b/tests/PHPUnit/Fixtures/SomeVisitsWithLongUrls.php
index 58f90494c1..6d5e2556b3 100644
--- a/tests/PHPUnit/Fixtures/SomeVisitsWithLongUrls.php
+++ b/tests/PHPUnit/Fixtures/SomeVisitsWithLongUrls.php
@@ -5,13 +5,16 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Fixtures;
+
use Piwik\Date;
+use Piwik\Tests\Fixture;
/**
* Adds one site and tracks 7 visits w/ some long-ish urls (as page urls and
* referrer urls).
*/
-class Test_Piwik_Fixture_SomeVisitsWithLongUrls extends Fixture
+class SomeVisitsWithLongUrls extends Fixture
{
public $dateTime = '2010-03-06 01:22:33';
public $idSite = 1;
@@ -102,4 +105,4 @@ class Test_Piwik_Fixture_SomeVisitsWithLongUrls extends Fixture
$t->setUrlReferrer('http://nz.bing.com/images/search?q=+++Kia+ora+++');
self::checkResponse($t->doTrackPageView('incredible title!'));
}
-}
+} \ No newline at end of file
diff --git a/tests/PHPUnit/Fixtures/SomeVisitsWithNonUnicodePageTitles.php b/tests/PHPUnit/Fixtures/SomeVisitsWithNonUnicodePageTitles.php
index 7dc9d2e9cf..60969e7041 100644
--- a/tests/PHPUnit/Fixtures/SomeVisitsWithNonUnicodePageTitles.php
+++ b/tests/PHPUnit/Fixtures/SomeVisitsWithNonUnicodePageTitles.php
@@ -5,13 +5,16 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Fixtures;
+
use Piwik\Date;
use Piwik\Plugins\SitesManager\API;
+use Piwik\Tests\Fixture;
/**
* Adds one website and some visits with non unicode page titles.
*/
-class Test_Piwik_Fixture_SomeVisitsWithNonUnicodePageTitles extends Fixture
+class SomeVisitsWithNonUnicodePageTitles extends Fixture
{
public $idSite1 = 1;
public $dateTime = '2010-01-03 11:22:33';
@@ -99,4 +102,4 @@ class Test_Piwik_Fixture_SomeVisitsWithNonUnicodePageTitles extends Fixture
self::checkResponse($visitor->doTrackPageView('Site Search results'));
$visitor->setPageCharset('');
}
-}
+} \ No newline at end of file
diff --git a/tests/PHPUnit/Fixtures/SqlDump.php b/tests/PHPUnit/Fixtures/SqlDump.php
index 9113d5e4e7..7aea83b781 100644
--- a/tests/PHPUnit/Fixtures/SqlDump.php
+++ b/tests/PHPUnit/Fixtures/SqlDump.php
@@ -5,15 +5,19 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Fixtures;
+
use Piwik\ArchiveProcessor\Rules;
use Piwik\Config;
use Piwik\Db;
use Piwik\Piwik;
+use Piwik\Tests\Fixture;
+use Exception;
/**
* Reusable fixture. Loads a SQL dump into the DB.
*/
-class Piwik_Test_Fixture_SqlDump extends Fixture
+class SqlDump extends Fixture
{
public $date = '2012-09-03';
public $dateTime = '2012-09-03';
diff --git a/tests/PHPUnit/Fixtures/ThreeGoalsOnePageview.php b/tests/PHPUnit/Fixtures/ThreeGoalsOnePageview.php
index 6c4e318341..ac7abb6a4f 100644
--- a/tests/PHPUnit/Fixtures/ThreeGoalsOnePageview.php
+++ b/tests/PHPUnit/Fixtures/ThreeGoalsOnePageview.php
@@ -5,14 +5,17 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Fixtures;
+
use Piwik\Date;
use Piwik\Plugins\Goals\API;
+use Piwik\Tests\Fixture;
/**
* Fixture that adds one site with three goals and tracks one pageview & one manual
* goal conversion.
*/
-class Test_Piwik_Fixture_ThreeGoalsOnePageview extends Fixture
+class ThreeGoalsOnePageview extends Fixture
{
public $dateTime = '2009-01-04 00:11:42';
public $idSite = 1;
@@ -67,4 +70,4 @@ class Test_Piwik_Fixture_ThreeGoalsOnePageview extends Fixture
$t->setForceVisitDateTime(Date::factory($this->dateTime)->addHour(0.3)->getDatetime());
self::checkResponse($t->doTrackGoal($this->idGoal3, $revenue = 42.256));
}
-}
+} \ No newline at end of file
diff --git a/tests/PHPUnit/Fixtures/ThreeSitesWithManyVisitsWithSiteSearch.php b/tests/PHPUnit/Fixtures/ThreeSitesWithManyVisitsWithSiteSearch.php
index 20c03a585a..f330218f9a 100644
--- a/tests/PHPUnit/Fixtures/ThreeSitesWithManyVisitsWithSiteSearch.php
+++ b/tests/PHPUnit/Fixtures/ThreeSitesWithManyVisitsWithSiteSearch.php
@@ -5,14 +5,17 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Fixtures;
+
use Piwik\Date;
use Piwik\Plugins\SitesManager\API;
+use Piwik\Tests\Fixture;
/**
* Adds three websites with different site search configurations and adds
* several visits to each of them.
*/
-class Test_Piwik_Fixture_ThreeSitesWithManyVisitsWithSiteSearch extends Fixture
+class ThreeSitesWithManyVisitsWithSiteSearch extends Fixture
{
public $idSite1 = 1;
public $idSite2 = 2;
@@ -205,6 +208,4 @@ class Test_Piwik_Fixture_ThreeSitesWithManyVisitsWithSiteSearch extends Fixture
$visitor->setUrl('http://example.org/index.htm?' . $crazyTitle);
self::checkResponse($visitor->doTrackPageView('Pageview: ' . $crazyTitle));
}
-
-}
-
+} \ No newline at end of file
diff --git a/tests/PHPUnit/Fixtures/TwoSitesEcommerceOrderWithItems.php b/tests/PHPUnit/Fixtures/TwoSitesEcommerceOrderWithItems.php
index 9481cd9f2e..938fe28c86 100644
--- a/tests/PHPUnit/Fixtures/TwoSitesEcommerceOrderWithItems.php
+++ b/tests/PHPUnit/Fixtures/TwoSitesEcommerceOrderWithItems.php
@@ -5,13 +5,16 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Fixtures;
+
use Piwik\Date;
use Piwik\Plugins\Goals\API;
+use Piwik\Tests\Fixture;
/**
* Adds two sites and tracks some visits with ecommerce orders.
*/
-class Test_Piwik_Fixture_TwoSitesEcommerceOrderWithItems extends Fixture
+class TwoSitesEcommerceOrderWithItems extends Fixture
{
public $dateTime = '2011-04-05 00:11:42';
public $idSite = 1;
@@ -207,9 +210,5 @@ class Test_Piwik_Fixture_TwoSitesEcommerceOrderWithItems extends Fixture
$t->setForceVisitDateTime(Date::factory($this->dateTime)->addHour(30.9)->getDatetime());
$t->addEcommerceItem($sku = 'TRIPOD SKU', $name = 'TRIPOD - bought day after', $category = 'Tools', $price = 100, $quantity = 2);
self::checkResponse($t->doTrackEcommerceOrder($orderId = '777', $grandTotal = 250));
- //------------------------------------- End tracking
-
-
}
-}
-
+} \ No newline at end of file
diff --git a/tests/PHPUnit/Fixtures/TwoSitesManyVisitsOverSeveralDaysWithSearchEngineReferrers.php b/tests/PHPUnit/Fixtures/TwoSitesManyVisitsOverSeveralDaysWithSearchEngineReferrers.php
index 326ca69d66..3ff7b56fa4 100644
--- a/tests/PHPUnit/Fixtures/TwoSitesManyVisitsOverSeveralDaysWithSearchEngineReferrers.php
+++ b/tests/PHPUnit/Fixtures/TwoSitesManyVisitsOverSeveralDaysWithSearchEngineReferrers.php
@@ -5,14 +5,17 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Fixtures;
+
use Piwik\Date;
use Piwik\Plugins\Goals\API;
+use Piwik\Tests\Fixture;
/**
* Adds one website and tracks visits on different days over a month
* using referrer URLs with search engines.
*/
-class Test_Piwik_Fixture_TwoSitesManyVisitsOverSeveralDaysWithSearchEngineReferrers extends Fixture
+class TwoSitesManyVisitsOverSeveralDaysWithSearchEngineReferrers extends Fixture
{
public $dateTime = '2010-02-01 11:22:33';
public $idSite = 1;
@@ -108,4 +111,4 @@ class Test_Piwik_Fixture_TwoSitesManyVisitsOverSeveralDaysWithSearchEngineReferr
}
self::checkBulkTrackingResponse($t->doBulkTrack());
}
-}
+} \ No newline at end of file
diff --git a/tests/PHPUnit/Fixtures/TwoSitesTwoVisitorsDifferentDays.php b/tests/PHPUnit/Fixtures/TwoSitesTwoVisitorsDifferentDays.php
index e2df5f8258..4caa3e1be7 100644
--- a/tests/PHPUnit/Fixtures/TwoSitesTwoVisitorsDifferentDays.php
+++ b/tests/PHPUnit/Fixtures/TwoSitesTwoVisitorsDifferentDays.php
@@ -5,14 +5,17 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Fixtures;
+
use Piwik\Date;
use Piwik\Plugins\Goals\API as APIGoals;
use Piwik\Plugins\SitesManager\API as APISitesManager;
+use Piwik\Tests\Fixture;
/**
* Adds two websites and tracks visits from two visitors on different days.
*/
-class Test_Piwik_Fixture_TwoSitesTwoVisitorsDifferentDays extends Fixture
+class TwoSitesTwoVisitorsDifferentDays extends Fixture
{
public $idSite1 = 1;
public $idSite2 = 2;
@@ -179,6 +182,4 @@ class Test_Piwik_Fixture_TwoSitesTwoVisitorsDifferentDays extends Fixture
$visitorAsite2->setGenerationTime(503);
self::checkResponse($visitorAsite2->doTrackPageView(''));
}
-
-}
-
+} \ No newline at end of file
diff --git a/tests/PHPUnit/Fixtures/TwoSitesVisitsInPast.php b/tests/PHPUnit/Fixtures/TwoSitesVisitsInPast.php
index d5a6415035..0d47c97815 100644
--- a/tests/PHPUnit/Fixtures/TwoSitesVisitsInPast.php
+++ b/tests/PHPUnit/Fixtures/TwoSitesVisitsInPast.php
@@ -5,12 +5,15 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Fixtures;
+
use Piwik\Date;
+use Piwik\Tests\Fixture;
/**
* Adds two sites and tracks several visits all in the past.
*/
-class Test_Piwik_Fixture_TwoSitesVisitsInPast extends Fixture
+class TwoSitesVisitsInPast extends Fixture
{
public $dateTimeFirstDateWebsite1 = '2010-03-06 01:22:33';
public $dateTimeDateInPastWebsite1 = '2010-01-06 01:22:33';
@@ -107,4 +110,4 @@ class Test_Piwik_Fixture_TwoSitesVisitsInPast extends Fixture
$t->setUrl('http://example.org/category/Pageyy');
self::checkResponse($t->doTrackPageView('Blabla'));
}
-}
+} \ No newline at end of file
diff --git a/tests/PHPUnit/Fixtures/TwoSitesWithAnnotations.php b/tests/PHPUnit/Fixtures/TwoSitesWithAnnotations.php
index 37cb956c51..370c5a864e 100644
--- a/tests/PHPUnit/Fixtures/TwoSitesWithAnnotations.php
+++ b/tests/PHPUnit/Fixtures/TwoSitesWithAnnotations.php
@@ -5,14 +5,18 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Fixtures;
+
use Piwik\Access;
use Piwik\Date;
use Piwik\Plugins\Annotations\API;
+use Piwik\Tests\Fixture;
+use FakeAccess;
/**
* A fixture that adds two websites and annotations for each website.
*/
-class Test_Piwik_Fixture_TwoSitesWithAnnotations extends Fixture
+class TwoSitesWithAnnotations extends Fixture
{
public $dateTime = '2011-01-01 00:11:42';
public $idSite1 = 1;
@@ -75,4 +79,4 @@ class Test_Piwik_Fixture_TwoSitesWithAnnotations extends Fixture
self::createWebsite($this->dateTime, $ecommerce = 1);
}
}
-}
+} \ No newline at end of file
diff --git a/tests/PHPUnit/Fixtures/TwoVisitsNoKeywordWithBot.php b/tests/PHPUnit/Fixtures/TwoVisitsNoKeywordWithBot.php
index de6bb9b2e0..eb48a6bd61 100644
--- a/tests/PHPUnit/Fixtures/TwoVisitsNoKeywordWithBot.php
+++ b/tests/PHPUnit/Fixtures/TwoVisitsNoKeywordWithBot.php
@@ -5,14 +5,17 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Fixtures;
+
use Piwik\Date;
use Piwik\Plugins\Goals\API;
+use Piwik\Tests\Fixture;
/**
* Adds one site and tracks two visits. One visit is a bot and one has no keyword
* but is from a search engine.
*/
-class Test_Piwik_Fixture_TwoVisitsNoKeywordWithBot extends Fixture
+class TwoVisitsNoKeywordWithBot extends Fixture
{
public $dateTime = '2010-03-06 11:22:33';
public $idSite = 1;
@@ -66,6 +69,5 @@ class Test_Piwik_Fixture_TwoVisitsNoKeywordWithBot extends Fixture
// Test with empty title, that the output of Live is valid
self::checkResponse($t->doTrackPageView(''));
-
}
-}
+} \ No newline at end of file
diff --git a/tests/PHPUnit/Fixtures/TwoVisitsWithCustomEvents.php b/tests/PHPUnit/Fixtures/TwoVisitsWithCustomEvents.php
index 8900eaace2..b2777b408f 100644
--- a/tests/PHPUnit/Fixtures/TwoVisitsWithCustomEvents.php
+++ b/tests/PHPUnit/Fixtures/TwoVisitsWithCustomEvents.php
@@ -5,13 +5,17 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Fixtures;
+
use Piwik\Date;
use Piwik\Plugins\Goals\API as APIGoals;
+use Piwik\Tests\Fixture;
+use PiwikTracker;
/**
* Tracks custom events
*/
-class Test_Piwik_Fixture_TwoVisitsWithCustomEvents extends Fixture
+class TwoVisitsWithCustomEvents extends Fixture
{
public $dateTime = '2010-01-03 11:22:33';
public $idSite = 1;
@@ -186,5 +190,4 @@ class Test_Piwik_Fixture_TwoVisitsWithCustomEvents extends Fixture
public function tearDown()
{
}
-
-}
+} \ No newline at end of file
diff --git a/tests/PHPUnit/Fixtures/TwoVisitsWithCustomVariables.php b/tests/PHPUnit/Fixtures/TwoVisitsWithCustomVariables.php
index ccf0120d7b..5ed8c06b85 100644
--- a/tests/PHPUnit/Fixtures/TwoVisitsWithCustomVariables.php
+++ b/tests/PHPUnit/Fixtures/TwoVisitsWithCustomVariables.php
@@ -5,13 +5,16 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Fixtures;
+
use Piwik\Date;
use Piwik\Plugins\Goals\API;
+use Piwik\Tests\Fixture;
/**
* Adds one site with two goals and tracks two visits with custom variables.
*/
-class Test_Piwik_Fixture_TwoVisitsWithCustomVariables extends Fixture
+class TwoVisitsWithCustomVariables extends Fixture
{
public $dateTime = '2010-01-03 11:22:33';
public $idSite = 1;
@@ -146,4 +149,4 @@ class Test_Piwik_Fixture_TwoVisitsWithCustomVariables extends Fixture
$visitorB->setForceVisitDateTime(Date::factory($dateTime)->addHour(2)->getDatetime());
self::checkResponse($visitorB->doTrackAction('http://test.com', 'link'));
}
-}
+} \ No newline at end of file
diff --git a/tests/PHPUnit/Fixtures/UITestFixture.php b/tests/PHPUnit/Fixtures/UITestFixture.php
index aeec9eba82..6afbfb2b6d 100644
--- a/tests/PHPUnit/Fixtures/UITestFixture.php
+++ b/tests/PHPUnit/Fixtures/UITestFixture.php
@@ -8,8 +8,8 @@
namespace Piwik\Tests\Fixtures;
use Exception;
-use Piwik\Access;
use Piwik\AssetManager;
+use Piwik\Access;
use Piwik\Common;
use Piwik\Date;
use Piwik\Db;
@@ -17,20 +17,32 @@ use Piwik\DbHelper;
use Piwik\FrontController;
use Piwik\Option;
use Piwik\Plugins\SegmentEditor\API as APISegmentEditor;
-use Piwik\Plugins\SitesManager\API as SitesManagerAPI;
use Piwik\Plugins\UsersManager\API as UsersManagerAPI;
use Piwik\Plugins\VisitsSummary\API as VisitsSummaryAPI;
+use Piwik\Plugins\SitesManager\API as SitesManagerAPI;
use Piwik\WidgetsList;
+use Piwik\Tests\Fixture;
+use Piwik\Tests\OverrideLogin;
/**
* Fixture for UI tests.
*/
-class UITestFixture extends OmniFixture
+class UITestFixture extends SqlDump
{
+ const FIXTURE_LOCATION = '/tests/resources/OmniFixture-dump.sql.gz';
+
+ public function __construct()
+ {
+ $this->dumpUrl = PIWIK_INCLUDE_PATH . self::FIXTURE_LOCATION;
+ $this->tablesPrefix = '';
+ }
+
public function setUp()
{
parent::setUp();
+ self::updateDatabase();
+
// make sure site has an early enough creation date (for period selector tests)
Db::get()->update(Common::prefixTable("site"),
array('ts_created' => '2011-01-01'),
@@ -42,14 +54,6 @@ class UITestFixture extends OmniFixture
DbHelper::createAnonymousUser();
UsersManagerAPI::getInstance()->setSuperUserAccess('superUserLogin', true);
-
- Option::set("Tests.forcedNowTimestamp", $this->now->getTimestamp());
-
- // launch archiving so tests don't run out of time
- $date = Date::factory($this->dateTime)->toString();
- VisitsSummaryAPI::getInstance()->get($this->idSite, 'year', $date);
- VisitsSummaryAPI::getInstance()->get($this->idSite, 'year', $date, urlencode($this->segment));
-
SitesManagerAPI::getInstance()->updateSite(1, null, null, true);
}
@@ -296,7 +300,7 @@ class UITestFixture extends OmniFixture
public static function createAccessInstance()
{
- Access::setSingletonInstance($access = new \Test_Access_OverrideLogin());
+ Access::setSingletonInstance($access = new OverrideLogin());
\Piwik\Piwik::postEvent('Request.initAuthenticationObject');
}
} \ No newline at end of file
diff --git a/tests/PHPUnit/Fixtures/VisitOverSeveralDaysImportedLogs.php b/tests/PHPUnit/Fixtures/VisitOverSeveralDaysImportedLogs.php
index 6492ebd1db..98cc3b50aa 100644
--- a/tests/PHPUnit/Fixtures/VisitOverSeveralDaysImportedLogs.php
+++ b/tests/PHPUnit/Fixtures/VisitOverSeveralDaysImportedLogs.php
@@ -5,13 +5,16 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Fixtures;
+
+use Piwik\Tests\Fixture;
/**
* Import a same visitor, over three different days, in reverse chronological order
* useful to test there are three visits are created for this visitor, as expected
*
*/
-class Test_Piwik_Fixture_VisitOverSeveralDaysImportedLogs extends Fixture
+class VisitOverSeveralDaysImportedLogs extends Fixture
{
public $dateTime = '2013-04-07 19:00:00';
public $idSite = 1;
@@ -52,5 +55,4 @@ class Test_Piwik_Fixture_VisitOverSeveralDaysImportedLogs extends Fixture
self::executeLogImporter($logFile, $opts);
}
-
-}
+} \ No newline at end of file
diff --git a/tests/PHPUnit/Fixtures/VisitsInDifferentTimezones.php b/tests/PHPUnit/Fixtures/VisitsInDifferentTimezones.php
index f47962e6d7..19c7fcc062 100644
--- a/tests/PHPUnit/Fixtures/VisitsInDifferentTimezones.php
+++ b/tests/PHPUnit/Fixtures/VisitsInDifferentTimezones.php
@@ -5,12 +5,15 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Fixtures;
+
use Piwik\Date;
+use Piwik\Tests\Fixture;
/**
* Adds one site with a non UTC timezone and tracks a couple visits near the end of the day.
*/
-class Test_Piwik_Fixture_VisitsInDifferentTimezones extends Fixture
+class VisitsInDifferentTimezones extends Fixture
{
public $idSite = 1;
public $dateTime = '2010-03-06';
diff --git a/tests/PHPUnit/Fixtures/VisitsOverSeveralDays.php b/tests/PHPUnit/Fixtures/VisitsOverSeveralDays.php
index d0b08c957d..caf67e00aa 100644
--- a/tests/PHPUnit/Fixtures/VisitsOverSeveralDays.php
+++ b/tests/PHPUnit/Fixtures/VisitsOverSeveralDays.php
@@ -5,13 +5,16 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Fixtures;
+
use Piwik\Date;
+use Piwik\Tests\Fixture;
/**
* Adds one website and tracks several visits from one visitor on
* different days that span about a month apart.
*/
-class Test_Piwik_Fixture_VisitsOverSeveralDays extends Fixture
+class VisitsOverSeveralDays extends Fixture
{
public $dateTimes = array(
'2010-12-14 01:00:00',
@@ -121,4 +124,4 @@ class Test_Piwik_Fixture_VisitsOverSeveralDays extends Fixture
$tracker->setDebugStringAppend($debugStringAppend);
return $tracker;
}
-}
+} \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/AnnotationsTest.php b/tests/PHPUnit/Integration/AnnotationsTest.php
index 6257bf7785..2dfd150e18 100755
--- a/tests/PHPUnit/Integration/AnnotationsTest.php
+++ b/tests/PHPUnit/Integration/AnnotationsTest.php
@@ -5,11 +5,20 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Integration;
use Piwik\Access;
use Piwik\API\Request;
use Piwik\Plugins\Annotations\API;
+use Piwik\Tests\IntegrationTestCase;
+use Piwik\Tests\Fixtures\TwoSitesWithAnnotations;
+use FakeAccess;
+use Exception;
+/**
+ * @group Integration
+ * @group AnnotationsTest
+ */
class AnnotationsTest extends IntegrationTestCase
{
public static $fixture = null;
@@ -80,16 +89,12 @@ class AnnotationsTest extends IntegrationTestCase
/**
* @dataProvider getApiForTesting
- * @group Integration
*/
public function testApi($api, $params)
{
$this->runApiTests($api, $params);
}
- /**
- * @group Integration
- */
public function testAddMultipleSitesFail()
{
try {
@@ -100,9 +105,6 @@ class AnnotationsTest extends IntegrationTestCase
}
}
- /**
- * @group Integration
- */
public function testAddInvalidDateFail()
{
try {
@@ -113,9 +115,6 @@ class AnnotationsTest extends IntegrationTestCase
}
}
- /**
- * @group Integration
- */
public function testSaveMultipleSitesFail()
{
try {
@@ -126,9 +125,6 @@ class AnnotationsTest extends IntegrationTestCase
}
}
- /**
- * @group Integration
- */
public function testSaveInvalidDateFail()
{
try {
@@ -139,9 +135,6 @@ class AnnotationsTest extends IntegrationTestCase
}
}
- /**
- * @group Integration
- */
public function testSaveInvalidNoteIdFail()
{
try {
@@ -152,9 +145,6 @@ class AnnotationsTest extends IntegrationTestCase
}
}
- /**
- * @group Integration
- */
public function testDeleteMultipleSitesFail()
{
try {
@@ -165,9 +155,6 @@ class AnnotationsTest extends IntegrationTestCase
}
}
- /**
- * @group Integration
- */
public function testDeleteInvalidNoteIdFail()
{
try {
@@ -178,9 +165,6 @@ class AnnotationsTest extends IntegrationTestCase
}
}
- /**
- * @group Integration
- */
public function testGetMultipleSitesFail()
{
try {
@@ -191,9 +175,6 @@ class AnnotationsTest extends IntegrationTestCase
}
}
- /**
- * @group Integration
- */
public function testGetInvalidNoteIdFail()
{
try {
@@ -204,9 +185,6 @@ class AnnotationsTest extends IntegrationTestCase
}
}
- /**
- * @group Integration
- */
public function testSaveSuccess()
{
API::getInstance()->save(
@@ -223,9 +201,6 @@ class AnnotationsTest extends IntegrationTestCase
$this->assertEquals($expectedAnnotation, API::getInstance()->get(self::$fixture->idSite1, 0));
}
- /**
- * @group Integration
- */
public function testSaveNoChangesSuccess()
{
API::getInstance()->save(self::$fixture->idSite1, 1);
@@ -241,9 +216,6 @@ class AnnotationsTest extends IntegrationTestCase
$this->assertEquals($expectedAnnotation, API::getInstance()->get(self::$fixture->idSite1, 1));
}
- /**
- * @group Integration
- */
public function testDeleteSuccess()
{
API::getInstance()->delete(self::$fixture->idSite1, 1);
@@ -287,7 +259,6 @@ class AnnotationsTest extends IntegrationTestCase
/**
* @dataProvider getPermissionsFailData
- * @group Integration
*/
public function testMethodPermissions($hasAdminAccess, $hasViewAccess, $request, $checkException, $failMessage)
{
@@ -314,4 +285,4 @@ class AnnotationsTest extends IntegrationTestCase
}
}
-AnnotationsTest::$fixture = new Test_Piwik_Fixture_TwoSitesWithAnnotations(); \ No newline at end of file
+AnnotationsTest::$fixture = new TwoSitesWithAnnotations(); \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/ApiGetReportMetadataTest.php b/tests/PHPUnit/Integration/ApiGetReportMetadataTest.php
index c9face0533..db49a8852b 100755
--- a/tests/PHPUnit/Integration/ApiGetReportMetadataTest.php
+++ b/tests/PHPUnit/Integration/ApiGetReportMetadataTest.php
@@ -5,14 +5,21 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Integration;
+
use Piwik\API\Proxy;
+use Piwik\Tests\IntegrationTestCase;
+use Piwik\Tests\Fixtures\ThreeGoalsOnePageview;
/**
* This tests the output of the API plugin API
* It will return metadata about all API reports from all plugins
* as well as the data itself, pre-processed and ready to be displayed
+ *
+ * @group Integration
+ * @group ApiGetReportMetadataTest
*/
-class Test_Piwik_Integration_ApiGetReportMetadata extends IntegrationTestCase
+class ApiGetReportMetadataTest extends IntegrationTestCase
{
public static $fixture = null; // initialized below class definition
@@ -75,7 +82,6 @@ class Test_Piwik_Integration_ApiGetReportMetadata extends IntegrationTestCase
/**
* @dataProvider getApiForTesting
- * @group Integration
*/
public function testApi($api, $params)
{
@@ -83,5 +89,4 @@ class Test_Piwik_Integration_ApiGetReportMetadata extends IntegrationTestCase
}
}
-Test_Piwik_Integration_ApiGetReportMetadata::$fixture = new Test_Piwik_Fixture_ThreeGoalsOnePageview();
-
+ApiGetReportMetadataTest::$fixture = new ThreeGoalsOnePageview(); \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/ApiGetReportMetadata_yearTest.php b/tests/PHPUnit/Integration/ApiGetReportMetadataYearTest.php
index 01a19ed2de..44da8df449 100755
--- a/tests/PHPUnit/Integration/ApiGetReportMetadata_yearTest.php
+++ b/tests/PHPUnit/Integration/ApiGetReportMetadataYearTest.php
@@ -5,12 +5,19 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Integration;
+
+use Piwik\Tests\IntegrationTestCase;
+use Piwik\Tests\Fixtures\InvalidVisits;
/**
* test the Yearly metadata API response,
* with no visits, with custom response language
+ *
+ * @group Integration
+ * @group ApiGetReportMetadataYearTest
*/
-class Test_Piwik_Integration_ApiGetReportMetadata_Year extends IntegrationTestCase
+class ApiGetReportMetadataYearTest extends IntegrationTestCase
{
public static $fixture = null; // initialized below class definition
@@ -34,7 +41,6 @@ class Test_Piwik_Integration_ApiGetReportMetadata_Year extends IntegrationTestCa
/**
* @dataProvider getApiForTesting
- * @group Integration
*/
public function testApi($api, $params)
{
@@ -42,6 +48,5 @@ class Test_Piwik_Integration_ApiGetReportMetadata_Year extends IntegrationTestCa
}
}
-Test_Piwik_Integration_ApiGetReportMetadata_Year::$fixture = new Test_Piwik_Fixture_InvalidVisits();
-Test_Piwik_Integration_ApiGetReportMetadata_Year::$fixture->trackInvalidRequests = false;
-
+ApiGetReportMetadataYearTest::$fixture = new InvalidVisits();
+ApiGetReportMetadataYearTest::$fixture->trackInvalidRequests = false; \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/ArchiveCronTest.php b/tests/PHPUnit/Integration/ArchiveCronTest.php
index 25c8ff418a..eceb90a482 100644
--- a/tests/PHPUnit/Integration/ArchiveCronTest.php
+++ b/tests/PHPUnit/Integration/ArchiveCronTest.php
@@ -5,9 +5,14 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Integration;
use Piwik\Date;
use Piwik\Plugins\SitesManager\API;
+use Piwik\Tests\IntegrationTestCase;
+use Piwik\Tests\Fixtures\ManySitesImportedLogs;
+use Piwik\Tests\Fixture;
+use Exception;
/**
* Tests to call the cron core:archive command script and check there is no error,
@@ -15,9 +20,10 @@ use Piwik\Plugins\SitesManager\API;
* This tests that, when archiving is disabled,
* then Piwik API will return data that was pre-processed during archive.php run
*
+ * @group Integration
* @group ArchiveCronTest
*/
-class Test_Piwik_Integration_ArchiveCronTest extends IntegrationTestCase
+class ArchiveCronTest extends IntegrationTestCase
{
public static $fixture = null; // initialized below class definition
@@ -52,8 +58,8 @@ class Test_Piwik_Integration_ArchiveCronTest extends IntegrationTestCase
'segment' => 'browserCode==EP',
'testSuffix' => '_nonPreArchivedSegment'));
- $segments = array(Test_Piwik_Fixture_ManySitesImportedLogs::SEGMENT_PRE_ARCHIVED,
- Test_Piwik_Fixture_ManySitesImportedLogs::SEGMENT_PRE_ARCHIVED_CONTAINS_ENCODED
+ $segments = array(ManySitesImportedLogs::SEGMENT_PRE_ARCHIVED,
+ ManySitesImportedLogs::SEGMENT_PRE_ARCHIVED_CONTAINS_ENCODED
);
foreach($segments as $segment) {
// TODO debugging travis
@@ -72,9 +78,6 @@ class Test_Piwik_Integration_ArchiveCronTest extends IntegrationTestCase
return $results;
}
- /**
- * @group Integration
- */
public function testArchivePhpCron()
{
if(self::isPhpVersion53()) {
@@ -163,5 +166,5 @@ class Test_Piwik_Integration_ArchiveCronTest extends IntegrationTestCase
}
}
-Test_Piwik_Integration_ArchiveCronTest::$fixture = new Test_Piwik_Fixture_ManySitesImportedLogs();
-Test_Piwik_Integration_ArchiveCronTest::$fixture->addSegments = true; \ No newline at end of file
+ArchiveCronTest::$fixture = new ManySitesImportedLogs();
+ArchiveCronTest::$fixture->addSegments = true; \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/ArchiveWebTest.php b/tests/PHPUnit/Integration/ArchiveWebTest.php
index 570b3b6290..4beb564304 100644
--- a/tests/PHPUnit/Integration/ArchiveWebTest.php
+++ b/tests/PHPUnit/Integration/ArchiveWebTest.php
@@ -5,16 +5,22 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Integration;
use Piwik\Option;
use Piwik\Http;
+use Piwik\Tests\IntegrationTestCase;
+use Piwik\Tests\Fixtures\ManySitesImportedLogs;
+use Piwik\Tests\Fixture;
+use Exception;
/**
- * Tests to call the archive.php script via web and check there is no error,
+ * Tests to call the archive.php script via web and check there is no error.
+ *
* @group Integration
* @group ArchiveWebTest
*/
-class Test_Piwik_Integration_ArchiveWebTest extends IntegrationTestCase
+class ArchiveWebTest extends IntegrationTestCase
{
public static $fixture = null; // initialized below class definition
@@ -71,5 +77,5 @@ class Test_Piwik_Integration_ArchiveWebTest extends IntegrationTestCase
}
}
-Test_Piwik_Integration_ArchiveWebTest::$fixture = new Test_Piwik_Fixture_ManySitesImportedLogs();
-Test_Piwik_Integration_ArchiveWebTest::$fixture->addSegments = true; \ No newline at end of file
+ArchiveWebTest::$fixture = new ManySitesImportedLogs();
+ArchiveWebTest::$fixture->addSegments = true; \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/AutoSuggestAPITest.php b/tests/PHPUnit/Integration/AutoSuggestAPITest.php
index a9e5c404d2..f893d258c6 100644
--- a/tests/PHPUnit/Integration/AutoSuggestAPITest.php
+++ b/tests/PHPUnit/Integration/AutoSuggestAPITest.php
@@ -5,13 +5,21 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Integration;
+
use Piwik\API\Request;
use Piwik\Date;
+use Piwik\Tests\IntegrationTestCase;
+use Piwik\Tests\Fixtures\ManyVisitsWithGeoIP;
+use Piwik\Tests\Fixture;
/**
* testing a the auto suggest API for all known segments
+ *
+ * @group AutoSuggestAPITest
+ * @group Integration
*/
-class Test_Piwik_Integration_AutoSuggestAPITest extends IntegrationTestCase
+class AutoSuggestAPITest extends IntegrationTestCase
{
public static $fixture = null; // initialized below class definition
@@ -20,7 +28,6 @@ class Test_Piwik_Integration_AutoSuggestAPITest extends IntegrationTestCase
/**
* @dataProvider getApiForTesting
- * @group Integration
*/
public function testApi($api, $params)
{
@@ -76,7 +83,6 @@ class Test_Piwik_Integration_AutoSuggestAPITest extends IntegrationTestCase
/**
* @depends testApi
* @dataProvider getAnotherApiForTesting
- * @group Integration
*/
public function testAnotherApi($api, $params)
{
@@ -124,7 +130,6 @@ class Test_Piwik_Integration_AutoSuggestAPITest extends IntegrationTestCase
}
/**
- * @group Integration
* @depends testAnotherApi
*/
public function testCheckOtherTestsWereComplete()
@@ -140,5 +145,5 @@ class Test_Piwik_Integration_AutoSuggestAPITest extends IntegrationTestCase
}
}
-Test_Piwik_Integration_AutoSuggestAPITest::$fixture = new Test_Piwik_Fixture_ManyVisitsWithGeoIP();
-Test_Piwik_Integration_AutoSuggestAPITest::$fixture->dateTime = Date::yesterday()->subDay(30)->getDatetime();
+AutoSuggestAPITest::$fixture = new ManyVisitsWithGeoIP();
+AutoSuggestAPITest::$fixture->dateTime = Date::yesterday()->subDay(30)->getDatetime();
diff --git a/tests/PHPUnit/Integration/BackwardsCompatibility1XTest.php b/tests/PHPUnit/Integration/BackwardsCompatibility1XTest.php
index da23211edf..1331786c69 100644
--- a/tests/PHPUnit/Integration/BackwardsCompatibility1XTest.php
+++ b/tests/PHPUnit/Integration/BackwardsCompatibility1XTest.php
@@ -5,19 +5,22 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Integration;
use Piwik\Common;
use Piwik\Db;
-use Piwik\Plugins\CoreUpdater\CoreUpdater;
use Piwik\Plugins\VisitFrequency\API as VisitFrequencyApi;
-use Piwik\Updater;
+use Piwik\Tests\IntegrationTestCase;
+use Piwik\Tests\Fixtures\SqlDump;
+use Piwik\Tests\Fixture;
/**
* Tests that Piwik 2.0 works w/ data from Piwik 1.12.
*
* @group BackwardsCompatibility1XTest
+ * @group Integration
*/
-class Test_Piwik_Integration_BackwardsCompatibility1XTest extends IntegrationTestCase
+class BackwardsCompatibility1XTest extends IntegrationTestCase
{
const FIXTURE_LOCATION = '/tests/resources/piwik-1.13-dump.sql';
@@ -27,7 +30,10 @@ class Test_Piwik_Integration_BackwardsCompatibility1XTest extends IntegrationTes
{
parent::setUpBeforeClass();
- self::updateDatabase();
+ $result = Fixture::updateDatabase();
+ if ($result === false) {
+ throw new \Exception("Failed to update pre-2.0 database (nothing to update).");
+ }
// truncate log tables so old data won't be re-archived
foreach (array('log_visit', 'log_link_visit_action', 'log_conversion', 'log_conversion_item') as $table) {
@@ -49,23 +55,6 @@ class Test_Piwik_Integration_BackwardsCompatibility1XTest extends IntegrationTes
VisitFrequencyApi::getInstance()->get(1, 'year', '2012-12-29');
}
- private static function updateDatabase()
- {
- $updater = new Updater();
- $componentsWithUpdateFile = CoreUpdater::getComponentUpdates($updater);
- if (empty($componentsWithUpdateFile)) {
- throw new \Exception("Failed to update pre-2.0 database (nothing to update).");
- }
-
- $result = CoreUpdater::updateComponents($updater, $componentsWithUpdateFile);
- if (!empty($result['coreError'])
- && !empty($result['warnings'])
- && !empty($result['errors'])
- ) {
- throw new \Exception("Failed to update pre-2.0 database (errors or warnings found): " . print_r($result, true));
- }
- }
-
public function setUp()
{
parent::setUp();
@@ -81,7 +70,6 @@ class Test_Piwik_Integration_BackwardsCompatibility1XTest extends IntegrationTes
/**
* @dataProvider getApiForTesting
- * @group Integration
*/
public function testApi($api, $params)
{
@@ -118,7 +106,6 @@ class Test_Piwik_Integration_BackwardsCompatibility1XTest extends IntegrationTes
}
}
-Test_Piwik_Integration_BackwardsCompatibility1XTest::$fixture = new Piwik_Test_Fixture_SqlDump();
-Test_Piwik_Integration_BackwardsCompatibility1XTest::$fixture->dumpUrl =
- PIWIK_INCLUDE_PATH . Test_Piwik_Integration_BackwardsCompatibility1XTest::FIXTURE_LOCATION;
-Test_Piwik_Integration_BackwardsCompatibility1XTest::$fixture->tablesPrefix = ''; \ No newline at end of file
+BackwardsCompatibility1XTest::$fixture = new SqlDump();
+BackwardsCompatibility1XTest::$fixture->dumpUrl = PIWIK_INCLUDE_PATH . BackwardsCompatibility1XTest::FIXTURE_LOCATION;
+BackwardsCompatibility1XTest::$fixture->tablesPrefix = ''; \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/BlobReportLimitingTest.php b/tests/PHPUnit/Integration/BlobReportLimitingTest.php
index db5db0f154..8010501886 100755
--- a/tests/PHPUnit/Integration/BlobReportLimitingTest.php
+++ b/tests/PHPUnit/Integration/BlobReportLimitingTest.php
@@ -5,17 +5,23 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Integration;
use Piwik\Config;
use Piwik\Plugins\Actions\ArchivingHelper;
+use Piwik\Tests\IntegrationTestCase;
+use Piwik\Tests\Fixtures\ManyVisitsWithMockLocationProvider;
require_once PIWIK_INCLUDE_PATH . '/tests/PHPUnit/MockLocationProvider.php';
/**
* Test Piwik's report limiting code. Make sure the datatable_archiving_maximum_rows_...
* config options limit the size of certain reports when archiving.
+ *
+ * @group Integration
+ * @group BlobReportLimitingTest
*/
-class Test_Piwik_Integration_BlobReportLimitingTest extends IntegrationTestCase
+class BlobReportLimitingTest extends IntegrationTestCase
{
public static $fixture = null; // initialized below class definition
@@ -85,16 +91,12 @@ class Test_Piwik_Integration_BlobReportLimitingTest extends IntegrationTestCase
/**
* @dataProvider getApiForTesting
- * @group Integration
*/
public function testApi($api, $params)
{
$this->runApiTests($api, $params);
}
- /**
- * @group Integration
- */
public function testApiWithRankingQuery()
{
// custom setup
@@ -114,9 +116,6 @@ class Test_Piwik_Integration_BlobReportLimitingTest extends IntegrationTestCase
}
}
- /**
- * @group Integration
- */
public function testApiWithRankingQueryDisabled()
{
self::deleteArchiveTables();
@@ -163,5 +162,5 @@ class Test_Piwik_Integration_BlobReportLimitingTest extends IntegrationTestCase
}
}
-Test_Piwik_Integration_BlobReportLimitingTest::$fixture = new Test_Piwik_Fixture_ManyVisitsWithMockLocationProvider();
-Test_Piwik_Integration_BlobReportLimitingTest::$fixture->createConfig = false; \ No newline at end of file
+BlobReportLimitingTest::$fixture = new ManyVisitsWithMockLocationProvider();
+BlobReportLimitingTest::$fixture->createConfig = false; \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/Core/ArchiveProcessingTest.php b/tests/PHPUnit/Integration/Core/ArchiveProcessingTest.php
index e970ec9769..a87ee6dd8f 100644
--- a/tests/PHPUnit/Integration/Core/ArchiveProcessingTest.php
+++ b/tests/PHPUnit/Integration/Core/ArchiveProcessingTest.php
@@ -335,7 +335,7 @@ class Core_ArchiveProcessingTest extends DatabaseTestCase
. ' The error Messages from MySQL were: '
. $didWeUseBulk
. "\n\n Learn more how to enable LOAD LOCAL DATA INFILE see the Mysql doc (http://dev.mysql.com/doc/refman/5.0/en/load-data-local.html) "
- . "\n or ask in this Piwik ticket (http://dev.piwik.org/trac/ticket/3605)"
+ . "\n or ask in this Piwik ticket (https://github.com/piwik/piwik/issues/3605)"
);
}
return $didWeUseBulk;
diff --git a/tests/PHPUnit/Integration/Core/CliMultiTest.php b/tests/PHPUnit/Integration/Core/CliMultiTest.php
index da462def03..fc337957f2 100644
--- a/tests/PHPUnit/Integration/Core/CliMultiTest.php
+++ b/tests/PHPUnit/Integration/Core/CliMultiTest.php
@@ -8,6 +8,8 @@
use Piwik\CliMulti;
use Piwik\Version;
+use Piwik\Tests\IntegrationTestCase;
+use Piwik\Tests\Fixture;
/**
* Class Core_CliMultiTest
diff --git a/tests/PHPUnit/Integration/Core/JsProxyTest.php b/tests/PHPUnit/Integration/Core/JsProxyTest.php
index 9e808f943b..91fe30dfae 100644
--- a/tests/PHPUnit/Integration/Core/JsProxyTest.php
+++ b/tests/PHPUnit/Integration/Core/JsProxyTest.php
@@ -1,5 +1,14 @@
<?php
-class Test_Piwik_JsProxy extends IntegrationTestCase
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+use Piwik\Tests\Fixture;
+
+class Test_Piwik_JsProxy extends PHPUnit_Framework_TestCase
{
/**
* @group Core
diff --git a/tests/PHPUnit/Integration/Core/SegmentTest.php b/tests/PHPUnit/Integration/Core/SegmentTest.php
index 48bc2df5d1..f26cd92e14 100644
--- a/tests/PHPUnit/Integration/Core/SegmentTest.php
+++ b/tests/PHPUnit/Integration/Core/SegmentTest.php
@@ -1,14 +1,15 @@
<?php
-use Piwik\Access;
-use Piwik\Common;
-use Piwik\Segment;
-
/**
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+use Piwik\Access;
+use Piwik\Common;
+use Piwik\Segment;
+use Piwik\Tests\Fixture;
+
class SegmentTest extends DatabaseTestCase
{
public function setUp()
diff --git a/tests/PHPUnit/Integration/Core/Tracker/ActionTest.php b/tests/PHPUnit/Integration/Core/Tracker/ActionTest.php
index 4a9e138b1e..f180db3a86 100644
--- a/tests/PHPUnit/Integration/Core/Tracker/ActionTest.php
+++ b/tests/PHPUnit/Integration/Core/Tracker/ActionTest.php
@@ -1,4 +1,10 @@
<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
use Piwik\Access;
use Piwik\Config;
use Piwik\Plugins\SitesManager\API;
diff --git a/tests/PHPUnit/Integration/Core/TrackerTest.php b/tests/PHPUnit/Integration/Core/TrackerTest.php
index 24dbab777c..51c8b2aafc 100644
--- a/tests/PHPUnit/Integration/Core/TrackerTest.php
+++ b/tests/PHPUnit/Integration/Core/TrackerTest.php
@@ -6,6 +6,8 @@
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+use Piwik\Tests\Fixture;
+
/**
* @group Core
*/
diff --git a/tests/PHPUnit/Integration/Core/UpdaterTest.php b/tests/PHPUnit/Integration/Core/UpdaterTest.php
index 292e9217a5..6745a3fe1d 100644
--- a/tests/PHPUnit/Integration/Core/UpdaterTest.php
+++ b/tests/PHPUnit/Integration/Core/UpdaterTest.php
@@ -5,18 +5,20 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Integration\Core;
+
+use DatabaseTestCase;
use Piwik\Updater;
+use Piwik\Tests\Fixture;
/**
* Class Core_UpdaterTest
*
* @group Core
+ * @group Core_UpdaterTest
*/
-class Core_UpdaterTest extends DatabaseTestCase
+class UpdaterTest extends DatabaseTestCase
{
- /**
- * @group Core
- */
public function testUpdaterChecksCoreVersionAndDetectsUpdateFile()
{
$updater = new Updater();
@@ -27,9 +29,6 @@ class Core_UpdaterTest extends DatabaseTestCase
$this->assertEquals(1, count($componentsWithUpdateFile));
}
- /**
- * @group Core
- */
public function testUpdaterChecksGivenPluginVersionAndDetectsMultipleUpdateFileInOrder()
{
$updater = new Updater();
@@ -50,9 +49,6 @@ class Core_UpdaterTest extends DatabaseTestCase
$this->assertEquals($expectedInOrder, array_map("basename", $updateFiles));
}
- /**
- * @group Core
- */
public function testUpdaterChecksCoreAndPluginCheckThatCoreIsRanFirst()
{
$updater = new Updater();
@@ -70,4 +66,12 @@ class Core_UpdaterTest extends DatabaseTestCase
reset($componentsWithUpdateFile);
$this->assertEquals('core', key($componentsWithUpdateFile));
}
-}
+
+ public function testUpdateWorksAfterPiwikIsAlreadyUpToDate()
+ {
+ $result = Fixture::updateDatabase($force = true);
+ if ($result === false) {
+ throw new \Exception("Failed to force update (nothing to update).");
+ }
+ }
+} \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/Core/WidgetsListTest.php b/tests/PHPUnit/Integration/Core/WidgetsListTest.php
index 4e11718d5a..ab3dcb9f88 100644
--- a/tests/PHPUnit/Integration/Core/WidgetsListTest.php
+++ b/tests/PHPUnit/Integration/Core/WidgetsListTest.php
@@ -9,6 +9,7 @@
use Piwik\Access;
use Piwik\Plugins\Goals\API;
use Piwik\WidgetsList;
+use Piwik\Tests\Fixture;
/**
* Class Core_WidgetsListTest
diff --git a/tests/PHPUnit/Integration/CsvExportTest.php b/tests/PHPUnit/Integration/CsvExportTest.php
index 3acf831a84..371875fa0b 100755
--- a/tests/PHPUnit/Integration/CsvExportTest.php
+++ b/tests/PHPUnit/Integration/CsvExportTest.php
@@ -5,11 +5,18 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Integration;
+
+use Piwik\Tests\IntegrationTestCase;
+use Piwik\Tests\Fixtures\TwoVisitsWithCustomVariables;
/**
* Test CSV export with Expanded rows, Translated labels, Different languages
+ *
+ * @group CsvExportTest
+ * @group Integration
*/
-class Test_Piwik_Integration_CsvExport extends IntegrationTestCase
+class CsvExportTest extends IntegrationTestCase
{
public static $fixture = null; // initialized below class definition
@@ -59,7 +66,6 @@ class Test_Piwik_Integration_CsvExport extends IntegrationTestCase
/**
* @dataProvider getApiForTesting
- * @group Integration
*/
public function testApi($api, $params)
{
@@ -72,8 +78,7 @@ class Test_Piwik_Integration_CsvExport extends IntegrationTestCase
}
}
-Test_Piwik_Integration_CsvExport::$fixture = new Test_Piwik_Fixture_TwoVisitsWithCustomVariables();
-Test_Piwik_Integration_CsvExport::$fixture->visitorId = null;
-Test_Piwik_Integration_CsvExport::$fixture->useEscapedQuotes = false;
-Test_Piwik_Integration_CsvExport::$fixture->doExtraQuoteTests = false;
-
+CsvExportTest::$fixture = new TwoVisitsWithCustomVariables();
+CsvExportTest::$fixture->visitorId = null;
+CsvExportTest::$fixture->useEscapedQuotes = false;
+CsvExportTest::$fixture->doExtraQuoteTests = false; \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/CustomEventsTest.php b/tests/PHPUnit/Integration/CustomEventsTest.php
index 11ef152455..c2a3bd9c62 100644
--- a/tests/PHPUnit/Integration/CustomEventsTest.php
+++ b/tests/PHPUnit/Integration/CustomEventsTest.php
@@ -5,17 +5,23 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Integration;
+
+use Piwik\Tests\IntegrationTestCase;
+use Piwik\Tests\Fixtures\TwoVisitsWithCustomEvents;
/**
* Testing Custom Events
+ *
+ * @group CustomEventsTest
+ * @group Integration
*/
-class Test_Piwik_Integration_CustomEvents extends IntegrationTestCase
+class CustomEventsTest extends IntegrationTestCase
{
public static $fixture = null; // initialized below class definition
/**
* @dataProvider getApiForTesting
- * @group Integration
*/
public function testApi($api, $params)
{
@@ -132,6 +138,4 @@ class Test_Piwik_Integration_CustomEvents extends IntegrationTestCase
}
}
-Test_Piwik_Integration_CustomEvents::$fixture = new Test_Piwik_Fixture_TwoVisitsWithCustomEvents();
-
-
+CustomEventsTest::$fixture = new TwoVisitsWithCustomEvents(); \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/EcommerceOrderWithItemsTest.php b/tests/PHPUnit/Integration/EcommerceOrderWithItemsTest.php
index 89d4cd8e9e..e4f5fc154b 100755
--- a/tests/PHPUnit/Integration/EcommerceOrderWithItemsTest.php
+++ b/tests/PHPUnit/Integration/EcommerceOrderWithItemsTest.php
@@ -5,20 +5,23 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Integration;
+
use Piwik\Date;
use Piwik\Piwik;
+use Piwik\Tests\IntegrationTestCase;
+use Piwik\Tests\Fixtures\TwoSitesEcommerceOrderWithItems;
/**
* Tests API methods after ecommerce orders are tracked.
+ *
+ * @group EcommerceOrderWithItemsTest
+ * @group Integration
*/
-class Test_Piwik_Integration_EcommerceOrderWithItems extends IntegrationTestCase
+class EcommerceOrderWithItemsTest extends IntegrationTestCase
{
public static $fixture = null; // initialized below class definition
- /**
- * @group Integration
- * *
- */
public function testImagesIncludedInTests()
{
$this->alertWhenImagesExcludedFromTests();
@@ -26,8 +29,6 @@ class Test_Piwik_Integration_EcommerceOrderWithItems extends IntegrationTestCase
/**
* @dataProvider getApiForTesting
- * @group Integration
- * *
*/
public function testApi($api, $params)
{
@@ -254,5 +255,4 @@ class Test_Piwik_Integration_EcommerceOrderWithItems extends IntegrationTestCase
}
}
-Test_Piwik_Integration_EcommerceOrderWithItems::$fixture = new Test_Piwik_Fixture_TwoSitesEcommerceOrderWithItems();
-
+EcommerceOrderWithItemsTest::$fixture = new TwoSitesEcommerceOrderWithItems(); \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/FlattenReportsTest.php b/tests/PHPUnit/Integration/FlattenReportsTest.php
index e7407f87f0..389f3c0e7b 100644
--- a/tests/PHPUnit/Integration/FlattenReportsTest.php
+++ b/tests/PHPUnit/Integration/FlattenReportsTest.php
@@ -5,18 +5,23 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Integration;
+
+use Piwik\Tests\IntegrationTestCase;
+use Piwik\Tests\Fixtures\ManyVisitsWithSubDirReferrersAndCustomVars;
/**
* Tests the flattening of reports.
+ *
+ * @group FlattenReportsTest
+ * @group Integration
*/
-class Test_Piwik_Integration_FlattenReports extends IntegrationTestCase
+class FlattenReportsTest extends IntegrationTestCase
{
public static $fixture = null; // initialized below class definition
/**
* @dataProvider getApiForTesting
- * @group Integration
- *
*/
public function testApi($api, $params)
{
@@ -120,6 +125,4 @@ class Test_Piwik_Integration_FlattenReports extends IntegrationTestCase
}
}
-Test_Piwik_Integration_FlattenReports::$fixture =
- new Test_Piwik_Fixture_ManyVisitsWithSubDirReferrersAndCustomVars();
-
+FlattenReportsTest::$fixture = new ManyVisitsWithSubDirReferrersAndCustomVars(); \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/ImportLogsTest.php b/tests/PHPUnit/Integration/ImportLogsTest.php
index 489fdc95e2..83b1da785a 100755
--- a/tests/PHPUnit/Integration/ImportLogsTest.php
+++ b/tests/PHPUnit/Integration/ImportLogsTest.php
@@ -5,19 +5,25 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Integration;
+
use Piwik\Access;
use Piwik\Plugins\SitesManager\API;
+use Piwik\Tests\IntegrationTestCase;
+use Piwik\Tests\Fixtures\ManySitesImportedLogs;
/**
* Tests the log importer.
+ *
+ * @group ImportLogsTest
+ * @group Integration
*/
-class Test_Piwik_Integration_ImportLogs extends IntegrationTestCase
+class ImportLogsTest extends IntegrationTestCase
{
public static $fixture = null; // initialized below class definition
/**
* @dataProvider getApiForTesting
- * @group Integration
*/
public function testApi($api, $params)
{
@@ -69,9 +75,6 @@ class Test_Piwik_Integration_ImportLogs extends IntegrationTestCase
}
/**
- * @group Integration
- *
- *
* NOTE: This test must be last since the new sites that get added are added in
* random order.
*/
@@ -99,5 +102,4 @@ class Test_Piwik_Integration_ImportLogs extends IntegrationTestCase
}
}
-Test_Piwik_Integration_ImportLogs::$fixture = new Test_Piwik_Fixture_ManySitesImportedLogs();
-
+ImportLogsTest::$fixture = new ManySitesImportedLogs(); \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/LabelFilterTest.php b/tests/PHPUnit/Integration/LabelFilterTest.php
index b8695f274b..5435809fff 100644
--- a/tests/PHPUnit/Integration/LabelFilterTest.php
+++ b/tests/PHPUnit/Integration/LabelFilterTest.php
@@ -5,20 +5,24 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Integration;
+
+use Piwik\Tests\IntegrationTestCase;
+use Piwik\Tests\Fixtures\OneVisitSeveralPageViews;
/**
* Tests the class LabelFilter.
* This is not possible as unit test, since it loads data from the archive.
*
* @group LabelFilterTest
+ * @group Integration
*/
-class Test_Piwik_Integration_LabelFilter extends IntegrationTestCase
+class LabelFilterTest extends IntegrationTestCase
{
public static $fixture = null; // initialized below class definition
/**
* @dataProvider getApiForTesting
- * @group Integration
*/
public function testApi($api, $params)
{
@@ -112,6 +116,50 @@ class Test_Piwik_Integration_LabelFilter extends IntegrationTestCase
$searchEngineTest['otherRequestParameters']['label'] = urlencode('Google>' . urlencode(html_entity_decode($keyword)));
$return[] = array('Referrers.getSearchEngines', $searchEngineTest);
+ // test the ! operator
+ $return[] = array('Actions.getPageTitles', array(
+ 'testSuffix' => '_terminalOperator_selectTerminal',
+ 'idSite' => $idSite,
+ 'date' => $dateTime,
+ 'otherRequestParameters' => array(
+ 'label' => urlencode(urlencode('check <>') . '> @ ' . urlencode('@one@')),
+ 'expanded' => 0
+ )
+ ));
+
+ $return[] = array('Actions.getPageTitles', array(
+ 'testSuffix' => '_terminalOperator_selectBranch',
+ 'idSite' => $idSite,
+ 'date' => $dateTime,
+ 'otherRequestParameters' => array(
+ 'label' => urlencode(urlencode('check <>') . '> ' . urlencode('@one@')),
+ 'expanded' => 0
+ )
+ ));
+
+ $return[] = array('Actions.getPageUrls', array(
+ 'testSuffix' => '_terminalOperator_selectTerminal',
+ 'idSite' => $idSite,
+ 'date' => $dateTime,
+ 'otherRequestParameters' => array(
+ 'label' => urlencode('dir> @ /subdir'),
+ 'expanded' => 0
+ )
+ ));
+
+ // test that filter_limit & filter_truncate are ignored when label is used
+ $return[] = array('Actions.getPageTitles', array(
+ 'testSuffix' => '_titles',
+ 'idSite' => $idSite,
+ 'date' => $dateTime,
+ 'otherRequestParameters' => array(
+ 'label' => urlencode('incredible title! <>,;'),
+ 'expanded' => 0,
+ 'filter_limit' => 1,
+ 'filter_truncate' => 1
+ )
+ ));
+
return $return;
}
@@ -121,5 +169,4 @@ class Test_Piwik_Integration_LabelFilter extends IntegrationTestCase
}
}
-Test_Piwik_Integration_LabelFilter::$fixture = new Test_Piwik_Fixture_OneVisitSeveralPageViews();
-
+LabelFilterTest::$fixture = new OneVisitSeveralPageViews(); \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/ManyVisitorsOneWebsiteTest.php b/tests/PHPUnit/Integration/ManyVisitorsOneWebsiteTest.php
index 82422186e8..edf52ffbfd 100755
--- a/tests/PHPUnit/Integration/ManyVisitorsOneWebsiteTest.php
+++ b/tests/PHPUnit/Integration/ManyVisitorsOneWebsiteTest.php
@@ -5,10 +5,13 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Integration;
require_once PIWIK_INCLUDE_PATH . '/tests/PHPUnit/MockLocationProvider.php';
use Piwik\Date;
+use Piwik\Tests\IntegrationTestCase;
+use Piwik\Tests\Fixtures\ManyVisitsWithGeoIP;
/**
* Tests w/ 14 visitors w/ 2 visits each.
@@ -16,14 +19,16 @@ use Piwik\Date;
*
* TODO Test ServerBased GeoIP implementation somehow. (Use X-FORWARDED-FOR?)
* TODO Test PECL implementation somehow. (The PECL module must point to the test dir, not the real one.)
+ *
+ * @group ManyVisitorsOneWebsiteTest
+ * @group Integration
*/
-class Test_Piwik_Integration_ManyVisitorsOneWebsiteTest extends IntegrationTestCase
+class ManyVisitorsOneWebsiteTest extends IntegrationTestCase
{
public static $fixture = null; // initialized below class definition
/**
* @dataProvider getApiForTesting
- * @group Integration
*/
public function testApi($api, $params)
{
@@ -126,5 +131,4 @@ class Test_Piwik_Integration_ManyVisitorsOneWebsiteTest extends IntegrationTestC
}
}
-Test_Piwik_Integration_ManyVisitorsOneWebsiteTest::$fixture = new Test_Piwik_Fixture_ManyVisitsWithGeoIP();
-
+ManyVisitorsOneWebsiteTest::$fixture = new ManyVisitsWithGeoIP(); \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/NoVisitTest.php b/tests/PHPUnit/Integration/NoVisitTest.php
index 6315830750..19a09a45f9 100755
--- a/tests/PHPUnit/Integration/NoVisitTest.php
+++ b/tests/PHPUnit/Integration/NoVisitTest.php
@@ -5,19 +5,25 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Integration;
+
+use Piwik\Tests\IntegrationTestCase;
+use Piwik\Tests\Fixtures\InvalidVisits;
/**
* testing various wrong Tracker requests and check that they behave as expected:
* not throwing errors and not recording data.
* API will archive and output empty stats.
+ *
+ * @group NoVisitTest
+ * @group Integration
*/
-class Test_Piwik_Integration_NoVisit extends IntegrationTestCase
+class NoVisitTest extends IntegrationTestCase
{
public static $fixture = null; // initialized below class definition
/**
* @dataProvider getApiForTesting
- * @group Integration
*/
public function testApi($api, $params)
{
@@ -44,5 +50,4 @@ class Test_Piwik_Integration_NoVisit extends IntegrationTestCase
}
}
-Test_Piwik_Integration_NoVisit::$fixture = new Test_Piwik_Fixture_InvalidVisits();
-
+NoVisitTest::$fixture = new InvalidVisits(); \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/NonUnicodeTest.php b/tests/PHPUnit/Integration/NonUnicodeTest.php
index b5b8a0c30b..cb9153a0ba 100755
--- a/tests/PHPUnit/Integration/NonUnicodeTest.php
+++ b/tests/PHPUnit/Integration/NonUnicodeTest.php
@@ -5,18 +5,24 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Integration;
+
+use Piwik\Tests\IntegrationTestCase;
+use Piwik\Tests\Fixtures\SomeVisitsWithNonUnicodePageTitles;
/**
* Tests that visits track & reports display correctly when non-unicode text is
* used in URL query params of visits.
+ *
+ * @group NonUnicodeTest
+ * @group Integration
*/
-class Test_Piwik_Integration_NonUnicodeTest extends IntegrationTestCase
+class NonUnicodeTest extends IntegrationTestCase
{
public static $fixture = null; // initialized below class definition
/**
* @dataProvider getApiForTesting
- * @group Integration
*/
public function testApi($api, $params)
{
@@ -46,6 +52,4 @@ class Test_Piwik_Integration_NonUnicodeTest extends IntegrationTestCase
}
-Test_Piwik_Integration_NonUnicodeTest::$fixture =
- new Test_Piwik_Fixture_SomeVisitsWithNonUnicodePageTitles();
-
+NonUnicodeTest::$fixture = new SomeVisitsWithNonUnicodePageTitles(); \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/OneVisitor_LongUrlsTruncatedTest.php b/tests/PHPUnit/Integration/OneVisitorLongUrlsTruncatedTest.php
index ce1d5121a3..62b94edcea 100644
--- a/tests/PHPUnit/Integration/OneVisitor_LongUrlsTruncatedTest.php
+++ b/tests/PHPUnit/Integration/OneVisitorLongUrlsTruncatedTest.php
@@ -5,16 +5,23 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Integration;
+
+use Piwik\Tests\IntegrationTestCase;
+use Piwik\Tests\Fixtures\SomeVisitsWithLongUrls;
+
/**
* Tests that filter_truncate works recursively in Page URLs report AND in the case there are 2 different data Keywords -> search engine
+ *
+ * @group OneVisitorLongUrlsTruncatedTest
+ * @group Integration
*/
-class Test_Piwik_Integration_OneVisitor_LongUrlsTruncated extends IntegrationTestCase
+class OneVisitorLongUrlsTruncatedTest extends IntegrationTestCase
{
public static $fixture = null; // initialized below class definition
/**
* @dataProvider getApiForTesting
- * @group Integration
*/
public function testApi($api, $params)
{
@@ -44,5 +51,4 @@ class Test_Piwik_Integration_OneVisitor_LongUrlsTruncated extends IntegrationTes
}
}
-Test_Piwik_Integration_OneVisitor_LongUrlsTruncated::$fixture = new Test_Piwik_Fixture_SomeVisitsWithLongUrls();
-
+OneVisitorLongUrlsTruncatedTest::$fixture = new SomeVisitsWithLongUrls(); \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/OneVisitor_NoKeywordSpecifiedTest.php b/tests/PHPUnit/Integration/OneVisitorNoKeywordSpecifiedTest.php
index 9c7c42cc2f..c2d8ba430b 100755
--- a/tests/PHPUnit/Integration/OneVisitor_NoKeywordSpecifiedTest.php
+++ b/tests/PHPUnit/Integration/OneVisitorNoKeywordSpecifiedTest.php
@@ -5,20 +5,26 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Integration;
+
+use Piwik\Tests\IntegrationTestCase;
+use Piwik\Tests\Fixtures\TwoVisitsNoKeywordWithBot;
/**
* 1) Tests empty google kwd works nicely in Live! output and Top keywords
* 2) Tests IP anonymization
* Also test that Live! will link to the search result page URL rather than the exact referrer URL
* when the referrer URL is google.XX/url.... which is a redirect to landing page rather than the search result URL
+ *
+ * @group Integration
+ * @group OneVisitorNoKeywordSpecifiedTest
*/
-class Test_Piwik_Integration_OneVisitor_NoKeywordSpecified extends IntegrationTestCase
+class OneVisitorNoKeywordSpecifiedTest extends IntegrationTestCase
{
public static $fixture = null; // initialized below class definition
/**
* @dataProvider getApiForTesting
- * @group Integration
*/
public function testApi($api, $params)
{
@@ -47,5 +53,4 @@ class Test_Piwik_Integration_OneVisitor_NoKeywordSpecified extends IntegrationTe
}
}
-Test_Piwik_Integration_OneVisitor_NoKeywordSpecified::$fixture = new Test_Piwik_Fixture_TwoVisitsNoKeywordWithBot();
-
+OneVisitorNoKeywordSpecifiedTest::$fixture = new TwoVisitsNoKeywordWithBot(); \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/OneVisitorOneWebsite_SeveralDaysDateRange_ArchivingTestsTest.php b/tests/PHPUnit/Integration/OneVisitorOneWebsiteSeveralDaysDateRangeArchivingTestsTest.php
index 176c9e1792..b7252a11d7 100755
--- a/tests/PHPUnit/Integration/OneVisitorOneWebsite_SeveralDaysDateRange_ArchivingTestsTest.php
+++ b/tests/PHPUnit/Integration/OneVisitorOneWebsiteSeveralDaysDateRangeArchivingTestsTest.php
@@ -5,15 +5,22 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Integration;
+
use Piwik\Common;
use Piwik\Db;
use Piwik\Piwik;
+use Piwik\Tests\IntegrationTestCase;
+use Piwik\Tests\Fixtures\VisitsOverSeveralDays;
/**
* Tests some API using range periods & makes sure the correct amount of blob/numeric
* archives are created.
+ *
+ * @group OneVisitorOneWebsiteSeveralDaysDateRangeArchivingTest
+ * @group Integration
*/
-class Test_Piwik_Integration_OneVisitorOneWebsite_SeveralDaysDateRange_ArchivingTests extends IntegrationTestCase
+class OneVisitorOneWebsiteSeveralDaysDateRangeArchivingTest extends IntegrationTestCase
{
public static $fixture = null; // initialized below test definition
@@ -24,8 +31,6 @@ class Test_Piwik_Integration_OneVisitorOneWebsite_SeveralDaysDateRange_Archiving
/**
* @dataProvider getApiForTesting
- * @group Integration
- * *
*/
public function testApi($api, $params)
{
@@ -89,10 +94,8 @@ class Test_Piwik_Integration_OneVisitorOneWebsite_SeveralDaysDateRange_Archiving
/**
* Check that requesting period "Range" means only processing
* the requested Plugin blob (Actions in this case), not all Plugins blobs
-
+ *
* @depends testApi
- * @group Integration
- * *
*/
public function test_checkArchiveRecords_whenPeriodIsRange()
{
@@ -180,6 +183,4 @@ class Test_Piwik_Integration_OneVisitorOneWebsite_SeveralDaysDateRange_Archiving
}
-Test_Piwik_Integration_OneVisitorOneWebsite_SeveralDaysDateRange_ArchivingTests::$fixture
- = new Test_Piwik_Fixture_VisitsOverSeveralDays();
-
+OneVisitorOneWebsiteSeveralDaysDateRangeArchivingTest::$fixture = new VisitsOverSeveralDays(); \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/OneVisitorOneWebsite_SeveralDaysDateRangeTest.php b/tests/PHPUnit/Integration/OneVisitorOneWebsiteSeveralDaysDateRangeTest.php
index a473112238..e877166a25 100755
--- a/tests/PHPUnit/Integration/OneVisitorOneWebsite_SeveralDaysDateRangeTest.php
+++ b/tests/PHPUnit/Integration/OneVisitorOneWebsiteSeveralDaysDateRangeTest.php
@@ -5,6 +5,10 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Integration;
+
+use Piwik\Tests\IntegrationTestCase;
+use Piwik\Tests\Fixtures\VisitsOverSeveralDays;
/**
* Use case testing various important features:
@@ -12,14 +16,16 @@
* - testing period=range use case.
* - Recording data before and after, checking that the requested range is processed correctly
* - and more
+ *
+ * @group OneVisitorOneWebsiteSeveralDaysDateRangeTest
+ * @group Integration
*/
-class Test_Piwik_Integration_OneVisitorOneWebsite_SeveralDaysDateRange extends IntegrationTestCase
+class OneVisitorOneWebsiteSeveralDaysDateRangeTest extends IntegrationTestCase
{
public static $fixture = null; // initialized below class definition
/**
* @dataProvider getApiForTesting
- * @group Integration
*/
public function testApi($api, $params)
{
@@ -94,6 +100,4 @@ class Test_Piwik_Integration_OneVisitorOneWebsite_SeveralDaysDateRange extends I
}
}
-Test_Piwik_Integration_OneVisitorOneWebsite_SeveralDaysDateRange::$fixture
- = new Test_Piwik_Fixture_VisitsOverSeveralDays();
-
+OneVisitorOneWebsiteSeveralDaysDateRangeTest::$fixture = new VisitsOverSeveralDays(); \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/OneVisitor_SeveralDays_ImportedInRandomOrderTest.php b/tests/PHPUnit/Integration/OneVisitorSeveralDaysImportedInRandomOrderTest.php
index 81af6b8123..5c4f427e79 100644
--- a/tests/PHPUnit/Integration/OneVisitor_SeveralDays_ImportedInRandomOrderTest.php
+++ b/tests/PHPUnit/Integration/OneVisitorSeveralDaysImportedInRandomOrderTest.php
@@ -5,14 +5,26 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Integration;
-class Test_Piwik_Integration_OneVisitor_SeveralDays_ImportedInRandomOrderTest extends IntegrationTestCase
+use Piwik\Tests\IntegrationTestCase;
+use Piwik\Tests\Fixtures\VisitOverSeveralDaysImportedLogs;
+
+/**
+ * @group Integration
+ * @group OneVisitorSeveralDaysImportedInRandomOrderTest
+ */
+class OneVisitorSeveralDaysImportedInRandomOrderTest extends IntegrationTestCase
{
public static $fixture = null; // initialized below class definition
+ public static function getOutputPrefix()
+ {
+ return "OneVisitor_SeveralDays_ImportedInRandomOrderTest";
+ }
+
/**
* @dataProvider getApiForTesting
- * @group Integration
*/
public function testApi($api, $params)
{
@@ -33,10 +45,6 @@ class Test_Piwik_Integration_OneVisitor_SeveralDays_ImportedInRandomOrderTest ex
)),
);
}
-
-
-
}
-Test_Piwik_Integration_OneVisitor_SeveralDays_ImportedInRandomOrderTest::$fixture = new Test_Piwik_Fixture_VisitOverSeveralDaysImportedLogs();
-
+OneVisitorSeveralDaysImportedInRandomOrderTest::$fixture = new VisitOverSeveralDaysImportedLogs(); \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/OneVisitorTwoVisitsTest.php b/tests/PHPUnit/Integration/OneVisitorTwoVisitsTest.php
index 5526d6fc71..94f8f79153 100755
--- a/tests/PHPUnit/Integration/OneVisitorTwoVisitsTest.php
+++ b/tests/PHPUnit/Integration/OneVisitorTwoVisitsTest.php
@@ -5,8 +5,13 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Integration;
+
use Piwik\API\Proxy;
use Piwik\Archive;
+use Piwik\Tests\IntegrationTestCase;
+use Piwik\Tests\Fixtures\OneVisitorTwoVisits;
+use Exception;
/**
* This use case covers many simple tracking features.
@@ -17,8 +22,11 @@ use Piwik\Archive;
* - In a returning visit, tracks a Goal conversion
* URL matching, with custom referrer and keyword
* NO cookie support
+ *
+ * @group Integration
+ * @group OneVisitorTwoVisitsTest
*/
-class Test_Piwik_Integration_OneVisitorTwoVisits extends IntegrationTestCase
+class OneVisitorTwoVisitsTest extends IntegrationTestCase
{
/**
* @var Test_Piwik_Fixture_OneVisitorTwoVisits
@@ -35,9 +43,13 @@ class Test_Piwik_Integration_OneVisitorTwoVisits extends IntegrationTestCase
Proxy::getInstance()->setHideIgnoredFunctions(true);
}
+ public static function getOutputPrefix()
+ {
+ return "OneVisitorTwoVisits";
+ }
+
/**
* @dataProvider getApiForTesting
- * @group Integration
*/
public function testApi($api, $params)
{
@@ -178,8 +190,6 @@ class Test_Piwik_Integration_OneVisitorTwoVisits extends IntegrationTestCase
/**
* Test that Archive::getBlob won't fetch extra unnecessary blobs.
- *
- * @group Integration
*/
public function testArchiveSingleGetBlob()
{
@@ -203,8 +213,6 @@ class Test_Piwik_Integration_OneVisitorTwoVisits extends IntegrationTestCase
/**
* Test that restricting the number of sites to those viewable to another login
* works when building an archive query object.
- *
- * @group Integration
*/
public function testArchiveSitesWhenRestrictingToLogin()
{
@@ -221,5 +229,5 @@ class Test_Piwik_Integration_OneVisitorTwoVisits extends IntegrationTestCase
}
}
-Test_Piwik_Integration_OneVisitorTwoVisits::$fixture = new Test_Piwik_Fixture_OneVisitorTwoVisits();
-Test_Piwik_Integration_OneVisitorTwoVisits::$fixture->excludeMozilla = true; \ No newline at end of file
+OneVisitorTwoVisitsTest::$fixture = new OneVisitorTwoVisits();
+OneVisitorTwoVisitsTest::$fixture->excludeMozilla = true; \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/OneVisitorTwoVisits_withCookieSupportTest.php b/tests/PHPUnit/Integration/OneVisitorTwoVisitsWithCookieSupportTest.php
index c8f87c9732..a266118018 100755
--- a/tests/PHPUnit/Integration/OneVisitorTwoVisits_withCookieSupportTest.php
+++ b/tests/PHPUnit/Integration/OneVisitorTwoVisitsWithCookieSupportTest.php
@@ -5,23 +5,27 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Integration;
+
+use Piwik\Tests\IntegrationTestCase;
+use Piwik\Tests\Fixtures\OneVisitorTwoVisits;
/**
* Same as OneVisitorTwoVisits.test.php, but with cookie support, which incurs some slight changes
* in the reporting data (more accurate unique visitor count, better referrer tracking for goals, etc.)
+ *
+ * @group OneVisitorTwoVisitsWithCookieSupportTest
+ * @group Integration
*/
-class Test_Piwik_Integration_OneVisitorTwoVisits_WithCookieSupport extends IntegrationTestCase
+class OneVisitorTwoVisitsWithCookieSupportTest extends IntegrationTestCase
{
public static $fixture = null; // initialized below class
/**
* @dataProvider getApiForTesting
- * @group Integration
- *
*/
public function testApi($api, $params)
{
- //var_dump(\Piwik\Db::get()->fetchAll('select * from piwiktests_log_action' ));
$this->runApiTests($api, $params);
}
@@ -44,7 +48,6 @@ class Test_Piwik_Integration_OneVisitorTwoVisits_WithCookieSupport extends Integ
}
}
-Test_Piwik_Integration_OneVisitorTwoVisits_WithCookieSupport::$fixture = new Test_Piwik_Fixture_OneVisitorTwoVisits();
-Test_Piwik_Integration_OneVisitorTwoVisits_WithCookieSupport::$fixture->useThirdPartyCookies = true;
-Test_Piwik_Integration_OneVisitorTwoVisits_WithCookieSupport::$fixture->useSiteSearch = true;
-
+OneVisitorTwoVisitsWithCookieSupportTest::$fixture = new OneVisitorTwoVisits();
+OneVisitorTwoVisitsWithCookieSupportTest::$fixture->useThirdPartyCookies = true;
+OneVisitorTwoVisitsWithCookieSupportTest::$fixture->useSiteSearch = true; \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/PeriodIsRange_DateIsLastN_MetadataAndNormalAPITest.php b/tests/PHPUnit/Integration/PeriodIsRangeDateIsLastNMetadataAndNormalAPITest.php
index b96c54f66c..cbf5b2e5f7 100755
--- a/tests/PHPUnit/Integration/PeriodIsRange_DateIsLastN_MetadataAndNormalAPITest.php
+++ b/tests/PHPUnit/Integration/PeriodIsRangeDateIsLastNMetadataAndNormalAPITest.php
@@ -5,12 +5,19 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Integration;
+
use Piwik\Date;
+use Piwik\Tests\IntegrationTestCase;
+use Piwik\Tests\Fixtures\TwoVisitsWithCustomVariables;
/**
* test Metadata API + period=range&date=lastN
+ *
+ * @group PeriodIsRangeDateIsLastNMetadataAndNormalAPITest
+ * @group Integration
*/
-class Test_Piwik_Integration_PeriodIsRange_DateIsLastN_MetadataAndNormalAPI extends IntegrationTestCase
+class PeriodIsRangeDateIsLastNMetadataAndNormalAPITest extends IntegrationTestCase
{
public static $fixture = null;
@@ -22,7 +29,6 @@ class Test_Piwik_Integration_PeriodIsRange_DateIsLastN_MetadataAndNormalAPI exte
/**
* @dataProvider getApiForTesting
- * @group Integration
*/
public function testApi($api, $params)
{
@@ -80,7 +86,5 @@ class Test_Piwik_Integration_PeriodIsRange_DateIsLastN_MetadataAndNormalAPI exte
}
}
-Test_Piwik_Integration_PeriodIsRange_DateIsLastN_MetadataAndNormalAPI::$fixture =
- new Test_Piwik_Fixture_TwoVisitsWithCustomVariables();
-Test_Piwik_Integration_PeriodIsRange_DateIsLastN_MetadataAndNormalAPI::$fixture->doExtraQuoteTests = false;
-
+PeriodIsRangeDateIsLastNMetadataAndNormalAPITest::$fixture = new TwoVisitsWithCustomVariables();
+PeriodIsRangeDateIsLastNMetadataAndNormalAPITest::$fixture->doExtraQuoteTests = false; \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/Plugins/UsersManagerTest.php b/tests/PHPUnit/Integration/Plugins/UsersManagerTest.php
index d02e79fd5b..cbcb6da860 100644
--- a/tests/PHPUnit/Integration/Plugins/UsersManagerTest.php
+++ b/tests/PHPUnit/Integration/Plugins/UsersManagerTest.php
@@ -1,4 +1,10 @@
<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
use Piwik\Access;
use Piwik\Plugins\SitesManager\API as APISitesManager;
use Piwik\Plugins\UsersManager\API;
diff --git a/tests/PHPUnit/Integration/PrivacyManagerTest.php b/tests/PHPUnit/Integration/PrivacyManagerTest.php
index c8a6d975b0..591be30265 100644
--- a/tests/PHPUnit/Integration/PrivacyManagerTest.php
+++ b/tests/PHPUnit/Integration/PrivacyManagerTest.php
@@ -5,6 +5,8 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Integration;
+
use Piwik\Archive;
use Piwik\ArchiveProcessor\Rules;
use Piwik\Common;
@@ -23,9 +25,15 @@ use Piwik\Plugins\VisitorInterest\API as APIVisitorInterest;
use Piwik\Site;
use Piwik\Tracker\Cache;
use Piwik\Tracker\GoalManager;
+use Piwik\Tests\IntegrationTestCase;
+use Piwik\Tests\Fixture;
require_once 'PrivacyManager/PrivacyManager.php';
+/**
+ * @group PrivacyManagerTest
+ * @group Integration
+ */
class PrivacyManagerTest extends IntegrationTestCase
{
// constants used in checking whether numeric tables are populated correctly.
@@ -134,8 +142,6 @@ class PrivacyManagerTest extends IntegrationTestCase
/**
* Make sure the first time deleteLogData is run, nothing happens.
- *
- * @group Integration
*/
public function testDeleteLogDataInitialRun()
{
@@ -153,8 +159,6 @@ class PrivacyManagerTest extends IntegrationTestCase
/**
* Make sure the first time deleteReportData is run, nothing happens.
- *
- * @group Integration
*/
public function testDeleteReportDataInitialRun()
{
@@ -169,8 +173,6 @@ class PrivacyManagerTest extends IntegrationTestCase
/**
* Make sure the task is not run when its scheduled for later.
- *
- * @group Integration
*/
public function testPurgeDataNotTimeToRun()
{
@@ -188,8 +190,6 @@ class PrivacyManagerTest extends IntegrationTestCase
/**
* Make sure purging data runs when scheduled.
- *
- * @group Integration
*/
public function testPurgeDataNotInitialAndTimeToRun()
{
@@ -234,8 +234,6 @@ class PrivacyManagerTest extends IntegrationTestCase
/**
* Make sure nothing happens when deleting logs & reports are both disabled.
- *
- * @group Integration
*/
public function testPurgeDataBothDisabled()
{
@@ -263,8 +261,6 @@ class PrivacyManagerTest extends IntegrationTestCase
/**
* Test that purgeData works when there's no data.
- *
- * @group Integration
*/
public function testPurgeDataDeleteLogsNoData()
{
@@ -301,8 +297,6 @@ class PrivacyManagerTest extends IntegrationTestCase
/**
* Test that purgeData works correctly when the 'keep basic metrics' setting is set to true.
- *
- * @group Integration
*/
public function testPurgeDataDeleteReportsKeepBasicMetrics()
{
@@ -357,8 +351,6 @@ class PrivacyManagerTest extends IntegrationTestCase
/**
* Test that purgeData works correctly when the 'keep daily reports' setting is set to true.
- *
- * @group Integration
*/
public function testPurgeDataDeleteReportsKeepDailyReports()
{
@@ -393,8 +385,6 @@ class PrivacyManagerTest extends IntegrationTestCase
/**
* Test that purgeData works correctly when the 'keep weekly reports' setting is set to true.
- *
- * @group Integration
*/
public function testPurgeDataDeleteReportsKeepWeeklyReports()
{
@@ -429,8 +419,6 @@ class PrivacyManagerTest extends IntegrationTestCase
/**
* Test that purgeData works correctly when the 'keep monthly reports' setting is set to true.
- *
- * @group Integration
*/
public function testPurgeDataDeleteReportsKeepMonthlyReports()
{
@@ -465,8 +453,6 @@ class PrivacyManagerTest extends IntegrationTestCase
/**
* Test that purgeData works correctly when the 'keep yearly reports' setting is set to true.
- *
- * @group Integration
*/
public function testPurgeDataDeleteReportsKeepYearlyReports()
{
@@ -501,8 +487,6 @@ class PrivacyManagerTest extends IntegrationTestCase
/**
* Test no concurrency issues when deleting log data from log_action table.
- *
- * @group Integration
*/
public function testPurgeLogDataConcurrency()
{
@@ -532,8 +516,6 @@ class PrivacyManagerTest extends IntegrationTestCase
/**
* Tests that purgeData works correctly when the 'keep range reports' setting is set to true.
- *
- * @group Integration
*/
public function testPurgeDataDeleteReportsKeepRangeReports()
{
@@ -568,8 +550,6 @@ class PrivacyManagerTest extends IntegrationTestCase
/**
* Tests that purgeData works correctly when the 'keep segment reports' setting is set to true.
- *
- * @group Integration
*/
public function testPurgeDataDeleteReportsKeepSegmentsReports()
{
@@ -675,7 +655,6 @@ class PrivacyManagerTest extends IntegrationTestCase
$archive = Archive::build(self::$idSite, 'year', $date);
APIVisitorInterest::getInstance()->getNumberOfVisitsPerVisitDuration(self::$idSite, 'year', $date);
-// APIVisitorInterest::getInstance()->get(self::$idSite, 'month', $date, $segment = false, self::$idSite);
// months are added via the 'year' period, but weeks must be done manually
for ($daysAgo = self::$daysAgoStart; $daysAgo > 0; $daysAgo -= 7) // every week
@@ -915,5 +894,4 @@ class PrivacyManagerTest extends IntegrationTestCase
;
return $eventsId;
}
-}
-
+} \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/PurgeDataTest.php b/tests/PHPUnit/Integration/PurgeDataTest.php
index e6ea34d9c3..29d7ccc084 100755
--- a/tests/PHPUnit/Integration/PurgeDataTest.php
+++ b/tests/PHPUnit/Integration/PurgeDataTest.php
@@ -5,17 +5,23 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Integration;
require_once PIWIK_INCLUDE_PATH . '/tests/PHPUnit/MockLocationProvider.php';
use Piwik\API\Request;
use Piwik\Plugins\PrivacyManager\PrivacyManager;
use Piwik\Plugins\PrivacyManager\ReportsPurger;
+use Piwik\Tests\IntegrationTestCase;
+use Piwik\Tests\Fixtures\OneVisitorTwoVisits;
/**
+ * TODO: shouldn't this be merged w/ PrivacyManagerTest? the original data purging tests are there
+ *
* @group Integration
+ * @group PurgeDataTest
*/
-class Test_Piwik_Integration_PurgeDataTest extends IntegrationTestCase
+class PurgeDataTest extends IntegrationTestCase
{
public static $fixture = null; // initialized below class definition
@@ -185,5 +191,4 @@ class Test_Piwik_Integration_PurgeDataTest extends IntegrationTestCase
}
}
-Test_Piwik_Integration_PurgeDataTest::$fixture = new Test_Piwik_Fixture_OneVisitorTwoVisits();
-
+PurgeDataTest::$fixture = new OneVisitorTwoVisits();
diff --git a/tests/PHPUnit/Integration/RowEvolutionTest.php b/tests/PHPUnit/Integration/RowEvolutionTest.php
index f0c87a0656..6fac424f54 100755
--- a/tests/PHPUnit/Integration/RowEvolutionTest.php
+++ b/tests/PHPUnit/Integration/RowEvolutionTest.php
@@ -5,17 +5,23 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Integration;
+
+use Piwik\Tests\IntegrationTestCase;
+use Piwik\Tests\Fixtures\TwoSitesManyVisitsOverSeveralDaysWithSearchEngineReferrers;
/**
* Tests the method API.getRowEvolution
+ *
+ * @group RowEvolutionTest
+ * @group Integration
*/
-class Test_Piwik_Integration_RowEvolution extends IntegrationTestCase
+class RowEvolutionTest extends IntegrationTestCase
{
public static $fixture = null; // initialized below class definition
/**
* @dataProvider getApiForTesting
- * @group Integration
*/
public function testApi($api, $params)
{
@@ -230,5 +236,4 @@ class Test_Piwik_Integration_RowEvolution extends IntegrationTestCase
}
}
-Test_Piwik_Integration_RowEvolution::$fixture
- = new Test_Piwik_Fixture_TwoSitesManyVisitsOverSeveralDaysWithSearchEngineReferrers(); \ No newline at end of file
+RowEvolutionTest::$fixture = new TwoSitesManyVisitsOverSeveralDaysWithSearchEngineReferrers(); \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/SiteSearchTest.php b/tests/PHPUnit/Integration/SiteSearchTest.php
index f329833f9c..0ae3c73fd2 100755
--- a/tests/PHPUnit/Integration/SiteSearchTest.php
+++ b/tests/PHPUnit/Integration/SiteSearchTest.php
@@ -5,17 +5,23 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Integration;
+
+use Piwik\Tests\IntegrationTestCase;
+use Piwik\Tests\Fixtures\ThreeSitesWithManyVisitsWithSiteSearch;
/**
* Testing the various use cases w/ internal Site Search tracking
+ *
+ * @group SiteSearchTest
+ * @group Integration
*/
-class Test_Piwik_Integration_SiteSearch extends IntegrationTestCase
+class SiteSearchTest extends IntegrationTestCase
{
public static $fixture = null; // initialized below class definition
/**
* @dataProvider getApiForTesting
- * @group Integration
*/
public function testApi($api, $params)
{
@@ -86,5 +92,4 @@ class Test_Piwik_Integration_SiteSearch extends IntegrationTestCase
}
}
-Test_Piwik_Integration_SiteSearch::$fixture = new Test_Piwik_Fixture_ThreeSitesWithManyVisitsWithSiteSearch();
-
+SiteSearchTest::$fixture = new ThreeSitesWithManyVisitsWithSiteSearch(); \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/TimezonesTest.php b/tests/PHPUnit/Integration/TimezonesTest.php
index 26d77d6dac..1603c23cb4 100644
--- a/tests/PHPUnit/Integration/TimezonesTest.php
+++ b/tests/PHPUnit/Integration/TimezonesTest.php
@@ -5,12 +5,19 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Integration;
+
use Piwik\Date;
+use Piwik\Tests\IntegrationTestCase;
+use Piwik\Tests\Fixtures\VisitsInDifferentTimezones;
/**
* Test reports using visits for a site with a non-UTC timezone.
+ *
+ * @group TimezonesTest
+ * @group Integration
*/
-class Test_Piwik_Integration_TimezonesTest extends IntegrationTestCase
+class TimezonesTest extends IntegrationTestCase
{
public static $fixture = null; // initialized below class definition
@@ -41,7 +48,6 @@ class Test_Piwik_Integration_TimezonesTest extends IntegrationTestCase
/**
* @dataProvider getApiForTesting
- * @group Integration
*/
public function testApi($api, $params)
{
@@ -49,4 +55,4 @@ class Test_Piwik_Integration_TimezonesTest extends IntegrationTestCase
}
}
-Test_Piwik_Integration_TimezonesTest::$fixture = new Test_Piwik_Fixture_VisitsInDifferentTimezones(); \ No newline at end of file
+TimezonesTest::$fixture = new VisitsInDifferentTimezones(); \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/TrackCustomVariablesAndCampaigns_ForceUsingVisitIdNotHeuristicsTest.php b/tests/PHPUnit/Integration/TrackCustomVariablesAndCampaignsForceUsingVisitIdNotHeuristicsTest.php
index 3ccefa4a64..3f45410510 100755
--- a/tests/PHPUnit/Integration/TrackCustomVariablesAndCampaigns_ForceUsingVisitIdNotHeuristicsTest.php
+++ b/tests/PHPUnit/Integration/TrackCustomVariablesAndCampaignsForceUsingVisitIdNotHeuristicsTest.php
@@ -5,18 +5,24 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Integration;
+
+use Piwik\Tests\IntegrationTestCase;
+use Piwik\Tests\Fixtures\SomeVisitsCustomVariablesCampaignsNotHeuristics;
/**
* Test tracker & API when forcing the use of visit ID instead of heuristics. Also
* tests campaign tracking.
+ *
+ * @group TrackCustomVariablesAndCampaignsForceUsingVisitIdNotHeuristicsTest
+ * @group Integration
*/
-class Test_Piwik_Integration_TrackCustomVariablesAndCampaigns_ForceUsingVisitIdNotHeuristics extends IntegrationTestCase
+class TrackCustomVariablesAndCampaignsForceUsingVisitIdNotHeuristicsTest extends IntegrationTestCase
{
public static $fixture = null; // initialized below class definition
/**
* @dataProvider getApiForTesting
- * @group Integration
*/
public function testApi($api, $params)
{
@@ -39,6 +45,5 @@ class Test_Piwik_Integration_TrackCustomVariablesAndCampaigns_ForceUsingVisitIdN
}
}
-Test_Piwik_Integration_TrackCustomVariablesAndCampaigns_ForceUsingVisitIdNotHeuristics::$fixture =
- new Test_Piwik_Fixture_SomeVisitsCustomVariablesCampaignsNotHeuristics();
-
+TrackCustomVariablesAndCampaignsForceUsingVisitIdNotHeuristicsTest::$fixture =
+ new SomeVisitsCustomVariablesCampaignsNotHeuristics(); \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/TrackGoals_AllowMultipleConversionsPerVisitTest.php b/tests/PHPUnit/Integration/TrackGoalsAllowMultipleConversionsPerVisitTest.php
index a1eb784ff6..6ed0f41a46 100755
--- a/tests/PHPUnit/Integration/TrackGoals_AllowMultipleConversionsPerVisitTest.php
+++ b/tests/PHPUnit/Integration/TrackGoalsAllowMultipleConversionsPerVisitTest.php
@@ -5,19 +5,25 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Integration;
+
use Piwik\Plugins\Goals\API;
+use Piwik\Tests\IntegrationTestCase;
+use Piwik\Tests\Fixtures\SomeVisitsAllConversions;
/**
* Tests API methods with goals that do and don't allow multiple
* conversions per visit.
+ *
+ * @group TrackGoalsAllowMultipleConversionsPerVisitTest
+ * @group Integration
*/
-class Test_Piwik_Integration_TrackGoals_AllowMultipleConversionsPerVisit extends IntegrationTestCase
+class TrackGoalsAllowMultipleConversionsPerVisitTest extends IntegrationTestCase
{
public static $fixture = null;
/**
* @dataProvider getApiForTesting
- * @group Integration
*/
public function testApi($api, $params)
{
@@ -26,7 +32,6 @@ class Test_Piwik_Integration_TrackGoals_AllowMultipleConversionsPerVisit extends
/**
* @depends testApi
- * @group Integration
*/
public function testCheck()
{
@@ -59,5 +64,4 @@ class Test_Piwik_Integration_TrackGoals_AllowMultipleConversionsPerVisit extends
}
}
-Test_Piwik_Integration_TrackGoals_AllowMultipleConversionsPerVisit::$fixture
- = new Piwik_Test_Fixture_SomeVisitsAllConversions();
+TrackGoalsAllowMultipleConversionsPerVisitTest::$fixture = new SomeVisitsAllConversions(); \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/TrackerWindowLookBackTest.php b/tests/PHPUnit/Integration/TrackerWindowLookBackTest.php
index c56d7786dd..58f1eecde7 100644
--- a/tests/PHPUnit/Integration/TrackerWindowLookBackTest.php
+++ b/tests/PHPUnit/Integration/TrackerWindowLookBackTest.php
@@ -5,19 +5,24 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Integration;
+
+use Piwik\Tests\IntegrationTestCase;
+use Piwik\Tests\Fixtures\VisitsOverSeveralDays;
/**
* Testing that, when using window_look_back_for_visitor with a high value,
* works well with the use case of a returning visitor being assigned to today's visit
*
+ * @group TrackerWindowLookBackTest
+ * @group Integration
*/
-class Test_Piwik_Integration_TrackerWindowLookBack extends IntegrationTestCase
+class TrackerWindowLookBackTest extends IntegrationTestCase
{
public static $fixture = null; // initialized below class definition
/**
* @dataProvider getApiForTesting
- * @group Integration
*/
public function testApi($api, $params)
{
@@ -42,5 +47,5 @@ class Test_Piwik_Integration_TrackerWindowLookBack extends IntegrationTestCase
}
}
-Test_Piwik_Integration_TrackerWindowLookBack::$fixture = new Test_Piwik_Fixture_VisitsOverSeveralDays();
-Test_Piwik_Integration_TrackerWindowLookBack::$fixture->forceLargeWindowLookBackForVisitor = true;
+TrackerWindowLookBackTest::$fixture = new VisitsOverSeveralDays();
+TrackerWindowLookBackTest::$fixture->forceLargeWindowLookBackForVisitor = true; \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/TrackingAPI_SetVisitorIdTest.php b/tests/PHPUnit/Integration/TrackingAPISetVisitorIdTest.php
index 3c738dcf26..86885f513d 100644
--- a/tests/PHPUnit/Integration/TrackingAPI_SetVisitorIdTest.php
+++ b/tests/PHPUnit/Integration/TrackingAPISetVisitorIdTest.php
@@ -5,13 +5,19 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Integration;
+
use Piwik\API\Proxy;
+use Piwik\Tests\IntegrationTestCase;
+use Piwik\Tests\Fixtures\FewVisitsWithSetVisitorId;
/**
* This test tests that when using &cid=, the visitor ID is enforced
*
+ * @group TrackingAPISetVisitorIdTest
+ * @group Integration
*/
-class Test_Piwik_Integration_TrackingAPI_SetVisitorId extends IntegrationTestCase
+class TrackingAPISetVisitorIdTest extends IntegrationTestCase
{
public static $fixture = null; // initialized below class definition
@@ -25,9 +31,13 @@ class Test_Piwik_Integration_TrackingAPI_SetVisitorId extends IntegrationTestCas
Proxy::getInstance()->setHideIgnoredFunctions(true);
}
+ public static function getOutputPrefix()
+ {
+ return "TrackingAPI_SetVisitorId";
+ }
+
/**
* @dataProvider getApiForTesting
- * @group Integration
*/
public function testApi($api, $params)
{
@@ -46,5 +56,4 @@ class Test_Piwik_Integration_TrackingAPI_SetVisitorId extends IntegrationTestCas
}
}
-Test_Piwik_Integration_TrackingAPI_SetVisitorId::$fixture = new Test_Piwik_Fixture_FewVisitsWithSetVisitorId();
-
+TrackingAPISetVisitorIdTest::$fixture = new FewVisitsWithSetVisitorId(); \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/TransitionsTest.php b/tests/PHPUnit/Integration/TransitionsTest.php
index aaf7edff70..7bb55b9f56 100644
--- a/tests/PHPUnit/Integration/TransitionsTest.php
+++ b/tests/PHPUnit/Integration/TransitionsTest.php
@@ -1,15 +1,27 @@
<?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\Tests\Integration;
+
+use Piwik\Tests\IntegrationTestCase;
+use Piwik\Tests\Fixtures\SomeVisitsManyPageviewsWithTransitions;
/**
* Tests the transitions plugin.
+ *
+ * @group TransitionsTest
+ * @group Integration
*/
-class Test_Piwik_Integration_Transitions extends IntegrationTestCase
+class TransitionsTest extends IntegrationTestCase
{
public static $fixture = null; // initialized below class definition
/**
* @dataProvider getApiForTesting
- * @group Integration
*/
public function testApi($api, $params)
{
@@ -76,5 +88,4 @@ class Test_Piwik_Integration_Transitions extends IntegrationTestCase
}
}
-Test_Piwik_Integration_Transitions::$fixture = new Test_Piwik_Fixture_SomeVisitsManyPageviewsWithTransitions();
-
+TransitionsTest::$fixture = new SomeVisitsManyPageviewsWithTransitions(); \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/TwoVisitors_TwoWebsites_DifferentDays_ArchivingDisabledTest.php b/tests/PHPUnit/Integration/TwoVisitorsTwoWebsitesDifferentDaysArchivingDisabledTest.php
index 154acdb647..747b733a9c 100755
--- a/tests/PHPUnit/Integration/TwoVisitors_TwoWebsites_DifferentDays_ArchivingDisabledTest.php
+++ b/tests/PHPUnit/Integration/TwoVisitorsTwoWebsitesDifferentDaysArchivingDisabledTest.php
@@ -5,18 +5,23 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Integration;
+
+use Piwik\Tests\IntegrationTestCase;
+use Piwik\Tests\Fixtures\TwoSitesTwoVisitorsDifferentDays;
/**
* Tests IndexedBySite optimizations when archiving is disabled.
+ *
+ * @group TwoVisitorsTwoWebsitesDifferentDaysArchivingDisabledTest
+ * @group Integration
*/
-class Test_Piwik_Integration_TwoVisitors_TwoWebsites_DifferentDays_ArchivingDisabled extends IntegrationTestCase
+class TwoVisitorsTwoWebsitesDifferentDaysArchivingDisabledTest extends IntegrationTestCase
{
public static $fixture = null; // initialized below class definition
/**
* @dataProvider getApiForTesting
- * @group Integration
- *
*/
public function testApi($api, $params)
{
@@ -56,7 +61,7 @@ class Test_Piwik_Integration_TwoVisitors_TwoWebsites_DifferentDays_ArchivingDisa
'testSuffix' => '_disabledAfter')),
- // Testing this particular bug: http://dev.piwik.org/trac/ticket/4532
+ // Testing this particular bug: https://github.com/piwik/piwik/issues/4532
// ENABLE ARCHIVING and Process this custom date range.
array('VisitsSummary.get', array('idSite' => 'all',
'date' => $dateRange,
@@ -83,7 +88,5 @@ class Test_Piwik_Integration_TwoVisitors_TwoWebsites_DifferentDays_ArchivingDisa
}
}
-Test_Piwik_Integration_TwoVisitors_TwoWebsites_DifferentDays_ArchivingDisabled::$fixture =
- new Test_Piwik_Fixture_TwoSitesTwoVisitorsDifferentDays();
-Test_Piwik_Integration_TwoVisitors_TwoWebsites_DifferentDays_ArchivingDisabled::$fixture->allowConversions = true;
-
+TwoVisitorsTwoWebsitesDifferentDaysArchivingDisabledTest::$fixture = new TwoSitesTwoVisitorsDifferentDays();
+TwoVisitorsTwoWebsitesDifferentDaysArchivingDisabledTest::$fixture->allowConversions = true; \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/TwoVisitors_TwoWebsites_DifferentDays_ConversionsTest.php b/tests/PHPUnit/Integration/TwoVisitorsTwoWebsitesDifferentDaysConversionsTest.php
index 00972de40b..9557cba704 100755
--- a/tests/PHPUnit/Integration/TwoVisitors_TwoWebsites_DifferentDays_ConversionsTest.php
+++ b/tests/PHPUnit/Integration/TwoVisitorsTwoWebsitesDifferentDaysConversionsTest.php
@@ -5,23 +5,27 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Integration;
use Piwik\Plugins\Goals\Archiver;
+use Piwik\Tests\IntegrationTestCase;
+use Piwik\Tests\Fixtures\TwoSitesTwoVisitorsDifferentDays;
require_once 'Goals/Goals.php';
/**
* Same as TwoVisitors_twoWebsites_differentDays but with goals that convert
* on every url.
+ *
+ * @group TwoVisitorsTwoWebsitesDifferentDaysConversionsTest
+ * @group Integration
*/
-class Test_Piwik_Integration_TwoVisitors_TwoWebsites_DifferentDays_Conversions extends IntegrationTestCase
+class TwoVisitorsTwoWebsitesDifferentDaysConversionsTest extends IntegrationTestCase
{
public static $fixture = null; // initialized below class definition
/**
* @dataProvider getApiForTesting
- * @group Integration
- *
*/
public function testApi($api, $params)
{
@@ -111,7 +115,5 @@ class Test_Piwik_Integration_TwoVisitors_TwoWebsites_DifferentDays_Conversions e
}
}
-Test_Piwik_Integration_TwoVisitors_TwoWebsites_DifferentDays_Conversions::$fixture =
- new Test_Piwik_Fixture_TwoSitesTwoVisitorsDifferentDays();
-Test_Piwik_Integration_TwoVisitors_TwoWebsites_DifferentDays_Conversions::$fixture->allowConversions = true;
-
+TwoVisitorsTwoWebsitesDifferentDaysConversionsTest::$fixture = new TwoSitesTwoVisitorsDifferentDays();
+TwoVisitorsTwoWebsitesDifferentDaysConversionsTest::$fixture->allowConversions = true; \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/TwoVisitors_TwoWebsites_DifferentDaysTest.php b/tests/PHPUnit/Integration/TwoVisitorsTwoWebsitesDifferentDaysTest.php
index e19490274b..f4c14d3569 100755
--- a/tests/PHPUnit/Integration/TwoVisitors_TwoWebsites_DifferentDaysTest.php
+++ b/tests/PHPUnit/Integration/TwoVisitorsTwoWebsitesDifferentDaysTest.php
@@ -5,6 +5,10 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Integration;
+
+use Piwik\Tests\IntegrationTestCase;
+use Piwik\Tests\Fixtures\TwoSitesTwoVisitorsDifferentDays;
/**
* tests Tracker several websites, different days.
@@ -14,14 +18,14 @@
* And testing empty URL and empty Page name request
* Also testing a click on a mailto counted as outlink
* Also testing metadata API for multiple periods
+ *
+ * @group TwoVisitorsTwoWebsitesDifferentDaysTest
+ * @group Integration
*/
-class Test_Piwik_Integration_TwoVisitors_TwoWebsites_DifferentDays extends IntegrationTestCase
+class TwoVisitorsTwoWebsitesDifferentDaysTest extends IntegrationTestCase
{
public static $fixture = null; // initialized below class definition
- /**
- * @group Integration
- */
public function testImagesIncludedInTests()
{
$this->alertWhenImagesExcludedFromTests();
@@ -29,7 +33,6 @@ class Test_Piwik_Integration_TwoVisitors_TwoWebsites_DifferentDays extends Integ
/**
* @dataProvider getApiForTesting
- * @group Integration
*/
public function testApi($api, $params)
{
@@ -106,6 +109,4 @@ class Test_Piwik_Integration_TwoVisitors_TwoWebsites_DifferentDays extends Integ
}
}
-Test_Piwik_Integration_TwoVisitors_TwoWebsites_DifferentDays::$fixture =
- new Test_Piwik_Fixture_TwoSitesTwoVisitorsDifferentDays();
-
+TwoVisitorsTwoWebsitesDifferentDaysTest::$fixture = new TwoSitesTwoVisitorsDifferentDays(); \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/TwoVisitsWithCustomVariables_SegmentContainsTest.php b/tests/PHPUnit/Integration/TwoVisitsWithCustomVariablesSegmentContainsTest.php
index 3b6f63bb26..1f31497a53 100755
--- a/tests/PHPUnit/Integration/TwoVisitsWithCustomVariables_SegmentContainsTest.php
+++ b/tests/PHPUnit/Integration/TwoVisitsWithCustomVariablesSegmentContainsTest.php
@@ -5,11 +5,18 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Integration;
+
+use Piwik\Tests\IntegrationTestCase;
+use Piwik\Tests\Fixtures\TwoVisitsWithCustomVariables;
/**
* Tests use of custom variable segments.
+ *
+ * @group Integration
+ * @group TwoVisitsWithCustomVariablesSegmentContainsTest
*/
-class Test_Piwik_Integration_TwoVisitsWithCustomVariables_SegmentContains extends IntegrationTestCase
+class TwoVisitsWithCustomVariablesSegmentContainsTest extends IntegrationTestCase
{
public static $fixture = null; // initialized below class definition
@@ -20,7 +27,6 @@ class Test_Piwik_Integration_TwoVisitsWithCustomVariables_SegmentContains extend
/**
* @dataProvider getApiForTesting
- * @group Integration
*/
public function testApi($api, $params)
{
@@ -57,7 +63,5 @@ class Test_Piwik_Integration_TwoVisitsWithCustomVariables_SegmentContains extend
}
}
-Test_Piwik_Integration_TwoVisitsWithCustomVariables_SegmentContains::$fixture
- = new Test_Piwik_Fixture_TwoVisitsWithCustomVariables();
-Test_Piwik_Integration_TwoVisitsWithCustomVariables_SegmentContains::$fixture->doExtraQuoteTests = false;
-
+TwoVisitsWithCustomVariablesSegmentContainsTest::$fixture = new TwoVisitsWithCustomVariables();
+TwoVisitsWithCustomVariablesSegmentContainsTest::$fixture->doExtraQuoteTests = false; \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/TwoVisitsWithCustomVariables_SegmentMatchALL_NoGoalDataTest.php b/tests/PHPUnit/Integration/TwoVisitsWithCustomVariablesSegmentMatchALLNoGoalDataTest.php
index b4e7c3d2fc..d800deca65 100755
--- a/tests/PHPUnit/Integration/TwoVisitsWithCustomVariables_SegmentMatchALL_NoGoalDataTest.php
+++ b/tests/PHPUnit/Integration/TwoVisitsWithCustomVariablesSegmentMatchALLNoGoalDataTest.php
@@ -5,14 +5,21 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Integration;
-class Test_Piwik_Integration_TwoVisitsWithCustomVariables_SegmentMatchALL_NoGoalData extends IntegrationTestCase
+use Piwik\Tests\IntegrationTestCase;
+use Piwik\Tests\Fixtures\TwoVisitsWithCustomVariables;
+
+/**
+ * @group Integration
+ * @group TwoVisitsWithCustomVariablesSegmentMatchALLNoGoalDataTest
+ */
+class TwoVisitsWithCustomVariablesSegmentMatchALLNoGoalDataTest extends IntegrationTestCase
{
public static $fixture = null; // initialized below class definition
/**
* @dataProvider getApiForTesting
- * @group Integration
*/
public function testApi($api, $params)
{
@@ -43,7 +50,5 @@ class Test_Piwik_Integration_TwoVisitsWithCustomVariables_SegmentMatchALL_NoGoal
}
}
-Test_Piwik_Integration_TwoVisitsWithCustomVariables_SegmentMatchALL_NoGoalData::$fixture
- = new Test_Piwik_Fixture_TwoVisitsWithCustomVariables();
-Test_Piwik_Integration_TwoVisitsWithCustomVariables_SegmentMatchALL_NoGoalData::$fixture->doExtraQuoteTests = false;
-
+TwoVisitsWithCustomVariablesSegmentMatchALLNoGoalDataTest::$fixture = new TwoVisitsWithCustomVariables();
+TwoVisitsWithCustomVariablesSegmentMatchALLNoGoalDataTest::$fixture->doExtraQuoteTests = false; \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/TwoVisitsWithCustomVariables_SegmentMatchNONETest.php b/tests/PHPUnit/Integration/TwoVisitsWithCustomVariablesSegmentMatchNONETest.php
index 9d9056709f..1c0af3449a 100755
--- a/tests/PHPUnit/Integration/TwoVisitsWithCustomVariables_SegmentMatchNONETest.php
+++ b/tests/PHPUnit/Integration/TwoVisitsWithCustomVariablesSegmentMatchNONETest.php
@@ -5,18 +5,25 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Integration;
+
use Piwik\Plugins\API\API;
+use Piwik\Tests\IntegrationTestCase;
+use Piwik\Tests\Fixtures\TwoVisitsWithCustomVariables;
+use Piwik\Tests\Fixture;
/**
* testing a segment containing all supported fields
+ *
+ * @group Integration
+ * @group TwoVisitsWithCustomVariablesSegmentMatchNONETest
*/
-class Test_Piwik_Integration_TwoVisitsWithCustomVariables_SegmentMatchNONE extends IntegrationTestCase
+class TwoVisitsWithCustomVariablesSegmentMatchNONETest extends IntegrationTestCase
{
public static $fixture = null; // initialized below class definition
/**
* @dataProvider getApiForTesting
- * @group Integration
*/
public function testApi($api, $params)
{
@@ -82,7 +89,5 @@ class Test_Piwik_Integration_TwoVisitsWithCustomVariables_SegmentMatchNONE exten
}
}
-Test_Piwik_Integration_TwoVisitsWithCustomVariables_SegmentMatchNONE::$fixture
- = new Test_Piwik_Fixture_TwoVisitsWithCustomVariables();
-Test_Piwik_Integration_TwoVisitsWithCustomVariables_SegmentMatchNONE::$fixture->doExtraQuoteTests = false;
-
+TwoVisitsWithCustomVariablesSegmentMatchNONETest::$fixture = new TwoVisitsWithCustomVariables();
+TwoVisitsWithCustomVariablesSegmentMatchNONETest::$fixture->doExtraQuoteTests = false; \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/TwoVisitsWithCustomVariables_SegmentMatchVisitorTypeTest.php b/tests/PHPUnit/Integration/TwoVisitsWithCustomVariablesSegmentMatchVisitorTypeTest.php
index d5181804f6..50c76d3a16 100755
--- a/tests/PHPUnit/Integration/TwoVisitsWithCustomVariables_SegmentMatchVisitorTypeTest.php
+++ b/tests/PHPUnit/Integration/TwoVisitsWithCustomVariablesSegmentMatchVisitorTypeTest.php
@@ -5,19 +5,25 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Integration;
+
use Piwik\Common;
use Piwik\Db;
+use Piwik\Tests\IntegrationTestCase;
+use Piwik\Tests\Fixtures\TwoVisitsWithCustomVariables;
/**
* Tests use of custom variable segments.
+ *
+ * @group Integration
+ * @group TwoVisitsWithCustomVariablesSegmentMatchVisitorTypeTest
*/
-class Test_Piwik_Integration_TwoVisitsWithCustomVariables_SegmentMatchVisitorType extends IntegrationTestCase
+class TwoVisitsWithCustomVariablesSegmentMatchVisitorTypeTest extends IntegrationTestCase
{
public static $fixture = null; // initialized below class definition
/**
* @dataProvider getApiForTesting
- * @group Integration
*/
public function testApi($api, $params)
{
@@ -104,6 +110,5 @@ class Test_Piwik_Integration_TwoVisitsWithCustomVariables_SegmentMatchVisitorTyp
}
}
-Test_Piwik_Integration_TwoVisitsWithCustomVariables_SegmentMatchVisitorType::$fixture
- = new Test_Piwik_Fixture_TwoVisitsWithCustomVariables();
-Test_Piwik_Integration_TwoVisitsWithCustomVariables_SegmentMatchVisitorType::$fixture->doExtraQuoteTests = false; \ No newline at end of file
+TwoVisitsWithCustomVariablesSegmentMatchVisitorTypeTest::$fixture = new TwoVisitsWithCustomVariables();
+TwoVisitsWithCustomVariablesSegmentMatchVisitorTypeTest::$fixture->doExtraQuoteTests = false; \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/TwoVisitsWithCustomVariablesTest.php b/tests/PHPUnit/Integration/TwoVisitsWithCustomVariablesTest.php
index b2a8ded3fc..a9fafeddb8 100755
--- a/tests/PHPUnit/Integration/TwoVisitsWithCustomVariablesTest.php
+++ b/tests/PHPUnit/Integration/TwoVisitsWithCustomVariablesTest.php
@@ -5,11 +5,18 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Integration;
+
+use Piwik\Tests\IntegrationTestCase;
+use Piwik\Tests\Fixtures\TwoVisitsWithCustomVariables;
/**
* Tests w/ two visits & custom variables.
+ *
+ * @group TwoVisitsWithCustomVariablesTest
+ * @group Integration
*/
-class Test_Piwik_Integration_TwoVisitsWithCustomVariables extends IntegrationTestCase
+class TwoVisitsWithCustomVariablesTest extends IntegrationTestCase
{
public static $fixture = null; // initialized below class definition
@@ -41,7 +48,6 @@ class Test_Piwik_Integration_TwoVisitsWithCustomVariables extends IntegrationTes
/**
* @dataProvider getApiForTesting
- * @group Integration
*/
public function testApi($api, $params)
{
@@ -54,5 +60,4 @@ class Test_Piwik_Integration_TwoVisitsWithCustomVariables extends IntegrationTes
}
}
-Test_Piwik_Integration_TwoVisitsWithCustomVariables::$fixture = new Test_Piwik_Fixture_TwoVisitsWithCustomVariables();
-
+TwoVisitsWithCustomVariablesTest::$fixture = new TwoVisitsWithCustomVariables(); \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/UrlNormalizationTest.php b/tests/PHPUnit/Integration/UrlNormalizationTest.php
index 608681348a..867fdcad60 100644
--- a/tests/PHPUnit/Integration/UrlNormalizationTest.php
+++ b/tests/PHPUnit/Integration/UrlNormalizationTest.php
@@ -1,18 +1,30 @@
<?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\Tests\Integration;
+
use Piwik\Common;
use Piwik\Db;
use Piwik\Tracker\Action;
+use Piwik\Tests\IntegrationTestCase;
+use Piwik\Tests\Fixtures\OneVisitWithAbnormalPageviewUrls;
/**
* Tests the URL normalization.
+ *
+ * @group Integration
+ * @group UrlNormalizationTest
*/
-class Test_Piwik_Integration_UrlNormalization extends IntegrationTestCase
+class UrlNormalizationTest extends IntegrationTestCase
{
public static $fixture = null; // initialized below class definition
/**
* @dataProvider getApiForTesting
- * @group Integration
*/
public function testApi($api, $params)
{
@@ -80,8 +92,7 @@ class Test_Piwik_Integration_UrlNormalization extends IntegrationTestCase
}
/**
- * @@depends testApi
- * @group Integration
+ * @depends testApi
*/
public function testCheckPostConditions()
{
@@ -109,5 +120,4 @@ class Test_Piwik_Integration_UrlNormalization extends IntegrationTestCase
}
}
-Test_Piwik_Integration_UrlNormalization::$fixture = new Test_Piwik_Fixture_OneVisitWithAbnormalPageviewUrls();
-
+UrlNormalizationTest::$fixture = new OneVisitWithAbnormalPageviewUrls(); \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/VisitsInPast_InvalidateOldReportsTest.php b/tests/PHPUnit/Integration/VisitsInPastInvalidateOldReportsTest.php
index 6387c3bcf6..aed03b9343 100644
--- a/tests/PHPUnit/Integration/VisitsInPast_InvalidateOldReportsTest.php
+++ b/tests/PHPUnit/Integration/VisitsInPastInvalidateOldReportsTest.php
@@ -5,18 +5,25 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Integration;
+
use Piwik\API\Request;
+use Piwik\Tests\IntegrationTestCase;
+use Piwik\Tests\Fixtures\TwoSitesVisitsInPast;
+use Exception;
/**
* Track visits before website creation date and test that Piwik handles them correctly.
+ *
+ * @group Integration
+ * @group VisitsInPastInvalidateOldReportsTest
*/
-class Test_Piwik_Integration_VisitsInPast_InvalidateOldReports extends IntegrationTestCase
+class VisitsInPastInvalidateOldReportsTest extends IntegrationTestCase
{
public static $fixture = null; // initialized below class definition
/**
* @dataProvider getApiForTesting
- * @group Integration
*/
public function testApi($api, $params)
{
@@ -59,7 +66,6 @@ class Test_Piwik_Integration_VisitsInPast_InvalidateOldReports extends Integrati
/**
* @depends testApi
* @dataProvider getAnotherApiForTesting
- * @group Integration
*/
public function testAnotherApi($api, $params)
{
@@ -133,5 +139,4 @@ class Test_Piwik_Integration_VisitsInPast_InvalidateOldReports extends Integrati
}
}
-Test_Piwik_Integration_VisitsInPast_InvalidateOldReports::$fixture = new Test_Piwik_Fixture_TwoSitesVisitsInPast();
-
+VisitsInPastInvalidateOldReportsTest::$fixture = new TwoSitesVisitsInPast(); \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/expected/test_LabelFilter_dir2sub0filephp__Actions.getPageUrls_day.xml b/tests/PHPUnit/Integration/expected/test_LabelFilter_dir2sub0filephp__Actions.getPageUrls_day.xml
index 17728cab17..8cedb2f9a9 100644
--- a/tests/PHPUnit/Integration/expected/test_LabelFilter_dir2sub0filephp__Actions.getPageUrls_day.xml
+++ b/tests/PHPUnit/Integration/expected/test_LabelFilter_dir2sub0filephp__Actions.getPageUrls_day.xml
@@ -5,8 +5,8 @@
<nb_visits>1</nb_visits>
<nb_uniq_visitors>1</nb_uniq_visitors>
<nb_hits>1</nb_hits>
- <sum_time_spent>0</sum_time_spent>
- <avg_time_on_page>0</avg_time_on_page>
+ <sum_time_spent>36</sum_time_spent>
+ <avg_time_on_page>36</avg_time_on_page>
<bounce_rate>0%</bounce_rate>
<exit_rate>0%</exit_rate>
<url>http://example.org/dir2/sub/0/file.php</url>
diff --git a/tests/PHPUnit/Integration/expected/test_LabelFilter_dir__Actions.getPageUrls_day.xml b/tests/PHPUnit/Integration/expected/test_LabelFilter_dir__Actions.getPageUrls_day.xml
index f5d57d7a79..3634faa18a 100644
--- a/tests/PHPUnit/Integration/expected/test_LabelFilter_dir__Actions.getPageUrls_day.xml
+++ b/tests/PHPUnit/Integration/expected/test_LabelFilter_dir__Actions.getPageUrls_day.xml
@@ -2,15 +2,15 @@
<result>
<row>
<label>dir</label>
- <nb_visits>2</nb_visits>
- <nb_hits>2</nb_hits>
- <sum_time_spent>684</sum_time_spent>
- <nb_hits_with_time_generation>2</nb_hits_with_time_generation>
+ <nb_visits>4</nb_visits>
+ <nb_hits>4</nb_hits>
+ <sum_time_spent>720</sum_time_spent>
+ <nb_hits_with_time_generation>4</nb_hits_with_time_generation>
<min_time_generation>0.123</min_time_generation>
- <max_time_generation>0.153</max_time_generation>
- <avg_time_on_page>342</avg_time_on_page>
+ <max_time_generation>0.333</max_time_generation>
+ <avg_time_on_page>180</avg_time_on_page>
<bounce_rate>0%</bounce_rate>
<exit_rate>0%</exit_rate>
- <avg_time_generation>0.138</avg_time_generation>
+ <avg_time_generation>0.211</avg_time_generation>
</row>
</result> \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/expected/test_LabelFilter_dir_range__Actions.getPageUrls_day.xml b/tests/PHPUnit/Integration/expected/test_LabelFilter_dir_range__Actions.getPageUrls_day.xml
index 9ece84f6b1..b648ce6807 100644
--- a/tests/PHPUnit/Integration/expected/test_LabelFilter_dir_range__Actions.getPageUrls_day.xml
+++ b/tests/PHPUnit/Integration/expected/test_LabelFilter_dir_range__Actions.getPageUrls_day.xml
@@ -3,16 +3,16 @@
<result date="2010-03-06">
<row>
<label>dir</label>
- <nb_visits>2</nb_visits>
- <nb_hits>2</nb_hits>
- <sum_time_spent>684</sum_time_spent>
- <nb_hits_with_time_generation>2</nb_hits_with_time_generation>
+ <nb_visits>4</nb_visits>
+ <nb_hits>4</nb_hits>
+ <sum_time_spent>720</sum_time_spent>
+ <nb_hits_with_time_generation>4</nb_hits_with_time_generation>
<min_time_generation>0.123</min_time_generation>
- <max_time_generation>0.153</max_time_generation>
- <avg_time_on_page>342</avg_time_on_page>
+ <max_time_generation>0.333</max_time_generation>
+ <avg_time_on_page>180</avg_time_on_page>
<bounce_rate>0%</bounce_rate>
<exit_rate>0%</exit_rate>
- <avg_time_generation>0.138</avg_time_generation>
+ <avg_time_generation>0.211</avg_time_generation>
</row>
</result>
<result date="2010-03-07" />
diff --git a/tests/PHPUnit/Integration/expected/test_LabelFilter_keywords_html__Referrers.getSearchEngines_day.xml b/tests/PHPUnit/Integration/expected/test_LabelFilter_keywords_html__Referrers.getSearchEngines_day.xml
index ea194078ed..8a58d46ddf 100644
--- a/tests/PHPUnit/Integration/expected/test_LabelFilter_keywords_html__Referrers.getSearchEngines_day.xml
+++ b/tests/PHPUnit/Integration/expected/test_LabelFilter_keywords_html__Referrers.getSearchEngines_day.xml
@@ -4,8 +4,8 @@
<label>&lt;&gt;&amp;\&quot;the pdo extension is required for this adapter but the extension is not loaded</label>
<nb_uniq_visitors>1</nb_uniq_visitors>
<nb_visits>1</nb_visits>
- <nb_actions>7</nb_actions>
- <max_actions>7</max_actions>
+ <nb_actions>9</nb_actions>
+ <max_actions>9</max_actions>
<sum_visit_length>1441</sum_visit_length>
<bounce_count>0</bounce_count>
<nb_visits_converted>0</nb_visits_converted>
diff --git a/tests/PHPUnit/Integration/expected/test_LabelFilter_terminalOperator_selectBranch__Actions.getPageTitles_day.xml b/tests/PHPUnit/Integration/expected/test_LabelFilter_terminalOperator_selectBranch__Actions.getPageTitles_day.xml
new file mode 100644
index 0000000000..04dac45ecd
--- /dev/null
+++ b/tests/PHPUnit/Integration/expected/test_LabelFilter_terminalOperator_selectBranch__Actions.getPageTitles_day.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<result>
+ <row>
+ <label>@one@</label>
+ <nb_visits>1</nb_visits>
+ <nb_hits>1</nb_hits>
+ <sum_time_spent>36</sum_time_spent>
+ <nb_hits_with_time_generation>1</nb_hits_with_time_generation>
+ <min_time_generation>0.233</min_time_generation>
+ <max_time_generation>0.233</max_time_generation>
+ <avg_time_on_page>36</avg_time_on_page>
+ <bounce_rate>0%</bounce_rate>
+ <exit_rate>0%</exit_rate>
+ <avg_time_generation>0.233</avg_time_generation>
+ </row>
+</result> \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/expected/test_LabelFilter_terminalOperator_selectTerminal__Actions.getPageTitles_day.xml b/tests/PHPUnit/Integration/expected/test_LabelFilter_terminalOperator_selectTerminal__Actions.getPageTitles_day.xml
new file mode 100644
index 0000000000..1517efab30
--- /dev/null
+++ b/tests/PHPUnit/Integration/expected/test_LabelFilter_terminalOperator_selectTerminal__Actions.getPageTitles_day.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<result>
+ <row>
+ <label> @one@</label>
+ <nb_visits>1</nb_visits>
+ <nb_uniq_visitors>1</nb_uniq_visitors>
+ <nb_hits>1</nb_hits>
+ <sum_time_spent>0</sum_time_spent>
+ <nb_hits_with_time_generation>1</nb_hits_with_time_generation>
+ <min_time_generation>0.333</min_time_generation>
+ <max_time_generation>0.333</max_time_generation>
+ <avg_time_on_page>0</avg_time_on_page>
+ <bounce_rate>0%</bounce_rate>
+ <exit_rate>0%</exit_rate>
+ <avg_time_generation>0.333</avg_time_generation>
+ </row>
+</result> \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/expected/test_LabelFilter_terminalOperator_selectTerminal__Actions.getPageUrls_day.xml b/tests/PHPUnit/Integration/expected/test_LabelFilter_terminalOperator_selectTerminal__Actions.getPageUrls_day.xml
new file mode 100644
index 0000000000..2a3958ceba
--- /dev/null
+++ b/tests/PHPUnit/Integration/expected/test_LabelFilter_terminalOperator_selectTerminal__Actions.getPageUrls_day.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<result>
+ <row>
+ <label>/subdir</label>
+ <nb_visits>1</nb_visits>
+ <nb_uniq_visitors>1</nb_uniq_visitors>
+ <nb_hits>1</nb_hits>
+ <sum_time_spent>0</sum_time_spent>
+ <nb_hits_with_time_generation>1</nb_hits_with_time_generation>
+ <min_time_generation>0.333</min_time_generation>
+ <max_time_generation>0.333</max_time_generation>
+ <avg_time_on_page>0</avg_time_on_page>
+ <bounce_rate>0%</bounce_rate>
+ <exit_rate>0%</exit_rate>
+ <avg_time_generation>0.333</avg_time_generation>
+ <url>http://example.org/dir/subdir</url>
+ </row>
+</result> \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/expected/test_LabelFilter_thisiscool__Actions.getPageUrls_day.xml b/tests/PHPUnit/Integration/expected/test_LabelFilter_thisiscool__Actions.getPageUrls_day.xml
index bbbd02dd81..4cec8aa9aa 100644
--- a/tests/PHPUnit/Integration/expected/test_LabelFilter_thisiscool__Actions.getPageUrls_day.xml
+++ b/tests/PHPUnit/Integration/expected/test_LabelFilter_thisiscool__Actions.getPageUrls_day.xml
@@ -11,7 +11,7 @@
<max_time_generation>0.523</max_time_generation>
<entry_nb_uniq_visitors>1</entry_nb_uniq_visitors>
<entry_nb_visits>1</entry_nb_visits>
- <entry_nb_actions>7</entry_nb_actions>
+ <entry_nb_actions>9</entry_nb_actions>
<entry_sum_visit_length>1441</entry_sum_visit_length>
<entry_bounce_count>0</entry_bounce_count>
<avg_time_on_page>720</avg_time_on_page>
diff --git a/tests/PHPUnit/Integration/expected/test_LabelFilter_titles__Actions.getPageTitles_day.xml b/tests/PHPUnit/Integration/expected/test_LabelFilter_titles__Actions.getPageTitles_day.xml
index 667e9fcd90..afffc60a48 100644
--- a/tests/PHPUnit/Integration/expected/test_LabelFilter_titles__Actions.getPageTitles_day.xml
+++ b/tests/PHPUnit/Integration/expected/test_LabelFilter_titles__Actions.getPageTitles_day.xml
@@ -5,16 +5,16 @@
<nb_visits>1</nb_visits>
<nb_uniq_visitors>1</nb_uniq_visitors>
<nb_hits>4</nb_hits>
- <sum_time_spent>1080</sum_time_spent>
+ <sum_time_spent>1116</sum_time_spent>
<nb_hits_with_time_generation>3</nb_hits_with_time_generation>
<min_time_generation>0.123</min_time_generation>
<max_time_generation>1.233</max_time_generation>
<entry_nb_uniq_visitors>1</entry_nb_uniq_visitors>
<entry_nb_visits>1</entry_nb_visits>
- <entry_nb_actions>7</entry_nb_actions>
+ <entry_nb_actions>9</entry_nb_actions>
<entry_sum_visit_length>1441</entry_sum_visit_length>
<entry_bounce_count>0</entry_bounce_count>
- <avg_time_on_page>1080</avg_time_on_page>
+ <avg_time_on_page>1116</avg_time_on_page>
<bounce_rate>0%</bounce_rate>
<exit_rate>0%</exit_rate>
<avg_time_generation>0.626</avg_time_generation>
diff --git a/tests/PHPUnit/IntegrationTestCase.php b/tests/PHPUnit/IntegrationTestCase.php
index aa4ca74026..abe5659c43 100755
--- a/tests/PHPUnit/IntegrationTestCase.php
+++ b/tests/PHPUnit/IntegrationTestCase.php
@@ -5,6 +5,8 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests;
+
use Piwik\API\DocumentationGenerator;
use Piwik\API\Proxy;
use Piwik\API\Request;
@@ -18,6 +20,7 @@ use Piwik\ReportRenderer;
use Piwik\Translate;
use Piwik\UrlHelper;
use Piwik\Log;
+use PHPUnit_Framework_TestCase;
require_once PIWIK_INCLUDE_PATH . '/libs/PiwikTracker/PiwikTracker.php';
@@ -200,7 +203,7 @@ abstract class IntegrationTestCase extends PHPUnit_Framework_TestCase
)
);
- if(Fixture::canImagesBeIncludedInScheduledReports()) {
+ if (Fixture::canImagesBeIncludedInScheduledReports()) {
// PDF Scheduled Report
// tests/PHPUnit/Integration/processed/test_ecommerceOrderWithItems_scheduled_report_in_pdf_tables_only__ScheduledReports.generateReport_week.original.pdf
array_push(
diff --git a/tests/PHPUnit/bootstrap.php b/tests/PHPUnit/bootstrap.php
index ea2d0aa3aa..4058a867d4 100644
--- a/tests/PHPUnit/bootstrap.php
+++ b/tests/PHPUnit/bootstrap.php
@@ -78,7 +78,7 @@ Try again.
-> If you still get this message, you can work around it by specifying Host + Request_Uri at the top of this file tests/PHPUnit/bootstrap.php. <-";
exit(1);
}
- $baseUrl = Fixture::getRootUrl();
+ $baseUrl = \Piwik\Tests\Fixture::getRootUrl();
\Piwik\SettingsPiwik::checkPiwikServerWorking($baseUrl, $acceptInvalidSSLCertificates = true);
}
diff --git a/tests/javascript/SQLite.php b/tests/javascript/SQLite.php
index c357c7febf..5b4a3b3343 100644
--- a/tests/javascript/SQLite.php
+++ b/tests/javascript/SQLite.php
@@ -5,7 +5,6 @@
* SQLite shim
*
* @link http://piwik.org
- * @source http://dev.piwik.org/trac/browser/trunk/tests/javascript/SQLite.php
* @license http://www.opensource.org/licenses/bsd-license.php Simplified BSD
*/
if (class_exists('SQLite3'))
diff --git a/tests/resources/OmniFixture-dump.sql.gz b/tests/resources/OmniFixture-dump.sql.gz
new file mode 100644
index 0000000000..9c8dc1b75a
--- /dev/null
+++ b/tests/resources/OmniFixture-dump.sql.gz
Binary files differ
diff --git a/tests/resources/extractSearchEngineInformationFromUrlTests.yml b/tests/resources/extractSearchEngineInformationFromUrlTests.yml
index 60daf9da83..345bf04a43 100644
--- a/tests/resources/extractSearchEngineInformationFromUrlTests.yml
+++ b/tests/resources/extractSearchEngineInformationFromUrlTests.yml
@@ -32,7 +32,7 @@
keywords: '<> &test; piwik &quot;'
# testing Baidu special case (several variable names possible, and custom encoding)
-# see http://dev.piwik.org/trac/ticket/589
+# see https://github.com/piwik/piwik/issues/589
# keyword is in "wd"
- url: 'http://www.baidu.com/s?ie=gb2312&bs=%BF%D5%BC%E4+hao123+%7C+%B8%FC%B6%E0%3E%3E&sr=&z=&cl=3&f=8&tn=baidu&wd=%BF%D5%BC%E4+%BA%C3123+%7C+%B8%FC%B6%E0%3E%3E&ct=0'
@@ -328,7 +328,7 @@
keywords: false
# Google images no keyword
-- url: 'http://www.google.com/imgres?hl=en&client=ubuntu&hs=xDb&sa=X&channel=fs&biw=1920&bih=1084&tbm=isch&prmd=imvns&tbnid=5i7iz7u4LPSSrM:&imgrefurl=http://dev.piwik.org/trac/wiki/HowToSetupDevelopmentEnvironmentWindows&docid=tWN9OesMyOTqsM&imgurl=http://dev.piwik.org/trac/raw-attachment/wiki/HowToSetupDevelopmentEnvironmentWindows/eclipse-preview.jpg&w=1000&h=627&ei=pURoT67BEdT74QTUzYiSCQ&zoom=1&iact=hc&vpx=1379&vpy=548&dur=513&hovh=178&hovw=284&tx=134&ty=105&sig=108396332168858896950&page=1&tbnh=142&tbnw=227&start=0&ndsp=37&ved=1t:429,r:5,s:0'
+- url: 'http://www.google.com/imgres?hl=en&client=ubuntu&hs=xDb&sa=X&channel=fs&biw=1920&bih=1084&tbm=isch&prmd=imvns&tbnid=5i7iz7u4LPSSrM:&imgrefurl=http://helloworld/trac/wiki/HowToSetupDevelopmentEnvironmentWindows&docid=tWN9OesMyOTqsM&imgurl=http://helloworld.org/trac/raw-attachment/wiki/HowToSetupDevelopmentEnvironmentWindows/eclipse-preview.jpg&w=1000&h=627&ei=pURoT67BEdT74QTUzYiSCQ&zoom=1&iact=hc&vpx=1379&vpy=548&dur=513&hovh=178&hovw=284&tx=134&ty=105&sig=108396332168858896950&page=1&tbnh=142&tbnw=227&start=0&ndsp=37&ved=1t:429,r:5,s:0'
engine: 'Google Images'
keywords: false