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--.gitignore3
-rw-r--r--.travis.yml44
-rw-r--r--CHANGELOG.md18
-rw-r--r--README.md2
-rw-r--r--core/API/DocumentationGenerator.php10
-rw-r--r--core/Cache/StaticCache.php9
-rw-r--r--core/Option.php24
-rw-r--r--core/Tracker.php6
-rw-r--r--core/Tracker/Model.php2
-rw-r--r--js/piwik.js2
-rw-r--r--plugins/API/tests/ConsoleRendererTest.php121
-rw-r--r--plugins/API/tests/CsvRendererTest.php283
-rw-r--r--plugins/API/tests/HtmlRendererTest.php459
-rw-r--r--plugins/API/tests/Integration/RowEvolutionTest.php46
-rw-r--r--plugins/API/tests/Integration/RssRendererTest.php193
-rw-r--r--plugins/API/tests/JsonRendererTest.php385
-rw-r--r--plugins/API/tests/OriginalRendererTest.phpbin4028 -> 0 bytes
-rw-r--r--plugins/API/tests/PhpRendererTest.php218
-rw-r--r--plugins/API/tests/RowEvolutionTest.php44
-rw-r--r--plugins/API/tests/RssRendererTest.php192
-rw-r--r--plugins/API/tests/Unit/ConsoleRendererTest.php121
-rw-r--r--plugins/API/tests/Unit/CsvRendererTest.php283
-rw-r--r--plugins/API/tests/Unit/HtmlRendererTest.php459
-rw-r--r--plugins/API/tests/Unit/JsonRendererTest.php385
-rw-r--r--plugins/API/tests/Unit/OriginalRendererTest.phpbin0 -> 4033 bytes
-rw-r--r--plugins/API/tests/Unit/PhpRendererTest.php218
-rw-r--r--plugins/API/tests/Unit/XmlRendererTest.php346
-rw-r--r--plugins/API/tests/XmlRendererTest.php346
-rw-r--r--plugins/Actions/tests/Unit/ArchiverTest.php130
-rw-r--r--plugins/Contents/.gitignore2
-rw-r--r--plugins/Contents/tests/ContentsTest.php128
-rw-r--r--plugins/Contents/tests/Fixtures/TwoVisitsWithContents.php2
-rw-r--r--plugins/Contents/tests/System/ContentsTest.php135
-rw-r--r--plugins/Contents/tests/System/expected/test_Contents_Contents.getContentNames_lastN__API.getProcessedReport_day.xml (renamed from plugins/Contents/tests/expected/test_Contents_Contents.getContentNames_lastN__API.getProcessedReport_day.xml)0
-rw-r--r--plugins/Contents/tests/System/expected/test_Contents_Contents.getContentPieces_lastN__API.getProcessedReport_day.xml (renamed from plugins/Contents/tests/expected/test_Contents_Contents.getContentPieces_lastN__API.getProcessedReport_day.xml)0
-rw-r--r--plugins/Contents/tests/System/expected/test_Contents__Actions.getPageUrls_day.xml (renamed from plugins/Contents/tests/expected/test_Contents__Actions.getPageUrls_day.xml)0
-rw-r--r--plugins/Contents/tests/System/expected/test_Contents__Actions.getPageUrls_month.xml (renamed from plugins/Contents/tests/expected/test_Contents__Actions.getPageUrls_month.xml)0
-rw-r--r--plugins/Contents/tests/System/expected/test_Contents__Actions.get_day.xml (renamed from plugins/Contents/tests/expected/test_Contents__Actions.get_day.xml)0
-rw-r--r--plugins/Contents/tests/System/expected/test_Contents__Actions.get_month.xml (renamed from plugins/Contents/tests/expected/test_Contents__Actions.get_month.xml)0
-rw-r--r--plugins/Contents/tests/System/expected/test_Contents__Contents.getContentNames_day.xml (renamed from plugins/Contents/tests/expected/test_Contents__Contents.getContentNames_day.xml)0
-rw-r--r--plugins/Contents/tests/System/expected/test_Contents__Contents.getContentNames_month.xml (renamed from plugins/Contents/tests/expected/test_Contents__Contents.getContentNames_month.xml)0
-rw-r--r--plugins/Contents/tests/System/expected/test_Contents__Contents.getContentPieces_day.xml (renamed from plugins/Contents/tests/expected/test_Contents__Contents.getContentPieces_day.xml)0
-rw-r--r--plugins/Contents/tests/System/expected/test_Contents__Contents.getContentPieces_month.xml (renamed from plugins/Contents/tests/expected/test_Contents__Contents.getContentPieces_month.xml)0
-rw-r--r--plugins/Contents/tests/System/expected/test_Contents__Live.getLastVisitsDetails_day.xml (renamed from plugins/Contents/tests/expected/test_Contents__Live.getLastVisitsDetails_day.xml)0
-rw-r--r--plugins/Contents/tests/System/expected/test_Contents__Live.getLastVisitsDetails_month.xml (renamed from plugins/Contents/tests/expected/test_Contents__Live.getLastVisitsDetails_month.xml)0
-rw-r--r--plugins/Contents/tests/System/expected/test_Contents_contentInteractionMatch__Actions.getPageUrls_day.xml (renamed from plugins/Contents/tests/expected/test_Contents_contentInteractionMatch__Actions.getPageUrls_day.xml)0
-rw-r--r--plugins/Contents/tests/System/expected/test_Contents_contentInteractionMatch__Contents.getContentNames_day.xml (renamed from plugins/Contents/tests/expected/test_Contents_contentInteractionMatch__Contents.getContentNames_day.xml)0
-rw-r--r--plugins/Contents/tests/System/expected/test_Contents_contentInteractionMatch__Contents.getContentPieces_day.xml (renamed from plugins/Contents/tests/expected/test_Contents_contentInteractionMatch__Contents.getContentPieces_day.xml)0
-rw-r--r--plugins/Contents/tests/System/expected/test_Contents_contentInteractionMatch__Live.getLastVisitsDetails_day.xml (renamed from plugins/Contents/tests/expected/test_Contents_contentInteractionMatch__Live.getLastVisitsDetails_day.xml)0
-rw-r--r--plugins/Contents/tests/System/expected/test_Contents_contentTargetMatch__Actions.getPageUrls_day.xml (renamed from plugins/Contents/tests/expected/test_Contents_contentTargetMatch__Actions.getPageUrls_day.xml)0
-rw-r--r--plugins/Contents/tests/System/expected/test_Contents_contentTargetMatch__Contents.getContentNames_day.xml (renamed from plugins/Contents/tests/expected/test_Contents_contentTargetMatch__Contents.getContentNames_day.xml)0
-rw-r--r--plugins/Contents/tests/System/expected/test_Contents_contentTargetMatch__Contents.getContentPieces_day.xml (renamed from plugins/Contents/tests/expected/test_Contents_contentTargetMatch__Contents.getContentPieces_day.xml)0
-rw-r--r--plugins/Contents/tests/System/expected/test_Contents_contentTargetMatch__Live.getLastVisitsDetails_day.xml (renamed from plugins/Contents/tests/expected/test_Contents_contentTargetMatch__Live.getLastVisitsDetails_day.xml)0
-rw-r--r--plugins/Contents/tests/System/expected/test_ContentscontentNameOrPieceMatch__Actions.getPageUrls_day.xml (renamed from plugins/Contents/tests/expected/test_ContentscontentNameOrPieceMatch__Actions.getPageUrls_day.xml)0
-rw-r--r--plugins/Contents/tests/System/expected/test_ContentscontentNameOrPieceMatch__Contents.getContentNames_day.xml (renamed from plugins/Contents/tests/expected/test_ContentscontentNameOrPieceMatch__Contents.getContentNames_day.xml)0
-rw-r--r--plugins/Contents/tests/System/expected/test_ContentscontentNameOrPieceMatch__Contents.getContentPieces_day.xml (renamed from plugins/Contents/tests/expected/test_ContentscontentNameOrPieceMatch__Contents.getContentPieces_day.xml)0
-rw-r--r--plugins/Contents/tests/System/expected/test_ContentscontentNameOrPieceMatch__Live.getLastVisitsDetails_day.xml (renamed from plugins/Contents/tests/expected/test_ContentscontentNameOrPieceMatch__Live.getLastVisitsDetails_day.xml)0
-rw-r--r--plugins/Contents/tests/System/processed/.gitkeep (renamed from plugins/Contents/tests/processed/.gitkeep)0
-rw-r--r--plugins/CoreConsole/Commands/CodeCoverage.php11
-rw-r--r--plugins/CoreConsole/Commands/DevelopmentManageTestFiles.php4
-rw-r--r--plugins/CoreConsole/Commands/GenerateReport.php6
-rw-r--r--plugins/CoreConsole/Commands/GenerateTest.php66
-rw-r--r--plugins/CoreConsole/Commands/GenerateTravisYmlFile.php2
-rw-r--r--plugins/CoreConsole/Commands/TestsRun.php93
-rw-r--r--plugins/CoreConsole/Commands/TestsSetupFixture.php6
-rw-r--r--plugins/CoreConsole/tests/Integration/TravisYmlViewTest.php165
-rw-r--r--plugins/CoreConsole/tests/Unit/TravisYmlViewTest.php165
-rw-r--r--plugins/CoreConsole/tests/resources/test.travis.yml2
-rw-r--r--plugins/CorePluginsAdmin/tests/Integration/UpdateCommunicationTest.php186
-rw-r--r--plugins/CoreUpdater/tests/Integration/UpdateCommunicationTest.php122
-rw-r--r--plugins/CoreUpdater/tests/Unit/ModelTest.php (renamed from plugins/CoreUpdater/tests/ModelTest.php)0
-rw-r--r--plugins/CoreVisualizations/Visualizations/Cloud.php2
m---------plugins/CustomAlerts0
-rw-r--r--plugins/CustomVariables/.gitignore1
-rw-r--r--plugins/CustomVariables/tests/Commands/InfoTest.php5
-rw-r--r--plugins/CustomVariables/tests/Commands/SetNumberOfCustomVariablesTest.php5
-rw-r--r--plugins/CustomVariables/tests/CustomVariablesIntegrationTest.php61
-rw-r--r--plugins/CustomVariables/tests/CustomVariablesTest.php43
-rw-r--r--plugins/CustomVariables/tests/Fixtures/VisitWithManyCustomVariables.php2
-rw-r--r--plugins/CustomVariables/tests/Integration/CustomVariablesTest.php44
-rw-r--r--plugins/CustomVariables/tests/Integration/ModelTest.php199
-rw-r--r--plugins/CustomVariables/tests/ModelTest.php200
-rw-r--r--plugins/CustomVariables/tests/System/CustomVariablesSystemTest.php60
-rw-r--r--plugins/CustomVariables/tests/System/expected/test_CustomVariablesSystemTest__CustomVariables.getCustomVariables_day.xml (renamed from plugins/CustomVariables/tests/expected/test_CustomVariablesIntegrationTest__CustomVariables.getCustomVariables_day.xml)0
-rw-r--r--plugins/CustomVariables/tests/System/expected/test_CustomVariablesSystemTest__Live.getLastVisitsDetails_day.xml (renamed from plugins/CustomVariables/tests/expected/test_CustomVariablesIntegrationTest__Live.getLastVisitsDetails_day.xml)0
-rw-r--r--plugins/CustomVariables/tests/processed/test_CustomVariablesIntegrationTest__CustomVariables.getCustomVariables_day.xml395
-rw-r--r--plugins/CustomVariables/tests/processed/test_CustomVariablesIntegrationTest__Live.getLastVisitsDetails_day.xml176
-rw-r--r--plugins/ExamplePlugin/.gitignore2
-rw-r--r--plugins/ExamplePlugin/.travis.yml4
-rw-r--r--plugins/ExamplePlugin/tests/Fixtures/SimpleFixtureTrackFewVisits.php77
-rw-r--r--plugins/ExamplePlugin/tests/Integration/SimpleTest.php26
-rw-r--r--plugins/ExamplePlugin/tests/SimpleIntegrationTest.php64
-rw-r--r--plugins/ExamplePlugin/tests/SimpleTest.php24
-rw-r--r--plugins/ExamplePlugin/tests/System/SimpleSystemTest.php66
-rw-r--r--plugins/ExamplePlugin/tests/System/expected/test___API.get_day.xml (renamed from plugins/ExamplePlugin/tests/expected/test___API.get_day.xml)0
-rw-r--r--plugins/ExamplePlugin/tests/System/expected/test___Goals.getItemsSku_day.xml (renamed from plugins/ExamplePlugin/tests/expected/test___Goals.getItemsSku_day.xml)0
-rw-r--r--plugins/ExamplePlugin/tests/System/processed/.gitkeep (renamed from plugins/ExamplePlugin/tests/processed/.gitkeep)0
-rw-r--r--plugins/ExamplePlugin/tests/Unit/SimpleTest.php24
-rw-r--r--plugins/ExamplePlugin/tests/fixtures/SimpleFixtureTrackFewVisits.php79
-rw-r--r--plugins/Goals/tests/APITest.php232
-rw-r--r--plugins/Goals/tests/Integration/APITest.php234
-rw-r--r--plugins/Insights/tests/ApiTest.php267
-rw-r--r--plugins/Insights/tests/Fixtures/SomeVisitsDifferentPathsOnTwoDays.php2
-rw-r--r--plugins/Insights/tests/Integration/ApiTest.php276
-rw-r--r--plugins/Insights/tests/Integration/ModelTest.php189
-rw-r--r--plugins/Insights/tests/ModelTest.php189
-rw-r--r--plugins/Insights/tests/Unit/BaseUnitTest.php (renamed from plugins/Insights/tests/BaseUnitTest.php)0
-rw-r--r--plugins/Insights/tests/Unit/FilterExcludeLowValueTest.php (renamed from plugins/Insights/tests/FilterExcludeLowValueTest.php)0
-rw-r--r--plugins/Insights/tests/Unit/FilterInsightTest.php (renamed from plugins/Insights/tests/FilterInsightTest.php)0
-rw-r--r--plugins/Insights/tests/Unit/FilterLimitTest.php (renamed from plugins/Insights/tests/FilterLimitTest.php)0
-rw-r--r--plugins/Insights/tests/Unit/FilterMinGrowthTest.php (renamed from plugins/Insights/tests/FilterMinGrowthTest.php)0
-rw-r--r--plugins/Insights/tests/Unit/FilterOrderByTest.php (renamed from plugins/Insights/tests/FilterOrderByTest.php)0
-rw-r--r--plugins/Insights/tests/Unit/InsightReportTest.php (renamed from plugins/Insights/tests/InsightReportTest.php)0
-rwxr-xr-xplugins/LanguagesManager/tests/Integration/LanguagesManagerTest.php182
-rw-r--r--plugins/LeftMenu/tests/APITest.php144
-rw-r--r--plugins/LeftMenu/tests/Integration/APITest.php145
-rw-r--r--plugins/Live/tests/APITest.php153
-rw-r--r--plugins/Live/tests/Integration/APITest.php152
-rw-r--r--plugins/Login/tests/Integration/LoginTest.php404
-rw-r--r--plugins/MobileMessaging/tests/Integration/MobileMessagingTest.php262
-rw-r--r--plugins/MultiSites/tests/Integration/MultiSitesTest.php52
-rw-r--r--plugins/PrivacyManager/tests/Integration/PrivacyManagerConfigTest.php102
-rw-r--r--plugins/PrivacyManager/tests/Integration/PrivacyManagerTest.php86
-rw-r--r--plugins/PrivacyManager/tests/Unit/AnonymizeIPTest.php92
-rw-r--r--plugins/Proxy/tests/Unit/ProxyTest.php48
-rw-r--r--plugins/Referrers/tests/Unit/ReferrersTest.php246
-rw-r--r--plugins/SEO/tests/Integration/SEOTest.php68
-rw-r--r--plugins/ScheduledReports/tests/Integration/ApiTest.php514
-rw-r--r--plugins/ScheduledReports/tests/Integration/ScheduledReportsTest.php164
-rw-r--r--plugins/ScheduledReports/tests/ScheduledReportsTest.php163
-rw-r--r--plugins/SegmentEditor/tests/Integration/SegmentEditorTest.php210
-rw-r--r--plugins/SitesManager/tests/Integration/SiteUrlsTest.php146
-rw-r--r--plugins/SitesManager/tests/Integration/SitesManagerTest.php1000
-rw-r--r--plugins/SitesManager/tests/SiteUrlsTest.php145
-rwxr-xr-xplugins/UserCountry/LocationProvider/GeoIp/Php.php2
-rw-r--r--plugins/UserCountry/tests/Unit/UserCountryTest.php185
-rw-r--r--plugins/UserSettings/.gitignore1
-rw-r--r--plugins/UserSettings/tests/Fixtures/LanguageFixture.php2
-rw-r--r--plugins/UserSettings/tests/GetLanguageIntegrationTest.php75
-rw-r--r--plugins/UserSettings/tests/System/GetLanguageSystemTest.php74
-rw-r--r--plugins/UserSettings/tests/System/expected/test___UserSettings.getLanguageCode_day.xml (renamed from plugins/UserSettings/tests/expected/test___UserSettings.getLanguageCode_day.xml)0
-rw-r--r--plugins/UserSettings/tests/System/expected/test___UserSettings.getLanguage_day.xml (renamed from plugins/UserSettings/tests/expected/test___UserSettings.getLanguage_day.xml)0
-rw-r--r--plugins/UserSettings/tests/System/processed/.gitkeep (renamed from plugins/UserSettings/tests/processed/.gitkeep)0
-rw-r--r--plugins/UserSettings/tests/Unit/UserSettingsTest.php1036
-rw-r--r--plugins/UsersManager/tests/APITest.php71
-rw-r--r--plugins/UsersManager/tests/Integration/APITest.php72
-rw-r--r--plugins/UsersManager/tests/Integration/UserPreferencesTest.php118
-rw-r--r--plugins/UsersManager/tests/Integration/UsersManagerTest.php919
-rw-r--r--plugins/UsersManager/tests/UserPreferencesTest.php116
m---------plugins/VisitorGenerator0
-rwxr-xr-xtests/PHPUnit/BenchmarkTestCase.php6
-rw-r--r--tests/PHPUnit/Benchmarks/Fixtures/ManyThousandSitesOneVisitEach.php2
-rw-r--r--tests/PHPUnit/Benchmarks/Fixtures/OneSiteThousandsOfDistinctUrlsOverMonth.php2
-rwxr-xr-xtests/PHPUnit/Benchmarks/Fixtures/OneSiteTwelveThousandVisitsOneYear.php2
-rwxr-xr-xtests/PHPUnit/Benchmarks/Fixtures/ThousandSitesTwelveVisitsEachOneDay.php2
-rw-r--r--tests/PHPUnit/ConsoleCommandTestCase.php5
-rw-r--r--tests/PHPUnit/Core/AssetManager/UIAssetMinifierTest.php55
-rw-r--r--tests/PHPUnit/Core/AssetManager/stylesheets/CssWithURLs.css12
-rw-r--r--tests/PHPUnit/Core/AssetManager/stylesheets/ExpectedMergeResult.css30
-rw-r--r--tests/PHPUnit/Core/AssetManagerTest.php721
-rw-r--r--tests/PHPUnit/Core/DeprecatedMethodsTest.php72
-rw-r--r--tests/PHPUnit/Core/HttpTest.php123
-rw-r--r--tests/PHPUnit/Core/ReleaseCheckListTest.php391
-rw-r--r--tests/PHPUnit/Core/ServeStaticFileTest.php589
-rwxr-xr-x[-rw-r--r--]tests/PHPUnit/DatabaseTestCase.php83
-rw-r--r--tests/PHPUnit/FakeAccess.php16
-rw-r--r--tests/PHPUnit/Fixture.php846
-rw-r--r--tests/PHPUnit/Fixtures/FewVisitsWithSetVisitorIdAndUserId.php2
-rw-r--r--tests/PHPUnit/Fixtures/InvalidVisits.php2
-rw-r--r--tests/PHPUnit/Fixtures/ManySitesImportedLogs.php2
-rw-r--r--tests/PHPUnit/Fixtures/ManySitesImportedLogsWithXssAttempts.php2
-rw-r--r--tests/PHPUnit/Fixtures/ManyVisitsWithGeoIP.php2
-rw-r--r--tests/PHPUnit/Fixtures/ManyVisitsWithMockLocationProvider.php2
-rw-r--r--tests/PHPUnit/Fixtures/ManyVisitsWithSubDirReferrersAndCustomVars.php2
-rw-r--r--tests/PHPUnit/Fixtures/OmniFixture.php2
-rw-r--r--tests/PHPUnit/Fixtures/OneVisitSeveralPageViews.php4
-rw-r--r--tests/PHPUnit/Fixtures/OneVisitWithAbnormalPageviewUrls.php2
-rw-r--r--tests/PHPUnit/Fixtures/OneVisitorTwoVisits.php2
-rw-r--r--tests/PHPUnit/Fixtures/SomeVisitsAllConversions.php2
-rw-r--r--tests/PHPUnit/Fixtures/SomeVisitsCustomVariablesCampaignsNotHeuristics.php2
-rw-r--r--tests/PHPUnit/Fixtures/SomeVisitsManyPageviewsWithTransitions.php2
-rw-r--r--tests/PHPUnit/Fixtures/SomeVisitsWithLongUrls.php4
-rw-r--r--tests/PHPUnit/Fixtures/SomeVisitsWithNonUnicodePageTitles.php2
-rw-r--r--tests/PHPUnit/Fixtures/SqlDump.php3
-rw-r--r--tests/PHPUnit/Fixtures/ThreeGoalsOnePageview.php2
-rw-r--r--tests/PHPUnit/Fixtures/ThreeSitesWithManyVisitsWithSiteSearch.php2
-rw-r--r--tests/PHPUnit/Fixtures/ThreeSitesWithSharedVisitors.php2
-rw-r--r--tests/PHPUnit/Fixtures/TwoSitesEcommerceOrderWithItems.php2
-rw-r--r--tests/PHPUnit/Fixtures/TwoSitesManyVisitsOverSeveralDaysWithSearchEngineReferrers.php2
-rw-r--r--tests/PHPUnit/Fixtures/TwoSitesTwoVisitorsDifferentDays.php2
-rw-r--r--tests/PHPUnit/Fixtures/TwoSitesVisitsInPast.php2
-rw-r--r--tests/PHPUnit/Fixtures/TwoSitesWithAnnotations.php2
-rw-r--r--tests/PHPUnit/Fixtures/TwoVisitsNoKeywordWithBot.php4
-rw-r--r--tests/PHPUnit/Fixtures/TwoVisitsWithCustomEvents.php2
-rw-r--r--tests/PHPUnit/Fixtures/TwoVisitsWithCustomVariables.php2
-rw-r--r--tests/PHPUnit/Fixtures/VisitOverSeveralDaysImportedLogs.php2
-rw-r--r--tests/PHPUnit/Fixtures/VisitsInDifferentTimezones.php2
-rw-r--r--tests/PHPUnit/Fixtures/VisitsOverSeveralDays.php2
-rw-r--r--tests/PHPUnit/Fixtures/VisitsTwoWebsitesWithAdditionalVisits.php2
-rw-r--r--tests/PHPUnit/Impl/ApiTestConfig.php8
-rw-r--r--tests/PHPUnit/Impl/Fixture.php861
-rw-r--r--tests/PHPUnit/Impl/IntegrationTestCase.php97
-rwxr-xr-xtests/PHPUnit/Impl/SystemTestCase.php581
-rw-r--r--tests/PHPUnit/Impl/TestRequestCollection.php3
-rw-r--r--tests/PHPUnit/Impl/TestRequestResponse.php3
-rw-r--r--tests/PHPUnit/Integration/AccessTest.php365
-rwxr-xr-xtests/PHPUnit/Integration/AnnotationsTest.php287
-rwxr-xr-xtests/PHPUnit/Integration/ApiGetReportMetadataTest.php92
-rwxr-xr-xtests/PHPUnit/Integration/ApiGetReportMetadataYearTest.php52
-rw-r--r--tests/PHPUnit/Integration/ArchiveCronTest.php167
-rw-r--r--tests/PHPUnit/Integration/ArchiveInvalidationTest.php140
-rw-r--r--tests/PHPUnit/Integration/ArchiveProcessingTest.php508
-rw-r--r--tests/PHPUnit/Integration/ArchiveWebTest.php79
-rw-r--r--tests/PHPUnit/Integration/AssetManager/UIAssetMinifierTest.php55
-rw-r--r--tests/PHPUnit/Integration/AutoSuggestAPITest.php148
-rw-r--r--tests/PHPUnit/Integration/BackwardsCompatibility1XTest.php137
-rwxr-xr-xtests/PHPUnit/Integration/BlobReportLimitingTest.php166
-rw-r--r--tests/PHPUnit/Integration/CliMultiTest.php251
-rw-r--r--tests/PHPUnit/Integration/Core/AccessTest.php364
-rw-r--r--tests/PHPUnit/Integration/Core/ArchiveProcessingTest.php507
-rw-r--r--tests/PHPUnit/Integration/Core/CliMultiTest.php248
-rw-r--r--tests/PHPUnit/Integration/Core/CronArchive/SharedSiteIdsTest.php114
-rw-r--r--tests/PHPUnit/Integration/Core/DbTest.php32
-rw-r--r--tests/PHPUnit/Integration/Core/JsProxyTest.php88
-rw-r--r--tests/PHPUnit/Integration/Core/LogTest.php303
-rw-r--r--tests/PHPUnit/Integration/Core/OptionTest.php191
-rw-r--r--tests/PHPUnit/Integration/Core/PiwikTest.php386
-rw-r--r--tests/PHPUnit/Integration/Core/Plugin/SettingsTest.php675
-rw-r--r--tests/PHPUnit/Integration/Core/ReportTest.php542
-rw-r--r--tests/PHPUnit/Integration/Core/SegmentTest.php480
-rwxr-xr-xtests/PHPUnit/Integration/Core/SqlTest.php46
-rw-r--r--tests/PHPUnit/Integration/Core/Tracker/ActionTest.php388
-rw-r--r--tests/PHPUnit/Integration/Core/Tracker/DbTest.php42
-rw-r--r--tests/PHPUnit/Integration/Core/Tracker/Visit2Test.php238
-rw-r--r--tests/PHPUnit/Integration/Core/Tracker/VisitTest.php274
-rw-r--r--tests/PHPUnit/Integration/Core/TrackerTest.php67
-rw-r--r--tests/PHPUnit/Integration/Core/TravisEnvironmentTest.php35
-rw-r--r--tests/PHPUnit/Integration/Core/UpdaterTest.php77
-rw-r--r--tests/PHPUnit/Integration/Core/ViewDataTable/ManagerTest.php105
-rw-r--r--tests/PHPUnit/Integration/Core/WidgetsListTest.php191
-rw-r--r--tests/PHPUnit/Integration/CronArchive/FixedSiteIdsTest.php (renamed from tests/PHPUnit/Integration/Core/CronArchive/FixedSiteIdsTest.php)0
-rw-r--r--tests/PHPUnit/Integration/CronArchive/SharedSiteIdsTest.php115
-rwxr-xr-xtests/PHPUnit/Integration/CsvExportTest.php84
-rw-r--r--tests/PHPUnit/Integration/CustomEventsTest.php141
-rw-r--r--tests/PHPUnit/Integration/DbTest.php33
-rwxr-xr-xtests/PHPUnit/Integration/EcommerceOrderWithItemsTest.php259
-rw-r--r--tests/PHPUnit/Integration/FlattenReportsTest.php128
-rw-r--r--tests/PHPUnit/Integration/Http/fixture.zip (renamed from tests/PHPUnit/Core/Http/fixture.zip)bin128 -> 128 bytes
-rw-r--r--tests/PHPUnit/Integration/HttpTest.php123
-rwxr-xr-xtests/PHPUnit/Integration/ImportLogsTest.php105
-rw-r--r--tests/PHPUnit/Integration/JsProxyTest.php85
-rw-r--r--tests/PHPUnit/Integration/LabelFilterTest.php172
-rw-r--r--tests/PHPUnit/Integration/LogTest.php304
-rwxr-xr-xtests/PHPUnit/Integration/ManyVisitorsOneWebsiteTest.php165
-rw-r--r--tests/PHPUnit/Integration/MultipleSitesArchivingTest.php60
-rwxr-xr-xtests/PHPUnit/Integration/NoVisitTest.php53
-rwxr-xr-xtests/PHPUnit/Integration/NonUnicodeTest.php55
-rw-r--r--tests/PHPUnit/Integration/OneVisitorLongUrlsTruncatedTest.php54
-rwxr-xr-xtests/PHPUnit/Integration/OneVisitorNoKeywordSpecifiedTest.php56
-rwxr-xr-xtests/PHPUnit/Integration/OneVisitorOneWebsiteSeveralDaysDateRangeArchivingTestsTest.php185
-rwxr-xr-xtests/PHPUnit/Integration/OneVisitorOneWebsiteSeveralDaysDateRangeTest.php103
-rw-r--r--tests/PHPUnit/Integration/OneVisitorSeveralDaysImportedInRandomOrderTest.php51
-rwxr-xr-xtests/PHPUnit/Integration/OneVisitorTwoVisitsTest.php238
-rwxr-xr-xtests/PHPUnit/Integration/OneVisitorTwoVisitsWithCookieSupportTest.php53
-rw-r--r--tests/PHPUnit/Integration/OptionTest.php192
-rwxr-xr-xtests/PHPUnit/Integration/PeriodIsRangeDateIsLastNMetadataAndNormalAPITest.php89
-rw-r--r--tests/PHPUnit/Integration/PivotByQueryParamTest.php189
-rw-r--r--tests/PHPUnit/Integration/PiwikTest.php387
-rw-r--r--tests/PHPUnit/Integration/Plugin/SettingsTest.php674
-rw-r--r--tests/PHPUnit/Integration/Plugins/CorePluginsAdmin/UpdateCommunicationTest.php183
-rw-r--r--tests/PHPUnit/Integration/Plugins/CoreUpdater/UpdateCommunicationTest.php119
-rw-r--r--tests/PHPUnit/Integration/Plugins/LoginTest.php399
-rw-r--r--tests/PHPUnit/Integration/Plugins/MobileMessagingTest.php258
-rw-r--r--tests/PHPUnit/Integration/Plugins/MultiSitesTest.php49
-rw-r--r--tests/PHPUnit/Integration/Plugins/PrivacyManagerConfigTest.php99
-rw-r--r--tests/PHPUnit/Integration/Plugins/PrivacyManagerTest.php83
-rw-r--r--tests/PHPUnit/Integration/Plugins/ScheduledReportsTest.php508
-rw-r--r--tests/PHPUnit/Integration/Plugins/SegmentEditorTest.php204
-rw-r--r--tests/PHPUnit/Integration/Plugins/SitesManagerTest.php993
-rw-r--r--tests/PHPUnit/Integration/Plugins/UsersManagerTest.php910
-rw-r--r--tests/PHPUnit/Integration/PrivacyManagerTest.php889
-rwxr-xr-xtests/PHPUnit/Integration/PurgeDataTest.php194
-rw-r--r--tests/PHPUnit/Integration/ReleaseCheckListTest.php389
-rw-r--r--tests/PHPUnit/Integration/ReportTest.php543
-rwxr-xr-xtests/PHPUnit/Integration/RowEvolutionTest.php239
-rw-r--r--tests/PHPUnit/Integration/SegmentTest.php481
-rw-r--r--tests/PHPUnit/Integration/ServeStaticFileTest.php591
-rwxr-xr-xtests/PHPUnit/Integration/SiteSearchTest.php95
-rwxr-xr-xtests/PHPUnit/Integration/SqlTest.php47
-rw-r--r--tests/PHPUnit/Integration/TimezonesTest.php58
-rwxr-xr-xtests/PHPUnit/Integration/TrackCustomVariablesAndCampaignsForceUsingVisitIdNotHeuristicsTest.php49
-rwxr-xr-xtests/PHPUnit/Integration/TrackGoalsAllowMultipleConversionsPerVisitTest.php67
-rw-r--r--tests/PHPUnit/Integration/Tracker/ActionTest.php390
-rw-r--r--tests/PHPUnit/Integration/Tracker/DbTest.php43
-rw-r--r--tests/PHPUnit/Integration/Tracker/Visit2Test.php239
-rw-r--r--tests/PHPUnit/Integration/Tracker/VisitTest.php275
-rw-r--r--tests/PHPUnit/Integration/TrackerTest.php68
-rw-r--r--tests/PHPUnit/Integration/TrackerWindowLookBackTest.php51
-rw-r--r--tests/PHPUnit/Integration/TransitionsTest.php91
-rw-r--r--tests/PHPUnit/Integration/TravisEnvironmentTest.php36
-rwxr-xr-xtests/PHPUnit/Integration/TwoVisitorsTwoWebsitesDifferentDaysArchivingDisabledTest.php89
-rwxr-xr-xtests/PHPUnit/Integration/TwoVisitorsTwoWebsitesDifferentDaysConversionsTest.php119
-rwxr-xr-xtests/PHPUnit/Integration/TwoVisitorsTwoWebsitesDifferentDaysTest.php112
-rwxr-xr-xtests/PHPUnit/Integration/TwoVisitsWithCustomVariablesSegmentContainsTest.php67
-rwxr-xr-xtests/PHPUnit/Integration/TwoVisitsWithCustomVariablesSegmentMatchALLNoGoalDataTest.php54
-rwxr-xr-xtests/PHPUnit/Integration/TwoVisitsWithCustomVariablesSegmentMatchNONETest.php93
-rwxr-xr-xtests/PHPUnit/Integration/TwoVisitsWithCustomVariablesSegmentMatchVisitorTypeTest.php114
-rwxr-xr-xtests/PHPUnit/Integration/TwoVisitsWithCustomVariablesTest.php63
-rw-r--r--tests/PHPUnit/Integration/UpdaterTest.php77
-rw-r--r--tests/PHPUnit/Integration/UrlNormalizationTest.php123
-rw-r--r--tests/PHPUnit/Integration/UserIdAndVisitorIdTest.php104
-rw-r--r--tests/PHPUnit/Integration/ViewDataTable/ManagerTest.php106
-rw-r--r--tests/PHPUnit/Integration/VisitsInPastInvalidateOldReportsTest.php151
-rw-r--r--tests/PHPUnit/Integration/WidgetsListTest.php192
-rw-r--r--tests/PHPUnit/Integration/expected/test_OneVisitor_NoKeywordSpecified__Live.getLastVisitsDetails_day.xml207
-rw-r--r--tests/PHPUnit/Integration/processed/.gitkeep0
-rw-r--r--[-rwxr-xr-x]tests/PHPUnit/IntegrationTestCase.php566
-rwxr-xr-xtests/PHPUnit/MockLocationProvider.php4
-rw-r--r--tests/PHPUnit/Plugins/ActionsTest.php123
-rw-r--r--tests/PHPUnit/Plugins/AnonymizeIPTest.php89
-rwxr-xr-xtests/PHPUnit/Plugins/LanguagesManagerTest.php177
-rw-r--r--tests/PHPUnit/Plugins/ProxyTest.php40
-rw-r--r--tests/PHPUnit/Plugins/ReferrersTest.php243
-rw-r--r--tests/PHPUnit/Plugins/SEOTest.php60
-rw-r--r--tests/PHPUnit/Plugins/UserCountryTest.php182
-rw-r--r--tests/PHPUnit/Plugins/UserSettingsTest.php1032
-rwxr-xr-xtests/PHPUnit/System/AnnotationsTest.php287
-rwxr-xr-xtests/PHPUnit/System/ApiGetReportMetadataTest.php92
-rwxr-xr-xtests/PHPUnit/System/ApiGetReportMetadataYearTest.php52
-rw-r--r--tests/PHPUnit/System/ArchiveCronTest.php167
-rw-r--r--tests/PHPUnit/System/ArchiveInvalidationTest.php139
-rw-r--r--tests/PHPUnit/System/ArchiveWebTest.php79
-rw-r--r--tests/PHPUnit/System/AutoSuggestAPITest.php148
-rw-r--r--tests/PHPUnit/System/BackwardsCompatibility1XTest.php137
-rwxr-xr-xtests/PHPUnit/System/BlobReportLimitingTest.php166
-rwxr-xr-xtests/PHPUnit/System/CsvExportTest.php84
-rw-r--r--tests/PHPUnit/System/CustomEventsTest.php141
-rwxr-xr-xtests/PHPUnit/System/EcommerceOrderWithItemsTest.php259
-rw-r--r--tests/PHPUnit/System/FlattenReportsTest.php128
-rwxr-xr-xtests/PHPUnit/System/ImportLogsTest.php105
-rw-r--r--tests/PHPUnit/System/LabelFilterTest.php172
-rwxr-xr-xtests/PHPUnit/System/ManyVisitorsOneWebsiteTest.php165
-rw-r--r--tests/PHPUnit/System/MultipleSitesArchivingTest.php60
-rwxr-xr-xtests/PHPUnit/System/NoVisitTest.php53
-rwxr-xr-xtests/PHPUnit/System/NonUnicodeTest.php55
-rw-r--r--tests/PHPUnit/System/OneVisitorLongUrlsTruncatedTest.php54
-rwxr-xr-xtests/PHPUnit/System/OneVisitorNoKeywordSpecifiedTest.php56
-rwxr-xr-xtests/PHPUnit/System/OneVisitorOneWebsiteSeveralDaysDateRangeArchivingTestsTest.php185
-rwxr-xr-xtests/PHPUnit/System/OneVisitorOneWebsiteSeveralDaysDateRangeTest.php103
-rw-r--r--tests/PHPUnit/System/OneVisitorSeveralDaysImportedInRandomOrderTest.php51
-rwxr-xr-xtests/PHPUnit/System/OneVisitorTwoVisitsTest.php238
-rwxr-xr-xtests/PHPUnit/System/OneVisitorTwoVisitsWithCookieSupportTest.php53
-rwxr-xr-xtests/PHPUnit/System/PeriodIsRangeDateIsLastNMetadataAndNormalAPITest.php89
-rw-r--r--tests/PHPUnit/System/PivotByQueryParamTest.php189
-rw-r--r--tests/PHPUnit/System/PrivacyManagerTest.php889
-rwxr-xr-xtests/PHPUnit/System/PurgeDataTest.php194
-rwxr-xr-xtests/PHPUnit/System/RowEvolutionTest.php239
-rwxr-xr-xtests/PHPUnit/System/SiteSearchTest.php95
-rw-r--r--tests/PHPUnit/System/TimezonesTest.php58
-rwxr-xr-xtests/PHPUnit/System/TrackCustomVariablesAndCampaignsForceUsingVisitIdNotHeuristicsTest.php49
-rwxr-xr-xtests/PHPUnit/System/TrackGoalsAllowMultipleConversionsPerVisitTest.php67
-rw-r--r--tests/PHPUnit/System/TrackerWindowLookBackTest.php51
-rw-r--r--tests/PHPUnit/System/TransitionsTest.php91
-rwxr-xr-xtests/PHPUnit/System/TwoVisitorsTwoWebsitesDifferentDaysArchivingDisabledTest.php89
-rwxr-xr-xtests/PHPUnit/System/TwoVisitorsTwoWebsitesDifferentDaysConversionsTest.php119
-rwxr-xr-xtests/PHPUnit/System/TwoVisitorsTwoWebsitesDifferentDaysTest.php112
-rwxr-xr-xtests/PHPUnit/System/TwoVisitsWithCustomVariablesSegmentContainsTest.php67
-rwxr-xr-xtests/PHPUnit/System/TwoVisitsWithCustomVariablesSegmentMatchALLNoGoalDataTest.php54
-rwxr-xr-xtests/PHPUnit/System/TwoVisitsWithCustomVariablesSegmentMatchNONETest.php93
-rwxr-xr-xtests/PHPUnit/System/TwoVisitsWithCustomVariablesSegmentMatchVisitorTypeTest.php113
-rwxr-xr-xtests/PHPUnit/System/TwoVisitsWithCustomVariablesTest.php63
-rw-r--r--tests/PHPUnit/System/UrlNormalizationTest.php123
-rw-r--r--tests/PHPUnit/System/UserIdAndVisitorIdTest.php104
-rw-r--r--tests/PHPUnit/System/VisitsInPastInvalidateOldReportsTest.php151
-rw-r--r--tests/PHPUnit/System/expected/.gitkeep (renamed from tests/PHPUnit/Integration/expected/.gitkeep)0
-rw-r--r--tests/PHPUnit/System/expected/test_ArchiveCronTest_archive_php_cron_output.txt (renamed from tests/PHPUnit/Integration/expected/test_ArchiveCronTest_archive_php_cron_output.txt)0
-rw-r--r--tests/PHPUnit/System/expected/test_ArchiveCronTest_noOptions__VisitsSummary.get_day.xml (renamed from tests/PHPUnit/Integration/expected/test_ArchiveCronTest_noOptions__VisitsSummary.get_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ArchiveCronTest_noOptions__VisitsSummary.get_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ArchiveCronTest_noOptions__VisitsSummary.get_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ArchiveCronTest_noOptions__VisitsSummary.get_week.xml (renamed from tests/PHPUnit/Integration/expected/test_ArchiveCronTest_noOptions__VisitsSummary.get_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ArchiveCronTest_noOptions__VisitsSummary.get_year.xml (renamed from tests/PHPUnit/Integration/expected/test_ArchiveCronTest_noOptions__VisitsSummary.get_year.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ArchiveCronTest_nonPreArchivedSegment_noOptions__VisitsSummary.get_day.xml (renamed from tests/PHPUnit/Integration/expected/test_ArchiveCronTest_nonPreArchivedSegment_noOptions__VisitsSummary.get_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ArchiveCronTest_nonPreArchivedSegment_noOptions__VisitsSummary.get_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ArchiveCronTest_nonPreArchivedSegment_noOptions__VisitsSummary.get_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ArchiveCronTest_nonPreArchivedSegment_noOptions__VisitsSummary.get_week.xml (renamed from tests/PHPUnit/Integration/expected/test_ArchiveCronTest_nonPreArchivedSegment_noOptions__VisitsSummary.get_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ArchiveCronTest_nonPreArchivedSegment_noOptions__VisitsSummary.get_year.xml (renamed from tests/PHPUnit/Integration/expected/test_ArchiveCronTest_nonPreArchivedSegment_noOptions__VisitsSummary.get_year.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ArchiveCronTest_preArchivedSegment_noOptions__Live.getLastVisitsDetails_day.xml (renamed from tests/PHPUnit/Integration/expected/test_ArchiveCronTest_preArchivedSegment_noOptions__Live.getLastVisitsDetails_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ArchiveCronTest_preArchivedSegment_noOptions__Live.getLastVisitsDetails_year.xml (renamed from tests/PHPUnit/Integration/expected/test_ArchiveCronTest_preArchivedSegment_noOptions__Live.getLastVisitsDetails_year.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ArchiveCronTest_preArchivedSegment_noOptions__VisitsSummary.get_day.xml (renamed from tests/PHPUnit/Integration/expected/test_ArchiveCronTest_preArchivedSegment_noOptions__VisitsSummary.get_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ArchiveCronTest_preArchivedSegment_noOptions__VisitsSummary.get_year.xml (renamed from tests/PHPUnit/Integration/expected/test_ArchiveCronTest_preArchivedSegment_noOptions__VisitsSummary.get_year.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ArchiveCronTest_segmentNoAutoArchive_noOptions__VisitsSummary.get_day.xml (renamed from tests/PHPUnit/Integration/expected/test_ArchiveCronTest_segmentNoAutoArchive_noOptions__VisitsSummary.get_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ArchiveCronTest_segmentNoAutoArchive_noOptions__VisitsSummary.get_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ArchiveCronTest_segmentNoAutoArchive_noOptions__VisitsSummary.get_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ArchiveCronTest_segmentNoAutoArchive_noOptions__VisitsSummary.get_week.xml (renamed from tests/PHPUnit/Integration/expected/test_ArchiveCronTest_segmentNoAutoArchive_noOptions__VisitsSummary.get_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ArchiveCronTest_segmentNoAutoArchive_noOptions__VisitsSummary.get_year.xml (renamed from tests/PHPUnit/Integration/expected/test_ArchiveCronTest_segmentNoAutoArchive_noOptions__VisitsSummary.get_year.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ArchiveCronTest_segmentOnlyOneSite_noOptions__VisitsSummary.get_day.xml (renamed from tests/PHPUnit/Integration/expected/test_ArchiveCronTest_segmentOnlyOneSite_noOptions__VisitsSummary.get_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ArchiveCronTest_segmentOnlyOneSite_noOptions__VisitsSummary.get_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ArchiveCronTest_segmentOnlyOneSite_noOptions__VisitsSummary.get_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ArchiveCronTest_segmentOnlyOneSite_noOptions__VisitsSummary.get_week.xml (renamed from tests/PHPUnit/Integration/expected/test_ArchiveCronTest_segmentOnlyOneSite_noOptions__VisitsSummary.get_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ArchiveCronTest_segmentOnlyOneSite_noOptions__VisitsSummary.get_year.xml (renamed from tests/PHPUnit/Integration/expected/test_ArchiveCronTest_segmentOnlyOneSite_noOptions__VisitsSummary.get_year.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_Archive_InvalidationWebsite1_NewDataShouldAppear__Actions.getPageUrls_month.xml (renamed from tests/PHPUnit/Integration/expected/test_Archive_InvalidationWebsite1_NewDataShouldAppear__Actions.getPageUrls_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_Archive_InvalidationWebsite1_NewDataShouldAppear__VisitsSummary.get_month.xml (renamed from tests/PHPUnit/Integration/expected/test_Archive_InvalidationWebsite1_NewDataShouldAppear__VisitsSummary.get_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_Archive_InvalidationWebsite1_NewDataShouldNotAppear__Actions.getPageUrls_month.xml (renamed from tests/PHPUnit/Integration/expected/test_Archive_InvalidationWebsite1_NewDataShouldNotAppear__Actions.getPageUrls_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_Archive_InvalidationWebsite1_NewDataShouldNotAppear__VisitsSummary.get_month.xml (renamed from tests/PHPUnit/Integration/expected/test_Archive_InvalidationWebsite1_NewDataShouldNotAppear__VisitsSummary.get_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_Archive_InvalidationWebsite2NewDataShouldNotAppear_BecauseWeekWasNotInvalidated__Actions.getPageUrls_week.xml (renamed from tests/PHPUnit/Integration/expected/test_Archive_InvalidationWebsite2NewDataShouldNotAppear_BecauseWeekWasNotInvalidated__Actions.getPageUrls_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_Archive_InvalidationWebsite2NewDataShouldNotAppear_BecauseWeekWasNotInvalidated__VisitsSummary.get_week.xml (renamed from tests/PHPUnit/Integration/expected/test_Archive_InvalidationWebsite2NewDataShouldNotAppear_BecauseWeekWasNotInvalidated__VisitsSummary.get_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_Archive_InvalidationWebsite2_NewDataShouldAppear__Actions.getPageUrls_month.xml (renamed from tests/PHPUnit/Integration/expected/test_Archive_InvalidationWebsite2_NewDataShouldAppear__Actions.getPageUrls_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_Archive_InvalidationWebsite2_NewDataShouldAppear__VisitsSummary.get_month.xml (renamed from tests/PHPUnit/Integration/expected/test_Archive_InvalidationWebsite2_NewDataShouldAppear__VisitsSummary.get_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_Archive_InvalidationWebsite2_NewDataShouldNotAppear_BecauseWeekWasNotInvalidated__Actions.getPageUrls_week.xml (renamed from tests/PHPUnit/Integration/expected/test_Archive_InvalidationWebsite2_NewDataShouldNotAppear_BecauseWeekWasNotInvalidated__Actions.getPageUrls_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_Archive_InvalidationWebsite2_NewDataShouldNotAppear_BecauseWeekWasNotInvalidated__VisitsSummary.get_week.xml (renamed from tests/PHPUnit/Integration/expected/test_Archive_InvalidationWebsite2_NewDataShouldNotAppear_BecauseWeekWasNotInvalidated__VisitsSummary.get_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_Archive_InvalidationWebsite2_NewDataShouldNotAppear__Actions.getPageUrls_month.xml (renamed from tests/PHPUnit/Integration/expected/test_Archive_InvalidationWebsite2_NewDataShouldNotAppear__Actions.getPageUrls_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_Archive_InvalidationWebsite2_NewDataShouldNotAppear__VisitsSummary.get_month.xml (renamed from tests/PHPUnit/Integration/expected/test_Archive_InvalidationWebsite2_NewDataShouldNotAppear__VisitsSummary.get_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest__Live.getLastVisitsDetails_range.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest__Live.getLastVisitsDetails_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_actions__API.getSuggestedValuesForSegment.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_actions__API.getSuggestedValuesForSegment.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_actions__VisitsSummary.get_range.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_actions__VisitsSummary.get_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_browserCode__API.getSuggestedValuesForSegment.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_browserCode__API.getSuggestedValuesForSegment.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_browserCode__VisitsSummary.get_range.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_browserCode__VisitsSummary.get_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_browserVersion__API.getSuggestedValuesForSegment.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_browserVersion__API.getSuggestedValuesForSegment.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_browserVersion__VisitsSummary.get_range.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_browserVersion__VisitsSummary.get_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_city__API.getSuggestedValuesForSegment.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_city__API.getSuggestedValuesForSegment.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_city__VisitsSummary.get_range.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_city__VisitsSummary.get_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_contentInteraction__API.getSuggestedValuesForSegment.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_contentInteraction__API.getSuggestedValuesForSegment.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_contentName__API.getSuggestedValuesForSegment.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_contentName__API.getSuggestedValuesForSegment.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_contentPiece__API.getSuggestedValuesForSegment.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_contentPiece__API.getSuggestedValuesForSegment.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_contentTarget__API.getSuggestedValuesForSegment.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_contentTarget__API.getSuggestedValuesForSegment.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_continentCode__API.getSuggestedValuesForSegment.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_continentCode__API.getSuggestedValuesForSegment.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_continentCode__VisitsSummary.get_range.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_continentCode__VisitsSummary.get_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_countryCode__API.getSuggestedValuesForSegment.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_countryCode__API.getSuggestedValuesForSegment.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_countryCode__VisitsSummary.get_range.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_countryCode__VisitsSummary.get_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariableName1__API.getSuggestedValuesForSegment.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariableName1__API.getSuggestedValuesForSegment.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariableName1__VisitsSummary.get_range.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariableName1__VisitsSummary.get_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariableName2__API.getSuggestedValuesForSegment.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariableName2__API.getSuggestedValuesForSegment.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariableName3__API.getSuggestedValuesForSegment.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariableName3__API.getSuggestedValuesForSegment.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariableName4__API.getSuggestedValuesForSegment.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariableName4__API.getSuggestedValuesForSegment.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariableName5__API.getSuggestedValuesForSegment.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariableName5__API.getSuggestedValuesForSegment.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariableName5__VisitsSummary.get_range.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariableName5__VisitsSummary.get_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariablePageName1__API.getSuggestedValuesForSegment.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariablePageName1__API.getSuggestedValuesForSegment.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariablePageName2__API.getSuggestedValuesForSegment.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariablePageName2__API.getSuggestedValuesForSegment.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariablePageName2__VisitsSummary.get_range.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariablePageName2__VisitsSummary.get_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariablePageName3__API.getSuggestedValuesForSegment.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariablePageName3__API.getSuggestedValuesForSegment.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariablePageName4__API.getSuggestedValuesForSegment.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariablePageName4__API.getSuggestedValuesForSegment.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariablePageName4__VisitsSummary.get_range.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariablePageName4__VisitsSummary.get_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariablePageName5__API.getSuggestedValuesForSegment.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariablePageName5__API.getSuggestedValuesForSegment.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariablePageName5__VisitsSummary.get_range.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariablePageName5__VisitsSummary.get_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariablePageValue1__API.getSuggestedValuesForSegment.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariablePageValue1__API.getSuggestedValuesForSegment.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariablePageValue2__API.getSuggestedValuesForSegment.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariablePageValue2__API.getSuggestedValuesForSegment.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariablePageValue2__VisitsSummary.get_range.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariablePageValue2__VisitsSummary.get_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariablePageValue3__API.getSuggestedValuesForSegment.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariablePageValue3__API.getSuggestedValuesForSegment.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariablePageValue4__API.getSuggestedValuesForSegment.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariablePageValue4__API.getSuggestedValuesForSegment.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariablePageValue4__VisitsSummary.get_range.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariablePageValue4__VisitsSummary.get_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariablePageValue5__API.getSuggestedValuesForSegment.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariablePageValue5__API.getSuggestedValuesForSegment.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariablePageValue5__VisitsSummary.get_range.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariablePageValue5__VisitsSummary.get_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariableValue1__API.getSuggestedValuesForSegment.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariableValue1__API.getSuggestedValuesForSegment.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariableValue1__VisitsSummary.get_range.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariableValue1__VisitsSummary.get_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariableValue2__API.getSuggestedValuesForSegment.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariableValue2__API.getSuggestedValuesForSegment.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariableValue3__API.getSuggestedValuesForSegment.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariableValue3__API.getSuggestedValuesForSegment.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariableValue4__API.getSuggestedValuesForSegment.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariableValue4__API.getSuggestedValuesForSegment.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariableValue5__API.getSuggestedValuesForSegment.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariableValue5__API.getSuggestedValuesForSegment.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariableValue5__VisitsSummary.get_range.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariableValue5__VisitsSummary.get_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_daysSinceFirstVisit__API.getSuggestedValuesForSegment.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_daysSinceFirstVisit__API.getSuggestedValuesForSegment.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_daysSinceFirstVisit__VisitsSummary.get_range.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_daysSinceFirstVisit__VisitsSummary.get_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_daysSinceLastEcommerceOrder__API.getSuggestedValuesForSegment.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_daysSinceLastEcommerceOrder__API.getSuggestedValuesForSegment.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_daysSinceLastEcommerceOrder__VisitsSummary.get_range.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_daysSinceLastEcommerceOrder__VisitsSummary.get_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_daysSinceLastVisit__API.getSuggestedValuesForSegment.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_daysSinceLastVisit__API.getSuggestedValuesForSegment.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_daysSinceLastVisit__VisitsSummary.get_range.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_daysSinceLastVisit__VisitsSummary.get_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_deviceType__API.getSuggestedValuesForSegment.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_deviceType__API.getSuggestedValuesForSegment.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_deviceType__VisitsSummary.get_range.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_deviceType__VisitsSummary.get_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_entryPageTitle__API.getSuggestedValuesForSegment.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_entryPageTitle__API.getSuggestedValuesForSegment.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_entryPageTitle__VisitsSummary.get_range.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_entryPageTitle__VisitsSummary.get_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_entryPageUrl__API.getSuggestedValuesForSegment.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_entryPageUrl__API.getSuggestedValuesForSegment.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_entryPageUrl__VisitsSummary.get_range.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_entryPageUrl__VisitsSummary.get_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_eventAction__API.getSuggestedValuesForSegment.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_eventAction__API.getSuggestedValuesForSegment.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_eventAction__VisitsSummary.get_range.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_eventAction__VisitsSummary.get_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_eventCategory__API.getSuggestedValuesForSegment.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_eventCategory__API.getSuggestedValuesForSegment.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_eventCategory__VisitsSummary.get_range.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_eventCategory__VisitsSummary.get_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_eventName__API.getSuggestedValuesForSegment.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_eventName__API.getSuggestedValuesForSegment.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_eventName__VisitsSummary.get_range.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_eventName__VisitsSummary.get_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_events__API.getSuggestedValuesForSegment.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_events__API.getSuggestedValuesForSegment.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_events__VisitsSummary.get_range.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_events__VisitsSummary.get_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_exitPageTitle__API.getSuggestedValuesForSegment.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_exitPageTitle__API.getSuggestedValuesForSegment.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_exitPageTitle__VisitsSummary.get_range.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_exitPageTitle__VisitsSummary.get_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_exitPageUrl__API.getSuggestedValuesForSegment.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_exitPageUrl__API.getSuggestedValuesForSegment.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_exitPageUrl__VisitsSummary.get_range.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_exitPageUrl__VisitsSummary.get_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_latitude__API.getSuggestedValuesForSegment.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_latitude__API.getSuggestedValuesForSegment.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_latitude__VisitsSummary.get_range.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_latitude__VisitsSummary.get_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_longitude__API.getSuggestedValuesForSegment.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_longitude__API.getSuggestedValuesForSegment.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_longitude__VisitsSummary.get_range.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_longitude__VisitsSummary.get_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_operatingSystemCode__API.getSuggestedValuesForSegment.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_operatingSystemCode__API.getSuggestedValuesForSegment.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_operatingSystemCode__VisitsSummary.get_range.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_operatingSystemCode__VisitsSummary.get_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_pageTitle__API.getSuggestedValuesForSegment.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_pageTitle__API.getSuggestedValuesForSegment.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_pageTitle__VisitsSummary.get_range.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_pageTitle__VisitsSummary.get_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_pageUrl__API.getSuggestedValuesForSegment.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_pageUrl__API.getSuggestedValuesForSegment.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_pageUrl__VisitsSummary.get_range.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_pageUrl__VisitsSummary.get_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_provider__API.getSuggestedValuesForSegment.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_provider__API.getSuggestedValuesForSegment.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_provider__VisitsSummary.get_range.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_provider__VisitsSummary.get_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_referrerKeyword__API.getSuggestedValuesForSegment.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_referrerKeyword__API.getSuggestedValuesForSegment.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_referrerKeyword__VisitsSummary.get_range.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_referrerKeyword__VisitsSummary.get_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_referrerName__API.getSuggestedValuesForSegment.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_referrerName__API.getSuggestedValuesForSegment.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_referrerName__VisitsSummary.get_range.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_referrerName__VisitsSummary.get_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_referrerType__API.getSuggestedValuesForSegment.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_referrerType__API.getSuggestedValuesForSegment.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_referrerType__VisitsSummary.get_range.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_referrerType__VisitsSummary.get_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_referrerUrl__API.getSuggestedValuesForSegment.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_referrerUrl__API.getSuggestedValuesForSegment.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_referrerUrl__VisitsSummary.get_range.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_referrerUrl__VisitsSummary.get_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_regionCode__API.getSuggestedValuesForSegment.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_regionCode__API.getSuggestedValuesForSegment.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_regionCode__VisitsSummary.get_range.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_regionCode__VisitsSummary.get_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_resolution__API.getSuggestedValuesForSegment.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_resolution__API.getSuggestedValuesForSegment.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_resolution__VisitsSummary.get_range.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_resolution__VisitsSummary.get_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_searches__API.getSuggestedValuesForSegment.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_searches__API.getSuggestedValuesForSegment.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_searches__VisitsSummary.get_range.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_searches__VisitsSummary.get_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_siteSearchKeyword__API.getSuggestedValuesForSegment.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_siteSearchKeyword__API.getSuggestedValuesForSegment.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_siteSearchKeyword__VisitsSummary.get_range.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_siteSearchKeyword__VisitsSummary.get_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_userId__API.getSuggestedValuesForSegment.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_userId__API.getSuggestedValuesForSegment.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_userId__VisitsSummary.get_range.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_userId__VisitsSummary.get_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitConvertedGoalId__API.getSuggestedValuesForSegment.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_visitConvertedGoalId__API.getSuggestedValuesForSegment.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitConvertedGoalId__VisitsSummary.get_range.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_visitConvertedGoalId__VisitsSummary.get_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitConverted__API.getSuggestedValuesForSegment.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_visitConverted__API.getSuggestedValuesForSegment.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitConverted__VisitsSummary.get_range.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_visitConverted__VisitsSummary.get_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitCount__API.getSuggestedValuesForSegment.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_visitCount__API.getSuggestedValuesForSegment.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitCount__VisitsSummary.get_range.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_visitCount__VisitsSummary.get_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitDuration__API.getSuggestedValuesForSegment.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_visitDuration__API.getSuggestedValuesForSegment.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitDuration__VisitsSummary.get_range.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_visitDuration__VisitsSummary.get_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitEcommerceStatus__API.getSuggestedValuesForSegment.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_visitEcommerceStatus__API.getSuggestedValuesForSegment.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitEcommerceStatus__VisitsSummary.get_range.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_visitEcommerceStatus__VisitsSummary.get_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitId__API.getSuggestedValuesForSegment.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_visitId__API.getSuggestedValuesForSegment.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitIp__API.getSuggestedValuesForSegment.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_visitIp__API.getSuggestedValuesForSegment.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitIp__VisitsSummary.get_range.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_visitIp__VisitsSummary.get_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitLocalHour__API.getSuggestedValuesForSegment.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_visitLocalHour__API.getSuggestedValuesForSegment.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitLocalHour__VisitsSummary.get_range.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_visitLocalHour__VisitsSummary.get_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitServerHour__API.getSuggestedValuesForSegment.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_visitServerHour__API.getSuggestedValuesForSegment.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitServerHour__VisitsSummary.get_range.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_visitServerHour__VisitsSummary.get_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitorId__API.getSuggestedValuesForSegment.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_visitorId__API.getSuggestedValuesForSegment.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitorId__VisitsSummary.get_range.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_visitorId__VisitsSummary.get_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitorType__API.getSuggestedValuesForSegment.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_visitorType__API.getSuggestedValuesForSegment.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitorType__VisitsSummary.get_range.xml (renamed from tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_visitorType__VisitsSummary.get_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_BackwardsCompatibility1XTest__VisitFrequency.get_day.xml (renamed from tests/PHPUnit/Integration/expected/test_BackwardsCompatibility1XTest__VisitFrequency.get_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_BackwardsCompatibility1XTest__VisitFrequency.get_month.xml (renamed from tests/PHPUnit/Integration/expected/test_BackwardsCompatibility1XTest__VisitFrequency.get_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_BackwardsCompatibility1XTest__VisitFrequency.get_range.xml (renamed from tests/PHPUnit/Integration/expected/test_BackwardsCompatibility1XTest__VisitFrequency.get_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_BackwardsCompatibility1XTest__VisitFrequency.get_week.xml (renamed from tests/PHPUnit/Integration/expected/test_BackwardsCompatibility1XTest__VisitFrequency.get_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_BackwardsCompatibility1XTest__VisitFrequency.get_year.xml (renamed from tests/PHPUnit/Integration/expected/test_BackwardsCompatibility1XTest__VisitFrequency.get_year.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_BackwardsCompatibility1XTest_multipleDates__VisitFrequency.get_day.xml (renamed from tests/PHPUnit/Integration/expected/test_BackwardsCompatibility1XTest_multipleDates__VisitFrequency.get_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_BackwardsCompatibility1XTest_multipleOldNew__VisitFrequency.get_month.xml (renamed from tests/PHPUnit/Integration/expected/test_BackwardsCompatibility1XTest_multipleOldNew__VisitFrequency.get_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_CustomEvents_Actions.getPageUrls_lastN__API.getProcessedReport_day.xml (renamed from tests/PHPUnit/Integration/expected/test_CustomEvents_Actions.getPageUrls_lastN__API.getProcessedReport_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_CustomEvents_Events.getAction_lastN__API.getProcessedReport_day.xml (renamed from tests/PHPUnit/Integration/expected/test_CustomEvents_Events.getAction_lastN__API.getProcessedReport_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_CustomEvents_Events.getCategory_lastN__API.getProcessedReport_day.xml (renamed from tests/PHPUnit/Integration/expected/test_CustomEvents_Events.getCategory_lastN__API.getProcessedReport_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_CustomEvents_Events.getName_lastN__API.getProcessedReport_day.xml (renamed from tests/PHPUnit/Integration/expected/test_CustomEvents_Events.getName_lastN__API.getProcessedReport_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_CustomEvents__Actions.getPageUrls_day.xml (renamed from tests/PHPUnit/Integration/expected/test_CustomEvents__Actions.getPageUrls_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_CustomEvents__Actions.getPageUrls_month.xml (renamed from tests/PHPUnit/Integration/expected/test_CustomEvents__Actions.getPageUrls_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_CustomEvents__Actions.get_day.xml (renamed from tests/PHPUnit/Integration/expected/test_CustomEvents__Actions.get_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_CustomEvents__Actions.get_month.xml (renamed from tests/PHPUnit/Integration/expected/test_CustomEvents__Actions.get_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_CustomEvents__Events.getAction_day.xml (renamed from tests/PHPUnit/Integration/expected/test_CustomEvents__Events.getAction_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_CustomEvents__Events.getAction_month.xml (renamed from tests/PHPUnit/Integration/expected/test_CustomEvents__Events.getAction_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_CustomEvents__Events.getCategory_day.xml (renamed from tests/PHPUnit/Integration/expected/test_CustomEvents__Events.getCategory_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_CustomEvents__Events.getCategory_month.xml (renamed from tests/PHPUnit/Integration/expected/test_CustomEvents__Events.getCategory_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_CustomEvents__Events.getName_day.xml (renamed from tests/PHPUnit/Integration/expected/test_CustomEvents__Events.getName_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_CustomEvents__Events.getName_month.xml (renamed from tests/PHPUnit/Integration/expected/test_CustomEvents__Events.getName_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_CustomEvents__Live.getLastVisitsDetails_day.xml (renamed from tests/PHPUnit/Integration/expected/test_CustomEvents__Live.getLastVisitsDetails_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_CustomEvents__Live.getLastVisitsDetails_month.xml (renamed from tests/PHPUnit/Integration/expected/test_CustomEvents__Live.getLastVisitsDetails_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_CustomEvents_eventCategoryOrNameMatch__Actions.getPageUrls_day.xml (renamed from tests/PHPUnit/Integration/expected/test_CustomEvents_eventCategoryOrNameMatch__Actions.getPageUrls_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_CustomEvents_eventCategoryOrNameMatch__Events.getAction_day.xml (renamed from tests/PHPUnit/Integration/expected/test_CustomEvents_eventCategoryOrNameMatch__Events.getAction_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_CustomEvents_eventCategoryOrNameMatch__Events.getCategory_day.xml (renamed from tests/PHPUnit/Integration/expected/test_CustomEvents_eventCategoryOrNameMatch__Events.getCategory_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_CustomEvents_eventCategoryOrNameMatch__Events.getName_day.xml (renamed from tests/PHPUnit/Integration/expected/test_CustomEvents_eventCategoryOrNameMatch__Events.getName_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventAction__Events.getAction_day.xml (renamed from tests/PHPUnit/Integration/expected/test_CustomEvents_secondaryDimensionIsEventAction__Events.getAction_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventAction__Events.getAction_month.xml (renamed from tests/PHPUnit/Integration/expected/test_CustomEvents_secondaryDimensionIsEventAction__Events.getAction_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventAction__Events.getCategory_day.xml (renamed from tests/PHPUnit/Integration/expected/test_CustomEvents_secondaryDimensionIsEventAction__Events.getCategory_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventAction__Events.getCategory_month.xml (renamed from tests/PHPUnit/Integration/expected/test_CustomEvents_secondaryDimensionIsEventAction__Events.getCategory_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventAction__Events.getName_day.xml (renamed from tests/PHPUnit/Integration/expected/test_CustomEvents_secondaryDimensionIsEventAction__Events.getName_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventAction__Events.getName_month.xml (renamed from tests/PHPUnit/Integration/expected/test_CustomEvents_secondaryDimensionIsEventAction__Events.getName_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventCategory__Events.getAction_day.xml (renamed from tests/PHPUnit/Integration/expected/test_CustomEvents_secondaryDimensionIsEventCategory__Events.getAction_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventCategory__Events.getAction_month.xml (renamed from tests/PHPUnit/Integration/expected/test_CustomEvents_secondaryDimensionIsEventCategory__Events.getAction_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventCategory__Events.getCategory_day.xml (renamed from tests/PHPUnit/Integration/expected/test_CustomEvents_secondaryDimensionIsEventCategory__Events.getCategory_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventCategory__Events.getCategory_month.xml (renamed from tests/PHPUnit/Integration/expected/test_CustomEvents_secondaryDimensionIsEventCategory__Events.getCategory_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventCategory__Events.getName_day.xml (renamed from tests/PHPUnit/Integration/expected/test_CustomEvents_secondaryDimensionIsEventCategory__Events.getName_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventCategory__Events.getName_month.xml (renamed from tests/PHPUnit/Integration/expected/test_CustomEvents_secondaryDimensionIsEventCategory__Events.getName_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventName__Events.getAction_day.xml (renamed from tests/PHPUnit/Integration/expected/test_CustomEvents_secondaryDimensionIsEventName__Events.getAction_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventName__Events.getAction_month.xml (renamed from tests/PHPUnit/Integration/expected/test_CustomEvents_secondaryDimensionIsEventName__Events.getAction_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventName__Events.getCategory_day.xml (renamed from tests/PHPUnit/Integration/expected/test_CustomEvents_secondaryDimensionIsEventName__Events.getCategory_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventName__Events.getCategory_month.xml (renamed from tests/PHPUnit/Integration/expected/test_CustomEvents_secondaryDimensionIsEventName__Events.getCategory_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventName__Events.getName_day.xml (renamed from tests/PHPUnit/Integration/expected/test_CustomEvents_secondaryDimensionIsEventName__Events.getName_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventName__Events.getName_month.xml (renamed from tests/PHPUnit/Integration/expected/test_CustomEvents_secondaryDimensionIsEventName__Events.getName_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_CustomEvents_segmentMatchesEventActionPlay__Actions.getPageUrls_day.xml (renamed from tests/PHPUnit/Integration/expected/test_CustomEvents_segmentMatchesEventActionPlay__Actions.getPageUrls_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_CustomEvents_segmentMatchesEventActionPlay__Events.getAction_day.xml (renamed from tests/PHPUnit/Integration/expected/test_CustomEvents_segmentMatchesEventActionPlay__Events.getAction_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_CustomEvents_segmentMatchesEventActionPlay__Events.getCategory_day.xml (renamed from tests/PHPUnit/Integration/expected/test_CustomEvents_segmentMatchesEventActionPlay__Events.getCategory_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_CustomEvents_segmentMatchesEventActionPlay__Events.getName_day.xml (renamed from tests/PHPUnit/Integration/expected/test_CustomEvents_segmentMatchesEventActionPlay__Events.getName_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_FlattenReports__Actions.getPageUrls_week.xml (renamed from tests/PHPUnit/Integration/expected/test_FlattenReports__Actions.getPageUrls_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_FlattenReports__CustomVariables.getCustomVariables_day.xml (renamed from tests/PHPUnit/Integration/expected/test_FlattenReports__CustomVariables.getCustomVariables_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_FlattenReports__Referrers.getWebsites_day.xml (renamed from tests/PHPUnit/Integration/expected/test_FlattenReports__Referrers.getWebsites_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_FlattenReports_expandedSubtable__Actions.getPageUrls_week.xml (renamed from tests/PHPUnit/Integration/expected/test_FlattenReports_expandedSubtable__Actions.getPageUrls_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_FlattenReports_expandedWithDepth__Actions.getPageUrls_week.xml (renamed from tests/PHPUnit/Integration/expected/test_FlattenReports_expandedWithDepth__Actions.getPageUrls_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_FlattenReports_flatFilterPatternRecursive__Actions.getPageUrls_week.xml (renamed from tests/PHPUnit/Integration/expected/test_FlattenReports_flatFilterPatternRecursive__Actions.getPageUrls_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_FlattenReports_withAggregate__Actions.getPageUrls_week.xml (renamed from tests/PHPUnit/Integration/expected/test_FlattenReports_withAggregate__Actions.getPageUrls_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__Actions.getDownload_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getDownload_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__Actions.getDownload_range.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getDownload_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__Actions.getDownloads_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getDownloads_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__Actions.getDownloads_range.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getDownloads_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__Actions.getEntryPageTitles_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getEntryPageTitles_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__Actions.getEntryPageTitles_range.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getEntryPageTitles_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__Actions.getEntryPageUrls_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getEntryPageUrls_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__Actions.getEntryPageUrls_range.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getEntryPageUrls_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__Actions.getExitPageTitles_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getExitPageTitles_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__Actions.getExitPageTitles_range.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getExitPageTitles_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__Actions.getExitPageUrls_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getExitPageUrls_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__Actions.getExitPageUrls_range.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getExitPageUrls_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__Actions.getOutlink_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getOutlink_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__Actions.getOutlink_range.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getOutlink_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__Actions.getOutlinks_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getOutlinks_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__Actions.getOutlinks_range.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getOutlinks_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__Actions.getPageTitle_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getPageTitle_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__Actions.getPageTitle_range.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getPageTitle_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__Actions.getPageTitlesFollowingSiteSearch_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getPageTitlesFollowingSiteSearch_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__Actions.getPageTitlesFollowingSiteSearch_range.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getPageTitlesFollowingSiteSearch_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__Actions.getPageTitles_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getPageTitles_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__Actions.getPageTitles_range.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getPageTitles_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__Actions.getPageUrl_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getPageUrl_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__Actions.getPageUrl_range.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getPageUrl_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__Actions.getPageUrlsFollowingSiteSearch_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getPageUrlsFollowingSiteSearch_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__Actions.getPageUrlsFollowingSiteSearch_range.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getPageUrlsFollowingSiteSearch_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__Actions.getPageUrls_day.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getPageUrls_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__Actions.getPageUrls_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getPageUrls_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__Actions.getPageUrls_range.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getPageUrls_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__Actions.getSiteSearchCategories_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getSiteSearchCategories_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__Actions.getSiteSearchCategories_range.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getSiteSearchCategories_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__Actions.getSiteSearchKeywords_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getSiteSearchKeywords_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__Actions.getSiteSearchKeywords_range.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getSiteSearchKeywords_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__Actions.getSiteSearchNoResultKeywords_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getSiteSearchNoResultKeywords_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__Actions.getSiteSearchNoResultKeywords_range.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getSiteSearchNoResultKeywords_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__Actions.get_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.get_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__Actions.get_range.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.get_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__Contents.getContentNames_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__Contents.getContentNames_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__Contents.getContentPieces_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__Contents.getContentPieces_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__CustomVariables.getCustomVariables_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__CustomVariables.getCustomVariables_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__DevicesDetection.getBrand_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__DevicesDetection.getBrand_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__DevicesDetection.getBrowserEngines_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__DevicesDetection.getBrowserEngines_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__DevicesDetection.getBrowserFamilies_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__DevicesDetection.getBrowserFamilies_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__DevicesDetection.getBrowserVersions_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__DevicesDetection.getBrowserVersions_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__DevicesDetection.getModel_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__DevicesDetection.getModel_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__DevicesDetection.getOsFamilies_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__DevicesDetection.getOsFamilies_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__DevicesDetection.getOsVersions_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__DevicesDetection.getOsVersions_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__DevicesDetection.getType_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__DevicesDetection.getType_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__Events.getAction_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__Events.getAction_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__Events.getCategory_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__Events.getCategory_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__Events.getName_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__Events.getName_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__ExamplePlugin.getAnswerToLife.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__ExamplePlugin.getAnswerToLife.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__ExamplePlugin.getExampleReport_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__ExamplePlugin.getExampleReport_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__Goals.getDaysToConversion_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__Goals.getDaysToConversion_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__Goals.getGoals.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__Goals.getGoals.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__Goals.getItemsCategory_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__Goals.getItemsCategory_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__Goals.getItemsName_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__Goals.getItemsName_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__Goals.getItemsSku_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__Goals.getItemsSku_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__Goals.getVisitsUntilConversion_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__Goals.getVisitsUntilConversion_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__Goals.get_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__Goals.get_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__Live.getLastVisitsDetails_range.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__Live.getLastVisitsDetails_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__MultiSites.getAll_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__MultiSites.getAll_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__MultiSites.getOne_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__MultiSites.getOne_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__Provider.getProvider_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__Provider.getProvider_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__Referrers.getAll_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__Referrers.getAll_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__Referrers.getCampaigns_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__Referrers.getCampaigns_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__Referrers.getKeywordsForPageUrl_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__Referrers.getKeywordsForPageUrl_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__Referrers.getKeywords_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__Referrers.getKeywords_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__Referrers.getNumberOfDistinctCampaigns_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__Referrers.getNumberOfDistinctCampaigns_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__Referrers.getNumberOfDistinctKeywords_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__Referrers.getNumberOfDistinctKeywords_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__Referrers.getNumberOfDistinctSearchEngines_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__Referrers.getNumberOfDistinctSearchEngines_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__Referrers.getNumberOfDistinctWebsitesUrls_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__Referrers.getNumberOfDistinctWebsitesUrls_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__Referrers.getNumberOfDistinctWebsites_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__Referrers.getNumberOfDistinctWebsites_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__Referrers.getReferrerType_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__Referrers.getReferrerType_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__Referrers.getSearchEngines_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__Referrers.getSearchEngines_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__Referrers.getSocials_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__Referrers.getSocials_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__Referrers.getUrlsForSocial_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__Referrers.getUrlsForSocial_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__Referrers.getWebsites_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__Referrers.getWebsites_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__UserCountry.getCity_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__UserCountry.getCity_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__UserCountry.getContinent_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__UserCountry.getContinent_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__UserCountry.getCountry_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__UserCountry.getCountry_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__UserCountry.getNumberOfDistinctCountries_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__UserCountry.getNumberOfDistinctCountries_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__UserCountry.getRegion_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__UserCountry.getRegion_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__UserSettings.getBrowserVersion_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__UserSettings.getBrowserVersion_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__UserSettings.getBrowser_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__UserSettings.getBrowser_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__UserSettings.getConfiguration_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__UserSettings.getConfiguration_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__UserSettings.getLanguageCode_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__UserSettings.getLanguageCode_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__UserSettings.getLanguage_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__UserSettings.getLanguage_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__UserSettings.getMobileVsDesktop_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__UserSettings.getMobileVsDesktop_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__UserSettings.getOSFamily_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__UserSettings.getOSFamily_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__UserSettings.getOS_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__UserSettings.getOS_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__UserSettings.getPlugin_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__UserSettings.getPlugin_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__UserSettings.getResolution_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__UserSettings.getResolution_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__UserSettings.getWideScreen_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__UserSettings.getWideScreen_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__VisitFrequency.get_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__VisitFrequency.get_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__VisitFrequency.get_range.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__VisitFrequency.get_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__VisitTime.getByDayOfWeek_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__VisitTime.getByDayOfWeek_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__VisitTime.getVisitInformationPerLocalTime_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__VisitTime.getVisitInformationPerLocalTime_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__VisitTime.getVisitInformationPerServerTime_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__VisitTime.getVisitInformationPerServerTime_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__VisitorInterest.getNumberOfVisitsByDaysSinceLast_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__VisitorInterest.getNumberOfVisitsByDaysSinceLast_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__VisitorInterest.getNumberOfVisitsByDaysSinceLast_range.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__VisitorInterest.getNumberOfVisitsByDaysSinceLast_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__VisitorInterest.getNumberOfVisitsByVisitCount_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__VisitorInterest.getNumberOfVisitsByVisitCount_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__VisitorInterest.getNumberOfVisitsByVisitCount_range.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__VisitorInterest.getNumberOfVisitsByVisitCount_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__VisitorInterest.getNumberOfVisitsPerPage_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__VisitorInterest.getNumberOfVisitsPerPage_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__VisitorInterest.getNumberOfVisitsPerPage_range.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__VisitorInterest.getNumberOfVisitsPerPage_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__VisitorInterest.getNumberOfVisitsPerVisitDuration_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__VisitorInterest.getNumberOfVisitsPerVisitDuration_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__VisitorInterest.getNumberOfVisitsPerVisitDuration_range.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__VisitorInterest.getNumberOfVisitsPerVisitDuration_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__VisitsSummary.getActions_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__VisitsSummary.getActions_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__VisitsSummary.getBounceCount_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__VisitsSummary.getBounceCount_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__VisitsSummary.getMaxActions_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__VisitsSummary.getMaxActions_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__VisitsSummary.getSumVisitsLengthPretty_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__VisitsSummary.getSumVisitsLengthPretty_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__VisitsSummary.getSumVisitsLength_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__VisitsSummary.getSumVisitsLength_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__VisitsSummary.getUniqueVisitors_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__VisitsSummary.getUniqueVisitors_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__VisitsSummary.getUsers_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__VisitsSummary.getUsers_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__VisitsSummary.getVisitsConverted_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__VisitsSummary.getVisitsConverted_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__VisitsSummary.getVisits_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__VisitsSummary.getVisits_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__VisitsSummary.get_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs__VisitsSummary.get_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs_siteIdTwo_TrackedUsingLogReplay__VisitsSummary.get_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs_siteIdTwo_TrackedUsingLogReplay__VisitsSummary.get_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs_withEnhancedAndLast7__MultiSites.getAll_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ImportLogs_withEnhancedAndLast7__MultiSites.getAll_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_LabelFilter_0__Actions.getPageUrls_day.xml (renamed from tests/PHPUnit/Integration/expected/test_LabelFilter_0__Actions.getPageUrls_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_LabelFilter_dir2sub0filephp__Actions.getPageUrls_day.xml (renamed from tests/PHPUnit/Integration/expected/test_LabelFilter_dir2sub0filephp__Actions.getPageUrls_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_LabelFilter_dir__Actions.getPageUrls_day.xml (renamed from tests/PHPUnit/Integration/expected/test_LabelFilter_dir__Actions.getPageUrls_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_LabelFilter_dir_range__Actions.getPageUrls_day.xml (renamed from tests/PHPUnit/Integration/expected/test_LabelFilter_dir_range__Actions.getPageUrls_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_LabelFilter_dirfilephpfoobarfoo2bar__Actions.getPageUrls_day.xml (renamed from tests/PHPUnit/Integration/expected/test_LabelFilter_dirfilephpfoobarfoo2bar__Actions.getPageUrls_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_LabelFilter_dirnonExistent__Actions.getPageUrls_day.xml (renamed from tests/PHPUnit/Integration/expected/test_LabelFilter_dirnonExistent__Actions.getPageUrls_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_LabelFilter_keywords_html__Referrers.getSearchEngines_day.xml (renamed from tests/PHPUnit/Integration/expected/test_LabelFilter_keywords_html__Referrers.getSearchEngines_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_LabelFilter_shouldBeNoData__Actions.getPageUrls_day.xml (renamed from tests/PHPUnit/Integration/expected/test_LabelFilter_shouldBeNoData__Actions.getPageUrls_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_LabelFilter_terminalOperator_selectBranch__Actions.getPageTitles_day.xml (renamed from tests/PHPUnit/Integration/expected/test_LabelFilter_terminalOperator_selectBranch__Actions.getPageTitles_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_LabelFilter_terminalOperator_selectTerminal__Actions.getPageTitles_day.xml (renamed from tests/PHPUnit/Integration/expected/test_LabelFilter_terminalOperator_selectTerminal__Actions.getPageTitles_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_LabelFilter_terminalOperator_selectTerminal__Actions.getPageUrls_day.xml (renamed from tests/PHPUnit/Integration/expected/test_LabelFilter_terminalOperator_selectTerminal__Actions.getPageUrls_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_LabelFilter_thisiscool__Actions.getPageUrls_day.xml (renamed from tests/PHPUnit/Integration/expected/test_LabelFilter_thisiscool__Actions.getPageUrls_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_LabelFilter_titlesRecursive__Actions.getPageTitles_day.xml (renamed from tests/PHPUnit/Integration/expected/test_LabelFilter_titlesRecursive__Actions.getPageTitles_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_LabelFilter_titles__Actions.getPageTitles_day.xml (renamed from tests/PHPUnit/Integration/expected/test_LabelFilter_titles__Actions.getPageTitles_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_Live.getLastVisitsDetails_sortAsc__Live.getLastVisitsDetails_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_Live.getLastVisitsDetails_sortAsc__Live.getLastVisitsDetails_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_Live.getLastVisitsDetails_sortByIdVisitAsc__Live.getLastVisitsDetails_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_Live.getLastVisitsDetails_sortByIdVisitAsc__Live.getLastVisitsDetails_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_Live.getLastVisitsDetails_sortByIdVisit__Live.getLastVisitsDetails_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_Live.getLastVisitsDetails_sortByIdVisit__Live.getLastVisitsDetails_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_Live.getLastVisitsDetails_sortByVisitCount__Live.getLastVisitsDetails_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_Live.getLastVisitsDetails_sortByVisitCount__Live.getLastVisitsDetails_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_Live.getLastVisitsDetails_sortDesc__Live.getLastVisitsDetails_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_Live.getLastVisitsDetails_sortDesc__Live.getLastVisitsDetails_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest__Live.getLastVisitsDetails_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest__Live.getLastVisitsDetails_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest__UserCountry.getCity_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest__UserCountry.getCity_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest__UserCountry.getContinent_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest__UserCountry.getContinent_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest__UserCountry.getCountry_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest__UserCountry.getCountry_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest__UserCountry.getLocationFromIP.xml (renamed from tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest__UserCountry.getLocationFromIP.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest__UserCountry.getNumberOfDistinctCountries_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest__UserCountry.getNumberOfDistinctCountries_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest__UserCountry.getRegion_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest__UserCountry.getRegion_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_segment_city__UserCountry.getCity_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_segment_city__UserCountry.getCity_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_segment_city__UserCountry.getContinent_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_segment_city__UserCountry.getContinent_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_segment_city__UserCountry.getCountry_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_segment_city__UserCountry.getCountry_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_segment_city__UserCountry.getNumberOfDistinctCountries_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_segment_city__UserCountry.getNumberOfDistinctCountries_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_segment_city__UserCountry.getRegion_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_segment_city__UserCountry.getRegion_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_segment_continent__UserCountry.getCountry_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_segment_continent__UserCountry.getCountry_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_segment_lat_long__UserCountry.getCity_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_segment_lat_long__UserCountry.getCity_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_segment_lat_long__UserCountry.getContinent_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_segment_lat_long__UserCountry.getContinent_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_segment_lat_long__UserCountry.getCountry_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_segment_lat_long__UserCountry.getCountry_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_segment_lat_long__UserCountry.getNumberOfDistinctCountries_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_segment_lat_long__UserCountry.getNumberOfDistinctCountries_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_segment_lat_long__UserCountry.getRegion_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_segment_lat_long__UserCountry.getRegion_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_segment_region__UserCountry.getCity_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_segment_region__UserCountry.getCity_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_segment_region__UserCountry.getContinent_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_segment_region__UserCountry.getContinent_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_segment_region__UserCountry.getCountry_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_segment_region__UserCountry.getCountry_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_segment_region__UserCountry.getNumberOfDistinctCountries_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_segment_region__UserCountry.getNumberOfDistinctCountries_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_segment_region__UserCountry.getRegion_month.xml (renamed from tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_segment_region__UserCountry.getRegion_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_sortByProcessedMetric__API.getProcessedReport_day.xml (renamed from tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_sortByProcessedMetric__API.getProcessedReport_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_sortByProcessedMetric_constantRowsCountShouldKeepEmptyRows__API.getProcessedReport_day.xml (renamed from tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_sortByProcessedMetric_constantRowsCountShouldKeepEmptyRows__API.getProcessedReport_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_MultipleSitesArchivingTest_sitesGroup__VisitsSummary.get_day.xml (renamed from tests/PHPUnit/Integration/expected/test_MultipleSitesArchivingTest_sitesGroup__VisitsSummary.get_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_MultipleSitesArchivingTest_sitesGroup__VisitsSummary.get_month.xml (renamed from tests/PHPUnit/Integration/expected/test_MultipleSitesArchivingTest_sitesGroup__VisitsSummary.get_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_NonUnicode__Actions.getPageTitles_day.xml (renamed from tests/PHPUnit/Integration/expected/test_NonUnicode__Actions.getPageTitles_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_NonUnicode__Actions.getPageUrls_day.xml (renamed from tests/PHPUnit/Integration/expected/test_NonUnicode__Actions.getPageUrls_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_NonUnicode__Actions.getSiteSearchKeywords_day.xml (renamed from tests/PHPUnit/Integration/expected/test_NonUnicode__Actions.getSiteSearchKeywords_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_NonUnicode__Referrers.getWebsites_day.xml (renamed from tests/PHPUnit/Integration/expected/test_NonUnicode__Referrers.getWebsites_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getDownload_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Actions.getDownload_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getDownloads_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Actions.getDownloads_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getEntryPageTitles_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Actions.getEntryPageTitles_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getEntryPageUrls_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Actions.getEntryPageUrls_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getExitPageTitles_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Actions.getExitPageTitles_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getExitPageUrls_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Actions.getExitPageUrls_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getOutlink_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Actions.getOutlink_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getOutlinks_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Actions.getOutlinks_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getPageTitle_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Actions.getPageTitle_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getPageTitlesFollowingSiteSearch_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Actions.getPageTitlesFollowingSiteSearch_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getPageTitles_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Actions.getPageTitles_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getPageUrl_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Actions.getPageUrl_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getPageUrlsFollowingSiteSearch_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Actions.getPageUrlsFollowingSiteSearch_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getPageUrls_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Actions.getPageUrls_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getSiteSearchCategories_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Actions.getSiteSearchCategories_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getSiteSearchKeywords_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Actions.getSiteSearchKeywords_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getSiteSearchNoResultKeywords_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Actions.getSiteSearchNoResultKeywords_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.get_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Actions.get_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Contents.getContentNames_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Contents.getContentNames_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Contents.getContentPieces_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Contents.getContentPieces_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__CoreAdminHome.getKnownSegmentsToArchive.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__CoreAdminHome.getKnownSegmentsToArchive.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__CoreAdminHome.getWebsiteIdsToInvalidate.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__CoreAdminHome.getWebsiteIdsToInvalidate.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__CustomVariables.getCustomVariables_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__CustomVariables.getCustomVariables_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__CustomVariables.getReservedCustomVariableKeys.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__CustomVariables.getReservedCustomVariableKeys.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__DevicesDetection.getBrand_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__DevicesDetection.getBrand_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__DevicesDetection.getBrowserEngines_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__DevicesDetection.getBrowserEngines_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__DevicesDetection.getBrowserFamilies_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__DevicesDetection.getBrowserFamilies_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__DevicesDetection.getBrowserVersions_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__DevicesDetection.getBrowserVersions_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__DevicesDetection.getModel_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__DevicesDetection.getModel_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__DevicesDetection.getOsFamilies_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__DevicesDetection.getOsFamilies_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__DevicesDetection.getOsVersions_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__DevicesDetection.getOsVersions_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__DevicesDetection.getType_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__DevicesDetection.getType_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Events.getAction_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Events.getAction_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Events.getCategory_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Events.getCategory_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Events.getName_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Events.getName_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__ExamplePlugin.getAnswerToLife.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__ExamplePlugin.getAnswerToLife.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__ExamplePlugin.getExampleReport_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__ExamplePlugin.getExampleReport_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Goals.getConversionRate_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Goals.getConversionRate_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Goals.getConversions_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Goals.getConversions_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Goals.getDaysToConversion_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Goals.getDaysToConversion_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Goals.getGoals.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Goals.getGoals.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Goals.getItemsCategory_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Goals.getItemsCategory_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Goals.getItemsName_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Goals.getItemsName_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Goals.getItemsSku_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Goals.getItemsSku_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Goals.getNbVisitsConverted_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Goals.getNbVisitsConverted_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Goals.getRevenue_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Goals.getRevenue_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Goals.getVisitsUntilConversion_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Goals.getVisitsUntilConversion_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Goals.get_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Goals.get_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__MultiSites.getAll_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__MultiSites.getAll_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__MultiSites.getOne_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__MultiSites.getOne_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Provider.getProvider_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Provider.getProvider_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Referrers.getAll_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Referrers.getAll_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Referrers.getCampaigns_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Referrers.getCampaigns_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Referrers.getCleanKeyword.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Referrers.getCleanKeyword.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Referrers.getKeywordNotDefinedString.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Referrers.getKeywordNotDefinedString.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Referrers.getKeywordsForPageUrl_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Referrers.getKeywordsForPageUrl_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Referrers.getKeywords_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Referrers.getKeywords_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Referrers.getNumberOfDistinctCampaigns_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Referrers.getNumberOfDistinctCampaigns_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Referrers.getNumberOfDistinctKeywords_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Referrers.getNumberOfDistinctKeywords_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Referrers.getNumberOfDistinctSearchEngines_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Referrers.getNumberOfDistinctSearchEngines_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Referrers.getNumberOfDistinctWebsitesUrls_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Referrers.getNumberOfDistinctWebsitesUrls_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Referrers.getNumberOfDistinctWebsites_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Referrers.getNumberOfDistinctWebsites_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Referrers.getReferrerType_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Referrers.getReferrerType_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Referrers.getSearchEngines_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Referrers.getSearchEngines_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Referrers.getSocials_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Referrers.getSocials_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Referrers.getUrlsForSocial_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Referrers.getUrlsForSocial_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Referrers.getWebsites_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Referrers.getWebsites_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__UserCountry.getCity_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__UserCountry.getCity_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__UserCountry.getContinent_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__UserCountry.getContinent_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__UserCountry.getCountry_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__UserCountry.getCountry_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__UserCountry.getNumberOfDistinctCountries_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__UserCountry.getNumberOfDistinctCountries_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__UserCountry.getRegion_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__UserCountry.getRegion_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__UserSettings.getBrowserVersion_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__UserSettings.getBrowserVersion_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__UserSettings.getBrowser_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__UserSettings.getBrowser_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__UserSettings.getConfiguration_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__UserSettings.getConfiguration_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__UserSettings.getLanguageCode_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__UserSettings.getLanguageCode_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__UserSettings.getLanguage_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__UserSettings.getLanguage_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__UserSettings.getMobileVsDesktop_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__UserSettings.getMobileVsDesktop_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__UserSettings.getOSFamily_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__UserSettings.getOSFamily_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__UserSettings.getOS_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__UserSettings.getOS_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__UserSettings.getPlugin_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__UserSettings.getPlugin_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__UserSettings.getResolution_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__UserSettings.getResolution_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__UserSettings.getWideScreen_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__UserSettings.getWideScreen_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__VisitFrequency.get_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__VisitFrequency.get_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__VisitTime.getByDayOfWeek_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__VisitTime.getByDayOfWeek_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__VisitTime.getVisitInformationPerLocalTime_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__VisitTime.getVisitInformationPerLocalTime_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__VisitTime.getVisitInformationPerServerTime_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__VisitTime.getVisitInformationPerServerTime_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__VisitorInterest.getNumberOfVisitsByDaysSinceLast_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__VisitorInterest.getNumberOfVisitsByDaysSinceLast_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__VisitorInterest.getNumberOfVisitsByVisitCount_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__VisitorInterest.getNumberOfVisitsByVisitCount_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__VisitorInterest.getNumberOfVisitsPerPage_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__VisitorInterest.getNumberOfVisitsPerPage_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__VisitorInterest.getNumberOfVisitsPerVisitDuration_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__VisitorInterest.getNumberOfVisitsPerVisitDuration_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__VisitsSummary.getActions_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__VisitsSummary.getActions_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__VisitsSummary.getBounceCount_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__VisitsSummary.getBounceCount_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__VisitsSummary.getColumns_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__VisitsSummary.getColumns_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__VisitsSummary.getMaxActions_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__VisitsSummary.getMaxActions_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__VisitsSummary.getSumVisitsLengthPretty_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__VisitsSummary.getSumVisitsLengthPretty_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__VisitsSummary.getSumVisitsLength_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__VisitsSummary.getSumVisitsLength_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__VisitsSummary.getUniqueVisitors_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__VisitsSummary.getUniqueVisitors_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__VisitsSummary.getUsers_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__VisitsSummary.getUsers_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__VisitsSummary.getVisitsConverted_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__VisitsSummary.getVisitsConverted_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__VisitsSummary.getVisits_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__VisitsSummary.getVisits_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__VisitsSummary.get_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__VisitsSummary.get_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__subtable__API.getProcessedReport_week.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__subtable__API.getProcessedReport_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_bulk_json__API.getBulkRequest.json (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_bulk_json__API.getBulkRequest.json)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_bulk_xml__API.getBulkRequest.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_bulk_xml__API.getBulkRequest.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_csv__API.get_month.csv (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_csv__API.get_month.csv)bin1896 -> 1896 bytes
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_hideAllColumns___VisitsSummary.get_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_hideAllColumns___VisitsSummary.get_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_hideColumns___API.getProcessedReport_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_hideColumns___API.getProcessedReport_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_hideColumns___Actions.getPageTitles_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_hideColumns___Actions.getPageTitles_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_hideColumns___VisitsSummary.get_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_hideColumns___VisitsSummary.get_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_showColumnsWithProcessedMetrics___API.getProcessedReport_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_showColumnsWithProcessedMetrics___API.getProcessedReport_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_showColumns__API.get_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_showColumns__API.get_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_showColumns___API.getProcessedReport_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_showColumns___API.getProcessedReport_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_showColumns___VisitsSummary.get_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_showColumns___VisitsSummary.get_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_showColumns_onlyOne__API.getProcessedReport_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_showColumns_onlyOne__API.getProcessedReport_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getDownload_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getDownload_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getDownloads_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getDownloads_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getEntryPageTitles_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getEntryPageTitles_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getEntryPageUrls_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getEntryPageUrls_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getExitPageTitles_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getExitPageTitles_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getExitPageUrls_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getExitPageUrls_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getOutlink_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getOutlink_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getOutlinks_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getOutlinks_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getPageTitle_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getPageTitle_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getPageTitlesFollowingSiteSearch_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getPageTitlesFollowingSiteSearch_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getPageTitles_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getPageTitles_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getPageUrl_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getPageUrl_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getPageUrlsFollowingSiteSearch_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getPageUrlsFollowingSiteSearch_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getPageUrls_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getPageUrls_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getSiteSearchCategories_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getSiteSearchCategories_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getSiteSearchKeywords_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getSiteSearchKeywords_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getSiteSearchNoResultKeywords_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getSiteSearchNoResultKeywords_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.get_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.get_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__CustomVariables.getCustomVariables_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__CustomVariables.getCustomVariables_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Goals.getDaysToConversion_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Goals.getDaysToConversion_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Goals.getGoals.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Goals.getGoals.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Goals.getItemsCategory_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Goals.getItemsCategory_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Goals.getItemsName_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Goals.getItemsName_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Goals.getItemsSku_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Goals.getItemsSku_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Goals.getVisitsUntilConversion_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Goals.getVisitsUntilConversion_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Goals.get_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Goals.get_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Live.getLastVisitsDetails_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Live.getLastVisitsDetails_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Provider.getProvider_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Provider.getProvider_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getAll_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getAll_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getCampaigns_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getCampaigns_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getKeywordsForPageUrl_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getKeywordsForPageUrl_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getKeywords_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getKeywords_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getNumberOfDistinctCampaigns_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getNumberOfDistinctCampaigns_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getNumberOfDistinctKeywords_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getNumberOfDistinctKeywords_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getNumberOfDistinctSearchEngines_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getNumberOfDistinctSearchEngines_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getNumberOfDistinctWebsitesUrls_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getNumberOfDistinctWebsitesUrls_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getNumberOfDistinctWebsites_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getNumberOfDistinctWebsites_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getReferrerType_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getReferrerType_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getSearchEngines_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getSearchEngines_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getSocials_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getSocials_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getUrlsForSocial_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getUrlsForSocial_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getWebsites_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getWebsites_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__UserCountry.getCity_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserCountry.getCity_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__UserCountry.getContinent_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserCountry.getContinent_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__UserCountry.getCountry_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserCountry.getCountry_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__UserCountry.getNumberOfDistinctCountries_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserCountry.getNumberOfDistinctCountries_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__UserCountry.getRegion_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserCountry.getRegion_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getBrowserVersion_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getBrowserVersion_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getBrowser_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getBrowser_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getConfiguration_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getConfiguration_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getLanguageCode_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getLanguageCode_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getLanguage_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getLanguage_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getMobileVsDesktop_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getMobileVsDesktop_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getOSFamily_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getOSFamily_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getOS_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getOS_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getPlugin_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getPlugin_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getResolution_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getResolution_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getWideScreen_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getWideScreen_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitFrequency.get_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitFrequency.get_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitTime.getByDayOfWeek_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitTime.getByDayOfWeek_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitTime.getVisitInformationPerLocalTime_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitTime.getVisitInformationPerLocalTime_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitTime.getVisitInformationPerServerTime_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitTime.getVisitInformationPerServerTime_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitorInterest.getNumberOfVisitsByDaysSinceLast_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitorInterest.getNumberOfVisitsByDaysSinceLast_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitorInterest.getNumberOfVisitsByVisitCount_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitorInterest.getNumberOfVisitsByVisitCount_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitorInterest.getNumberOfVisitsPerPage_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitorInterest.getNumberOfVisitsPerPage_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitorInterest.getNumberOfVisitsPerVisitDuration_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitorInterest.getNumberOfVisitsPerVisitDuration_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitsSummary.getActions_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitsSummary.getActions_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitsSummary.getBounceCount_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitsSummary.getBounceCount_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitsSummary.getMaxActions_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitsSummary.getMaxActions_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitsSummary.getSumVisitsLengthPretty_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitsSummary.getSumVisitsLengthPretty_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitsSummary.getSumVisitsLength_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitsSummary.getSumVisitsLength_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitsSummary.getUniqueVisitors_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitsSummary.getUniqueVisitors_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitsSummary.getUsers_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitsSummary.getUsers_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitsSummary.getVisitsConverted_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitsSummary.getVisitsConverted_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitsSummary.getVisits_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitsSummary.getVisits_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitsSummary.get_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitsSummary.get_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitor_LongUrlsTruncated__Actions.getPageUrls_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitor_LongUrlsTruncated__Actions.getPageUrls_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitor_LongUrlsTruncated__Referrers.getKeywords_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitor_LongUrlsTruncated__Referrers.getKeywords_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitor_LongUrlsTruncated__UserSettings.getPlugin_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitor_LongUrlsTruncated__UserSettings.getPlugin_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitor_NoKeywordSpecified__Live.getLastVisitsDetails_day.xml231
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitor_NoKeywordSpecified__Referrers.getKeywords_day.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitor_NoKeywordSpecified__Referrers.getKeywords_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitor_SeveralDays_ImportedInRandomOrderTest_shouldShowOneVisit_InEachOfThreeDays__Live.getLastVisitsDetails_month.xml (renamed from tests/PHPUnit/Integration/expected/test_OneVisitor_SeveralDays_ImportedInRandomOrderTest_shouldShowOneVisit_InEachOfThreeDays__Live.getLastVisitsDetails_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_PivotByQueryParamTest_test_PivotByParam_PlaysNiceWithDataTableMaps__Referrers.getKeywords_day.xml (renamed from tests/PHPUnit/Integration/expected/test_PivotByQueryParamTest_test_PivotByParam_PlaysNiceWithDataTableMaps__Referrers.getKeywords_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_PivotByQueryParamTest_test_PivotByParam_PlaysNiceWithOtherQueryParams__Referrers.getKeywords_week.xml (renamed from tests/PHPUnit/Integration/expected/test_PivotByQueryParamTest_test_PivotByParam_PlaysNiceWithOtherQueryParams__Referrers.getKeywords_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_PivotByQueryParamTest_test_PivotByParam_WorksWithColumnLimiting__Referrers.getKeywords_week.xml (renamed from tests/PHPUnit/Integration/expected/test_PivotByQueryParamTest_test_PivotByParam_WorksWithColumnLimiting__Referrers.getKeywords_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_PivotByQueryParamTest_test_PivotByParam_WorksWithCsvOutput__Referrers.getKeywords_week.csv (renamed from tests/PHPUnit/Integration/expected/test_PivotByQueryParamTest_test_PivotByParam_WorksWithCsvOutput__Referrers.getKeywords_week.csv)bin458 -> 458 bytes
-rw-r--r--tests/PHPUnit/System/expected/test_PivotByQueryParamTest_test_PivotByParam_WorksWithJsonOutput__Referrers.getKeywords_week.json (renamed from tests/PHPUnit/Integration/expected/test_PivotByQueryParamTest_test_PivotByParam_WorksWithJsonOutput__Referrers.getKeywords_week.json)0
-rw-r--r--tests/PHPUnit/System/expected/test_PivotByQueryParamTest_test_PivotByParam_WorksWithReportWhoseSubtableIsSelf__Actions.getPageUrls_week.xml (renamed from tests/PHPUnit/Integration/expected/test_PivotByQueryParamTest_test_PivotByParam_WorksWithReportWhoseSubtableIsSelf__Actions.getPageUrls_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_PivotByQueryParamTest_test_PivotBySegment_CreatesCorrectPivotTable_WhenSegmentUsedInRequest__Referrers.getKeywords_week.xml (renamed from tests/PHPUnit/Integration/expected/test_PivotByQueryParamTest_test_PivotBySegment_CreatesCorrectPivotTable_WhenSegmentUsedInRequest__Referrers.getKeywords_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_PivotByQueryParamTest_test_PivotBySegment_CreatesCorrectPivotTable__Referrers.getKeywords_week.xml (renamed from tests/PHPUnit/Integration/expected/test_PivotByQueryParamTest_test_PivotBySegment_CreatesCorrectPivotTable__Referrers.getKeywords_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_PivotByQueryParamTest_test_PivotBySubtableDimension_CreatesCorrectPivotTable__Referrers.getKeywords_week.xml (renamed from tests/PHPUnit/Integration/expected/test_PivotByQueryParamTest_test_PivotBySubtableDimension_CreatesCorrectPivotTable__Referrers.getKeywords_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_PivotByQueryParamTest_test_PivotBySubtableDimension_WhenEntireHirearchyIsNotLoaded__Referrers.getKeywords_week.xml (renamed from tests/PHPUnit/Integration/expected/test_PivotByQueryParamTest_test_PivotBySubtableDimension_WhenEntireHirearchyIsNotLoaded__Referrers.getKeywords_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_PiwikTracker_trackForceUsingVisitId_insteadOfHeuristics_alsoTestsCampaignTracking__Referrers.getCampaigns_day.xml (renamed from tests/PHPUnit/Integration/expected/test_PiwikTracker_trackForceUsingVisitId_insteadOfHeuristics_alsoTestsCampaignTracking__Referrers.getCampaigns_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_PiwikTracker_trackForceUsingVisitId_insteadOfHeuristics_alsoTestsCampaignTracking__Referrers.getWebsites_day.xml (renamed from tests/PHPUnit/Integration/expected/test_PiwikTracker_trackForceUsingVisitId_insteadOfHeuristics_alsoTestsCampaignTracking__Referrers.getWebsites_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_PiwikTracker_trackForceUsingVisitId_insteadOfHeuristics_alsoTestsCampaignTracking__VisitsSummary.get_day.xml (renamed from tests/PHPUnit/Integration/expected/test_PiwikTracker_trackForceUsingVisitId_insteadOfHeuristics_alsoTestsCampaignTracking__VisitsSummary.get_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_RowEvolution_LabelReservedCharactersHierarchical__API.getRowEvolution_day.xml (renamed from tests/PHPUnit/Integration/expected/test_RowEvolution_LabelReservedCharactersHierarchical__API.getRowEvolution_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_RowEvolution_LabelReservedCharacters__API.getRowEvolution_day.xml (renamed from tests/PHPUnit/Integration/expected/test_RowEvolution_LabelReservedCharacters__API.getRowEvolution_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_RowEvolution_entryPageTitles__API.getRowEvolution_day.xml (renamed from tests/PHPUnit/Integration/expected/test_RowEvolution_entryPageTitles__API.getRowEvolution_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_RowEvolution_flatFilters__Referrers.getSearchEngines_month.xml (renamed from tests/PHPUnit/Integration/expected/test_RowEvolution_flatFilters__Referrers.getSearchEngines_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_RowEvolution_goals_visitsUntilConversion_WithoutLabels__API.getRowEvolution_day.xml (renamed from tests/PHPUnit/Integration/expected/test_RowEvolution_goals_visitsUntilConversion_WithoutLabels__API.getRowEvolution_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_RowEvolution_goals_visitsUntilConversion__API.getRowEvolution_day.xml (renamed from tests/PHPUnit/Integration/expected/test_RowEvolution_goals_visitsUntilConversion__API.getRowEvolution_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_RowEvolution_mobileDesktop__API.getRowEvolution_day.xml (renamed from tests/PHPUnit/Integration/expected/test_RowEvolution_mobileDesktop__API.getRowEvolution_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_RowEvolution_multiWithFilterLimit__API.getRowEvolution_day.xml (renamed from tests/PHPUnit/Integration/expected/test_RowEvolution_multiWithFilterLimit__API.getRowEvolution_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_RowEvolution_multiWithNoData__API.getRowEvolution_day.xml (renamed from tests/PHPUnit/Integration/expected/test_RowEvolution_multiWithNoData__API.getRowEvolution_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_RowEvolution_multipleDates_lastNoData__API.getRowEvolution_month.xml (renamed from tests/PHPUnit/Integration/expected/test_RowEvolution_multipleDates_lastNoData__API.getRowEvolution_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_RowEvolution_pageTitlesMulti__API.getRowEvolution_day.xml (renamed from tests/PHPUnit/Integration/expected/test_RowEvolution_pageTitlesMulti__API.getRowEvolution_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_RowEvolution_pageTitlesMulti__API.getRowEvolution_week.xml (renamed from tests/PHPUnit/Integration/expected/test_RowEvolution_pageTitlesMulti__API.getRowEvolution_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_RowEvolution_pageTitles__API.getRowEvolution_day.xml (renamed from tests/PHPUnit/Integration/expected/test_RowEvolution_pageTitles__API.getRowEvolution_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_RowEvolution_pageTitles__API.getRowEvolution_week.xml (renamed from tests/PHPUnit/Integration/expected/test_RowEvolution_pageTitles__API.getRowEvolution_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_RowEvolution_pageUrls__API.getRowEvolution_range.xml (renamed from tests/PHPUnit/Integration/expected/test_RowEvolution_pageUrls__API.getRowEvolution_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_RowEvolution_processedRowLabel__API.getRowEvolution_day.xml (renamed from tests/PHPUnit/Integration/expected/test_RowEvolution_processedRowLabel__API.getRowEvolution_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_RowEvolution_referrer1__API.getRowEvolution_day.xml (renamed from tests/PHPUnit/Integration/expected/test_RowEvolution_referrer1__API.getRowEvolution_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_RowEvolution_referrer2__API.getRowEvolution_day.xml (renamed from tests/PHPUnit/Integration/expected/test_RowEvolution_referrer2__API.getRowEvolution_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_RowEvolution_referrerMulti1__API.getRowEvolution_day.xml (renamed from tests/PHPUnit/Integration/expected/test_RowEvolution_referrerMulti1__API.getRowEvolution_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_SiteSearch_Actions.getPageTitlesFollowingSiteSearch_firstSite_lastN__API.getProcessedReport_day.xml (renamed from tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getPageTitlesFollowingSiteSearch_firstSite_lastN__API.getProcessedReport_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_SiteSearch_Actions.getPageTitlesFollowingSiteSearch_firstSite_lastN__API.getProcessedReport_month.xml (renamed from tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getPageTitlesFollowingSiteSearch_firstSite_lastN__API.getProcessedReport_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_SiteSearch_Actions.getPageTitles_firstSite_lastN__API.getProcessedReport_day.xml (renamed from tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getPageTitles_firstSite_lastN__API.getProcessedReport_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_SiteSearch_Actions.getPageTitles_firstSite_lastN__API.getProcessedReport_month.xml (renamed from tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getPageTitles_firstSite_lastN__API.getProcessedReport_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_SiteSearch_Actions.getPageUrlsFollowingSiteSearch_firstSite_lastN__API.getProcessedReport_day.xml (renamed from tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getPageUrlsFollowingSiteSearch_firstSite_lastN__API.getProcessedReport_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_SiteSearch_Actions.getPageUrlsFollowingSiteSearch_firstSite_lastN__API.getProcessedReport_month.xml (renamed from tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getPageUrlsFollowingSiteSearch_firstSite_lastN__API.getProcessedReport_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_SiteSearch_Actions.getPageUrls_firstSite_lastN__API.getProcessedReport_day.xml (renamed from tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getPageUrls_firstSite_lastN__API.getProcessedReport_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_SiteSearch_Actions.getPageUrls_firstSite_lastN__API.getProcessedReport_month.xml (renamed from tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getPageUrls_firstSite_lastN__API.getProcessedReport_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_SiteSearch_Actions.getSiteSearchCategories_firstSite_lastN__API.getProcessedReport_day.xml (renamed from tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getSiteSearchCategories_firstSite_lastN__API.getProcessedReport_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_SiteSearch_Actions.getSiteSearchCategories_firstSite_lastN__API.getProcessedReport_month.xml (renamed from tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getSiteSearchCategories_firstSite_lastN__API.getProcessedReport_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_SiteSearch_Actions.getSiteSearchKeywords_firstSite_lastN__API.getProcessedReport_day.xml (renamed from tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getSiteSearchKeywords_firstSite_lastN__API.getProcessedReport_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_SiteSearch_Actions.getSiteSearchKeywords_firstSite_lastN__API.getProcessedReport_month.xml (renamed from tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getSiteSearchKeywords_firstSite_lastN__API.getProcessedReport_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_SiteSearch_Actions.getSiteSearchNoResultKeywords_firstSite_lastN__API.getProcessedReport_day.xml (renamed from tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getSiteSearchNoResultKeywords_firstSite_lastN__API.getProcessedReport_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_SiteSearch_Actions.getSiteSearchNoResultKeywords_firstSite_lastN__API.getProcessedReport_month.xml (renamed from tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getSiteSearchNoResultKeywords_firstSite_lastN__API.getProcessedReport_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_SiteSearch_Actions.get_firstSite_lastN__API.getProcessedReport_day.xml (renamed from tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.get_firstSite_lastN__API.getProcessedReport_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_SiteSearch_Actions.get_firstSite_lastN__API.getProcessedReport_month.xml (renamed from tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.get_firstSite_lastN__API.getProcessedReport_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_SiteSearch_AllSites__Actions.getPageTitlesFollowingSiteSearch_day.xml (renamed from tests/PHPUnit/Integration/expected/test_SiteSearch_AllSites__Actions.getPageTitlesFollowingSiteSearch_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_SiteSearch_AllSites__Actions.getPageTitlesFollowingSiteSearch_month.xml (renamed from tests/PHPUnit/Integration/expected/test_SiteSearch_AllSites__Actions.getPageTitlesFollowingSiteSearch_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_SiteSearch_AllSites__Actions.getPageTitles_day.xml (renamed from tests/PHPUnit/Integration/expected/test_SiteSearch_AllSites__Actions.getPageTitles_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_SiteSearch_AllSites__Actions.getPageTitles_month.xml (renamed from tests/PHPUnit/Integration/expected/test_SiteSearch_AllSites__Actions.getPageTitles_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_SiteSearch_AllSites__Actions.getPageUrlsFollowingSiteSearch_day.xml (renamed from tests/PHPUnit/Integration/expected/test_SiteSearch_AllSites__Actions.getPageUrlsFollowingSiteSearch_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_SiteSearch_AllSites__Actions.getPageUrlsFollowingSiteSearch_month.xml (renamed from tests/PHPUnit/Integration/expected/test_SiteSearch_AllSites__Actions.getPageUrlsFollowingSiteSearch_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_SiteSearch_AllSites__Actions.getPageUrls_day.xml (renamed from tests/PHPUnit/Integration/expected/test_SiteSearch_AllSites__Actions.getPageUrls_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_SiteSearch_AllSites__Actions.getPageUrls_month.xml (renamed from tests/PHPUnit/Integration/expected/test_SiteSearch_AllSites__Actions.getPageUrls_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_SiteSearch_AllSites__Actions.getSiteSearchCategories_day.xml (renamed from tests/PHPUnit/Integration/expected/test_SiteSearch_AllSites__Actions.getSiteSearchCategories_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_SiteSearch_AllSites__Actions.getSiteSearchCategories_month.xml (renamed from tests/PHPUnit/Integration/expected/test_SiteSearch_AllSites__Actions.getSiteSearchCategories_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_SiteSearch_AllSites__Actions.getSiteSearchKeywords_day.xml (renamed from tests/PHPUnit/Integration/expected/test_SiteSearch_AllSites__Actions.getSiteSearchKeywords_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_SiteSearch_AllSites__Actions.getSiteSearchKeywords_month.xml (renamed from tests/PHPUnit/Integration/expected/test_SiteSearch_AllSites__Actions.getSiteSearchKeywords_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_SiteSearch_AllSites__Actions.getSiteSearchNoResultKeywords_day.xml (renamed from tests/PHPUnit/Integration/expected/test_SiteSearch_AllSites__Actions.getSiteSearchNoResultKeywords_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_SiteSearch_AllSites__Actions.getSiteSearchNoResultKeywords_month.xml (renamed from tests/PHPUnit/Integration/expected/test_SiteSearch_AllSites__Actions.getSiteSearchNoResultKeywords_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_SiteSearch_AllSites__Actions.get_day.xml (renamed from tests/PHPUnit/Integration/expected/test_SiteSearch_AllSites__Actions.get_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_SiteSearch_AllSites__Actions.get_month.xml (renamed from tests/PHPUnit/Integration/expected/test_SiteSearch_AllSites__Actions.get_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_SiteSearch_AllSites__CustomVariables.getCustomVariables_day.xml (renamed from tests/PHPUnit/Integration/expected/test_SiteSearch_AllSites__CustomVariables.getCustomVariables_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_SiteSearch_AllSites__CustomVariables.getCustomVariables_month.xml (renamed from tests/PHPUnit/Integration/expected/test_SiteSearch_AllSites__CustomVariables.getCustomVariables_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_SiteSearch_CustomVariables.getCustomVariables_firstSite_lastN__API.getProcessedReport_day.xml (renamed from tests/PHPUnit/Integration/expected/test_SiteSearch_CustomVariables.getCustomVariables_firstSite_lastN__API.getProcessedReport_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_SiteSearch_CustomVariables.getCustomVariables_firstSite_lastN__API.getProcessedReport_month.xml (renamed from tests/PHPUnit/Integration/expected/test_SiteSearch_CustomVariables.getCustomVariables_firstSite_lastN__API.getProcessedReport_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_SiteSearch_NotLastNPeriods__Actions.getPageTitlesFollowingSiteSearch_day.xml (renamed from tests/PHPUnit/Integration/expected/test_SiteSearch_NotLastNPeriods__Actions.getPageTitlesFollowingSiteSearch_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_SiteSearch_NotLastNPeriods__Actions.getPageTitlesFollowingSiteSearch_month.xml (renamed from tests/PHPUnit/Integration/expected/test_SiteSearch_NotLastNPeriods__Actions.getPageTitlesFollowingSiteSearch_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_SiteSearch_NotLastNPeriods__Actions.getPageTitles_day.xml (renamed from tests/PHPUnit/Integration/expected/test_SiteSearch_NotLastNPeriods__Actions.getPageTitles_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_SiteSearch_NotLastNPeriods__Actions.getPageTitles_month.xml (renamed from tests/PHPUnit/Integration/expected/test_SiteSearch_NotLastNPeriods__Actions.getPageTitles_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_SiteSearch_NotLastNPeriods__Actions.getPageUrlsFollowingSiteSearch_day.xml (renamed from tests/PHPUnit/Integration/expected/test_SiteSearch_NotLastNPeriods__Actions.getPageUrlsFollowingSiteSearch_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_SiteSearch_NotLastNPeriods__Actions.getPageUrlsFollowingSiteSearch_month.xml (renamed from tests/PHPUnit/Integration/expected/test_SiteSearch_NotLastNPeriods__Actions.getPageUrlsFollowingSiteSearch_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_SiteSearch_NotLastNPeriods__Actions.getPageUrls_day.xml (renamed from tests/PHPUnit/Integration/expected/test_SiteSearch_NotLastNPeriods__Actions.getPageUrls_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_SiteSearch_NotLastNPeriods__Actions.getPageUrls_month.xml (renamed from tests/PHPUnit/Integration/expected/test_SiteSearch_NotLastNPeriods__Actions.getPageUrls_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_SiteSearch_NotLastNPeriods__Actions.getSiteSearchCategories_day.xml (renamed from tests/PHPUnit/Integration/expected/test_SiteSearch_NotLastNPeriods__Actions.getSiteSearchCategories_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_SiteSearch_NotLastNPeriods__Actions.getSiteSearchCategories_month.xml (renamed from tests/PHPUnit/Integration/expected/test_SiteSearch_NotLastNPeriods__Actions.getSiteSearchCategories_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_SiteSearch_NotLastNPeriods__Actions.getSiteSearchKeywords_day.xml (renamed from tests/PHPUnit/Integration/expected/test_SiteSearch_NotLastNPeriods__Actions.getSiteSearchKeywords_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_SiteSearch_NotLastNPeriods__Actions.getSiteSearchKeywords_month.xml (renamed from tests/PHPUnit/Integration/expected/test_SiteSearch_NotLastNPeriods__Actions.getSiteSearchKeywords_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_SiteSearch_NotLastNPeriods__Actions.getSiteSearchNoResultKeywords_day.xml (renamed from tests/PHPUnit/Integration/expected/test_SiteSearch_NotLastNPeriods__Actions.getSiteSearchNoResultKeywords_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_SiteSearch_NotLastNPeriods__Actions.getSiteSearchNoResultKeywords_month.xml (renamed from tests/PHPUnit/Integration/expected/test_SiteSearch_NotLastNPeriods__Actions.getSiteSearchNoResultKeywords_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_SiteSearch_NotLastNPeriods__Actions.get_day.xml (renamed from tests/PHPUnit/Integration/expected/test_SiteSearch_NotLastNPeriods__Actions.get_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_SiteSearch_NotLastNPeriods__Actions.get_month.xml (renamed from tests/PHPUnit/Integration/expected/test_SiteSearch_NotLastNPeriods__Actions.get_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_SiteSearch_NotLastNPeriods__CustomVariables.getCustomVariables_day.xml (renamed from tests/PHPUnit/Integration/expected/test_SiteSearch_NotLastNPeriods__CustomVariables.getCustomVariables_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_SiteSearch_NotLastNPeriods__CustomVariables.getCustomVariables_month.xml (renamed from tests/PHPUnit/Integration/expected/test_SiteSearch_NotLastNPeriods__CustomVariables.getCustomVariables_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TimezonesTest__Live.getLastVisitsDetails_day.xml (renamed from tests/PHPUnit/Integration/expected/test_TimezonesTest__Live.getLastVisitsDetails_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TimezonesTest_dayAfterVisit__VisitsSummary.get_day.xml (renamed from tests/PHPUnit/Integration/expected/test_TimezonesTest_dayAfterVisit__VisitsSummary.get_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TimezonesTest_withVisit__VisitsSummary.get_day.xml (renamed from tests/PHPUnit/Integration/expected/test_TimezonesTest_withVisit__VisitsSummary.get_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TrackerWindowLookBack__VisitsSummary.getVisits_range.xml (renamed from tests/PHPUnit/Integration/expected/test_TrackerWindowLookBack__VisitsSummary.getVisits_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_Transitions__Transitions.getTransitionsForPageUrl_day.xml (renamed from tests/PHPUnit/Integration/expected/test_Transitions__Transitions.getTransitionsForPageUrl_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_Transitions__Transitions.getTransitionsForPageUrl_month.xml (renamed from tests/PHPUnit/Integration/expected/test_Transitions__Transitions.getTransitionsForPageUrl_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_Transitions_noData__Transitions.getTransitionsForPageTitle_day.xml (renamed from tests/PHPUnit/Integration/expected/test_Transitions_noData__Transitions.getTransitionsForPageTitle_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_Transitions_noData__Transitions.getTransitionsForPageTitle_month.xml (renamed from tests/PHPUnit/Integration/expected/test_Transitions_noData__Transitions.getTransitionsForPageTitle_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_Transitions_noData__Transitions.getTransitionsForPageUrl_day.xml (renamed from tests/PHPUnit/Integration/expected/test_Transitions_noData__Transitions.getTransitionsForPageUrl_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_Transitions_noData__Transitions.getTransitionsForPageUrl_month.xml (renamed from tests/PHPUnit/Integration/expected/test_Transitions_noData__Transitions.getTransitionsForPageUrl_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_Transitions_noLimit__Transitions.getTransitionsForPageTitle_day.xml (renamed from tests/PHPUnit/Integration/expected/test_Transitions_noLimit__Transitions.getTransitionsForPageTitle_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_Transitions_noLimit__Transitions.getTransitionsForPageTitle_month.xml (renamed from tests/PHPUnit/Integration/expected/test_Transitions_noLimit__Transitions.getTransitionsForPageTitle_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_Transitions_noLimit__Transitions.getTransitionsForPageUrl_day.xml (renamed from tests/PHPUnit/Integration/expected/test_Transitions_noLimit__Transitions.getTransitionsForPageUrl_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_Transitions_noLimit__Transitions.getTransitionsForPageUrl_month.xml (renamed from tests/PHPUnit/Integration/expected/test_Transitions_noLimit__Transitions.getTransitionsForPageUrl_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Actions.getOutlinks_firstSite_lastN__API.getProcessedReport_day.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Actions.getOutlinks_firstSite_lastN__API.getProcessedReport_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Actions.getPageTitles_firstSite_lastN__API.getProcessedReport_day.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Actions.getPageTitles_firstSite_lastN__API.getProcessedReport_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Actions.getPageUrls_firstSite_lastN__API.getProcessedReport_day.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Actions.getPageUrls_firstSite_lastN__API.getProcessedReport_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_disabledAfter__VisitsSummary.get_day.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_disabledAfter__VisitsSummary.get_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_disabledAfter__VisitsSummary.get_month.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_disabledAfter__VisitsSummary.get_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_disabledAfter__VisitsSummary.get_week.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_disabledAfter__VisitsSummary.get_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_disabledAfter__VisitsSummary.get_year.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_disabledAfter__VisitsSummary.get_year.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_disabledBefore__VisitsSummary.get_day.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_disabledBefore__VisitsSummary.get_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_disabledBefore__VisitsSummary.get_month.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_disabledBefore__VisitsSummary.get_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_disabledBefore__VisitsSummary.get_week.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_disabledBefore__VisitsSummary.get_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_disabledBefore__VisitsSummary.get_year.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_disabledBefore__VisitsSummary.get_year.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_disabledBefore_isDateRange__VisitsSummary.get_range.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_disabledBefore_isDateRange__VisitsSummary.get_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_enabledBefore_isDateRange__VisitsSummary.get_range.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_enabledBefore_isDateRange__VisitsSummary.get_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_enabled__VisitsSummary.get_day.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_enabled__VisitsSummary.get_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_enabled__VisitsSummary.get_month.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_enabled__VisitsSummary.get_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_enabled__VisitsSummary.get_week.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_enabled__VisitsSummary.get_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_enabled__VisitsSummary.get_year.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_enabled__VisitsSummary.get_year.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_Goals.getDaysToConversion_firstSite_lastN__API.getProcessedReport_day.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_Goals.getDaysToConversion_firstSite_lastN__API.getProcessedReport_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_MultiSites.getAll_firstSite_lastN__API.getProcessedReport_day.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_MultiSites.getAll_firstSite_lastN__API.getProcessedReport_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_NotLastNPeriods__Goals.get_day.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_NotLastNPeriods__Goals.get_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_NotLastNPeriods__Goals.get_month.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_NotLastNPeriods__Goals.get_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_NotLastNPeriods__VisitsSummary.get_day.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_NotLastNPeriods__VisitsSummary.get_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_NotLastNPeriods__VisitsSummary.get_month.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_NotLastNPeriods__VisitsSummary.get_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions__Goals.getDaysToConversion_day.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions__Goals.getDaysToConversion_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions__Goals.getDaysToConversion_month.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions__Goals.getDaysToConversion_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions__Goals.getDaysToConversion_week.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions__Goals.getDaysToConversion_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions__Goals.getDaysToConversion_year.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions__Goals.getDaysToConversion_year.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions__MultiSites.getAll_day.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions__MultiSites.getAll_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions__MultiSites.getAll_month.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions__MultiSites.getAll_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions__MultiSites.getAll_week.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions__MultiSites.getAll_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions__MultiSites.getAll_year.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions__MultiSites.getAll_year.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_getMetricsFromDifferentReports__VisitsSummary.get_range.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_getMetricsFromDifferentReports__VisitsSummary.get_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_idSiteOne___Goals.getDaysToConversion_day.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_idSiteOne___Goals.getDaysToConversion_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_idSiteOne___Goals.getDaysToConversion_month.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_idSiteOne___Goals.getDaysToConversion_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_idSiteOne___Goals.getDaysToConversion_week.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_idSiteOne___Goals.getDaysToConversion_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_idSiteOne___Goals.getDaysToConversion_year.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_idSiteOne___Goals.getDaysToConversion_year.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_idSiteOne___MultiSites.getAll_day.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_idSiteOne___MultiSites.getAll_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_idSiteOne___MultiSites.getAll_month.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_idSiteOne___MultiSites.getAll_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_idSiteOne___MultiSites.getAll_week.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_idSiteOne___MultiSites.getAll_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_idSiteOne___MultiSites.getAll_year.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_idSiteOne___MultiSites.getAll_year.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_NotLastNPeriods__Goals.get_day.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_NotLastNPeriods__Goals.get_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_NotLastNPeriods__Goals.get_month.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_NotLastNPeriods__Goals.get_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_NotLastNPeriods__VisitsSummary.get_day.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_NotLastNPeriods__VisitsSummary.get_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_NotLastNPeriods__VisitsSummary.get_month.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_NotLastNPeriods__VisitsSummary.get_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Referrers.getWebsites_firstSite_lastN__API.getProcessedReport_day.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Referrers.getWebsites_firstSite_lastN__API.getProcessedReport_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_VisitFrequency.get_firstSite_lastN__API.getProcessedReport_day.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_VisitFrequency.get_firstSite_lastN__API.getProcessedReport_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_VisitorInterest.getNumberOfVisitsByDaysSinceLast_firstSite_lastN__API.getProcessedReport_day.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_VisitorInterest.getNumberOfVisitsByDaysSinceLast_firstSite_lastN__API.getProcessedReport_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_VisitsSummary.get_firstSite_lastN__API.getProcessedReport_day.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_VisitsSummary.get_firstSite_lastN__API.getProcessedReport_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getOutlinks_day.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getOutlinks_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getOutlinks_month.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getOutlinks_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getOutlinks_week.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getOutlinks_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getOutlinks_year.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getOutlinks_year.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageTitle_day.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageTitle_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageTitle_month.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageTitle_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageTitle_week.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageTitle_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageTitle_year.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageTitle_year.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageTitles_day.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageTitles_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageTitles_month.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageTitles_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageTitles_week.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageTitles_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageTitles_year.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageTitles_year.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageUrl_day.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageUrl_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageUrl_month.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageUrl_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageUrl_week.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageUrl_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageUrl_year.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageUrl_year.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageUrls_day.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageUrls_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageUrls_month.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageUrls_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageUrls_week.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageUrls_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageUrls_year.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageUrls_year.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__Referrers.getWebsites_day.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__Referrers.getWebsites_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__Referrers.getWebsites_month.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__Referrers.getWebsites_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__Referrers.getWebsites_week.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__Referrers.getWebsites_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__Referrers.getWebsites_year.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__Referrers.getWebsites_year.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__VisitFrequency.get_day.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__VisitFrequency.get_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__VisitFrequency.get_month.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__VisitFrequency.get_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__VisitFrequency.get_week.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__VisitFrequency.get_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__VisitFrequency.get_year.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__VisitFrequency.get_year.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__VisitorInterest.getNumberOfVisitsByDaysSinceLast_day.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__VisitorInterest.getNumberOfVisitsByDaysSinceLast_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__VisitorInterest.getNumberOfVisitsByDaysSinceLast_month.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__VisitorInterest.getNumberOfVisitsByDaysSinceLast_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__VisitorInterest.getNumberOfVisitsByDaysSinceLast_week.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__VisitorInterest.getNumberOfVisitsByDaysSinceLast_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__VisitorInterest.getNumberOfVisitsByDaysSinceLast_year.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__VisitorInterest.getNumberOfVisitsByDaysSinceLast_year.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__VisitsSummary.get_day.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__VisitsSummary.get_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__VisitsSummary.get_month.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__VisitsSummary.get_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__VisitsSummary.get_week.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__VisitsSummary.get_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__VisitsSummary.get_year.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__VisitsSummary.get_year.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getOutlinks_day.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getOutlinks_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getOutlinks_month.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getOutlinks_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getOutlinks_week.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getOutlinks_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getOutlinks_year.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getOutlinks_year.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageTitle_day.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageTitle_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageTitle_month.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageTitle_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageTitle_week.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageTitle_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageTitle_year.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageTitle_year.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageTitles_day.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageTitles_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageTitles_month.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageTitles_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageTitles_week.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageTitles_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageTitles_year.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageTitles_year.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageUrl_day.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageUrl_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageUrl_month.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageUrl_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageUrl_week.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageUrl_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageUrl_year.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageUrl_year.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageUrls_day.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageUrls_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageUrls_month.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageUrls_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageUrls_week.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageUrls_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageUrls_year.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageUrls_year.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Referrers.getWebsites_day.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Referrers.getWebsites_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Referrers.getWebsites_month.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Referrers.getWebsites_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Referrers.getWebsites_week.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Referrers.getWebsites_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Referrers.getWebsites_year.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Referrers.getWebsites_year.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___VisitFrequency.get_day.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___VisitFrequency.get_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___VisitFrequency.get_month.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___VisitFrequency.get_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___VisitFrequency.get_week.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___VisitFrequency.get_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___VisitFrequency.get_year.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___VisitFrequency.get_year.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___VisitorInterest.getNumberOfVisitsByDaysSinceLast_day.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___VisitorInterest.getNumberOfVisitsByDaysSinceLast_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___VisitorInterest.getNumberOfVisitsByDaysSinceLast_month.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___VisitorInterest.getNumberOfVisitsByDaysSinceLast_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___VisitorInterest.getNumberOfVisitsByDaysSinceLast_week.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___VisitorInterest.getNumberOfVisitsByDaysSinceLast_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___VisitorInterest.getNumberOfVisitsByDaysSinceLast_year.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___VisitorInterest.getNumberOfVisitsByDaysSinceLast_year.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___VisitsSummary.get_day.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___VisitsSummary.get_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___VisitsSummary.get_month.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___VisitsSummary.get_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___VisitsSummary.get_week.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___VisitsSummary.get_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___VisitsSummary.get_year.xml (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___VisitsSummary.get_year.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_csv__ScheduledReports.generateReport_month.original.csv (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_csv__ScheduledReports.generateReport_month.original.csv)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_html_row_evolution_graph__ScheduledReports.generateReport_month.original.html (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_html_row_evolution_graph__ScheduledReports.generateReport_month.original.html)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_html_tables_and_graph__ScheduledReports.generateReport_month.original.html (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_html_tables_and_graph__ScheduledReports.generateReport_month.original.html)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_html_tables_only__ScheduledReports.generateReport_month.original.html (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_html_tables_only__ScheduledReports.generateReport_month.original.html)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_pdf_tables_only__ScheduledReports.generateReport_month.original.pdf (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_pdf_tables_only__ScheduledReports.generateReport_month.original.pdf)bin510055 -> 510055 bytes
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_via_sms_all_sites__ScheduledReports.generateReport_month.original.sms.txt (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_via_sms_all_sites__ScheduledReports.generateReport_month.original.sms.txt)0
-rw-r--r--tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_via_sms_one_site__ScheduledReports.generateReport_month.original.sms.txt (renamed from tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_via_sms_one_site__ScheduledReports.generateReport_month.original.sms.txt)0
-rw-r--r--tests/PHPUnit/System/expected/test_UrlNormalization_keywords__Referrers.getKeywordsForPageUrl_day.xml (renamed from tests/PHPUnit/Integration/expected/test_UrlNormalization_keywords__Referrers.getKeywordsForPageUrl_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_UrlNormalization_pagesSegmentedRef__Actions.getPageUrls_day.xml (renamed from tests/PHPUnit/Integration/expected/test_UrlNormalization_pagesSegmentedRef__Actions.getPageUrls_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_UrlNormalization_pagesSegmented__Actions.getPageUrls_day.xml (renamed from tests/PHPUnit/Integration/expected/test_UrlNormalization_pagesSegmented__Actions.getPageUrls_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_UrlNormalization_titles__Actions.getPageTitles_day.xml (renamed from tests/PHPUnit/Integration/expected/test_UrlNormalization_titles__Actions.getPageTitles_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_UrlNormalization_urls__Actions.getPageUrls_day.xml (renamed from tests/PHPUnit/Integration/expected/test_UrlNormalization_urls__Actions.getPageUrls_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_UserId_VisitorId__Live.getLastVisitsDetails_month.xml (renamed from tests/PHPUnit/Integration/expected/test_UserId_VisitorId__Live.getLastVisitsDetails_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_UserId_VisitorId__VisitsSummary.getUsers_day.xml (renamed from tests/PHPUnit/Integration/expected/test_UserId_VisitorId__VisitsSummary.getUsers_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_UserId_VisitorId__VisitsSummary.getUsers_month.xml (renamed from tests/PHPUnit/Integration/expected/test_UserId_VisitorId__VisitsSummary.getUsers_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_UserId_VisitorId__VisitsSummary.getUsers_week.xml (renamed from tests/PHPUnit/Integration/expected/test_UserId_VisitorId__VisitsSummary.getUsers_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_UserId_VisitorId__VisitsSummary.getUsers_year.xml (renamed from tests/PHPUnit/Integration/expected/test_UserId_VisitorId__VisitsSummary.getUsers_year.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_UserId_VisitorId__VisitsSummary.get_day.xml (renamed from tests/PHPUnit/Integration/expected/test_UserId_VisitorId__VisitsSummary.get_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_UserId_VisitorId__VisitsSummary.get_month.xml (renamed from tests/PHPUnit/Integration/expected/test_UserId_VisitorId__VisitsSummary.get_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_UserId_VisitorId__VisitsSummary.get_week.xml (renamed from tests/PHPUnit/Integration/expected/test_UserId_VisitorId__VisitsSummary.get_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_UserId_VisitorId__VisitsSummary.get_year.xml (renamed from tests/PHPUnit/Integration/expected/test_UserId_VisitorId__VisitsSummary.get_year.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_UserId_VisitorId_invalidSegmentUserId__VisitsSummary.get_day.xml (renamed from tests/PHPUnit/Integration/expected/test_UserId_VisitorId_invalidSegmentUserId__VisitsSummary.get_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_UserId_VisitorId_segmentUserIdAndCartAbandoned_getAbandonedCartItems__Goals.getItemsName_day.xml (renamed from tests/PHPUnit/Integration/expected/test_UserId_VisitorId_segmentUserIdAndCartAbandoned_getAbandonedCartItems__Goals.getItemsName_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_UserId_VisitorId_segmentUserId__Goals.get_day.xml (renamed from tests/PHPUnit/Integration/expected/test_UserId_VisitorId_segmentUserId__Goals.get_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_UserId_VisitorId_segmentUserId__VisitsSummary.get_day.xml (renamed from tests/PHPUnit/Integration/expected/test_UserId_VisitorId_segmentUserId__VisitsSummary.get_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_VisitsInPast_InvalidateOldReportsWebsite1_OldReportsShouldAppear__Actions.getPageUrls_month.xml (renamed from tests/PHPUnit/Integration/expected/test_VisitsInPast_InvalidateOldReportsWebsite1_OldReportsShouldAppear__Actions.getPageUrls_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_VisitsInPast_InvalidateOldReportsWebsite1_OldReportsShouldAppear__VisitsSummary.get_month.xml (renamed from tests/PHPUnit/Integration/expected/test_VisitsInPast_InvalidateOldReportsWebsite1_OldReportsShouldAppear__VisitsSummary.get_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_VisitsInPast_InvalidateOldReportsWebsite1_OldReportsShouldNotAppear__Actions.getPageUrls_month.xml (renamed from tests/PHPUnit/Integration/expected/test_VisitsInPast_InvalidateOldReportsWebsite1_OldReportsShouldNotAppear__Actions.getPageUrls_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_VisitsInPast_InvalidateOldReportsWebsite1_OldReportsShouldNotAppear__VisitsSummary.get_month.xml (renamed from tests/PHPUnit/Integration/expected/test_VisitsInPast_InvalidateOldReportsWebsite1_OldReportsShouldNotAppear__VisitsSummary.get_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_VisitsInPast_InvalidateOldReportsWebsite2_OldReportsShouldAppear__Actions.getPageUrls_month.xml (renamed from tests/PHPUnit/Integration/expected/test_VisitsInPast_InvalidateOldReportsWebsite2_OldReportsShouldAppear__Actions.getPageUrls_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_VisitsInPast_InvalidateOldReportsWebsite2_OldReportsShouldAppear__VisitsSummary.get_month.xml (renamed from tests/PHPUnit/Integration/expected/test_VisitsInPast_InvalidateOldReportsWebsite2_OldReportsShouldAppear__VisitsSummary.get_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_VisitsInPast_InvalidateOldReportsWebsite2_OldReportsShouldNotAppear__Actions.getPageUrls_month.xml (renamed from tests/PHPUnit/Integration/expected/test_VisitsInPast_InvalidateOldReportsWebsite2_OldReportsShouldNotAppear__Actions.getPageUrls_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_VisitsInPast_InvalidateOldReportsWebsite2_OldReportsShouldNotAppear__VisitsSummary.get_month.xml (renamed from tests/PHPUnit/Integration/expected/test_VisitsInPast_InvalidateOldReportsWebsite2_OldReportsShouldNotAppear__VisitsSummary.get_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_annotations__Annotations.get.xml (renamed from tests/PHPUnit/Integration/expected/test_annotations__Annotations.get.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_annotations__Annotations.getAll_day.xml (renamed from tests/PHPUnit/Integration/expected/test_annotations__Annotations.getAll_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_annotations__Annotations.getAll_month.xml (renamed from tests/PHPUnit/Integration/expected/test_annotations__Annotations.getAll_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_annotations__Annotations.getAll_week.xml (renamed from tests/PHPUnit/Integration/expected/test_annotations__Annotations.getAll_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_annotations__Annotations.getAll_year.xml (renamed from tests/PHPUnit/Integration/expected/test_annotations__Annotations.getAll_year.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_annotations__Annotations.getAnnotationCountForDates_day.xml (renamed from tests/PHPUnit/Integration/expected/test_annotations__Annotations.getAnnotationCountForDates_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_annotations__Annotations.getAnnotationCountForDates_month.xml (renamed from tests/PHPUnit/Integration/expected/test_annotations__Annotations.getAnnotationCountForDates_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_annotations__Annotations.getAnnotationCountForDates_week.xml (renamed from tests/PHPUnit/Integration/expected/test_annotations__Annotations.getAnnotationCountForDates_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_annotations__Annotations.getAnnotationCountForDates_year.xml (renamed from tests/PHPUnit/Integration/expected/test_annotations__Annotations.getAnnotationCountForDates_year.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_annotations_lastN__Annotations.getAll_week.xml (renamed from tests/PHPUnit/Integration/expected/test_annotations_lastN__Annotations.getAll_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_annotations_lastN__Annotations.getAnnotationCountForDates_week.xml (renamed from tests/PHPUnit/Integration/expected/test_annotations_lastN__Annotations.getAnnotationCountForDates_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_annotations_multipleSites__Annotations.getAll_month.xml (renamed from tests/PHPUnit/Integration/expected/test_annotations_multipleSites__Annotations.getAll_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_annotations_multipleSites__Annotations.getAnnotationCountForDates_month.xml (renamed from tests/PHPUnit/Integration/expected/test_annotations_multipleSites__Annotations.getAnnotationCountForDates_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_annotations_range__Annotations.getAll_range.xml (renamed from tests/PHPUnit/Integration/expected/test_annotations_range__Annotations.getAll_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_annotations_range__Annotations.getAnnotationCountForDates_range.xml (renamed from tests/PHPUnit/Integration/expected/test_annotations_range__Annotations.getAnnotationCountForDates_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getDefaultMetricTranslations.xml (renamed from tests/PHPUnit/Integration/expected/test_apiGetReportMetadata__API.getDefaultMetricTranslations.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getIpFromHeader.xml (renamed from tests/PHPUnit/Integration/expected/test_apiGetReportMetadata__API.getIpFromHeader.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getLastDate_day.xml (renamed from tests/PHPUnit/Integration/expected/test_apiGetReportMetadata__API.getLastDate_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getMetadata_day.xml (renamed from tests/PHPUnit/Integration/expected/test_apiGetReportMetadata__API.getMetadata_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getProcessedReport_day.xml (renamed from tests/PHPUnit/Integration/expected/test_apiGetReportMetadata__API.getProcessedReport_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getReportMetadata_day.xml (renamed from tests/PHPUnit/Integration/expected/test_apiGetReportMetadata__API.getReportMetadata_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getRowEvolution_day.xml (renamed from tests/PHPUnit/Integration/expected/test_apiGetReportMetadata__API.getRowEvolution_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getSegmentsMetadata.xml (renamed from tests/PHPUnit/Integration/expected/test_apiGetReportMetadata__API.getSegmentsMetadata.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getSettings.xml (renamed from tests/PHPUnit/Integration/expected/test_apiGetReportMetadata__API.getSettings.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getSuggestedValuesForSegment.xml (renamed from tests/PHPUnit/Integration/expected/test_apiGetReportMetadata__API.getSuggestedValuesForSegment.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.get_day.xml (renamed from tests/PHPUnit/Integration/expected/test_apiGetReportMetadata__API.get_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_apiGetReportMetadata_hideMetricsDoc__API.getMetadata_day.xml (renamed from tests/PHPUnit/Integration/expected/test_apiGetReportMetadata_hideMetricsDoc__API.getMetadata_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_apiGetReportMetadata_hideMetricsDoc__API.getProcessedReport_day.xml (renamed from tests/PHPUnit/Integration/expected/test_apiGetReportMetadata_hideMetricsDoc__API.getProcessedReport_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_apiGetReportMetadata_pageTitleZeroString__Actions.getPageTitles_day.xml (renamed from tests/PHPUnit/Integration/expected/test_apiGetReportMetadata_pageTitleZeroString__Actions.getPageTitles_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_apiGetReportMetadata_phpRenderer__API.getDefaultMetricTranslations.php (renamed from tests/PHPUnit/Integration/expected/test_apiGetReportMetadata_phpRenderer__API.getDefaultMetricTranslations.php)0
-rw-r--r--tests/PHPUnit/System/expected/test_apiGetReportMetadata_showRawMetrics__API.getProcessedReport_day.xml (renamed from tests/PHPUnit/Integration/expected/test_apiGetReportMetadata_showRawMetrics__API.getProcessedReport_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_apiGetReportMetadata_year__API.getProcessedReport_year.xml (renamed from tests/PHPUnit/Integration/expected/test_apiGetReportMetadata_year__API.getProcessedReport_year.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_apiGetReportMetadata_year__LanguagesManager.getAvailableLanguageNames.xml (renamed from tests/PHPUnit/Integration/expected/test_apiGetReportMetadata_year__LanguagesManager.getAvailableLanguageNames.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_apiGetReportMetadata_year__SitesManager.getJavascriptTag.xml (renamed from tests/PHPUnit/Integration/expected/test_apiGetReportMetadata_year__SitesManager.getJavascriptTag.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_csvExport__Live.getLastVisitsDetails_day.csv (renamed from tests/PHPUnit/Integration/expected/test_csvExport__Live.getLastVisitsDetails_day.csv)bin7924 -> 7924 bytes
-rw-r--r--tests/PHPUnit/System/expected/test_csvExport_xp0__CustomVariables.getCustomVariables_day.csv (renamed from tests/PHPUnit/Integration/expected/test_csvExport_xp0__CustomVariables.getCustomVariables_day.csv)bin1280 -> 1280 bytes
-rw-r--r--tests/PHPUnit/System/expected/test_csvExport_xp0__VisitsSummary.get_day.csv (renamed from tests/PHPUnit/Integration/expected/test_csvExport_xp0__VisitsSummary.get_day.csv)bin378 -> 378 bytes
-rw-r--r--tests/PHPUnit/System/expected/test_csvExport_xp1_inner0_trans-en__CustomVariables.getCustomVariables_day.csv (renamed from tests/PHPUnit/Integration/expected/test_csvExport_xp1_inner0_trans-en__CustomVariables.getCustomVariables_day.csv)bin2500 -> 2500 bytes
-rw-r--r--tests/PHPUnit/System/expected/test_csvExport_xp1_inner0_trans-en__VisitsSummary.get_day.csv (renamed from tests/PHPUnit/Integration/expected/test_csvExport_xp1_inner0_trans-en__VisitsSummary.get_day.csv)bin466 -> 466 bytes
-rw-r--r--tests/PHPUnit/System/expected/test_csvExport_xp1_inner1_trans-de__CustomVariables.getCustomVariables_day.csv (renamed from tests/PHPUnit/Integration/expected/test_csvExport_xp1_inner1_trans-de__CustomVariables.getCustomVariables_day.csv)bin3468 -> 3468 bytes
-rw-r--r--tests/PHPUnit/System/expected/test_csvExport_xp1_inner1_trans-de__VisitsSummary.get_day.csv (renamed from tests/PHPUnit/Integration/expected/test_csvExport_xp1_inner1_trans-de__VisitsSummary.get_day.csv)bin588 -> 588 bytes
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_API_get__API.get_day.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_API_get__API.get_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_API_get__API.get_week.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_API_get__API.get_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_AbandonedCarts__Goals.getItemsCategory_day.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_AbandonedCarts__Goals.getItemsCategory_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_AbandonedCarts__Goals.getItemsCategory_week.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_AbandonedCarts__Goals.getItemsCategory_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_AbandonedCarts__Goals.getItemsName_day.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_AbandonedCarts__Goals.getItemsName_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_AbandonedCarts__Goals.getItemsName_week.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_AbandonedCarts__Goals.getItemsName_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_AbandonedCarts__Goals.getItemsSku_day.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_AbandonedCarts__Goals.getItemsSku_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_AbandonedCarts__Goals.getItemsSku_week.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_AbandonedCarts__Goals.getItemsSku_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalAbandonedCart__Goals.get_day.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_GoalAbandonedCart__Goals.get_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalAbandonedCart__Goals.get_week.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_GoalAbandonedCart__Goals.get_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalMatchTitle__Goals.get_day.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_GoalMatchTitle__Goals.get_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalMatchTitle__Goals.get_week.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_GoalMatchTitle__Goals.get_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalOrder__Goals.get_day.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_GoalOrder__Goals.get_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalOrder__Goals.get_week.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_GoalOrder__Goals.get_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalOverall__Goals.get_day.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_GoalOverall__Goals.get_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalOverall__Goals.get_week.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_GoalOverall__Goals.get_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_LiveEcommerceStatusOrdered__Live.getLastVisitsDetails_day.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_LiveEcommerceStatusOrdered__Live.getLastVisitsDetails_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_Metadata_Goals.Get_AbandonedCart__API.getProcessedReport_day.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_Metadata_Goals.Get_AbandonedCart__API.getProcessedReport_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_Metadata_Goals.Get_NormalGoal__API.getProcessedReport_day.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_Metadata_Goals.Get_NormalGoal__API.getProcessedReport_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_Metadata_Goals.Get_NotExistingGoal__API.getProcessedReport_day.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_Metadata_Goals.Get_NotExistingGoal__API.getProcessedReport_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_Metadata_Goals.Get_Order__API.getProcessedReport_day.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_Metadata_Goals.Get_Order__API.getProcessedReport_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_Metadata_ItemsCategory__API.getProcessedReport_day.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_Metadata_ItemsCategory__API.getProcessedReport_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_Metadata_ItemsSku__API.getProcessedReport_day.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_Metadata_ItemsSku__API.getProcessedReport_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_Metadata_VisitTime.getVisitInformationPerServerTime__API.getProcessedReport_day.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_Metadata_VisitTime.getVisitInformationPerServerTime__API.getProcessedReport_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentAbandonedCart__VisitsSummary.get_day.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentAbandonedCart__VisitsSummary.get_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentConvertedGoalId1__VisitsSummary.get_day.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentConvertedGoalId1__VisitsSummary.get_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentConvertedGoalId1__VisitsSummary.get_week.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentConvertedGoalId1__VisitsSummary.get_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentCountryIsFr__Goals.getItemsCategory_day.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentCountryIsFr__Goals.getItemsCategory_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentCountryIsFr__Goals.getItemsCategory_week.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentCountryIsFr__Goals.getItemsCategory_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentCountryIsFr__Goals.getItemsName_day.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentCountryIsFr__Goals.getItemsName_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentCountryIsFr__Goals.getItemsName_week.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentCountryIsFr__Goals.getItemsName_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentCountryIsFr__Goals.getItemsSku_day.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentCountryIsFr__Goals.getItemsSku_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentCountryIsFr__Goals.getItemsSku_week.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentCountryIsFr__Goals.getItemsSku_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentDidNotConvertGoalId1__VisitsSummary.get_day.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentDidNotConvertGoalId1__VisitsSummary.get_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentNewVisitors__VisitsSummary.get_week.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentNewVisitors__VisitsSummary.get_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentNoEcommerce__VisitsSummary.get_day.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentNoEcommerce__VisitsSummary.get_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentNoVisit_HaveConvertedNonExistingGoal__Goals.getItemsCategory_week.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentNoVisit_HaveConvertedNonExistingGoal__Goals.getItemsCategory_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentNoVisit_HaveConvertedNonExistingGoal__Goals.getItemsName_week.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentNoVisit_HaveConvertedNonExistingGoal__Goals.getItemsName_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentNoVisit_HaveConvertedNonExistingGoal__Goals.getItemsSku_week.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentNoVisit_HaveConvertedNonExistingGoal__Goals.getItemsSku_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentNoVisit_HaveConvertedNonExistingGoal__Goals.get_week.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentNoVisit_HaveConvertedNonExistingGoal__Goals.get_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentNoVisit_HaveConvertedNonExistingGoal__VisitsSummary.get_week.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentNoVisit_HaveConvertedNonExistingGoal__VisitsSummary.get_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentOrderedSomething__VisitsSummary.get_day.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentOrderedSomething__VisitsSummary.get_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentPageTitleMatch__VisitsSummary.get_day.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentPageTitleMatch__VisitsSummary.get_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentPageUrlContains__Goals.getItemsCategory_day.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentPageUrlContains__Goals.getItemsCategory_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentPageUrlContains__Goals.getItemsCategory_week.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentPageUrlContains__Goals.getItemsCategory_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentPageUrlContains__Goals.getItemsName_day.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentPageUrlContains__Goals.getItemsName_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentPageUrlContains__Goals.getItemsName_week.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentPageUrlContains__Goals.getItemsName_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentPageUrlContains__Goals.getItemsSku_day.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentPageUrlContains__Goals.getItemsSku_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentPageUrlContains__Goals.getItemsSku_week.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentPageUrlContains__Goals.getItemsSku_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentReturningCustomers__VisitsSummary.get_week.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentReturningCustomers__VisitsSummary.get_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentReturningVisitors__VisitsSummary.get_week.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentReturningVisitors__VisitsSummary.get_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentVisitHasConvertedGoal__Goals.getItemsCategory_week.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentVisitHasConvertedGoal__Goals.getItemsCategory_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentVisitHasConvertedGoal__Goals.getItemsName_week.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentVisitHasConvertedGoal__Goals.getItemsName_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentVisitHasConvertedGoal__Goals.getItemsSku_week.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentVisitHasConvertedGoal__Goals.getItemsSku_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentVisitHasConvertedGoal__Goals.get_week.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentVisitHasConvertedGoal__Goals.get_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentVisitHasConvertedGoal__VisitsSummary.get_week.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentVisitHasConvertedGoal__VisitsSummary.get_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentVisitHasNotOrderedAndConvertedGoal__Goals.getItemsCategory_week.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentVisitHasNotOrderedAndConvertedGoal__Goals.getItemsCategory_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentVisitHasNotOrderedAndConvertedGoal__Goals.getItemsName_week.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentVisitHasNotOrderedAndConvertedGoal__Goals.getItemsName_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentVisitHasNotOrderedAndConvertedGoal__Goals.getItemsSku_week.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentVisitHasNotOrderedAndConvertedGoal__Goals.getItemsSku_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentVisitHasNotOrderedAndConvertedGoal__Goals.get_week.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentVisitHasNotOrderedAndConvertedGoal__Goals.get_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentVisitHasNotOrderedAndConvertedGoal__VisitsSummary.get_week.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentVisitHasNotOrderedAndConvertedGoal__VisitsSummary.get_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_Website2__Goals.getItemsCategory_week.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_Website2__Goals.getItemsCategory_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_Website2__Goals.getItemsName_week.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_Website2__Goals.getItemsName_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_Website2__Goals.getItemsSku_week.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_Website2__Goals.getItemsSku_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_Website2__Goals.get_week.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_Website2__Goals.get_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__API.getProcessedReport_day.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems__API.getProcessedReport_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__CustomVariables.getCustomVariables_day.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems__CustomVariables.getCustomVariables_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__Goals.getItemsCategory_day.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems__Goals.getItemsCategory_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__Goals.getItemsCategory_week.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems__Goals.getItemsCategory_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__Goals.getItemsName_day.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems__Goals.getItemsName_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__Goals.getItemsName_week.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems__Goals.getItemsName_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__Goals.getItemsSku_day.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems__Goals.getItemsSku_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__Goals.getItemsSku_week.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems__Goals.getItemsSku_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__Goals.get_day.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems__Goals.get_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__Goals.get_week.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems__Goals.get_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__Live.getLastVisitsDetails_day.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems__Live.getLastVisitsDetails_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__UserCountry.getCity_day.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems__UserCountry.getCity_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__UserCountry.getContinent_day.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems__UserCountry.getContinent_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__UserCountry.getCountry_day.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems__UserCountry.getCountry_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__UserCountry.getNumberOfDistinctCountries_day.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems__UserCountry.getNumberOfDistinctCountries_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__UserCountry.getRegion_day.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems__UserCountry.getRegion_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__VisitTime.getByDayOfWeek_day.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems__VisitTime.getByDayOfWeek_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__VisitTime.getVisitInformationPerLocalTime_day.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems__VisitTime.getVisitInformationPerLocalTime_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__VisitTime.getVisitInformationPerServerTime_day.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems__VisitTime.getVisitInformationPerServerTime_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__VisitsSummary.get_day.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems__VisitsSummary.get_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_scheduled_report_in_csv__ScheduledReports.generateReport_week.original.csv (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_scheduled_report_in_csv__ScheduledReports.generateReport_week.original.csv)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_scheduled_report_in_html_row_evolution_graph__ScheduledReports.generateReport_week.original.html (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_scheduled_report_in_html_row_evolution_graph__ScheduledReports.generateReport_week.original.html)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_scheduled_report_in_html_tables_and_graph__ScheduledReports.generateReport_week.original.html (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_scheduled_report_in_html_tables_and_graph__ScheduledReports.generateReport_week.original.html)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_scheduled_report_in_html_tables_only__ScheduledReports.generateReport_week.original.html (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_scheduled_report_in_html_tables_only__ScheduledReports.generateReport_week.original.html)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_scheduled_report_in_pdf_tables_only__ScheduledReports.generateReport_week.original.pdf (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_scheduled_report_in_pdf_tables_only__ScheduledReports.generateReport_week.original.pdf)bin527977 -> 527977 bytes
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_scheduled_report_via_sms_all_sites__ScheduledReports.generateReport_week.original.sms.txt (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_scheduled_report_via_sms_all_sites__ScheduledReports.generateReport_week.original.sms.txt)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_scheduled_report_via_sms_one_site__ScheduledReports.generateReport_week.original.sms.txt (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_scheduled_report_via_sms_one_site__ScheduledReports.generateReport_week.original.sms.txt)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItemsmultipleDates__Goals.getItemsCategory_day.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItemsmultipleDates__Goals.getItemsCategory_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItemsmultipleDates__Goals.getItemsName_day.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItemsmultipleDates__Goals.getItemsName_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItemsmultipleDates__Goals.getItemsSku_day.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItemsmultipleDates__Goals.getItemsSku_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItemsmultipleDates_andMultipleWebsites__Goals.getItemsCategory_day.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItemsmultipleDates_andMultipleWebsites__Goals.getItemsCategory_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItemsmultipleDates_andMultipleWebsites__Goals.getItemsName_day.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItemsmultipleDates_andMultipleWebsites__Goals.getItemsName_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_ecommerceOrderWithItemsmultipleDates_andMultipleWebsites__Goals.getItemsSku_day.xml (renamed from tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItemsmultipleDates_andMultipleWebsites__Goals.getItemsSku_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getDownload_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getDownload_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getDownload_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getDownload_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getDownloads_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getDownloads_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getDownloads_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getDownloads_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getEntryPageTitles_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getEntryPageTitles_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getEntryPageTitles_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getEntryPageTitles_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getEntryPageUrls_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getEntryPageUrls_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getEntryPageUrls_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getEntryPageUrls_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getExitPageTitles_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getExitPageTitles_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getExitPageTitles_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getExitPageTitles_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getExitPageUrls_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getExitPageUrls_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getExitPageUrls_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getExitPageUrls_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getOutlink_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getOutlink_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getOutlink_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getOutlink_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getOutlinks_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getOutlinks_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getOutlinks_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getOutlinks_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getPageTitle_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getPageTitle_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getPageTitle_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getPageTitle_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getPageTitlesFollowingSiteSearch_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getPageTitlesFollowingSiteSearch_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getPageTitlesFollowingSiteSearch_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getPageTitlesFollowingSiteSearch_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getPageTitles_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getPageTitles_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getPageTitles_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getPageTitles_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getPageUrl_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getPageUrl_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getPageUrl_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getPageUrl_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getPageUrlsFollowingSiteSearch_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getPageUrlsFollowingSiteSearch_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getPageUrlsFollowingSiteSearch_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getPageUrlsFollowingSiteSearch_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getPageUrls_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getPageUrls_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getPageUrls_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getPageUrls_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getSiteSearchCategories_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getSiteSearchCategories_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getSiteSearchCategories_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getSiteSearchCategories_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getSiteSearchKeywords_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getSiteSearchKeywords_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getSiteSearchKeywords_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getSiteSearchKeywords_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getSiteSearchNoResultKeywords_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getSiteSearchNoResultKeywords_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getSiteSearchNoResultKeywords_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getSiteSearchNoResultKeywords_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.get_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.get_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.get_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.get_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Contents.getContentNames_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Contents.getContentNames_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Contents.getContentNames_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Contents.getContentNames_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Contents.getContentPieces_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Contents.getContentPieces_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Contents.getContentPieces_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Contents.getContentPieces_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__CustomVariables.getCustomVariables_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__CustomVariables.getCustomVariables_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__CustomVariables.getCustomVariables_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__CustomVariables.getCustomVariables_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__DevicesDetection.getBrand_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__DevicesDetection.getBrand_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__DevicesDetection.getBrand_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__DevicesDetection.getBrand_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__DevicesDetection.getBrowserEngines_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__DevicesDetection.getBrowserEngines_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__DevicesDetection.getBrowserEngines_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__DevicesDetection.getBrowserEngines_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__DevicesDetection.getBrowserFamilies_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__DevicesDetection.getBrowserFamilies_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__DevicesDetection.getBrowserFamilies_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__DevicesDetection.getBrowserFamilies_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__DevicesDetection.getBrowserVersions_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__DevicesDetection.getBrowserVersions_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__DevicesDetection.getBrowserVersions_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__DevicesDetection.getBrowserVersions_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__DevicesDetection.getModel_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__DevicesDetection.getModel_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__DevicesDetection.getModel_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__DevicesDetection.getModel_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__DevicesDetection.getOsFamilies_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__DevicesDetection.getOsFamilies_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__DevicesDetection.getOsFamilies_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__DevicesDetection.getOsFamilies_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__DevicesDetection.getOsVersions_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__DevicesDetection.getOsVersions_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__DevicesDetection.getOsVersions_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__DevicesDetection.getOsVersions_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__DevicesDetection.getType_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__DevicesDetection.getType_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__DevicesDetection.getType_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__DevicesDetection.getType_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Events.getAction_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Events.getAction_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Events.getAction_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Events.getAction_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Events.getCategory_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Events.getCategory_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Events.getCategory_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Events.getCategory_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Events.getName_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Events.getName_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Events.getName_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Events.getName_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__ExamplePlugin.getAnswerToLife.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__ExamplePlugin.getAnswerToLife.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__ExamplePlugin.getExampleReport_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__ExamplePlugin.getExampleReport_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__ExamplePlugin.getExampleReport_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__ExamplePlugin.getExampleReport_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Goals.getDaysToConversion_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Goals.getDaysToConversion_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Goals.getDaysToConversion_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Goals.getDaysToConversion_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Goals.getGoals.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Goals.getGoals.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Goals.getItemsCategory_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Goals.getItemsCategory_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Goals.getItemsCategory_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Goals.getItemsCategory_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Goals.getItemsName_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Goals.getItemsName_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Goals.getItemsName_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Goals.getItemsName_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Goals.getItemsSku_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Goals.getItemsSku_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Goals.getItemsSku_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Goals.getItemsSku_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Goals.getVisitsUntilConversion_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Goals.getVisitsUntilConversion_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Goals.getVisitsUntilConversion_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Goals.getVisitsUntilConversion_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Goals.get_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Goals.get_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Goals.get_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Goals.get_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__MultiSites.getAll_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__MultiSites.getAll_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__MultiSites.getAll_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__MultiSites.getAll_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__MultiSites.getOne_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__MultiSites.getOne_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__MultiSites.getOne_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__MultiSites.getOne_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Provider.getProvider_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Provider.getProvider_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Provider.getProvider_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Provider.getProvider_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getAll_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getAll_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getAll_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getAll_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getCampaigns_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getCampaigns_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getCampaigns_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getCampaigns_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getKeywordsForPageUrl_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getKeywordsForPageUrl_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getKeywordsForPageUrl_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getKeywordsForPageUrl_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getKeywords_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getKeywords_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getKeywords_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getKeywords_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getNumberOfDistinctCampaigns_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getNumberOfDistinctCampaigns_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getNumberOfDistinctCampaigns_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getNumberOfDistinctCampaigns_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getNumberOfDistinctKeywords_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getNumberOfDistinctKeywords_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getNumberOfDistinctKeywords_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getNumberOfDistinctKeywords_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getNumberOfDistinctSearchEngines_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getNumberOfDistinctSearchEngines_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getNumberOfDistinctSearchEngines_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getNumberOfDistinctSearchEngines_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getNumberOfDistinctWebsitesUrls_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getNumberOfDistinctWebsitesUrls_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getNumberOfDistinctWebsitesUrls_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getNumberOfDistinctWebsitesUrls_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getNumberOfDistinctWebsites_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getNumberOfDistinctWebsites_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getNumberOfDistinctWebsites_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getNumberOfDistinctWebsites_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getReferrerType_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getReferrerType_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getReferrerType_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getReferrerType_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getSearchEngines_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getSearchEngines_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getSearchEngines_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getSearchEngines_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getSocials_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getSocials_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getSocials_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getSocials_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getUrlsForSocial_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getUrlsForSocial_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getUrlsForSocial_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getUrlsForSocial_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getWebsites_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getWebsites_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getWebsites_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getWebsites_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserCountry.getCity_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserCountry.getCity_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserCountry.getCity_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserCountry.getCity_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserCountry.getContinent_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserCountry.getContinent_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserCountry.getContinent_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserCountry.getContinent_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserCountry.getCountry_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserCountry.getCountry_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserCountry.getCountry_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserCountry.getCountry_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserCountry.getNumberOfDistinctCountries_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserCountry.getNumberOfDistinctCountries_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserCountry.getNumberOfDistinctCountries_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserCountry.getNumberOfDistinctCountries_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserCountry.getRegion_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserCountry.getRegion_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserCountry.getRegion_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserCountry.getRegion_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserSettings.getBrowserVersion_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserSettings.getBrowserVersion_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserSettings.getBrowserVersion_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserSettings.getBrowserVersion_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserSettings.getBrowser_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserSettings.getBrowser_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserSettings.getBrowser_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserSettings.getBrowser_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserSettings.getConfiguration_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserSettings.getConfiguration_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserSettings.getConfiguration_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserSettings.getConfiguration_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserSettings.getLanguageCode_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserSettings.getLanguageCode_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserSettings.getLanguageCode_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserSettings.getLanguageCode_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserSettings.getLanguage_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserSettings.getLanguage_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserSettings.getLanguage_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserSettings.getLanguage_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserSettings.getMobileVsDesktop_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserSettings.getMobileVsDesktop_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserSettings.getMobileVsDesktop_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserSettings.getMobileVsDesktop_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserSettings.getOSFamily_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserSettings.getOSFamily_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserSettings.getOSFamily_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserSettings.getOSFamily_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserSettings.getOS_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserSettings.getOS_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserSettings.getOS_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserSettings.getOS_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserSettings.getPlugin_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserSettings.getPlugin_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserSettings.getPlugin_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserSettings.getPlugin_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserSettings.getResolution_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserSettings.getResolution_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserSettings.getResolution_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserSettings.getResolution_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserSettings.getWideScreen_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserSettings.getWideScreen_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserSettings.getWideScreen_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserSettings.getWideScreen_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitFrequency.get_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitFrequency.get_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitFrequency.get_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitFrequency.get_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitTime.getByDayOfWeek_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitTime.getByDayOfWeek_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitTime.getByDayOfWeek_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitTime.getByDayOfWeek_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitTime.getVisitInformationPerLocalTime_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitTime.getVisitInformationPerLocalTime_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitTime.getVisitInformationPerLocalTime_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitTime.getVisitInformationPerLocalTime_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitTime.getVisitInformationPerServerTime_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitTime.getVisitInformationPerServerTime_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitTime.getVisitInformationPerServerTime_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitTime.getVisitInformationPerServerTime_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitorInterest.getNumberOfVisitsByDaysSinceLast_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitorInterest.getNumberOfVisitsByDaysSinceLast_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitorInterest.getNumberOfVisitsByDaysSinceLast_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitorInterest.getNumberOfVisitsByDaysSinceLast_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitorInterest.getNumberOfVisitsByVisitCount_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitorInterest.getNumberOfVisitsByVisitCount_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitorInterest.getNumberOfVisitsByVisitCount_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitorInterest.getNumberOfVisitsByVisitCount_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitorInterest.getNumberOfVisitsPerPage_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitorInterest.getNumberOfVisitsPerPage_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitorInterest.getNumberOfVisitsPerPage_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitorInterest.getNumberOfVisitsPerPage_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitorInterest.getNumberOfVisitsPerVisitDuration_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitorInterest.getNumberOfVisitsPerVisitDuration_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitorInterest.getNumberOfVisitsPerVisitDuration_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitorInterest.getNumberOfVisitsPerVisitDuration_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitsSummary.getActions_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitsSummary.getActions_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitsSummary.getActions_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitsSummary.getActions_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitsSummary.getBounceCount_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitsSummary.getBounceCount_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitsSummary.getBounceCount_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitsSummary.getBounceCount_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitsSummary.getMaxActions_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitsSummary.getMaxActions_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitsSummary.getMaxActions_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitsSummary.getMaxActions_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitsSummary.getSumVisitsLengthPretty_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitsSummary.getSumVisitsLengthPretty_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitsSummary.getSumVisitsLengthPretty_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitsSummary.getSumVisitsLengthPretty_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitsSummary.getSumVisitsLength_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitsSummary.getSumVisitsLength_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitsSummary.getSumVisitsLength_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitsSummary.getSumVisitsLength_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitsSummary.getUniqueVisitors_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitsSummary.getUniqueVisitors_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitsSummary.getUniqueVisitors_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitsSummary.getUniqueVisitors_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitsSummary.getUsers_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitsSummary.getUsers_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitsSummary.getUsers_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitsSummary.getUsers_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitsSummary.getVisitsConverted_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitsSummary.getVisitsConverted_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitsSummary.getVisitsConverted_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitsSummary.getVisitsConverted_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitsSummary.getVisits_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitsSummary.getVisits_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitsSummary.getVisits_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitsSummary.getVisits_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitsSummary.get_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitsSummary.get_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitsSummary.get_week.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitsSummary.get_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__Actions.getDownload_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__Actions.getDownload_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__Actions.getDownloads_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__Actions.getDownloads_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__Actions.getEntryPageTitles_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__Actions.getEntryPageTitles_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__Actions.getEntryPageUrls_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__Actions.getEntryPageUrls_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__Actions.getExitPageTitles_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__Actions.getExitPageTitles_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__Actions.getExitPageUrls_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__Actions.getExitPageUrls_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__Actions.getOutlink_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__Actions.getOutlink_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__Actions.getOutlinks_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__Actions.getOutlinks_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__Actions.getPageTitle_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__Actions.getPageTitle_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__Actions.getPageTitlesFollowingSiteSearch_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__Actions.getPageTitlesFollowingSiteSearch_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__Actions.getPageTitles_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__Actions.getPageTitles_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__Actions.getPageUrl_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__Actions.getPageUrl_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__Actions.getPageUrlsFollowingSiteSearch_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__Actions.getPageUrlsFollowingSiteSearch_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__Actions.getPageUrls_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__Actions.getPageUrls_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__Actions.getSiteSearchCategories_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__Actions.getSiteSearchCategories_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__Actions.getSiteSearchKeywords_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__Actions.getSiteSearchKeywords_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__Actions.getSiteSearchNoResultKeywords_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__Actions.getSiteSearchNoResultKeywords_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__Actions.get_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__Actions.get_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__Contents.getContentNames_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__Contents.getContentNames_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__Contents.getContentPieces_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__Contents.getContentPieces_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__CustomVariables.getCustomVariables_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__CustomVariables.getCustomVariables_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__DevicesDetection.getBrand_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__DevicesDetection.getBrand_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__DevicesDetection.getBrowserEngines_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__DevicesDetection.getBrowserEngines_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__DevicesDetection.getBrowserFamilies_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__DevicesDetection.getBrowserFamilies_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__DevicesDetection.getBrowserVersions_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__DevicesDetection.getBrowserVersions_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__DevicesDetection.getModel_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__DevicesDetection.getModel_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__DevicesDetection.getOsFamilies_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__DevicesDetection.getOsFamilies_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__DevicesDetection.getOsVersions_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__DevicesDetection.getOsVersions_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__DevicesDetection.getType_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__DevicesDetection.getType_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__Events.getAction_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__Events.getAction_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__Events.getCategory_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__Events.getCategory_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__Events.getName_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__Events.getName_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__ExamplePlugin.getAnswerToLife.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__ExamplePlugin.getAnswerToLife.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__ExamplePlugin.getExampleReport_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__ExamplePlugin.getExampleReport_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__Goals.getDaysToConversion_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__Goals.getDaysToConversion_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__Goals.getGoals.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__Goals.getGoals.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__Goals.getItemsCategory_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__Goals.getItemsCategory_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__Goals.getItemsName_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__Goals.getItemsName_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__Goals.getItemsSku_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__Goals.getItemsSku_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__Goals.getVisitsUntilConversion_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__Goals.getVisitsUntilConversion_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__Goals.get_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__Goals.get_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__MultiSites.getAll_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__MultiSites.getAll_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__MultiSites.getOne_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__MultiSites.getOne_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__Provider.getProvider_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__Provider.getProvider_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__Referrers.getAll_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__Referrers.getAll_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__Referrers.getCampaigns_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__Referrers.getCampaigns_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__Referrers.getKeywordsForPageUrl_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__Referrers.getKeywordsForPageUrl_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__Referrers.getKeywords_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__Referrers.getKeywords_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__Referrers.getNumberOfDistinctCampaigns_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__Referrers.getNumberOfDistinctCampaigns_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__Referrers.getNumberOfDistinctKeywords_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__Referrers.getNumberOfDistinctKeywords_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__Referrers.getNumberOfDistinctSearchEngines_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__Referrers.getNumberOfDistinctSearchEngines_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__Referrers.getNumberOfDistinctWebsitesUrls_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__Referrers.getNumberOfDistinctWebsitesUrls_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__Referrers.getNumberOfDistinctWebsites_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__Referrers.getNumberOfDistinctWebsites_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__Referrers.getReferrerType_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__Referrers.getReferrerType_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__Referrers.getSearchEngines_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__Referrers.getSearchEngines_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__Referrers.getSocials_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__Referrers.getSocials_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__Referrers.getUrlsForSocial_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__Referrers.getUrlsForSocial_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__Referrers.getWebsites_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__Referrers.getWebsites_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__UserCountry.getCity_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__UserCountry.getCity_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__UserCountry.getContinent_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__UserCountry.getContinent_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__UserCountry.getCountry_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__UserCountry.getCountry_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__UserCountry.getNumberOfDistinctCountries_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__UserCountry.getNumberOfDistinctCountries_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__UserCountry.getRegion_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__UserCountry.getRegion_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__UserSettings.getBrowserVersion_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__UserSettings.getBrowserVersion_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__UserSettings.getBrowser_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__UserSettings.getBrowser_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__UserSettings.getConfiguration_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__UserSettings.getConfiguration_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__UserSettings.getLanguageCode_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__UserSettings.getLanguageCode_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__UserSettings.getLanguage_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__UserSettings.getLanguage_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__UserSettings.getMobileVsDesktop_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__UserSettings.getMobileVsDesktop_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__UserSettings.getOSFamily_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__UserSettings.getOSFamily_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__UserSettings.getOS_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__UserSettings.getOS_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__UserSettings.getPlugin_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__UserSettings.getPlugin_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__UserSettings.getResolution_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__UserSettings.getResolution_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__UserSettings.getWideScreen_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__UserSettings.getWideScreen_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__VisitFrequency.get_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__VisitFrequency.get_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__VisitTime.getByDayOfWeek_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__VisitTime.getByDayOfWeek_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__VisitTime.getVisitInformationPerLocalTime_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__VisitTime.getVisitInformationPerLocalTime_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__VisitTime.getVisitInformationPerServerTime_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__VisitTime.getVisitInformationPerServerTime_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__VisitorInterest.getNumberOfVisitsByDaysSinceLast_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__VisitorInterest.getNumberOfVisitsByDaysSinceLast_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__VisitorInterest.getNumberOfVisitsByVisitCount_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__VisitorInterest.getNumberOfVisitsByVisitCount_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__VisitorInterest.getNumberOfVisitsPerPage_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__VisitorInterest.getNumberOfVisitsPerPage_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__VisitorInterest.getNumberOfVisitsPerVisitDuration_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__VisitorInterest.getNumberOfVisitsPerVisitDuration_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__VisitsSummary.getActions_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__VisitsSummary.getActions_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__VisitsSummary.getBounceCount_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__VisitsSummary.getBounceCount_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__VisitsSummary.getMaxActions_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__VisitsSummary.getMaxActions_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__VisitsSummary.getSumVisitsLengthPretty_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__VisitsSummary.getSumVisitsLengthPretty_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__VisitsSummary.getSumVisitsLength_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__VisitsSummary.getSumVisitsLength_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__VisitsSummary.getUniqueVisitors_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__VisitsSummary.getUniqueVisitors_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__VisitsSummary.getUsers_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__VisitsSummary.getUsers_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__VisitsSummary.getVisitsConverted_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__VisitsSummary.getVisitsConverted_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__VisitsSummary.getVisits_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__VisitsSummary.getVisits_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__VisitsSummary.get_day.xml (renamed from tests/PHPUnit/Integration/expected/test_noVisit__VisitsSummary.get_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_oneVisitor_oneWebsite_severalDays_DateRange_IndexedByDate__MultiSites.getAll_day.xml (renamed from tests/PHPUnit/Integration/expected/test_oneVisitor_oneWebsite_severalDays_DateRange_IndexedByDate__MultiSites.getAll_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_oneVisitor_oneWebsite_severalDays_DateRange_IndexedByDate__Referrers.getSocials_day.xml (renamed from tests/PHPUnit/Integration/expected/test_oneVisitor_oneWebsite_severalDays_DateRange_IndexedByDate__Referrers.getSocials_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_oneVisitor_oneWebsite_severalDays_DateRange_MultipleDatesNotSupported__MultiSites.getAll_day.xml (renamed from tests/PHPUnit/Integration/expected/test_oneVisitor_oneWebsite_severalDays_DateRange_MultipleDatesNotSupported__MultiSites.getAll_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_oneVisitor_oneWebsite_severalDays_DateRange__Actions.getPageUrls_range.xml (renamed from tests/PHPUnit/Integration/expected/test_oneVisitor_oneWebsite_severalDays_DateRange__Actions.getPageUrls_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_oneVisitor_oneWebsite_severalDays_DateRange__MultiSites.getAll_range.xml (renamed from tests/PHPUnit/Integration/expected/test_oneVisitor_oneWebsite_severalDays_DateRange__MultiSites.getAll_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_oneVisitor_oneWebsite_severalDays_DateRange__MultiSites.getOne_range.xml (renamed from tests/PHPUnit/Integration/expected/test_oneVisitor_oneWebsite_severalDays_DateRange__MultiSites.getOne_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_oneVisitor_oneWebsite_severalDays_DateRange__Referrers.getSocials_range.xml (renamed from tests/PHPUnit/Integration/expected/test_oneVisitor_oneWebsite_severalDays_DateRange__Referrers.getSocials_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_oneVisitor_oneWebsite_severalDays_DateRange__Referrers.getUrlsForSocial_range.xml (renamed from tests/PHPUnit/Integration/expected/test_oneVisitor_oneWebsite_severalDays_DateRange__Referrers.getUrlsForSocial_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_oneVisitor_oneWebsite_severalDays_DateRange__UserCountry.getCountry_range.xml (renamed from tests/PHPUnit/Integration/expected/test_oneVisitor_oneWebsite_severalDays_DateRange__UserCountry.getCountry_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_oneVisitor_oneWebsite_severalDays_DateRange__UserSettings.getResolution_range.xml (renamed from tests/PHPUnit/Integration/expected/test_oneVisitor_oneWebsite_severalDays_DateRange__UserSettings.getResolution_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_oneVisitor_oneWebsite_severalDays_DateRange__VisitFrequency.get_range.xml (renamed from tests/PHPUnit/Integration/expected/test_oneVisitor_oneWebsite_severalDays_DateRange__VisitFrequency.get_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_oneVisitor_oneWebsite_severalDays_DateRange__VisitTime.getVisitInformationPerServerTime_range.xml (renamed from tests/PHPUnit/Integration/expected/test_oneVisitor_oneWebsite_severalDays_DateRange__VisitTime.getVisitInformationPerServerTime_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_oneVisitor_oneWebsite_severalDays_DateRange__VisitsSummary.get_range.xml (renamed from tests/PHPUnit/Integration/expected/test_oneVisitor_oneWebsite_severalDays_DateRange__VisitsSummary.get_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_oneVisitor_oneWebsite_severalDays_DateRange_noIdSubtable__Referrers.getUrlsForSocial_range.xml (renamed from tests/PHPUnit/Integration/expected/test_oneVisitor_oneWebsite_severalDays_DateRange_noIdSubtable__Referrers.getUrlsForSocial_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_oneVisitor_oneWebsite_severalDays_DateRange_periodIsRange_expanded___Actions.getPageUrls_range.xml (renamed from tests/PHPUnit/Integration/expected/test_oneVisitor_oneWebsite_severalDays_DateRange_periodIsRange_expanded___Actions.getPageUrls_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_oneVisitor_oneWebsite_severalDays_DateRange_periodIsRange_flattened___Actions.getPageUrls_range.xml (renamed from tests/PHPUnit/Integration/expected/test_oneVisitor_oneWebsite_severalDays_DateRange_periodIsRange_flattened___Actions.getPageUrls_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__API.getProcessedReport_range.xml (renamed from tests/PHPUnit/Integration/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__API.getProcessedReport_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Actions.getPageUrls_range.xml (renamed from tests/PHPUnit/Integration/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Actions.getPageUrls_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__CustomVariables.getCustomVariables_range.xml (renamed from tests/PHPUnit/Integration/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__CustomVariables.getCustomVariables_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Goals.get_range.xml (renamed from tests/PHPUnit/Integration/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Goals.get_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Live.getCounters.xml (renamed from tests/PHPUnit/Integration/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Live.getCounters.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Live.getLastVisitsDetails_range.xml (renamed from tests/PHPUnit/Integration/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Live.getLastVisitsDetails_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Live.getMostRecentVisitorId.xml (renamed from tests/PHPUnit/Integration/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Live.getMostRecentVisitorId.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Live.getVisitorProfile.xml (renamed from tests/PHPUnit/Integration/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Live.getVisitorProfile.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Referrers.getCampaigns_range.xml (renamed from tests/PHPUnit/Integration/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Referrers.getCampaigns_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Referrers.getKeywords_range.xml (renamed from tests/PHPUnit/Integration/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Referrers.getKeywords_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__VisitsSummary.get_range.xml (renamed from tests/PHPUnit/Integration/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__VisitsSummary.get_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_reportLimiting__Actions.getDownloads_day.xml (renamed from tests/PHPUnit/Integration/expected/test_reportLimiting__Actions.getDownloads_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_reportLimiting__Actions.getOutlinks_day.xml (renamed from tests/PHPUnit/Integration/expected/test_reportLimiting__Actions.getOutlinks_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_reportLimiting__Actions.getPageTitles_day.xml (renamed from tests/PHPUnit/Integration/expected/test_reportLimiting__Actions.getPageTitles_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_reportLimiting__Actions.getPageUrls_day.xml (renamed from tests/PHPUnit/Integration/expected/test_reportLimiting__Actions.getPageUrls_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_reportLimiting__CustomVariables.getCustomVariables_day.xml (renamed from tests/PHPUnit/Integration/expected/test_reportLimiting__CustomVariables.getCustomVariables_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_reportLimiting__Goals.getItemsCategory_day.xml (renamed from tests/PHPUnit/Integration/expected/test_reportLimiting__Goals.getItemsCategory_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_reportLimiting__Goals.getItemsName_day.xml (renamed from tests/PHPUnit/Integration/expected/test_reportLimiting__Goals.getItemsName_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_reportLimiting__Goals.getItemsSku_day.xml (renamed from tests/PHPUnit/Integration/expected/test_reportLimiting__Goals.getItemsSku_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_reportLimiting__Referrers.getAll_day.xml (renamed from tests/PHPUnit/Integration/expected/test_reportLimiting__Referrers.getAll_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_reportLimiting__Referrers.getKeywords_day.xml (renamed from tests/PHPUnit/Integration/expected/test_reportLimiting__Referrers.getKeywords_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_reportLimiting__Referrers.getReferrerType_day.xml (renamed from tests/PHPUnit/Integration/expected/test_reportLimiting__Referrers.getReferrerType_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_reportLimiting__Referrers.getSearchEngines_day.xml (renamed from tests/PHPUnit/Integration/expected/test_reportLimiting__Referrers.getSearchEngines_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_reportLimiting__Referrers.getWebsites_day.xml (renamed from tests/PHPUnit/Integration/expected/test_reportLimiting__Referrers.getWebsites_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_reportLimiting__UserCountry.getCity_day.xml (renamed from tests/PHPUnit/Integration/expected/test_reportLimiting__UserCountry.getCity_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_reportLimiting__UserCountry.getRegion_day.xml (renamed from tests/PHPUnit/Integration/expected/test_reportLimiting__UserCountry.getRegion_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_reportLimiting__UserSettings.getBrowserVersion_day.xml (renamed from tests/PHPUnit/Integration/expected/test_reportLimiting__UserSettings.getBrowserVersion_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_reportLimiting__UserSettings.getConfiguration_day.xml (renamed from tests/PHPUnit/Integration/expected/test_reportLimiting__UserSettings.getConfiguration_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_reportLimiting__UserSettings.getOS_day.xml (renamed from tests/PHPUnit/Integration/expected/test_reportLimiting__UserSettings.getOS_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_reportLimiting__UserSettings.getResolution_day.xml (renamed from tests/PHPUnit/Integration/expected/test_reportLimiting__UserSettings.getResolution_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_reportLimiting_rangeFlat_rankingQueryDisabled__Actions.getDownloads_range.xml (renamed from tests/PHPUnit/Integration/expected/test_reportLimiting_rangeFlat_rankingQueryDisabled__Actions.getDownloads_range.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_reportLimiting_rankingQueryDisabled__Actions.getPageUrls_day.xml (renamed from tests/PHPUnit/Integration/expected/test_reportLimiting_rankingQueryDisabled__Actions.getPageUrls_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_reportLimiting_rankingQueryDisabled__Provider.getProvider_month.xml (renamed from tests/PHPUnit/Integration/expected/test_reportLimiting_rankingQueryDisabled__Provider.getProvider_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_reportLimiting_rankingQuery__Actions.getDownloads_day.xml (renamed from tests/PHPUnit/Integration/expected/test_reportLimiting_rankingQuery__Actions.getDownloads_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_reportLimiting_rankingQuery__Actions.getOutlinks_day.xml (renamed from tests/PHPUnit/Integration/expected/test_reportLimiting_rankingQuery__Actions.getOutlinks_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_reportLimiting_rankingQuery__Actions.getPageTitles_day.xml (renamed from tests/PHPUnit/Integration/expected/test_reportLimiting_rankingQuery__Actions.getPageTitles_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_reportLimiting_rankingQuery__Actions.getPageUrls_day.xml (renamed from tests/PHPUnit/Integration/expected/test_reportLimiting_rankingQuery__Actions.getPageUrls_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_reportLimiting_rankingQuery__CustomVariables.getCustomVariables_day.xml (renamed from tests/PHPUnit/Integration/expected/test_reportLimiting_rankingQuery__CustomVariables.getCustomVariables_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_reportLimiting_rankingQuery__Goals.getItemsCategory_day.xml (renamed from tests/PHPUnit/Integration/expected/test_reportLimiting_rankingQuery__Goals.getItemsCategory_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_reportLimiting_rankingQuery__Goals.getItemsName_day.xml (renamed from tests/PHPUnit/Integration/expected/test_reportLimiting_rankingQuery__Goals.getItemsName_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_reportLimiting_rankingQuery__Goals.getItemsSku_day.xml (renamed from tests/PHPUnit/Integration/expected/test_reportLimiting_rankingQuery__Goals.getItemsSku_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_reportLimiting_rankingQuery__Referrers.getAll_day.xml (renamed from tests/PHPUnit/Integration/expected/test_reportLimiting_rankingQuery__Referrers.getAll_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_reportLimiting_rankingQuery__Referrers.getKeywords_day.xml (renamed from tests/PHPUnit/Integration/expected/test_reportLimiting_rankingQuery__Referrers.getKeywords_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_reportLimiting_rankingQuery__Referrers.getReferrerType_day.xml (renamed from tests/PHPUnit/Integration/expected/test_reportLimiting_rankingQuery__Referrers.getReferrerType_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_reportLimiting_rankingQuery__Referrers.getSearchEngines_day.xml (renamed from tests/PHPUnit/Integration/expected/test_reportLimiting_rankingQuery__Referrers.getSearchEngines_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_reportLimiting_rankingQuery__Referrers.getWebsites_day.xml (renamed from tests/PHPUnit/Integration/expected/test_reportLimiting_rankingQuery__Referrers.getWebsites_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_reportLimiting_rankingQuery__UserCountry.getCity_day.xml (renamed from tests/PHPUnit/Integration/expected/test_reportLimiting_rankingQuery__UserCountry.getCity_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_reportLimiting_rankingQuery__UserCountry.getRegion_day.xml (renamed from tests/PHPUnit/Integration/expected/test_reportLimiting_rankingQuery__UserCountry.getRegion_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_reportLimiting_rankingQuery__UserSettings.getBrowserVersion_day.xml (renamed from tests/PHPUnit/Integration/expected/test_reportLimiting_rankingQuery__UserSettings.getBrowserVersion_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_reportLimiting_rankingQuery__UserSettings.getConfiguration_day.xml (renamed from tests/PHPUnit/Integration/expected/test_reportLimiting_rankingQuery__UserSettings.getConfiguration_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_reportLimiting_rankingQuery__UserSettings.getOS_day.xml (renamed from tests/PHPUnit/Integration/expected/test_reportLimiting_rankingQuery__UserSettings.getOS_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_reportLimiting_rankingQuery__UserSettings.getResolution_day.xml (renamed from tests/PHPUnit/Integration/expected/test_reportLimiting_rankingQuery__UserSettings.getResolution_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_reportLimiting_segment_provider_rankingQueryDisabled__Provider.getProvider_month.xml (renamed from tests/PHPUnit/Integration/expected/test_reportLimiting_segment_provider_rankingQueryDisabled__Provider.getProvider_month.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_trackGoals_allowMultipleConversionsPerVisit__VisitTime.getVisitInformationPerServerTime_day.xml (renamed from tests/PHPUnit/Integration/expected/test_trackGoals_allowMultipleConversionsPerVisit__VisitTime.getVisitInformationPerServerTime_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_trackGoals_allowMultipleConversionsPerVisit__VisitsSummary.get_day.xml (renamed from tests/PHPUnit/Integration/expected/test_trackGoals_allowMultipleConversionsPerVisit__VisitsSummary.get_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_SegmentPageTitleContainsStrangeCharacters__Actions.getPageTitles_day.xml (renamed from tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_SegmentPageTitleContainsStrangeCharacters__Actions.getPageTitles_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_SegmentPageTitleContainsStrangeCharacters__VisitsSummary.get_day.xml (renamed from tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_SegmentPageTitleContainsStrangeCharacters__VisitsSummary.get_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_SegmentPageTitleContains__Actions.getPageTitles_day.xml (renamed from tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_SegmentPageTitleContains__Actions.getPageTitles_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_SegmentPageTitleContains__Actions.getPageUrls_day.xml (renamed from tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_SegmentPageTitleContains__Actions.getPageUrls_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_SegmentPageTitleContains__VisitsSummary.get_day.xml (renamed from tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_SegmentPageTitleContains__VisitsSummary.get_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_SegmentPageTitleExcludes__Actions.getPageTitles_day.xml (renamed from tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_SegmentPageTitleExcludes__Actions.getPageTitles_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_SegmentPageTitleExcludes__Actions.getPageUrls_day.xml (renamed from tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_SegmentPageTitleExcludes__Actions.getPageUrls_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_SegmentPageTitleExcludes__VisitsSummary.get_day.xml (renamed from tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_SegmentPageTitleExcludes__VisitsSummary.get_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_SegmentPageUrlContains__Actions.getPageTitles_day.xml (renamed from tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_SegmentPageUrlContains__Actions.getPageTitles_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_SegmentPageUrlContains__Actions.getPageUrls_day.xml (renamed from tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_SegmentPageUrlContains__Actions.getPageUrls_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_SegmentPageUrlContains__VisitsSummary.get_day.xml (renamed from tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_SegmentPageUrlContains__VisitsSummary.get_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_SegmentPageUrlExcludes__Actions.getPageTitles_day.xml (renamed from tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_SegmentPageUrlExcludes__Actions.getPageTitles_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_SegmentPageUrlExcludes__Actions.getPageUrls_day.xml (renamed from tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_SegmentPageUrlExcludes__Actions.getPageUrls_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_SegmentPageUrlExcludes__VisitsSummary.get_day.xml (renamed from tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_SegmentPageUrlExcludes__VisitsSummary.get_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables__CustomVariables.getCustomVariables_day.xml (renamed from tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables__CustomVariables.getCustomVariables_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables__CustomVariables.getCustomVariables_week.xml (renamed from tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables__CustomVariables.getCustomVariables_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables__VisitsSummary.get_day.xml (renamed from tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables__VisitsSummary.get_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables__VisitsSummary.get_week.xml (renamed from tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables__VisitsSummary.get_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables__subtable__API.getProcessedReport_day.xml (renamed from tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables__subtable__API.getProcessedReport_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_segmentMatchALL_noGoalData__CustomVariables.getCustomVariables_day.xml (renamed from tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_segmentMatchALL_noGoalData__CustomVariables.getCustomVariables_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_segmentMatchALL_noGoalData__CustomVariables.getCustomVariables_week.xml (renamed from tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_segmentMatchALL_noGoalData__CustomVariables.getCustomVariables_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_segmentMatchALL_noGoalData__VisitsSummary.get_day.xml (renamed from tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_segmentMatchALL_noGoalData__VisitsSummary.get_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_segmentMatchALL_noGoalData__VisitsSummary.get_week.xml (renamed from tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_segmentMatchALL_noGoalData__VisitsSummary.get_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_segmentMatchNONE__CustomVariables.getCustomVariables_day.xml (renamed from tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_segmentMatchNONE__CustomVariables.getCustomVariables_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_segmentMatchNONE__CustomVariables.getCustomVariables_week.xml (renamed from tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_segmentMatchNONE__CustomVariables.getCustomVariables_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_segmentMatchNONE__VisitsSummary.get_day.xml (renamed from tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_segmentMatchNONE__VisitsSummary.get_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_segmentMatchNONE__VisitsSummary.get_week.xml (renamed from tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_segmentMatchNONE__VisitsSummary.get_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_segmentMatchVisitorType__CustomVariables.getCustomVariables_day.xml (renamed from tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_segmentMatchVisitorType__CustomVariables.getCustomVariables_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_segmentMatchVisitorType__CustomVariables.getCustomVariables_week.xml (renamed from tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_segmentMatchVisitorType__CustomVariables.getCustomVariables_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_segmentMatchVisitorType__Referrers.getKeywords_day.xml (renamed from tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_segmentMatchVisitorType__Referrers.getKeywords_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_segmentMatchVisitorType__Referrers.getKeywords_week.xml (renamed from tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_segmentMatchVisitorType__Referrers.getKeywords_week.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_segmentMatchVisitorType__VisitsSummary.get_day.xml (renamed from tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_segmentMatchVisitorType__VisitsSummary.get_day.xml)0
-rw-r--r--tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_segmentMatchVisitorType__VisitsSummary.get_week.xml (renamed from tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_segmentMatchVisitorType__VisitsSummary.get_week.xml)0
-rw-r--r--tests/PHPUnit/TestingEnvironment.php6
m---------tests/PHPUnit/UI0
-rw-r--r--tests/PHPUnit/Unit/API/ApiRendererTest.php (renamed from tests/PHPUnit/Core/API/ApiRendererTest.php)0
-rw-r--r--tests/PHPUnit/Unit/API/ResponseBuilderTest.php (renamed from tests/PHPUnit/Core/API/ResponseBuilderTest.php)0
-rw-r--r--tests/PHPUnit/Unit/AssetManager/PluginManagerMock.php (renamed from tests/PHPUnit/Core/AssetManager/PluginManagerMock.php)0
-rw-r--r--tests/PHPUnit/Unit/AssetManager/PluginMock.php (renamed from tests/PHPUnit/Core/AssetManager/PluginMock.php)0
-rw-r--r--tests/PHPUnit/Unit/AssetManager/ThemeMock.php (renamed from tests/PHPUnit/Core/AssetManager/ThemeMock.php)0
-rw-r--r--tests/PHPUnit/Unit/AssetManager/UIAssetCacheBusterMock.php (renamed from tests/PHPUnit/Core/AssetManager/UIAssetCacheBusterMock.php)0
-rw-r--r--tests/PHPUnit/Unit/AssetManager/UIAssetCacheBusterTest.php (renamed from tests/PHPUnit/Core/AssetManager/UIAssetCacheBusterTest.php)0
-rw-r--r--tests/PHPUnit/Unit/AssetManager/UIAssetCatalogSorterTest.php (renamed from tests/PHPUnit/Core/AssetManager/UIAssetCatalogSorterTest.php)0
-rw-r--r--tests/PHPUnit/Unit/AssetManager/configs/merged-assets-disabled.ini.php (renamed from tests/PHPUnit/Core/AssetManager/configs/merged-assets-disabled.ini.php)0
-rw-r--r--tests/PHPUnit/Unit/AssetManager/configs/merged-assets-enabled.ini.php (renamed from tests/PHPUnit/Core/AssetManager/configs/merged-assets-enabled.ini.php)0
-rw-r--r--tests/PHPUnit/Unit/AssetManager/configs/plugins.ini.php (renamed from tests/PHPUnit/Core/AssetManager/configs/plugins.ini.php)0
-rw-r--r--tests/PHPUnit/Unit/AssetManager/scripts/ExpectedMergeResultCore.js (renamed from tests/PHPUnit/Core/AssetManager/scripts/ExpectedMergeResultCore.js)0
-rw-r--r--tests/PHPUnit/Unit/AssetManager/scripts/ExpectedMergeResultNonCore.js (renamed from tests/PHPUnit/Core/AssetManager/scripts/ExpectedMergeResultNonCore.js)0
-rw-r--r--tests/PHPUnit/Unit/AssetManager/scripts/SimpleAlert.js (renamed from tests/PHPUnit/Core/AssetManager/scripts/SimpleAlert.js)0
-rw-r--r--tests/PHPUnit/Unit/AssetManager/scripts/SimpleArray.js (renamed from tests/PHPUnit/Core/AssetManager/scripts/SimpleArray.js)0
-rw-r--r--tests/PHPUnit/Unit/AssetManager/scripts/SimpleComments.js (renamed from tests/PHPUnit/Core/AssetManager/scripts/SimpleComments.js)0
-rw-r--r--tests/PHPUnit/Unit/AssetManager/scripts/SimpleObject.js (renamed from tests/PHPUnit/Core/AssetManager/scripts/SimpleObject.js)0
-rw-r--r--tests/PHPUnit/Unit/AssetManager/stylesheets/CssWithURLs.css12
-rw-r--r--tests/PHPUnit/Unit/AssetManager/stylesheets/ExpectedMergeResult.css30
-rw-r--r--tests/PHPUnit/Unit/AssetManager/stylesheets/ImportedLess.less (renamed from tests/PHPUnit/Core/AssetManager/stylesheets/ImportedLess.less)0
-rw-r--r--tests/PHPUnit/Unit/AssetManager/stylesheets/SimpleBody.css (renamed from tests/PHPUnit/Core/AssetManager/stylesheets/SimpleBody.css)0
-rw-r--r--tests/PHPUnit/Unit/AssetManager/stylesheets/SimpleLess.less (renamed from tests/PHPUnit/Core/AssetManager/stylesheets/SimpleLess.less)0
-rw-r--r--tests/PHPUnit/Unit/AssetManager/stylesheets/images/test-image.png (renamed from tests/PHPUnit/Core/AssetManager/stylesheets/images/test-image.png)bin290 -> 290 bytes
-rw-r--r--tests/PHPUnit/Unit/AssetManagerTest.php721
-rw-r--r--tests/PHPUnit/Unit/CliMulti/OutputTest.php (renamed from tests/PHPUnit/Core/CliMulti/OutputTest.php)0
-rw-r--r--tests/PHPUnit/Unit/CliMulti/ProcessTest.php (renamed from tests/PHPUnit/Core/CliMulti/ProcessTest.php)0
-rw-r--r--tests/PHPUnit/Unit/Columns/DimensionTest.php (renamed from tests/PHPUnit/Core/Columns/DimensionTest.php)0
-rw-r--r--tests/PHPUnit/Unit/CommonTest.php (renamed from tests/PHPUnit/Core/CommonTest.php)0
-rw-r--r--tests/PHPUnit/Unit/ConfigTest.php (renamed from tests/PHPUnit/Core/ConfigTest.php)0
-rw-r--r--tests/PHPUnit/Unit/CookieTest.php (renamed from tests/PHPUnit/Core/CookieTest.php)0
-rw-r--r--tests/PHPUnit/Unit/DataTable/Filter/AddSummaryRowTest.php (renamed from tests/PHPUnit/Core/DataTable/Filter/AddSummaryRowTest.php)0
-rw-r--r--tests/PHPUnit/Unit/DataTable/Filter/ExcludeLowPopulationTest.php (renamed from tests/PHPUnit/Core/DataTable/Filter/ExcludeLowPopulationTest.php)0
-rw-r--r--tests/PHPUnit/Unit/DataTable/Filter/LimitTest.php (renamed from tests/PHPUnit/Core/DataTable/Filter/LimitTest.php)0
-rw-r--r--tests/PHPUnit/Unit/DataTable/Filter/PatternRecursiveTest.php (renamed from tests/PHPUnit/Core/DataTable/Filter/PatternRecursiveTest.php)0
-rw-r--r--tests/PHPUnit/Unit/DataTable/Filter/PatternTest.php (renamed from tests/PHPUnit/Core/DataTable/Filter/PatternTest.php)0
-rw-r--r--tests/PHPUnit/Unit/DataTable/Filter/PivotByDimensionTest.php (renamed from tests/PHPUnit/Core/DataTable/Filter/PivotByDimensionTest.php)0
-rw-r--r--tests/PHPUnit/Unit/DataTable/Filter/RangeCheckTest.php (renamed from tests/PHPUnit/Core/DataTable/Filter/RangeCheckTest.php)0
-rw-r--r--tests/PHPUnit/Unit/DataTable/Filter/SortTest.php (renamed from tests/PHPUnit/Core/DataTable/Filter/SortTest.php)0
-rw-r--r--tests/PHPUnit/Unit/DataTable/Filter/TruncateTest.php (renamed from tests/PHPUnit/Core/DataTable/Filter/TruncateTest.php)0
-rw-r--r--tests/PHPUnit/Unit/DataTable/MapTest.php (renamed from tests/PHPUnit/Core/DataTable/MapTest.php)0
-rw-r--r--tests/PHPUnit/Unit/DataTable/Renderer/CSVTest.php (renamed from tests/PHPUnit/Core/DataTable/Renderer/CSVTest.php)0
-rw-r--r--tests/PHPUnit/Unit/DataTable/Renderer/ConsoleTest.php (renamed from tests/PHPUnit/Core/DataTable/Renderer/ConsoleTest.php)0
-rw-r--r--tests/PHPUnit/Unit/DataTable/Renderer/JSONTest.php (renamed from tests/PHPUnit/Core/DataTable/Renderer/JSONTest.php)0
-rw-r--r--tests/PHPUnit/Unit/DataTable/Renderer/PHPTest.php (renamed from tests/PHPUnit/Core/DataTable/Renderer/PHPTest.php)0
-rw-r--r--tests/PHPUnit/Unit/DataTable/Renderer/XMLTest.php (renamed from tests/PHPUnit/Core/DataTable/Renderer/XMLTest.php)0
-rw-r--r--tests/PHPUnit/Unit/DataTable/RowTest.php (renamed from tests/PHPUnit/Core/DataTable/RowTest.php)0
-rw-r--r--tests/PHPUnit/Unit/DataTableTest.php (renamed from tests/PHPUnit/Core/DataTableTest.php)0
-rw-r--r--tests/PHPUnit/Unit/DateTest.php (renamed from tests/PHPUnit/Core/DateTest.php)0
-rw-r--r--tests/PHPUnit/Unit/DependencyTest.php (renamed from tests/PHPUnit/Core/DependencyTest.php)0
-rw-r--r--tests/PHPUnit/Unit/DeprecatedMethodsTest.php97
-rw-r--r--tests/PHPUnit/Unit/FactoryTest.php (renamed from tests/PHPUnit/Core/FactoryTest.php)0
-rw-r--r--tests/PHPUnit/Unit/FilesystemTest.php (renamed from tests/PHPUnit/Core/FilesystemTest.php)0
-rw-r--r--tests/PHPUnit/Unit/IPTest.php (renamed from tests/PHPUnit/Core/IPTest.php)0
-rw-r--r--tests/PHPUnit/Unit/Menu/MenuReportingTest.php (renamed from tests/PHPUnit/Core/Menu/MenuReportingTest.php)0
-rw-r--r--tests/PHPUnit/Unit/MetricsTest.php (renamed from tests/PHPUnit/Core/MetricsTest.php)0
-rw-r--r--tests/PHPUnit/Unit/NonceTest.php (renamed from tests/PHPUnit/Core/NonceTest.php)0
-rw-r--r--tests/PHPUnit/Unit/Period/DayTest.php (renamed from tests/PHPUnit/Core/Period/DayTest.php)0
-rw-r--r--tests/PHPUnit/Unit/Period/MonthTest.php (renamed from tests/PHPUnit/Core/Period/MonthTest.php)0
-rw-r--r--tests/PHPUnit/Unit/Period/RangeTest.php (renamed from tests/PHPUnit/Core/Period/RangeTest.php)0
-rw-r--r--tests/PHPUnit/Unit/Period/WeekTest.php (renamed from tests/PHPUnit/Core/Period/WeekTest.php)0
-rw-r--r--tests/PHPUnit/Unit/Period/YearTest.php (renamed from tests/PHPUnit/Core/Period/YearTest.php)0
-rw-r--r--tests/PHPUnit/Unit/PeriodTest.php (renamed from tests/PHPUnit/Core/PeriodTest.php)0
-rw-r--r--tests/PHPUnit/Unit/Plugin/ComponentFactoryTest.php (renamed from tests/PHPUnit/Core/Plugin/ComponentFactoryTest.php)0
-rw-r--r--tests/PHPUnit/Unit/Plugin/Dimension/ActionDimensionTest.php (renamed from tests/PHPUnit/Core/Plugin/Dimension/ActionDimensionTest.php)0
-rw-r--r--tests/PHPUnit/Unit/Plugin/Dimension/ConversionDimensionTest.php (renamed from tests/PHPUnit/Core/Plugin/Dimension/ConversionDimensionTest.php)0
-rw-r--r--tests/PHPUnit/Unit/Plugin/Dimension/VisitDimensionTest.php (renamed from tests/PHPUnit/Core/Plugin/Dimension/VisitDimensionTest.php)0
-rw-r--r--tests/PHPUnit/Unit/RankingQueryTest.php (renamed from tests/PHPUnit/Core/RankingQueryTest.php)0
-rw-r--r--tests/PHPUnit/Unit/RegistryTest.php (renamed from tests/PHPUnit/Core/RegistryTest.php)0
-rw-r--r--tests/PHPUnit/Unit/ScheduledTaskTest.php (renamed from tests/PHPUnit/Core/ScheduledTaskTest.php)0
-rw-r--r--tests/PHPUnit/Unit/ScheduledTime/DailyTest.php (renamed from tests/PHPUnit/Core/ScheduledTime/DailyTest.php)0
-rw-r--r--tests/PHPUnit/Unit/ScheduledTime/HourlyTest.php (renamed from tests/PHPUnit/Core/ScheduledTime/HourlyTest.php)0
-rw-r--r--tests/PHPUnit/Unit/ScheduledTime/MonthlyTest.php (renamed from tests/PHPUnit/Core/ScheduledTime/MonthlyTest.php)0
-rw-r--r--tests/PHPUnit/Unit/ScheduledTime/WeeklyTest.php (renamed from tests/PHPUnit/Core/ScheduledTime/WeeklyTest.php)0
-rw-r--r--tests/PHPUnit/Unit/SegmentExpressionTest.php (renamed from tests/PHPUnit/Core/SegmentExpressionTest.php)0
-rw-r--r--tests/PHPUnit/Unit/TaskSchedulerTest.php (renamed from tests/PHPUnit/Core/TaskSchedulerTest.php)0
-rw-r--r--tests/PHPUnit/Unit/Translate/Filter/ByBaseTranslationsTest.php (renamed from tests/PHPUnit/Core/Translate/Filter/ByBaseTranslationsTest.php)0
-rw-r--r--tests/PHPUnit/Unit/Translate/Filter/ByParameterCountTest.php (renamed from tests/PHPUnit/Core/Translate/Filter/ByParameterCountTest.php)0
-rw-r--r--tests/PHPUnit/Unit/Translate/Filter/EmptyTranslationsTest.php (renamed from tests/PHPUnit/Core/Translate/Filter/EmptyTranslationsTest.php)0
-rw-r--r--tests/PHPUnit/Unit/Translate/Filter/EncodedEntitiesTest.php (renamed from tests/PHPUnit/Core/Translate/Filter/EncodedEntitiesTest.php)0
-rw-r--r--tests/PHPUnit/Unit/Translate/Filter/UnnecassaryWhitespacesTest.php (renamed from tests/PHPUnit/Core/Translate/Filter/UnnecassaryWhitespacesTest.php)0
-rw-r--r--tests/PHPUnit/Unit/Translate/Validate/CoreTranslationsTest.php (renamed from tests/PHPUnit/Core/Translate/Validate/CoreTranslationsTest.php)0
-rw-r--r--tests/PHPUnit/Unit/Translate/Validate/NoScriptsTest.php (renamed from tests/PHPUnit/Core/Translate/Validate/NoScriptsTest.php)0
-rw-r--r--tests/PHPUnit/Unit/Translate/WriterTest.php (renamed from tests/PHPUnit/Core/Translate/WriterTest.php)0
-rw-r--r--tests/PHPUnit/Unit/TranslateTest.php (renamed from tests/PHPUnit/Core/TranslateTest.php)0
-rw-r--r--tests/PHPUnit/Unit/UrlHelperTest.php (renamed from tests/PHPUnit/Core/UrlHelperTest.php)0
-rw-r--r--tests/PHPUnit/Unit/UrlTest.php (renamed from tests/PHPUnit/Core/UrlTest.php)0
-rw-r--r--tests/PHPUnit/bootstrap.php7
-rw-r--r--tests/PHPUnit/phpunit.xml.dist40
-rw-r--r--tests/PHPUnit/proxy/index.php2
-rw-r--r--tests/README.md63
-rw-r--r--tests/README.screenshots.md2
-rw-r--r--tests/README.troubleshooting.md6
-rw-r--r--tests/lib/screenshot-testing/support/test-environment.js2
-rwxr-xr-xtests/travis/initiate_ui_tests.sh4
-rwxr-xr-xtests/travis/prepare.sh2
-rw-r--r--tests/travis/travis-helper.sh1
-rwxr-xr-xtests/travis/travis.sh18
-rwxr-xr-xtests/travis/upload_artifacts.sh4
1822 files changed, 26186 insertions, 26332 deletions
diff --git a/.gitignore b/.gitignore
index 8f00ee1d60..e1be781d50 100644
--- a/.gitignore
+++ b/.gitignore
@@ -21,6 +21,7 @@ php_errors.log
/plugins/*.zip
/plugins/ImageGraph/fonts/unifont.ttf
/plugins/ImageGraph/fonts/unifont.ttf.zip
+/plugins/*/tests/System/processed
/robots.txt
/tmp/
/vendor/
@@ -36,7 +37,7 @@ php_errors.log
/tests/javascript/unittest2.dbf
/tests/lib/geoip-files/*.dat*
/tests/lib/xhprof*
-/tests/PHPUnit/Integration/processed/
+/tests/PHPUnit/System/processed/
/tests/PHPUnit/phpunit.xml
/tests/results/
/.htaccess
diff --git a/.travis.yml b/.travis.yml
index b313620187..8df1bf946a 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -21,13 +21,13 @@ php:
env:
matrix:
# PDO Mysql
+ - TEST_SUITE=SystemTests MYSQL_ADAPTER=PDO_MYSQL
- TEST_SUITE=IntegrationTests MYSQL_ADAPTER=PDO_MYSQL
- - TEST_SUITE=PluginTests MYSQL_ADAPTER=PDO_MYSQL
- - TEST_SUITE=CoreTests MYSQL_ADAPTER=PDO_MYSQL
+ - TEST_SUITE=UnitTests MYSQL_ADAPTER=PDO_MYSQL
# Mysqli
+ - TEST_SUITE=SystemTests MYSQL_ADAPTER=MYSQLI
- TEST_SUITE=IntegrationTests MYSQL_ADAPTER=MYSQLI
- - TEST_SUITE=PluginTests MYSQL_ADAPTER=MYSQLI
- - TEST_SUITE=CoreTests MYSQL_ADAPTER=MYSQLI
+ - TEST_SUITE=UnitTests MYSQL_ADAPTER=MYSQLI
# Javascript tests
- TEST_SUITE=JavascriptTests MYSQL_ADAPTER=PDO_MYSQL
- TEST_SUITE=AngularJSTests MYSQL_ADAPTER=PDO_MYSQL
@@ -43,19 +43,19 @@ matrix:
- php: hhvm
- php: 5.6
- php: 5.4
- env: MYSQL_ADAPTER=PDO_MYSQL COVERAGE=Core
- - php: 5.4
- env: MYSQL_ADAPTER=PDO_MYSQL COVERAGE=Plugins
+ env: MYSQL_ADAPTER=PDO_MYSQL COVERAGE=Sytem
- php: 5.4
env: MYSQL_ADAPTER=PDO_MYSQL COVERAGE=Integration
+ - php: 5.4
+ env: MYSQL_ADAPTER=PDO_MYSQL COVERAGE=Unit
include:
# Code Coverage
- php: 5.4
- env: MYSQL_ADAPTER=PDO_MYSQL COVERAGE=Core
- - php: 5.4
- env: MYSQL_ADAPTER=PDO_MYSQL COVERAGE=Plugins
+ env: MYSQL_ADAPTER=PDO_MYSQL COVERAGE=Sytem
- php: 5.4
env: MYSQL_ADAPTER=PDO_MYSQL COVERAGE=Integration
+ - php: 5.4
+ env: MYSQL_ADAPTER=PDO_MYSQL COVERAGE=Unit
exclude:
# Javascript tests need to run only on one PHP version
- php: 5.4
@@ -77,29 +77,29 @@ matrix:
env: TEST_SUITE=AngularJSTests MYSQL_ADAPTER=PDO_MYSQL
# Only run Mysqli tests on PHP 5.4
- php: 5.3.3
- env: TEST_SUITE=IntegrationTests MYSQL_ADAPTER=MYSQLI
+ env: TEST_SUITE=SystemTests MYSQL_ADAPTER=MYSQLI
- php: 5.3.3
- env: TEST_SUITE=PluginTests MYSQL_ADAPTER=MYSQLI
+ env: TEST_SUITE=IntegrationTests MYSQL_ADAPTER=MYSQLI
- php: 5.3.3
- env: TEST_SUITE=CoreTests MYSQL_ADAPTER=MYSQLI
+ env: TEST_SUITE=UnitTests MYSQL_ADAPTER=MYSQLI
- php: 5.5
- env: TEST_SUITE=IntegrationTests MYSQL_ADAPTER=MYSQLI
+ env: TEST_SUITE=SystemTests MYSQL_ADAPTER=MYSQLI
- php: 5.5
- env: TEST_SUITE=PluginTests MYSQL_ADAPTER=MYSQLI
+ env: TEST_SUITE=IntegrationTests MYSQL_ADAPTER=MYSQLI
- php: 5.5
- env: TEST_SUITE=CoreTests MYSQL_ADAPTER=MYSQLI
+ env: TEST_SUITE=UnitTests MYSQL_ADAPTER=MYSQLI
- php: 5.6
- env: TEST_SUITE=IntegrationTests MYSQL_ADAPTER=MYSQLI
+ env: TEST_SUITE=SystemTests MYSQL_ADAPTER=MYSQLI
- php: 5.6
- env: TEST_SUITE=PluginTests MYSQL_ADAPTER=MYSQLI
+ env: TEST_SUITE=IntegrationTests MYSQL_ADAPTER=MYSQLI
- php: 5.6
- env: TEST_SUITE=CoreTests MYSQL_ADAPTER=MYSQLI
+ env: TEST_SUITE=UnitTests MYSQL_ADAPTER=MYSQLI
- php: hhvm
- env: TEST_SUITE=IntegrationTests MYSQL_ADAPTER=MYSQLI
+ env: TEST_SUITE=SystemTests MYSQL_ADAPTER=MYSQLI
- php: hhvm
- env: TEST_SUITE=PluginTests MYSQL_ADAPTER=MYSQLI
+ env: TEST_SUITE=IntegrationTests MYSQL_ADAPTER=MYSQLI
- php: hhvm
- env: TEST_SUITE=CoreTests MYSQL_ADAPTER=MYSQLI
+ env: TEST_SUITE=UnitTests MYSQL_ADAPTER=MYSQLI
script: $PIWIK_ROOT_DIR/tests/travis/travis.sh
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 93a02516f4..1f1561a585 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,12 +4,6 @@ This is a changelog for Piwik platform developers. All changes for our HTTP API'
## Piwik 2.8.0
-### New API Features
-* The pivotBy and related query parameters can be used to pivot reports by another dimension. Read more about the new query parameters [here](http://developer.piwik.org/api-reference/reporting-api#optional-api-parameters).
-
-### Library updates
-* Updated AngularJS from 1.2.13 to 1.2.25
-
### Breaking Changes
* The Auth interface has been modified, existing Auth implementations will have to be modified. Changes include:
* The initSession method has been moved. Since this behavior must be executed for every Auth implementation, it has been put into a new class: SessionInitializer.
@@ -23,7 +17,17 @@ This is a changelog for Piwik platform developers. All changes for our HTTP API'
* `Piwik\Unzip\UncompressInterface` has been moved and renamed to `Piwik\Decompress\DecompressInterface` (inside the new repository).
### Deprecations
-* The Piwik::setUserHasSuperUserAccess method is deprecated, instead use Access::doAsSuperUser. This method will ensure that super user access is properly rescinded after the callback finishes.
+* The `Piwik::setUserHasSuperUserAccess` method is deprecated, instead use Access::doAsSuperUser. This method will ensure that super user access is properly rescinded after the callback finishes.
+* The class is `\IntegrationTestCase` deprecated and will be removed from February 6th 2015. Use `\Piwik\Tests\Impl\SystemTestCase` instead.
+* The class is `\DatabaseTestCase` deprecated and will be removed from February 6th 2015. Use `\Piwik\Tests\Impl\IntegrationTestCase` instead.
+* The class is `\Piwik\Tests\Fixture` deprecated and will be removed from February 6th 2015. Use `\Piwik\Tests\Impl\Fixture` instead.
+* The class is `\Piwik\Tests\OverrideLogin` deprecated and will be removed from February 6ths 2015. Use `\Piwik\Tests\Impl\OverrideLogin` instead.
+
+### New API Features
+* The pivotBy and related query parameters can be used to pivot reports by another dimension. Read more about the new query parameters [here](http://developer.piwik.org/api-reference/reporting-api#optional-api-parameters).
+
+### Library updates
+* Updated AngularJS from 1.2.13 to 1.2.25
### New commands
* `generate:angular-directive` Let's you easily generate a template for a new angular directive for any plugin.
diff --git a/README.md b/README.md
index d1760329f0..5a0b7b55fe 100644
--- a/README.md
+++ b/README.md
@@ -96,7 +96,7 @@ We are grateful if you can share the Job Description with your friends and colle
## Code Status
-The Piwik project uses an ever-expanding comprehensive set of thousands of unit tests and dozens of integration [tests](https://github.com/piwik/piwik/tree/master/tests),
+The Piwik project uses an ever-expanding comprehensive set of thousands of unit and integration tests and dozens of system [tests](https://github.com/piwik/piwik/tree/master/tests),
running on the hosted distributed continuous integration platform Travis-CI.
Build status (master branch) [![Build Status](https://travis-ci.org/piwik/piwik.png?branch=master)](https://travis-ci.org/piwik/piwik) - Screenshot tests Build [![Build Status](https://travis-ci.org/piwik/piwik-ui-tests.png?branch=master)](https://travis-ci.org/piwik/piwik-ui-tests)
diff --git a/core/API/DocumentationGenerator.php b/core/API/DocumentationGenerator.php
index 63ae943433..f9cc779982 100644
--- a/core/API/DocumentationGenerator.php
+++ b/core/API/DocumentationGenerator.php
@@ -155,8 +155,8 @@ class DocumentationGenerator
$aParameters = Proxy::getInstance()->getParametersList($class, $methodName);
// Kindly force some known generic parameters to appear in the final list
// the parameter 'format' can be set to all API methods (used in tests)
- // the parameter 'hideIdSubDatable' is used for integration tests only
- // the parameter 'serialize' sets php outputs human readable, used in integration tests and debug
+ // the parameter 'hideIdSubDatable' is used for system tests only
+ // the parameter 'serialize' sets php outputs human readable, used in system tests and debug
// the parameter 'language' sets the language for the response (eg. country names)
// the parameter 'flat' reduces a hierarchical table to a single level by concatenating labels
// the parameter 'include_aggregate_rows' can be set to include inner nodes in flat reports
@@ -169,9 +169,9 @@ class DocumentationGenerator
$aParameters['label'] = false;
$aParameters['flat'] = false;
$aParameters['include_aggregate_rows'] = false;
- $aParameters['filter_limit'] = false; //@review without adding this, I can not set filter_limit in $otherRequestParameters integration tests
- $aParameters['filter_sort_column'] = false; //@review without adding this, I can not set filter_sort_column in $otherRequestParameters integration tests
- $aParameters['filter_sort_order'] = false; //@review without adding this, I can not set filter_sort_order in $otherRequestParameters integration tests
+ $aParameters['filter_limit'] = false; //@review without adding this, I can not set filter_limit in $otherRequestParameters system tests
+ $aParameters['filter_sort_column'] = false; //@review without adding this, I can not set filter_sort_column in $otherRequestParameters system tests
+ $aParameters['filter_sort_order'] = false; //@review without adding this, I can not set filter_sort_order in $otherRequestParameters system tests
$aParameters['filter_truncate'] = false;
$aParameters['hideColumns'] = false;
$aParameters['showColumns'] = false;
diff --git a/core/Cache/StaticCache.php b/core/Cache/StaticCache.php
index b09f49ae0b..0c102e18d3 100644
--- a/core/Cache/StaticCache.php
+++ b/core/Cache/StaticCache.php
@@ -70,6 +70,15 @@ class StaticCache
}
/**
+ * Reset the stored content of the current cache key.
+ * @ignore
+ */
+ public static function clearAll()
+ {
+ self::$staticCache = array();
+ }
+
+ /**
* Set (overwrite) any content related to the current set cache key.
* @param $content
*/
diff --git a/core/Option.php b/core/Option.php
index e10aed631c..d79df967ed 100644
--- a/core/Option.php
+++ b/core/Option.php
@@ -139,6 +139,7 @@ class Option
if (self::$instance == null) {
self::$instance = new self;
}
+
return self::$instance;
}
@@ -173,6 +174,7 @@ class Option
if (isset($this->all[$name])) {
return $this->all[$name];
}
+
$value = Db::fetchOne('SELECT option_value FROM `' . Common::prefixTable('option') . '` ' .
'WHERE option_name = ?', $name);
@@ -187,10 +189,14 @@ class Option
protected function setValue($name, $value, $autoLoad = 0)
{
$autoLoad = (int)$autoLoad;
- Db::query('INSERT INTO `' . Common::prefixTable('option') . '` (option_name, option_value, autoload) ' .
- ' VALUES (?, ?, ?) ' .
- ' ON DUPLICATE KEY UPDATE option_value = ?',
- array($name, $value, $autoLoad, $value));
+
+ $sql = 'INSERT INTO `' . Common::prefixTable('option') . '` (option_name, option_value, autoload) ' .
+ ' VALUES (?, ?, ?) ' .
+ ' ON DUPLICATE KEY UPDATE option_value = ?';
+ $bind = array($name, $value, $autoLoad, $value);
+
+ Db::query($sql, $bind);
+
$this->all[$name] = $value;
}
@@ -228,11 +234,13 @@ class Option
{
$sql = 'SELECT option_name, option_value FROM `' . Common::prefixTable('option') . '` WHERE option_name LIKE ?';
$bind = array($name);
+ $rows = Db::fetchAll($sql, $bind);
$result = array();
- foreach (Db::fetchAll($sql, $bind) as $row) {
+ foreach ($rows as $row) {
$result[$row['option_name']] = $row['option_value'];
}
+
return $result;
}
@@ -247,8 +255,10 @@ class Option
return;
}
- $all = Db::fetchAll('SELECT option_value, option_name FROM `' . Common::prefixTable('option') . '`
- WHERE autoload = 1');
+ $table = Common::prefixTable('option');
+ $sql = 'SELECT option_value, option_name FROM `' . $table . '` WHERE autoload = 1';
+ $all = Db::fetchAll($sql);
+
foreach ($all as $option) {
$this->all[$option['option_name']] = $option['option_value'];
}
diff --git a/core/Tracker.php b/core/Tracker.php
index bd72e04920..f3c8fa55d7 100644
--- a/core/Tracker.php
+++ b/core/Tracker.php
@@ -794,9 +794,11 @@ class Tracker
// Avoid leaking the username/db name when access denied
if ($e->getCode() == 1044 || $e->getCode() == 42000) {
return "Error while connecting to the Piwik database - please check your credentials in config/config.ini.php file";
- } else {
- return $e->getMessage();
}
+ if(Common::isPhpCliMode()) {
+ return $e->getMessage() . "\n" . $e->getTraceAsString();
+ }
+ return $e->getMessage();
}
/**
diff --git a/core/Tracker/Model.php b/core/Tracker/Model.php
index 090cd8be59..72ff75b950 100644
--- a/core/Tracker/Model.php
+++ b/core/Tracker/Model.php
@@ -377,7 +377,7 @@ class Model
private function getDb()
{
- return Tracker::getDatabase();
+ return \Piwik\Db::get();
}
}
diff --git a/js/piwik.js b/js/piwik.js
index 8e6783d246..74f63f45c0 100644
--- a/js/piwik.js
+++ b/js/piwik.js
@@ -2646,7 +2646,7 @@ if (typeof Piwik !== 'object') {
*/
function loadReferrerAttributionCookie() {
// NOTE: if the format of the cookie changes,
- // we must also update JS tests, PHP tracker, Integration tests,
+ // we must also update JS tests, PHP tracker, System tests,
// and notify other tracking clients (eg. Java) of the changes
var cookie = getCookie(getCookieName('ref'));
diff --git a/plugins/API/tests/ConsoleRendererTest.php b/plugins/API/tests/ConsoleRendererTest.php
deleted file mode 100644
index 26357935ff..0000000000
--- a/plugins/API/tests/ConsoleRendererTest.php
+++ /dev/null
@@ -1,121 +0,0 @@
-<?php
-/**
- * Piwik - free/libre analytics platform
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- */
-
-namespace Piwik\Plugins\API\tests;
-
-use Piwik\DataTable;
-use Piwik\Plugins\API\Renderer\Console;
-
-/**
- * @group Plugin
- * @group API
- */
-class ConsoleRendererTest extends \PHPUnit_Framework_TestCase
-{
- /**
- * @var Console
- */
- private $builder;
-
- public function setUp()
- {
- $this->builder = $this->makeBuilder(array());
- DataTable\Manager::getInstance()->deleteAll();
- }
-
- public function test_renderSuccess_shouldAlwaysReturnTrueAndIgnoreMessage()
- {
- $response = $this->builder->renderSuccess('ok');
-
- $this->assertEquals('Success:ok', $response);
- }
-
- public function test_renderException_shouldThrowTheException()
- {
- $response = $this->builder->renderException('This message should be used', new \BadMethodCallException('The other message'));
-
- $this->assertEquals('Error: This message should be used', $response);
- }
-
- public function test_renderScalar_shouldReturnTheSameValue()
- {
- $response = $this->builder->renderScalar(true);
- $this->assertSame("- 1 ['0' => 1] [] [idsubtable = ]<br />
-", $response);
-
- $response = $this->builder->renderScalar(5);
- $this->assertSame("- 1 ['0' => 5] [] [idsubtable = ]<br />
-", $response);
-
- $response = $this->builder->renderScalar('string');
- $this->assertSame("- 1 ['0' => 'string'] [] [idsubtable = ]<br />
-", $response);
- }
-
- public function test_renderObject_shouldReturAnError()
- {
- $response = $this->builder->renderObject(new \stdClass());
-
- $this->assertEquals('Error: The API cannot handle this data structure.', $response);
- }
-
- public function test_renderResource_shouldReturAnError()
- {
- $response = $this->builder->renderResource(new \stdClass());
-
- $this->assertEquals('Error: The API cannot handle this data structure.', $response);
- }
-
- public function test_renderDataTable_shouldReturnResult()
- {
- $dataTable = new DataTable();
- $dataTable->addRowFromSimpleArray(array('nb_visits' => 5, 'nb_random' => 10));
-
- $response = $this->builder->renderDataTable($dataTable);
-
- $this->assertSame("- 1 ['nb_visits' => 5, 'nb_random' => 10] [] [idsubtable = ]<br />
-", $response);
- }
-
- public function test_renderArray_ShouldReturnConsoleResult()
- {
- $input = array(1, 2, 5, 'string', 10);
-
- $response = $this->builder->renderArray($input);
-
- $this->assertSame("- 1 ['0' => 1] [] [idsubtable = ]<br />
-- 2 ['0' => 2] [] [idsubtable = ]<br />
-- 3 ['0' => 5] [] [idsubtable = ]<br />
-- 4 ['0' => 'string'] [] [idsubtable = ]<br />
-- 5 ['0' => 10] [] [idsubtable = ]<br />
-", $response);
- }
-
- /**
- * @expectedException \Exception
- * @expectedExceptionMessage Data structure returned is not convertible in the requested format
- */
- public function test_renderArray_ShouldConvertMultiDimensionalAssociativeArrayToJson()
- {
- $input = array(
- "firstElement" => "isFirst",
- "secondElement" => array(
- "firstElement" => "isFirst",
- "secondElement" => "isSecond",
- ),
- "thirdElement" => "isThird");
-
- $actual = $this->builder->renderArray($input);
- $this->assertSame($input, $actual);
- }
-
- private function makeBuilder($request)
- {
- return new Console($request);
- }
-}
diff --git a/plugins/API/tests/CsvRendererTest.php b/plugins/API/tests/CsvRendererTest.php
deleted file mode 100644
index 526d2f3728..0000000000
--- a/plugins/API/tests/CsvRendererTest.php
+++ /dev/null
@@ -1,283 +0,0 @@
-<?php
-/**
- * Piwik - free/libre analytics platform
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- */
-
-namespace Piwik\Plugins\API\tests;
-
-use Piwik\DataTable;
-use Piwik\Plugins\API\Renderer\Csv;
-
-/**
- * @group Plugin
- * @group API
- */
-class CsvRendererTest extends \PHPUnit_Framework_TestCase
-{
- /**
- * @var Csv
- */
- private $builder;
-
- public function setUp()
- {
- $this->builder = $this->makeBuilder(array('method' => 'MultiSites_getAll', 'convertToUnicode' => 0));
- }
-
- public function test_renderSuccess_shouldIncludeMessage()
- {
- $response = $this->builder->renderSuccess('ok');
-
- $this->assertEquals("message
-ok", $response);
- }
-
- public function test_renderException_shouldIncludeTheMessageAndNotExceptionMessage()
- {
- $response = $this->builder->renderException("The error message", new \Exception('The other message'));
-
- $this->assertEquals('Error: The error message', $response);
- }
-
- public function test_renderException_shouldRespectNewlines()
- {
- $response = $this->builder->renderException("The\nerror\nmessage", new \Exception('The other message'));
-
- $this->assertEquals('Error: The
-error
-message', $response);
- }
-
- public function test_renderObject_shouldReturAnError()
- {
- $response = $this->builder->renderObject(new \stdClass());
-
- $this->assertEquals('Error: The API cannot handle this data structure.', $response);
- }
-
- public function test_renderResource_shouldReturAnError()
- {
- $response = $this->builder->renderResource(new \stdClass());
-
- $this->assertEquals('Error: The API cannot handle this data structure.', $response);
- }
-
- public function test_renderScalar_shouldConvertToUnicodeByDefault()
- {
- $builder = $this->makeBuilder(array('method' => 'MultiSites_getAll'));
- $response = $builder->renderScalar(true);
-
- $this->assertStringStartsWith(chr(255) . chr(254), $response);
- }
-
- public function test_renderScalar_shouldReturnABooleanAsIntegerWrappedInTable()
- {
- $response = $this->builder->renderScalar(true);
-
- $this->assertEquals('value
-1', $response);
- }
-
- public function test_renderScalar_shouldReturnAnIntegerWrappedInTable()
- {
- $response = $this->builder->renderScalar(5);
-
- $this->assertEquals('value
-5', $response);
- }
-
- public function test_renderScalar_shouldReturnAStringWrappedInValue()
- {
- $response = $this->builder->renderScalar('The Output');
-
- $this->assertEquals('value
-The Output', $response);
- }
-
- public function test_renderScalar_shouldNotRemoveLineBreaks()
- {
- $response = $this->builder->renderScalar('The\nOutput');
-
- $this->assertEquals('value
-The\nOutput', $response);
- }
-
- public function test_renderDataTable_shouldRenderABasicDataTable()
- {
- $dataTable = new DataTable();
- $dataTable->addRowFromSimpleArray(array('nb_visits' => 5, 'nb_random' => 10));
-
- $response = $this->builder->renderDataTable($dataTable);
-
- $this->assertEquals('nb_visits,nb_random
-5,10', $response);
- }
-
- public function test_renderDataTable_shouldNotRenderSubtables_AsItIsNotSupportedYet()
- {
- $subtable = new DataTable();
- $subtable->addRowFromSimpleArray(array('nb_visits' => 2, 'nb_random' => 6));
-
- $dataTable = new DataTable();
- $dataTable->addRowFromSimpleArray(array('nb_visits' => 5, 'nb_random' => 10));
- $dataTable->getFirstRow()->setSubtable($subtable);
-
- $response = $this->builder->renderDataTable($dataTable);
-
- $this->assertEquals('nb_visits,nb_random
-5,10', $response);
- }
-
- public function test_renderDataTable_shouldRenderDataTableMaps()
- {
- $map = new DataTable\Map();
-
- $dataTable = new DataTable();
- $dataTable->addRowFromSimpleArray(array('nb_visits' => 5, 'nb_random' => 10));
-
- $dataTable2 = new DataTable();
- $dataTable2->addRowFromSimpleArray(array('nb_visits' => 3, 'nb_random' => 6));
-
- $map->addTable($dataTable, 'table1');
- $map->addTable($dataTable2, 'table2');
-
- $response = $this->builder->renderDataTable($map);
-
- $this->assertEquals('defaultKeyName,nb_visits,nb_random
-table1,5,10
-table2,3,6', $response);
- }
-
- public function test_renderDataTable_shouldRenderSimpleDataTable()
- {
- $dataTable = new DataTable\Simple();
- $dataTable->addRowsFromArray(array('nb_visits' => 3, 'nb_random' => 6));
-
- $response = $this->builder->renderDataTable($dataTable);
-
- $this->assertEquals('nb_visits,nb_random
-3,6', $response);
- }
-
- public function test_renderArray_ShouldConvertSimpleArrayToJson()
- {
- $input = array(1, 2, 5, 'string', 10);
-
- $response = $this->builder->renderArray($input);
-
- $this->assertEquals('1
-2
-5
-string
-10', $response);
- }
-
- public function test_renderArray_ShouldRenderAnEmptyArray()
- {
- $response = $this->builder->renderArray(array());
-
- $this->assertEquals('No data available', $response);
- }
-
- public function test_renderArray_ShouldConvertAssociativeArrayToJson()
- {
- $input = array('nb_visits' => 6, 'nb_random' => 8);
-
- $response = $this->builder->renderArray($input);
-
- $this->assertEquals('nb_visits,nb_random
-6,8', $response);
- }
-
- public function test_renderArray_ShouldConvertsIndexedAssociativeArrayToJson()
- {
- $input = array(
- array('nb_visits' => 6, 'nb_random' => 8),
- array('nb_visits' => 3, 'nb_random' => 4)
- );
-
- $response = $this->builder->renderArray($input);
-
- $this->assertEquals('nb_visits,nb_random
-6,8
-3,4', $response);
- }
-
- public function test_renderArray_ShouldConvertMultiDimensionalStandardArrayToJson()
- {
- $input = array("firstElement",
- array(
- "firstElement",
- "secondElement",
- ),
- "thirdElement");
-
- $actual = $this->builder->renderArray($input);
- $this->assertEquals('0,1,2
-firstElement,,
-firstElement,secondElement,
-,,thirdElement', $actual);
- }
-
- /**
- * @expectedException \Exception
- * @expectedExceptionMessage Data structure returned is not convertible in the requested format
- */
- public function test_renderArray_ShouldConvertMultiDimensionalAssociativeArrayToJson()
- {
- $input = array(
- "firstElement" => "isFirst",
- "secondElement" => array(
- "firstElement" => "isFirst",
- "secondElement" => "isSecond",
- ),
- "thirdElement" => "isThird");
-
- $this->builder->renderArray($input);
- }
-
- /**
- * @expectedException \Exception
- * @expectedExceptionMessage Data structure returned is not convertible in the requested format
- */
- public function test_renderArray_ShouldConvertMultiDimensionalIndexArrayToJson()
- {
- $input = array(array("firstElement",
- array(
- "firstElement",
- "secondElement",
- ),
- "thirdElement"));
-
- $this->builder->renderArray($input);
- }
-
- /**
- * @expectedException \Exception
- * @expectedExceptionMessage Data structure returned is not convertible in the requested format
- */
- public function test_renderArray_ShouldConvertMultiDimensionalMixedArrayToJson()
- {
- $input = array(
- "firstElement" => "isFirst",
- array(
- "firstElement",
- "secondElement",
- ),
- "thirdElement" => array(
- "firstElement" => "isFirst",
- "secondElement" => "isSecond",
- )
- );
-
- $this->builder->renderArray($input);
- }
-
- private function makeBuilder($request)
- {
- return new Csv($request);
- }
-}
diff --git a/plugins/API/tests/HtmlRendererTest.php b/plugins/API/tests/HtmlRendererTest.php
deleted file mode 100644
index 4cf4f98c9b..0000000000
--- a/plugins/API/tests/HtmlRendererTest.php
+++ /dev/null
@@ -1,459 +0,0 @@
-<?php
-/**
- * Piwik - free/libre analytics platform
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- */
-
-namespace Piwik\Plugins\API\tests;
-
-use Piwik\DataTable;
-use Piwik\Plugins\API\Renderer\Html;
-
-/**
- * @group Plugin
- * @group API
- */
-class HtmlRendererTest extends \PHPUnit_Framework_TestCase
-{
- /**
- * @var Html
- */
- private $builder;
-
- public function setUp()
- {
- $this->builder = $this->makeBuilder(array('method' => 'MultiSites_getAll'));
- DataTable\Manager::getInstance()->deleteAll();
- }
-
- public function test_renderSuccess_shouldIncludeMessage()
- {
- $response = $this->builder->renderSuccess('ok');
-
- $this->assertEquals('Success:ok', $response);
- }
-
- public function test_renderException_shouldIncludeTheMessageAndNotExceptionMessage()
- {
- $response = $this->builder->renderException("The error message", new \Exception('The other message'));
-
- $this->assertEquals('The error message', $response);
- }
-
- public function test_renderException_shouldConvertNewLinesToBr()
- {
- $response = $this->builder->renderException("The\nerror\nmessage", new \Exception('The other message'));
-
- $this->assertEquals('The<br />
-error<br />
-message', $response);
- }
-
- public function test_renderObject_shouldReturAnError()
- {
- $response = $this->builder->renderObject(new \stdClass());
-
- $this->assertEquals('The API cannot handle this data structure.', $response);
- }
-
- public function test_renderResource_shouldReturAnError()
- {
- $response = $this->builder->renderResource(new \stdClass());
-
- $this->assertEquals('The API cannot handle this data structure.', $response);
- }
-
- public function test_renderScalar_shouldReturnABooleanAsIntegerWrappedInTable()
- {
- $response = $this->builder->renderScalar(true);
-
- $this->assertEquals('<table id="MultiSites_getAll" border="1">
-<thead>
- <tr>
- <th>value</th>
- </tr>
-</thead>
-<tbody>
- <tr>
- <td>1</td>
- </tr>
-</tbody>
-</table>
-', $response);
- }
-
- public function test_renderScalar_shouldReturnAnIntegerWrappedInTable()
- {
- $response = $this->builder->renderScalar(5);
-
- $this->assertEquals('<table id="MultiSites_getAll" border="1">
-<thead>
- <tr>
- <th>value</th>
- </tr>
-</thead>
-<tbody>
- <tr>
- <td>5</td>
- </tr>
-</tbody>
-</table>
-', $response);
- }
-
- public function test_renderScalar_shouldReturnAStringWrappedInValue()
- {
- $response = $this->builder->renderScalar('The Output');
-
- $this->assertEquals('<table id="MultiSites_getAll" border="1">
-<thead>
- <tr>
- <th>value</th>
- </tr>
-</thead>
-<tbody>
- <tr>
- <td>The Output</td>
- </tr>
-</tbody>
-</table>
-', $response);
- }
-
- public function test_renderScalar_shouldNotRemoveLineBreaks()
- {
- $response = $this->builder->renderScalar('The\nOutput');
-
- $this->assertEquals('<table id="MultiSites_getAll" border="1">
-<thead>
- <tr>
- <th>value</th>
- </tr>
-</thead>
-<tbody>
- <tr>
- <td>The\nOutput</td>
- </tr>
-</tbody>
-</table>
-', $response);
- }
-
- public function test_renderDataTable_shouldRenderABasicDataTable()
- {
- $dataTable = new DataTable();
- $dataTable->addRowFromSimpleArray(array('nb_visits' => 5, 'nb_random' => 10));
-
- $response = $this->builder->renderDataTable($dataTable);
-
- $this->assertEquals('<table id="MultiSites_getAll" border="1">
-<thead>
- <tr>
- <th>nb_visits</th>
- <th>nb_random</th>
- </tr>
-</thead>
-<tbody>
- <tr>
- <td>5</td>
- <td>10</td>
- </tr>
-</tbody>
-</table>
-', $response);
- }
-
- public function test_renderDataTable_shouldRenderSubtables()
- {
- $subtable = new DataTable();
- $subtable->addRowFromSimpleArray(array('nb_visits' => 2, 'nb_random' => 6));
-
- $dataTable = new DataTable();
- $dataTable->addRowFromSimpleArray(array('nb_visits' => 5, 'nb_random' => 10));
- $dataTable->getFirstRow()->setSubtable($subtable);
-
- $response = $this->builder->renderDataTable($dataTable);
-
- $this->assertEquals('<table id="MultiSites_getAll" border="1">
-<thead>
- <tr>
- <th>nb_visits</th>
- <th>nb_random</th>
- <th>_idSubtable</th>
- </tr>
-</thead>
-<tbody>
- <tr>
- <td>5</td>
- <td>10</td>
- <td>1</td>
- </tr>
-</tbody>
-</table>
-', $response);
- }
-
- public function test_renderDataTable_shouldRenderDataTableMaps()
- {
- $map = new DataTable\Map();
-
- $dataTable = new DataTable();
- $dataTable->addRowFromSimpleArray(array('nb_visits' => 5, 'nb_random' => 10));
-
- $dataTable2 = new DataTable();
- $dataTable2->addRowFromSimpleArray(array('nb_visits' => 3, 'nb_random' => 6));
-
- $map->addTable($dataTable, 'table1');
- $map->addTable($dataTable2, 'table2');
-
- $response = $this->builder->renderDataTable($map);
-
- $this->assertEquals('<table id="MultiSites_getAll" border="1">
-<thead>
- <tr>
- <th>_defaultKeyName</th>
- <th>nb_visits</th>
- <th>nb_random</th>
- </tr>
-</thead>
-<tbody>
- <tr>
- <td>table1</td>
- <td>5</td>
- <td>10</td>
- </tr>
- <tr>
- <td>table2</td>
- <td>3</td>
- <td>6</td>
- </tr>
-</tbody>
-</table>
-', $response);
- }
-
- public function test_renderDataTable_shouldRenderSimpleDataTable()
- {
- $dataTable = new DataTable\Simple();
- $dataTable->addRowsFromArray(array('nb_visits' => 3, 'nb_random' => 6));
-
- $response = $this->builder->renderDataTable($dataTable);
-
- $this->assertEquals('<table id="MultiSites_getAll" border="1">
-<thead>
- <tr>
- <th>nb_visits</th>
- <th>nb_random</th>
- </tr>
-</thead>
-<tbody>
- <tr>
- <td>3</td>
- <td>6</td>
- </tr>
-</tbody>
-</table>
-', $response);
- }
-
- public function test_renderArray_ShouldConvertSimpleArrayToJson()
- {
- $input = array(1, 2, 5, 'string', 10);
-
- $response = $this->builder->renderArray($input);
-
- $this->assertEquals('<table id="MultiSites_getAll" border="1">
-<thead>
- <tr>
- <th>value</th>
- </tr>
-</thead>
-<tbody>
- <tr>
- <td>1</td>
- </tr>
- <tr>
- <td>2</td>
- </tr>
- <tr>
- <td>5</td>
- </tr>
- <tr>
- <td>string</td>
- </tr>
- <tr>
- <td>10</td>
- </tr>
-</tbody>
-</table>
-', $response);
- }
-
- public function test_renderArray_ShouldRenderAnEmptyArray()
- {
- $response = $this->builder->renderArray(array());
-
- $this->assertEquals('<table id="MultiSites_getAll" border="1">
-<thead>
- <tr>
- </tr>
-</thead>
-<tbody>
-</tbody>
-</table>
-', $response);
- }
-
- public function test_renderArray_ShouldConvertAssociativeArrayToJson()
- {
- $input = array('nb_visits' => 6, 'nb_random' => 8);
-
- $response = $this->builder->renderArray($input);
-
- $this->assertEquals('<table id="MultiSites_getAll" border="1">
-<thead>
- <tr>
- <th>nb_visits</th>
- <th>nb_random</th>
- </tr>
-</thead>
-<tbody>
- <tr>
- <td>6</td>
- <td>8</td>
- </tr>
-</tbody>
-</table>
-', $response);
- }
-
- public function test_renderArray_ShouldConvertsIndexedAssociativeArrayToJson()
- {
- $input = array(
- array('nb_visits' => 6, 'nb_random' => 8),
- array('nb_visits' => 3, 'nb_random' => 4)
- );
-
- $response = $this->builder->renderArray($input);
-
- $this->assertEquals('<table id="MultiSites_getAll" border="1">
-<thead>
- <tr>
- <th>nb_visits</th>
- <th>nb_random</th>
- </tr>
-</thead>
-<tbody>
- <tr>
- <td>6</td>
- <td>8</td>
- </tr>
- <tr>
- <td>3</td>
- <td>4</td>
- </tr>
-</tbody>
-</table>
-', $response);
- }
-
- public function test_renderArray_ShouldConvertMultiDimensionalStandardArrayToJson()
- {
- $input = array("firstElement",
- array(
- "firstElement",
- "secondElement",
- ),
- "thirdElement");
-
- $actual = $this->builder->renderArray($input);
- $this->assertEquals('<table id="MultiSites_getAll" border="1">
-<thead>
- <tr>
- <th>value</th>
- <th>1</th>
- <th>2</th>
- </tr>
-</thead>
-<tbody>
- <tr>
- <td>firstElement</td>
- <td>-</td>
- <td>-</td>
- </tr>
- <tr>
- <td>firstElement</td>
- <td>secondElement</td>
- <td>-</td>
- </tr>
- <tr>
- <td>-</td>
- <td>-</td>
- <td>thirdElement</td>
- </tr>
-</tbody>
-</table>
-', $actual);
- }
-
- /**
- * @expectedException \Exception
- * @expectedExceptionMessage Data structure returned is not convertible in the requested format
- */
- public function test_renderArray_ShouldConvertMultiDimensionalAssociativeArrayToJson()
- {
- $input = array(
- "firstElement" => "isFirst",
- "secondElement" => array(
- "firstElement" => "isFirst",
- "secondElement" => "isSecond",
- ),
- "thirdElement" => "isThird");
-
- $this->builder->renderArray($input);
- }
-
- /**
- * @expectedException \Exception
- * @expectedExceptionMessage Data structure returned is not convertible in the requested format
- */
- public function test_renderArray_ShouldConvertMultiDimensionalIndexArrayToJson()
- {
- $input = array(array("firstElement",
- array(
- "firstElement",
- "secondElement",
- ),
- "thirdElement"));
-
- $this->builder->renderArray($input);
- }
-
- /**
- * @expectedException \Exception
- * @expectedExceptionMessage Data structure returned is not convertible in the requested format
- */
- public function test_renderArray_ShouldConvertMultiDimensionalMixedArrayToJson()
- {
- $input = array(
- "firstElement" => "isFirst",
- array(
- "firstElement",
- "secondElement",
- ),
- "thirdElement" => array(
- "firstElement" => "isFirst",
- "secondElement" => "isSecond",
- )
- );
-
- $this->builder->renderArray($input);
- }
-
- private function makeBuilder($request)
- {
- return new Html($request);
- }
-}
diff --git a/plugins/API/tests/Integration/RowEvolutionTest.php b/plugins/API/tests/Integration/RowEvolutionTest.php
new file mode 100644
index 0000000000..cb3dc66a99
--- /dev/null
+++ b/plugins/API/tests/Integration/RowEvolutionTest.php
@@ -0,0 +1,46 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+namespace Piwik\Plugins\API\tests\Integration;
+
+use Piwik\Plugins\API\RowEvolution;
+use Piwik\Tests\Impl\Fixture;
+use Piwik\Tests\Impl\IntegrationTestCase;
+
+/**
+ * @group API
+ * @group RowEvolutionTest
+ * @group Plugins
+ */
+class RowEvolutionTest extends IntegrationTestCase
+{
+
+ public function setUp()
+ {
+ parent::setUp();
+ Fixture::createWebsite('2014-01-01 00:00:00');
+ }
+
+ /**
+ * @expectedException \Exception
+ * @expectedExceptionMessage Reports like VisitsSummary.get which do not have a dimension are not supported by row evolution
+ */
+ public function test_getRowEvolution_shouldTriggerAnException_IfReportHasNoDimension()
+ {
+ $rowEvolution = new RowEvolution();
+ $rowEvolution->getRowEvolution(1, 'day', 'last7', 'VisitsSummary', 'get');
+ }
+
+ public function test_getRowEvolution_shouldNotTriggerAnException_IfReportHasADimension()
+ {
+ $rowEvolution = new RowEvolution();
+ $table = $rowEvolution->getRowEvolution(1, 'day', 'last7', 'Actions', 'getPageUrls');
+ $this->assertNotEmpty($table);
+ }
+
+}
diff --git a/plugins/API/tests/Integration/RssRendererTest.php b/plugins/API/tests/Integration/RssRendererTest.php
new file mode 100644
index 0000000000..3011273d69
--- /dev/null
+++ b/plugins/API/tests/Integration/RssRendererTest.php
@@ -0,0 +1,193 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+namespace Piwik\Plugins\API\tests\Integration;
+
+use Piwik\Access;
+use Piwik\DataTable;
+use Piwik\Plugins\API\Renderer\Rss;
+use Piwik\Tests\Impl\Fixture;
+use Piwik\Tests\Impl\IntegrationTestCase;
+
+/**
+ * @group Plugin
+ * @group API
+ */
+class RssRendererTest extends IntegrationTestCase
+{
+ /**
+ * @var Rss
+ */
+ private $builder;
+
+ public function setUp()
+ {
+ parent::setUp();
+
+ $pseudoMockAccess = new \FakeAccess();
+ \FakeAccess::setSuperUserAccess(true);
+ Access::setSingletonInstance($pseudoMockAccess);
+
+ $idSite = Fixture::createWebsite('2014-01-01 00:00:00');
+
+ $this->builder = $this->makeBuilder(array('method' => 'MultiSites_getAll', 'idSite' => $idSite));
+ }
+
+ public function test_renderSuccess_shouldIncludeMessage()
+ {
+ $response = $this->builder->renderSuccess('ok');
+
+ $this->assertEquals('Success:ok', $response);
+ }
+
+ public function test_renderException_shouldIncludeTheMessageAndNotExceptionMessage()
+ {
+ $response = $this->builder->renderException("The error message", new \Exception('The other message'));
+
+ $this->assertEquals('Error: The error message', $response);
+ }
+
+ public function test_renderObject_shouldReturAnError()
+ {
+ $response = $this->builder->renderObject(new \stdClass());
+
+ $this->assertEquals('Error: The API cannot handle this data structure.', $response);
+ }
+
+ public function test_renderResource_shouldReturAnError()
+ {
+ $response = $this->builder->renderResource(new \stdClass());
+
+ $this->assertEquals('Error: The API cannot handle this data structure.', $response);
+ }
+
+ /**
+ * @expectedException \Exception
+ * @expectedExceptionMessage RSS feeds can be generated for one specific website
+ */
+ public function test_renderScalar_shouldFailForBooleanScalar()
+ {
+ $this->builder->renderScalar(true);
+ }
+
+ /**
+ * @expectedException \Exception
+ * @expectedExceptionMessage RSS feeds can be generated for one specific website
+ */
+ public function test_renderScalar_shouldFailForIntegerScalar()
+ {
+ $this->builder->renderScalar(5);
+ }
+
+ /**
+ * @expectedException \Exception
+ * @expectedExceptionMessage RSS feeds can be generated for one specific website
+ */
+ public function test_renderScalar_shouldFailForStringScalar()
+ {
+ $this->builder->renderScalar('string');
+ }
+
+ /**
+ * @expectedException \Exception
+ * @expectedExceptionMessage RSS feeds can be generated for one specific website
+ */
+ public function test_renderDataTable_shouldFailForDataTable()
+ {
+ $dataTable = new DataTable();
+ $dataTable->addRowFromSimpleArray(array('nb_visits' => 5, 'nb_random' => 10));
+
+ $this->builder->renderDataTable($dataTable);
+ }
+
+ /**
+ * @expectedException \Exception
+ * @expectedExceptionMessage RSS feeds can be generated for one specific website
+ */
+ public function test_renderDataTable_shouldFailForSubtables()
+ {
+ $subtable = new DataTable();
+ $subtable->addRowFromSimpleArray(array('nb_visits' => 2, 'nb_random' => 6));
+
+ $dataTable = new DataTable();
+ $dataTable->addRowFromSimpleArray(array('nb_visits' => 5, 'nb_random' => 10));
+ $dataTable->getFirstRow()->setSubtable($subtable);
+
+ $this->builder->renderDataTable($dataTable);
+ }
+
+ /**
+ * @expectedException \Exception
+ * @expectedExceptionMessage RSS feeds can be generated for one specific website
+ */
+ public function test_renderDataTable_shouldFail_IfKeynameIsNotDate()
+ {
+ $map = new DataTable\Map();
+
+ $dataTable = new DataTable();
+ $dataTable->addRowFromSimpleArray(array('nb_visits' => 5, 'nb_random' => 10));
+
+ $map->addTable($dataTable, 'table1');
+ $map->addTable($dataTable, 'table2');
+
+ $this->builder->renderDataTable($map);
+ }
+
+ public function test_renderDataTable_shouldRenderDataTableMaps_IfKeynameIsDate()
+ {
+ $map = new DataTable\Map();
+ $map->setKeyName('date');
+ $_GET['period'] = 'day';
+
+ $response = $this->builder->renderDataTable($map);
+
+ unset($_GET['period']);
+
+ $response = preg_replace(array('/<pubDate>(.*)<\/pubDate>/','/<lastBuildDate>(.*)<\/lastBuildDate>/'), '', $response);
+
+ $this->assertEquals('<?xml version="1.0" encoding="UTF-8"?>
+<rss version="2.0">
+ <channel>
+ <title>piwik statistics - RSS</title>
+ <link>http://piwik.org</link>
+ <description>Piwik RSS feed</description>
+
+ <generator>piwik</generator>
+ <language>en</language>
+ </channel>
+</rss>', $response);
+ }
+
+ /**
+ * @expectedException \Exception
+ * @expectedExceptionMessage RSS feeds can be generated for one specific website
+ */
+ public function test_renderDataTable_shouldFailForSimpleDataTable()
+ {
+ $dataTable = new DataTable\Simple();
+ $dataTable->addRowsFromArray(array('nb_visits' => 3, 'nb_random' => 6));
+
+ $this->builder->renderDataTable($dataTable);
+ }
+
+ /**
+ * @expectedException \Exception
+ * @expectedExceptionMessage RSS feeds can be generated for one specific website
+ */
+ public function test_renderArray_ShouldFailForArrays()
+ {
+ $input = array(1, 2, 5, 'string', 10);
+
+ $this->builder->renderArray($input);
+ }
+
+ private function makeBuilder($request)
+ {
+ return new Rss($request);
+ }
+}
diff --git a/plugins/API/tests/JsonRendererTest.php b/plugins/API/tests/JsonRendererTest.php
deleted file mode 100644
index fc1bf5d502..0000000000
--- a/plugins/API/tests/JsonRendererTest.php
+++ /dev/null
@@ -1,385 +0,0 @@
-<?php
-/**
- * Piwik - free/libre analytics platform
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- */
-
-namespace Piwik\Plugins\API\tests;
-
-use Piwik\DataTable;
-use Piwik\Plugins\API\Renderer\Json;
-use Piwik\Plugins\API\Renderer\Json2;
-
-/**
- * @group Plugin
- * @group API
- * @group API_JsonRendererTest
- */
-class JsonRendererTest extends \PHPUnit_Framework_TestCase
-{
- /**
- * @var Json
- */
- private $jsonBuilder;
-
- public function setUp()
- {
- $this->jsonBuilder = $this->makeBuilder(array());
- DataTable\Manager::getInstance()->deleteAll();
- }
-
- public function test_renderSuccess_shouldIncludeMessage()
- {
- $response = $this->jsonBuilder->renderSuccess('ok');
-
- $this->assertEquals('{"result":"success","message":"ok"}', $response);
- $this->assertEquals((array) array('result' => 'success', 'message' => 'ok'), json_decode($response, true));
- $this->assertNoJsonError($response);
- }
-
- public function test_renderSuccess_shouldWrapIfEnabledAndCallbackShouldBePreferred()
- {
- $builder = $this->makeBuilder(array('callback' => 'myName', 'jsoncallback' => 'myOther'));
- $response = $builder->renderSuccess('ok');
-
- $this->assertEquals('myName({"result":"success","message":"ok"})', $response);
- $this->assertNoJsonError($response);
- }
-
- public function test_renderSuccess_shouldWrapIfEnabledAndFallbackToJsonCallbackIfCallbackNotSet()
- {
- $builder = $this->makeBuilder(array('jsoncallback' => 'myOther'));
- $response = $builder->renderSuccess('ok');
-
- $this->assertEquals('myOther({"result":"success","message":"ok"})', $response);
- $this->assertNoJsonError($response);
- }
-
- public function test_renderSuccess_shouldNotWrapIfCallbackContainsInvalidCharacters()
- {
- $builder = $this->makeBuilder(array('callback' => 'myOther#?._kek'));
- $response = $builder->renderSuccess('ok');
-
- $this->assertEquals('{"result":"success","message":"ok"}', $response);
- $this->assertNoJsonError($response);
- }
-
- public function test_renderException_shouldIncludeTheMessageAndNotExceptionMessage()
- {
- $response = $this->jsonBuilder->renderException("The error message", new \Exception('The other message'));
-
- $this->assertEquals('{"result":"error","message":"The error message"}', $response);
- $this->assertEquals((array) array('result' => 'error', 'message' => 'The error message'), json_decode($response, true));
- $this->assertNoJsonError($response);
- }
-
- public function test_renderException_shouldRemoveWhitespace()
- {
- $response = $this->jsonBuilder->renderException("The\nerror\r\nmessage", new \Exception());
-
- $this->assertEquals('{"result":"error","message":"Theerrormessage"}', $response);
- $this->assertEquals((array) array('result' => 'error', 'message' => 'Theerrormessage'), json_decode($response, true));
- $this->assertNoJsonError($response);
- }
-
- public function test_renderException_shouldWrapIfEnabled()
- {
- $builder = $this->makeBuilder(array('callback' => 'myName'));
- $response = $builder->renderException('error', new \Exception());
-
- $this->assertEquals('myName({"result":"error","message":"error"})', $response);
- $this->assertNoJsonError($response);
- }
-
- public function test_renderObject_shouldReturAnError()
- {
- $response = $this->jsonBuilder->renderObject(new \stdClass());
-
- $this->assertEquals('{"result":"error","message":"The API cannot handle this data structure."}', $response);
- $this->assertNoJsonError($response);
- }
-
- public function test_renderResource_shouldReturAnError()
- {
- $response = $this->jsonBuilder->renderResource(new \stdClass());
-
- $this->assertEquals('{"result":"error","message":"The API cannot handle this data structure."}', $response);
- $this->assertNoJsonError($response);
- }
-
- public function test_renderScalar_shouldReturnABooleanWrappedInValue()
- {
- $response = $this->jsonBuilder->renderScalar(true);
-
- $this->assertEquals('{"value":true}', $response);
- $this->assertNoJsonError($response);
- }
-
- public function test_renderScalar_shouldReturnAnIntegerWrappedInValue()
- {
- $response = $this->jsonBuilder->renderScalar(5);
-
- $this->assertEquals('{"value":5}', $response);
- $this->assertNoJsonError($response);
- }
-
- public function test_renderScalar_shouldReturnAStringWrappedInValue()
- {
- $response = $this->jsonBuilder->renderScalar('The Output');
-
- $this->assertEquals('{"value":"The Output"}', $response);
- $this->assertNoJsonError($response);
- }
-
- public function test_renderScalar_shouldNotRemoveLineBreaks()
- {
- $response = $this->jsonBuilder->renderScalar('The\nOutput');
-
- $this->assertEquals('{"value":"The\\\\nOutput"}', $response);
- $this->assertNoJsonError($response);
- }
-
- public function test_renderScalar_shouldWrapJsonIfNeeded()
- {
- $builder = $this->makeBuilder(array('callback' => 'myName'));
- $response = $builder->renderScalar(true);
-
- $this->assertEquals('myName({"value":true})', $response);
- $this->assertNoJsonError($response);
- }
-
- public function test_renderDataTable_shouldRenderABasicDataTable()
- {
- $dataTable = new DataTable();
- $dataTable->addRowFromSimpleArray(array('nb_visits' => 5, 'nb_random' => 10));
-
- $response = $this->jsonBuilder->renderDataTable($dataTable);
-
- $this->assertEquals('[{"nb_visits":5,"nb_random":10}]', $response);
- $this->assertNoJsonError($response);
- }
-
- public function test_renderDataTable_shouldRenderSubtables()
- {
- $subtable = new DataTable();
- $subtable->addRowFromSimpleArray(array('nb_visits' => 2, 'nb_random' => 6));
-
- $dataTable = new DataTable();
- $dataTable->addRowFromSimpleArray(array('nb_visits' => 5, 'nb_random' => 10));
- $dataTable->getFirstRow()->setSubtable($subtable);
-
- $response = $this->jsonBuilder->renderDataTable($dataTable);
-
- $this->assertEquals('[{"nb_visits":5,"nb_random":10,"idsubdatatable":1}]', $response);
- $this->assertNoJsonError($response);
- }
-
- public function test_renderDataTable_shouldRenderDataTableMaps()
- {
- $map = new DataTable\Map();
-
- $dataTable = new DataTable();
- $dataTable->addRowFromSimpleArray(array('nb_visits' => 5, 'nb_random' => 10));
-
- $dataTable2 = new DataTable();
- $dataTable2->addRowFromSimpleArray(array('nb_visits' => 3, 'nb_random' => 6));
-
- $map->addTable($dataTable, 'table1');
- $map->addTable($dataTable2, 'table2');
-
- $response = $this->jsonBuilder->renderDataTable($map);
-
- $this->assertEquals('{"table1":[{"nb_visits":5,"nb_random":10}],"table2":[{"nb_visits":3,"nb_random":6}]}', $response);
- $this->assertNoJsonError($response);
- }
-
- public function test_renderDataTable_shouldRenderSimpleDataTable()
- {
- $dataTable = new DataTable\Simple();
- $dataTable->addRowsFromArray(array('nb_visits' => 3, 'nb_random' => 6));
-
- $response = $this->jsonBuilder->renderDataTable($dataTable);
-
- $this->assertEquals('{"nb_visits":3,"nb_random":6}', $response);
- $this->assertNoJsonError($response);
- }
-
- public function test_renderDataTable_shouldWrapADataTable()
- {
- $builder = $this->makeBuilder(array('callback' => 'myName'));
- $dataTable = new DataTable();
- $dataTable->addRowFromSimpleArray(array('nb_visits' => 5, 'nb_random' => 10));
-
- $response = $builder->renderDataTable($dataTable);
-
- $this->assertEquals('myName([{"nb_visits":5,"nb_random":10}])', $response);
- $this->assertNoJsonError($response);
- }
-
- public function test_renderArray_ShouldConvertSimpleArrayToJson()
- {
- $input = array(1, 2, 5, 'string', 10);
-
- $response = $this->jsonBuilder->renderArray($input);
-
- $this->assertEquals('[1,2,5,"string",10]', $response);
- $this->assertNoJsonError($response);
- }
-
- public function test_renderArray_ShouldWrapJsonIfRequested()
- {
- $input = array(1, 2, 5, 'string', 10);
-
- $builder = $this->makeBuilder(array('jsoncallback' => 'myName'));
- $response = $builder->renderArray($input);
-
- $this->assertEquals('myName([1,2,5,"string",10])', $response);
- }
-
- public function test_renderArray_ShouldRenderAnEmptyArray()
- {
- $response = $this->jsonBuilder->renderArray(array());
-
- $this->assertEquals('[]', $response);
- $this->assertNoJsonError($response);
- }
-
- public function test_renderArray_ShouldConvertAssociativeArrayToJson()
- {
- $input = array('nb_visits' => 6, 'nb_random' => 8);
-
- $response = $this->jsonBuilder->renderArray($input);
- $expected = json_encode($input);
-
- $this->assertEquals($expected, $response);
- $this->assertNoJsonError($response);
- }
-
- public function test_renderArray_ShouldConvertsIndexedAssociativeArrayToJson()
- {
- $input = array(
- array('nb_visits' => 6, 'nb_random' => 8),
- array('nb_visits' => 3, 'nb_random' => 4)
- );
-
- $response = $this->jsonBuilder->renderArray($input);
- $expected = json_encode($input);
-
- $this->assertEquals($expected, $response);
- $this->assertNoJsonError($response);
- }
-
- public function test_renderArray_ShouldConvertMultiDimensionalStandardArrayToJson()
- {
- $input = array("firstElement",
- array(
- "firstElement",
- "secondElement",
- ),
- "thirdElement");
-
- $expected = json_encode($input);
-
- $actual = $this->jsonBuilder->renderArray($input);
- $this->assertEquals($expected, $actual);
- $this->assertNoJsonError($actual);
- }
-
- public function test_renderArray_ShouldConvertMultiDimensionalAssociativeArrayToJson()
- {
- $input = array(
- "firstElement" => "isFirst",
- "secondElement" => array(
- "firstElement" => "isFirst",
- "secondElement" => "isSecond",
- ),
- "thirdElement" => "isThird");
-
- $expected = json_encode($input);
-
- $actual = $this->jsonBuilder->renderArray($input);
- $this->assertEquals($expected, $actual);
- $this->assertNoJsonError($actual);
- }
-
- public function test_renderArray_ShouldConvertSingleDimensionalAssociativeArrayToJson()
- {
- $input = array(
- "fistElement" => "isFirst",
- "secondElement" => "isSecond"
- );
-
- $expected = json_encode($input);
-
- $actual = $this->jsonBuilder->renderArray($input);
- $this->assertEquals($expected, $actual);
- $this->assertNoJsonError($actual);
- }
-
- public function test_renderArray_ShouldConvertMultiDimensionalIndexArrayToJson()
- {
- $input = array(array("firstElement",
- array(
- "firstElement",
- "secondElement",
- ),
- "thirdElement"));
-
- $expected = json_encode($input);
-
- $actual = $this->jsonBuilder->renderArray($input);
- $this->assertEquals($expected, $actual);
- $this->assertNoJsonError($actual);
- }
-
- public function test_renderArray_ShouldConvertMultiDimensionalMixedArrayToJson()
- {
- $input = array(
- "firstElement" => "isFirst",
- array(
- "firstElement",
- "secondElement",
- ),
- "thirdElement" => array(
- "firstElement" => "isFirst",
- "secondElement" => "isSecond",
- )
- );
-
- $expected = json_encode($input);
-
- $actual = $this->jsonBuilder->renderArray($input);
- $this->assertEquals($expected, $actual);
- $this->assertNoJsonError($actual);
- }
-
- /**
- * backwards compatibility test
- */
- public function test_oldJson_renderArray_ShouldConvertSingleDimensionalAssociativeArray()
- {
- $input = array(
- "firstElement" => "isFirst",
- "secondElement" => "isSecond"
- );
-
- $expected = '[{"firstElement":"isFirst","secondElement":"isSecond"}]';
-
- $oldJsonBuilder = new Json($input);
- $actual = $oldJsonBuilder->renderArray($input);
- $this->assertEquals($expected, $actual);
- $this->assertNoJsonError($actual);
- }
-
- private function makeBuilder($request)
- {
- return new Json2($request);
- }
-
- private function assertNoJsonError($response)
- {
- return null !== json_decode($response);
- }
-}
diff --git a/plugins/API/tests/OriginalRendererTest.php b/plugins/API/tests/OriginalRendererTest.php
deleted file mode 100644
index 40a3575ec7..0000000000
--- a/plugins/API/tests/OriginalRendererTest.php
+++ /dev/null
Binary files differ
diff --git a/plugins/API/tests/PhpRendererTest.php b/plugins/API/tests/PhpRendererTest.php
deleted file mode 100644
index 5234db8df1..0000000000
--- a/plugins/API/tests/PhpRendererTest.php
+++ /dev/null
@@ -1,218 +0,0 @@
-<?php
-/**
- * Piwik - free/libre analytics platform
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- */
-
-namespace Piwik\Plugins\API\tests;
-
-use Piwik\DataTable;
-use Piwik\Plugins\API\Renderer\Php;
-
-/**
- * @group Plugin
- * @group API
- * @group PhpRendererTest
- */
-class PhpRendererTest extends \PHPUnit_Framework_TestCase
-{
- /**
- * @var Php
- */
- private $builder;
-
- public function setUp()
- {
- $this->builder = $this->makeBuilder(array('serialize' => 0));
- DataTable\Manager::getInstance()->deleteAll();
- }
-
- public function test_renderSuccess_shouldAlwaysReturnTrueAndIgnoreMessage()
- {
- $response = $this->builder->renderSuccess('ok');
- $expected = array('result' => 'success', 'message' => 'ok');
-
- $this->assertEquals($expected, $response);
- }
-
- public function test_renderSuccess_shouldSerializeByDefault()
- {
- $response = $this->makeBuilder(array())->renderSuccess('ok');
- $expected = 'a:2:{s:6:"result";s:7:"success";s:7:"message";s:2:"ok";}';
-
- $this->assertEquals($expected, $response);
- }
-
- public function test_renderException_shouldReturnTheMessageAndNotTheExceptionMessage()
- {
- $response = $this->builder->renderException('This message should be ignored', new \BadMethodCallException('The other message'));
- $expected = array('result' => 'error', 'message' => 'This message should be ignored');
-
- $this->assertEquals($expected, $response);
- }
-
- public function test_renderException_shouldSerializeByDefault()
- {
- $response = $this->makeBuilder(array())->renderException('This message should be ignored', new \BadMethodCallException('The other message'));
- $expected = 'a:2:{s:6:"result";s:5:"error";s:7:"message";s:30:"This message should be ignored";}';
-
- $this->assertEquals($expected, $response);
- }
-
- public function test_renderScalar_shouldReturnTheSameValue()
- {
- $response = $this->builder->renderScalar(true);
- $this->assertEquals(true, $response);
-
- $response = $this->builder->renderScalar(5);
- $this->assertEquals(5, $response);
-
- $response = $this->builder->renderScalar('string');
- $this->assertEquals('string', $response);
- }
-
- public function test_renderObject_shouldReturnTheSameValue()
- {
- $response = $this->builder->renderObject($this);
- $expected = array('result' => 'error', 'message' => 'The API cannot handle this data structure.');
-
- $this->assertEquals($expected, $response);
- }
-
- public function test_renderResource_shouldReturnTheSameValue()
- {
- $resource = curl_init();
- $response = $this->builder->renderResource($resource);
- $expected = array('result' => 'error', 'message' => 'The API cannot handle this data structure.');
-
- $this->assertEquals($expected, $response);
- }
-
- public function test_renderDataTable_shouldNotSerializeIfDisabled()
- {
- $dataTable = new DataTable();
- $dataTable->addRowFromSimpleArray(array('nb_visits' => 5, 'nb_random' => 10));
-
- $response = $this->builder->renderDataTable($dataTable);
- $expected = array(
- array('nb_visits' => 5, 'nb_random' => 10)
- );
- $this->assertEquals($expected, $response);
- }
-
- public function test_renderDataTable_shouldSerializeByDefault()
- {
- $dataTable = new DataTable();
- $dataTable->addRowFromSimpleArray(array('nb_visits' => 5, 'nb_random' => 10));
-
- $builder = $this->makeBuilder(array());
- $response = $builder->renderDataTable($dataTable);
-
- $expected = 'a:1:{i:0;a:2:{s:9:"nb_visits";i:5;s:9:"nb_random";i:10;}}';
- $this->assertSame($expected, $response);
- }
-
- public function test_renderDataTable_shouldRenderSubtables()
- {
- $subtable = new DataTable();
- $subtable->addRowFromSimpleArray(array('nb_visits' => 2, 'nb_random' => 6));
-
- $dataTable = new DataTable();
- $dataTable->addRowFromSimpleArray(array('nb_visits' => 5, 'nb_random' => 10));
- $dataTable->getFirstRow()->setSubtable($subtable);
-
- $response = $this->builder->renderDataTable($dataTable);
- $expected = array(array('nb_visits' => 5, 'nb_random' => 10, 'idsubdatatable' => 1));
-
- $this->assertEquals($expected, $response);
- }
-
- public function test_renderDataTable_shouldRenderDataTableMaps()
- {
- $map = new DataTable\Map();
-
- $dataTable = new DataTable();
- $dataTable->addRowFromSimpleArray(array('nb_visits' => 5, 'nb_random' => 10));
-
- $dataTable2 = new DataTable();
- $dataTable2->addRowFromSimpleArray(array('nb_visits' => 3, 'nb_random' => 6));
-
- $map->addTable($dataTable, 'table1');
- $map->addTable($dataTable2, 'table2');
-
- $response = $this->builder->renderDataTable($map);
- $expected = array(
- 'table1' => array(array('nb_visits' => 5, 'nb_random' => 10)),
- 'table2' => array(array('nb_visits' => 3, 'nb_random' => 6))
- );
-
- $this->assertEquals($expected, $response);
- }
-
- public function test_renderDataTable_shouldRenderSimpleDataTable()
- {
- $dataTable = new DataTable\Simple();
- $dataTable->addRowsFromArray(array('nb_visits' => 3, 'nb_random' => 6));
-
- $response = $this->builder->renderDataTable($dataTable);
- $expected = array('nb_visits' => 3, 'nb_random' => 6);
-
- $this->assertEquals($expected, $response);
- }
-
- public function test_renderArray_ShouldReturnSameArrayNotSerialize()
- {
- $input = array(1, 2, 5, 'string', 10);
-
- // builder has serialize=0
- $response = $this->builder->renderArray($input);
-
- $this->assertSame($input, $response);
- }
-
- public function test_renderArray_ShouldSerializeByDefault()
- {
- $builder = $this->makeBuilder(array());
- $input = array(1, 2, 5, 'string', 10);
-
- $response = $builder->renderArray($input);
-
- $this->assertSame('a:5:{i:0;i:1;i:1;i:2;i:2;i:5;i:3;s:6:"string";i:4;i:10;}', $response);
- }
-
- public function test_renderArray_ShouldSerializeByDefaulMultiDimensionalArray()
- {
- $input = array(
- "firstElement" => "isFirst",
- "secondElement" => array(
- "firstElement" => "isFirst",
- "secondElement" => "isSecond",
- ),
- "thirdElement" => "isThird");
-
- $builder = $this->makeBuilder(array());
- $actual = $builder->renderArray($input);
- $this->assertSame( serialize($input), $actual);
- }
-
- public function test_renderArray_ShouldConvertMultiDimensionalAssociativeArrayToJson()
- {
- $input = array(
- "firstElement" => "isFirst",
- "secondElement" => array(
- "firstElement" => "isFirst",
- "secondElement" => "isSecond",
- ),
- "thirdElement" => "isThird");
-
- $actual = $this->builder->renderArray($input);
- $this->assertSame($input, $actual);
- }
-
- private function makeBuilder($request)
- {
- return new Php($request);
- }
-}
diff --git a/plugins/API/tests/RowEvolutionTest.php b/plugins/API/tests/RowEvolutionTest.php
deleted file mode 100644
index b341efd91a..0000000000
--- a/plugins/API/tests/RowEvolutionTest.php
+++ /dev/null
@@ -1,44 +0,0 @@
-<?php
-/**
- * Piwik - free/libre analytics platform
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- */
-
-namespace Piwik\Plugins\API\tests;
-use Piwik\Plugins\API\RowEvolution;
-use Piwik\Tests\Fixture;
-
-/**
- * @group API
- * @group RowEvolutionTest
- * @group Database
- */
-class RowEvolutionTest extends \DatabaseTestCase
-{
-
- public function setUp()
- {
- parent::setUp();
- Fixture::createWebsite('2014-01-01 00:00:00');
- }
-
- /**
- * @expectedException \Exception
- * @expectedExceptionMessage Reports like VisitsSummary.get which do not have a dimension are not supported by row evolution
- */
- public function test_getRowEvolution_shouldTriggerAnException_IfReportHasNoDimension()
- {
- $rowEvolution = new RowEvolution();
- $rowEvolution->getRowEvolution(1, 'day', 'last7', 'VisitsSummary', 'get');
- }
-
- public function test_getRowEvolution_shouldNotTriggerAnException_IfReportHasADimension()
- {
- $rowEvolution = new RowEvolution();
- $table = $rowEvolution->getRowEvolution(1, 'day', 'last7', 'Actions', 'getPageUrls');
- $this->assertNotEmpty($table);
- }
-
-}
diff --git a/plugins/API/tests/RssRendererTest.php b/plugins/API/tests/RssRendererTest.php
deleted file mode 100644
index 175699fca3..0000000000
--- a/plugins/API/tests/RssRendererTest.php
+++ /dev/null
@@ -1,192 +0,0 @@
-<?php
-/**
- * Piwik - free/libre analytics platform
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- */
-
-namespace Piwik\Plugins\API\tests;
-
-use Piwik\Access;
-use Piwik\DataTable;
-use Piwik\Plugins\API\Renderer\Rss;
-use Piwik\Tests\Fixture;
-
-/**
- * @group Plugin
- * @group API
- */
-class RssRendererTest extends \DatabaseTestCase
-{
- /**
- * @var Rss
- */
- private $builder;
-
- public function setUp()
- {
- parent::setUp();
-
- $pseudoMockAccess = new \FakeAccess();
- \FakeAccess::setSuperUserAccess(true);
- Access::setSingletonInstance($pseudoMockAccess);
-
- $idSite = Fixture::createWebsite('2014-01-01 00:00:00');
-
- $this->builder = $this->makeBuilder(array('method' => 'MultiSites_getAll', 'idSite' => $idSite));
- }
-
- public function test_renderSuccess_shouldIncludeMessage()
- {
- $response = $this->builder->renderSuccess('ok');
-
- $this->assertEquals('Success:ok', $response);
- }
-
- public function test_renderException_shouldIncludeTheMessageAndNotExceptionMessage()
- {
- $response = $this->builder->renderException("The error message", new \Exception('The other message'));
-
- $this->assertEquals('Error: The error message', $response);
- }
-
- public function test_renderObject_shouldReturAnError()
- {
- $response = $this->builder->renderObject(new \stdClass());
-
- $this->assertEquals('Error: The API cannot handle this data structure.', $response);
- }
-
- public function test_renderResource_shouldReturAnError()
- {
- $response = $this->builder->renderResource(new \stdClass());
-
- $this->assertEquals('Error: The API cannot handle this data structure.', $response);
- }
-
- /**
- * @expectedException \Exception
- * @expectedExceptionMessage RSS feeds can be generated for one specific website
- */
- public function test_renderScalar_shouldFailForBooleanScalar()
- {
- $this->builder->renderScalar(true);
- }
-
- /**
- * @expectedException \Exception
- * @expectedExceptionMessage RSS feeds can be generated for one specific website
- */
- public function test_renderScalar_shouldFailForIntegerScalar()
- {
- $this->builder->renderScalar(5);
- }
-
- /**
- * @expectedException \Exception
- * @expectedExceptionMessage RSS feeds can be generated for one specific website
- */
- public function test_renderScalar_shouldFailForStringScalar()
- {
- $this->builder->renderScalar('string');
- }
-
- /**
- * @expectedException \Exception
- * @expectedExceptionMessage RSS feeds can be generated for one specific website
- */
- public function test_renderDataTable_shouldFailForDataTable()
- {
- $dataTable = new DataTable();
- $dataTable->addRowFromSimpleArray(array('nb_visits' => 5, 'nb_random' => 10));
-
- $this->builder->renderDataTable($dataTable);
- }
-
- /**
- * @expectedException \Exception
- * @expectedExceptionMessage RSS feeds can be generated for one specific website
- */
- public function test_renderDataTable_shouldFailForSubtables()
- {
- $subtable = new DataTable();
- $subtable->addRowFromSimpleArray(array('nb_visits' => 2, 'nb_random' => 6));
-
- $dataTable = new DataTable();
- $dataTable->addRowFromSimpleArray(array('nb_visits' => 5, 'nb_random' => 10));
- $dataTable->getFirstRow()->setSubtable($subtable);
-
- $this->builder->renderDataTable($dataTable);
- }
-
- /**
- * @expectedException \Exception
- * @expectedExceptionMessage RSS feeds can be generated for one specific website
- */
- public function test_renderDataTable_shouldFail_IfKeynameIsNotDate()
- {
- $map = new DataTable\Map();
-
- $dataTable = new DataTable();
- $dataTable->addRowFromSimpleArray(array('nb_visits' => 5, 'nb_random' => 10));
-
- $map->addTable($dataTable, 'table1');
- $map->addTable($dataTable, 'table2');
-
- $this->builder->renderDataTable($map);
- }
-
- public function test_renderDataTable_shouldRenderDataTableMaps_IfKeynameIsDate()
- {
- $map = new DataTable\Map();
- $map->setKeyName('date');
- $_GET['period'] = 'day';
-
- $response = $this->builder->renderDataTable($map);
-
- unset($_GET['period']);
-
- $response = preg_replace(array('/<pubDate>(.*)<\/pubDate>/','/<lastBuildDate>(.*)<\/lastBuildDate>/'), '', $response);
-
- $this->assertEquals('<?xml version="1.0" encoding="UTF-8"?>
-<rss version="2.0">
- <channel>
- <title>piwik statistics - RSS</title>
- <link>http://piwik.org</link>
- <description>Piwik RSS feed</description>
-
- <generator>piwik</generator>
- <language>en</language>
- </channel>
-</rss>', $response);
- }
-
- /**
- * @expectedException \Exception
- * @expectedExceptionMessage RSS feeds can be generated for one specific website
- */
- public function test_renderDataTable_shouldFailForSimpleDataTable()
- {
- $dataTable = new DataTable\Simple();
- $dataTable->addRowsFromArray(array('nb_visits' => 3, 'nb_random' => 6));
-
- $this->builder->renderDataTable($dataTable);
- }
-
- /**
- * @expectedException \Exception
- * @expectedExceptionMessage RSS feeds can be generated for one specific website
- */
- public function test_renderArray_ShouldFailForArrays()
- {
- $input = array(1, 2, 5, 'string', 10);
-
- $this->builder->renderArray($input);
- }
-
- private function makeBuilder($request)
- {
- return new Rss($request);
- }
-}
diff --git a/plugins/API/tests/Unit/ConsoleRendererTest.php b/plugins/API/tests/Unit/ConsoleRendererTest.php
new file mode 100644
index 0000000000..bd556809ff
--- /dev/null
+++ b/plugins/API/tests/Unit/ConsoleRendererTest.php
@@ -0,0 +1,121 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+namespace Piwik\Plugins\API\tests\Unit;
+
+use Piwik\DataTable;
+use Piwik\Plugins\API\Renderer\Console;
+
+/**
+ * @group Plugin
+ * @group API
+ */
+class ConsoleRendererTest extends \PHPUnit_Framework_TestCase
+{
+ /**
+ * @var Console
+ */
+ private $builder;
+
+ public function setUp()
+ {
+ $this->builder = $this->makeBuilder(array());
+ DataTable\Manager::getInstance()->deleteAll();
+ }
+
+ public function test_renderSuccess_shouldAlwaysReturnTrueAndIgnoreMessage()
+ {
+ $response = $this->builder->renderSuccess('ok');
+
+ $this->assertEquals('Success:ok', $response);
+ }
+
+ public function test_renderException_shouldThrowTheException()
+ {
+ $response = $this->builder->renderException('This message should be used', new \BadMethodCallException('The other message'));
+
+ $this->assertEquals('Error: This message should be used', $response);
+ }
+
+ public function test_renderScalar_shouldReturnTheSameValue()
+ {
+ $response = $this->builder->renderScalar(true);
+ $this->assertSame("- 1 ['0' => 1] [] [idsubtable = ]<br />
+", $response);
+
+ $response = $this->builder->renderScalar(5);
+ $this->assertSame("- 1 ['0' => 5] [] [idsubtable = ]<br />
+", $response);
+
+ $response = $this->builder->renderScalar('string');
+ $this->assertSame("- 1 ['0' => 'string'] [] [idsubtable = ]<br />
+", $response);
+ }
+
+ public function test_renderObject_shouldReturAnError()
+ {
+ $response = $this->builder->renderObject(new \stdClass());
+
+ $this->assertEquals('Error: The API cannot handle this data structure.', $response);
+ }
+
+ public function test_renderResource_shouldReturAnError()
+ {
+ $response = $this->builder->renderResource(new \stdClass());
+
+ $this->assertEquals('Error: The API cannot handle this data structure.', $response);
+ }
+
+ public function test_renderDataTable_shouldReturnResult()
+ {
+ $dataTable = new DataTable();
+ $dataTable->addRowFromSimpleArray(array('nb_visits' => 5, 'nb_random' => 10));
+
+ $response = $this->builder->renderDataTable($dataTable);
+
+ $this->assertSame("- 1 ['nb_visits' => 5, 'nb_random' => 10] [] [idsubtable = ]<br />
+", $response);
+ }
+
+ public function test_renderArray_ShouldReturnConsoleResult()
+ {
+ $input = array(1, 2, 5, 'string', 10);
+
+ $response = $this->builder->renderArray($input);
+
+ $this->assertSame("- 1 ['0' => 1] [] [idsubtable = ]<br />
+- 2 ['0' => 2] [] [idsubtable = ]<br />
+- 3 ['0' => 5] [] [idsubtable = ]<br />
+- 4 ['0' => 'string'] [] [idsubtable = ]<br />
+- 5 ['0' => 10] [] [idsubtable = ]<br />
+", $response);
+ }
+
+ /**
+ * @expectedException \Exception
+ * @expectedExceptionMessage Data structure returned is not convertible in the requested format
+ */
+ public function test_renderArray_ShouldConvertMultiDimensionalAssociativeArrayToJson()
+ {
+ $input = array(
+ "firstElement" => "isFirst",
+ "secondElement" => array(
+ "firstElement" => "isFirst",
+ "secondElement" => "isSecond",
+ ),
+ "thirdElement" => "isThird");
+
+ $actual = $this->builder->renderArray($input);
+ $this->assertSame($input, $actual);
+ }
+
+ private function makeBuilder($request)
+ {
+ return new Console($request);
+ }
+}
diff --git a/plugins/API/tests/Unit/CsvRendererTest.php b/plugins/API/tests/Unit/CsvRendererTest.php
new file mode 100644
index 0000000000..76d16ed515
--- /dev/null
+++ b/plugins/API/tests/Unit/CsvRendererTest.php
@@ -0,0 +1,283 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+namespace Piwik\Plugins\API\test\Unit;
+
+use Piwik\DataTable;
+use Piwik\Plugins\API\Renderer\Csv;
+
+/**
+ * @group Plugin
+ * @group API
+ */
+class CsvRendererTest extends \PHPUnit_Framework_TestCase
+{
+ /**
+ * @var Csv
+ */
+ private $builder;
+
+ public function setUp()
+ {
+ $this->builder = $this->makeBuilder(array('method' => 'MultiSites_getAll', 'convertToUnicode' => 0));
+ }
+
+ public function test_renderSuccess_shouldIncludeMessage()
+ {
+ $response = $this->builder->renderSuccess('ok');
+
+ $this->assertEquals("message
+ok", $response);
+ }
+
+ public function test_renderException_shouldIncludeTheMessageAndNotExceptionMessage()
+ {
+ $response = $this->builder->renderException("The error message", new \Exception('The other message'));
+
+ $this->assertEquals('Error: The error message', $response);
+ }
+
+ public function test_renderException_shouldRespectNewlines()
+ {
+ $response = $this->builder->renderException("The\nerror\nmessage", new \Exception('The other message'));
+
+ $this->assertEquals('Error: The
+error
+message', $response);
+ }
+
+ public function test_renderObject_shouldReturAnError()
+ {
+ $response = $this->builder->renderObject(new \stdClass());
+
+ $this->assertEquals('Error: The API cannot handle this data structure.', $response);
+ }
+
+ public function test_renderResource_shouldReturAnError()
+ {
+ $response = $this->builder->renderResource(new \stdClass());
+
+ $this->assertEquals('Error: The API cannot handle this data structure.', $response);
+ }
+
+ public function test_renderScalar_shouldConvertToUnicodeByDefault()
+ {
+ $builder = $this->makeBuilder(array('method' => 'MultiSites_getAll'));
+ $response = $builder->renderScalar(true);
+
+ $this->assertStringStartsWith(chr(255) . chr(254), $response);
+ }
+
+ public function test_renderScalar_shouldReturnABooleanAsIntegerWrappedInTable()
+ {
+ $response = $this->builder->renderScalar(true);
+
+ $this->assertEquals('value
+1', $response);
+ }
+
+ public function test_renderScalar_shouldReturnAnIntegerWrappedInTable()
+ {
+ $response = $this->builder->renderScalar(5);
+
+ $this->assertEquals('value
+5', $response);
+ }
+
+ public function test_renderScalar_shouldReturnAStringWrappedInValue()
+ {
+ $response = $this->builder->renderScalar('The Output');
+
+ $this->assertEquals('value
+The Output', $response);
+ }
+
+ public function test_renderScalar_shouldNotRemoveLineBreaks()
+ {
+ $response = $this->builder->renderScalar('The\nOutput');
+
+ $this->assertEquals('value
+The\nOutput', $response);
+ }
+
+ public function test_renderDataTable_shouldRenderABasicDataTable()
+ {
+ $dataTable = new DataTable();
+ $dataTable->addRowFromSimpleArray(array('nb_visits' => 5, 'nb_random' => 10));
+
+ $response = $this->builder->renderDataTable($dataTable);
+
+ $this->assertEquals('nb_visits,nb_random
+5,10', $response);
+ }
+
+ public function test_renderDataTable_shouldNotRenderSubtables_AsItIsNotSupportedYet()
+ {
+ $subtable = new DataTable();
+ $subtable->addRowFromSimpleArray(array('nb_visits' => 2, 'nb_random' => 6));
+
+ $dataTable = new DataTable();
+ $dataTable->addRowFromSimpleArray(array('nb_visits' => 5, 'nb_random' => 10));
+ $dataTable->getFirstRow()->setSubtable($subtable);
+
+ $response = $this->builder->renderDataTable($dataTable);
+
+ $this->assertEquals('nb_visits,nb_random
+5,10', $response);
+ }
+
+ public function test_renderDataTable_shouldRenderDataTableMaps()
+ {
+ $map = new DataTable\Map();
+
+ $dataTable = new DataTable();
+ $dataTable->addRowFromSimpleArray(array('nb_visits' => 5, 'nb_random' => 10));
+
+ $dataTable2 = new DataTable();
+ $dataTable2->addRowFromSimpleArray(array('nb_visits' => 3, 'nb_random' => 6));
+
+ $map->addTable($dataTable, 'table1');
+ $map->addTable($dataTable2, 'table2');
+
+ $response = $this->builder->renderDataTable($map);
+
+ $this->assertEquals('defaultKeyName,nb_visits,nb_random
+table1,5,10
+table2,3,6', $response);
+ }
+
+ public function test_renderDataTable_shouldRenderSimpleDataTable()
+ {
+ $dataTable = new DataTable\Simple();
+ $dataTable->addRowsFromArray(array('nb_visits' => 3, 'nb_random' => 6));
+
+ $response = $this->builder->renderDataTable($dataTable);
+
+ $this->assertEquals('nb_visits,nb_random
+3,6', $response);
+ }
+
+ public function test_renderArray_ShouldConvertSimpleArrayToJson()
+ {
+ $input = array(1, 2, 5, 'string', 10);
+
+ $response = $this->builder->renderArray($input);
+
+ $this->assertEquals('1
+2
+5
+string
+10', $response);
+ }
+
+ public function test_renderArray_ShouldRenderAnEmptyArray()
+ {
+ $response = $this->builder->renderArray(array());
+
+ $this->assertEquals('No data available', $response);
+ }
+
+ public function test_renderArray_ShouldConvertAssociativeArrayToJson()
+ {
+ $input = array('nb_visits' => 6, 'nb_random' => 8);
+
+ $response = $this->builder->renderArray($input);
+
+ $this->assertEquals('nb_visits,nb_random
+6,8', $response);
+ }
+
+ public function test_renderArray_ShouldConvertsIndexedAssociativeArrayToJson()
+ {
+ $input = array(
+ array('nb_visits' => 6, 'nb_random' => 8),
+ array('nb_visits' => 3, 'nb_random' => 4)
+ );
+
+ $response = $this->builder->renderArray($input);
+
+ $this->assertEquals('nb_visits,nb_random
+6,8
+3,4', $response);
+ }
+
+ public function test_renderArray_ShouldConvertMultiDimensionalStandardArrayToJson()
+ {
+ $input = array("firstElement",
+ array(
+ "firstElement",
+ "secondElement",
+ ),
+ "thirdElement");
+
+ $actual = $this->builder->renderArray($input);
+ $this->assertEquals('0,1,2
+firstElement,,
+firstElement,secondElement,
+,,thirdElement', $actual);
+ }
+
+ /**
+ * @expectedException \Exception
+ * @expectedExceptionMessage Data structure returned is not convertible in the requested format
+ */
+ public function test_renderArray_ShouldConvertMultiDimensionalAssociativeArrayToJson()
+ {
+ $input = array(
+ "firstElement" => "isFirst",
+ "secondElement" => array(
+ "firstElement" => "isFirst",
+ "secondElement" => "isSecond",
+ ),
+ "thirdElement" => "isThird");
+
+ $this->builder->renderArray($input);
+ }
+
+ /**
+ * @expectedException \Exception
+ * @expectedExceptionMessage Data structure returned is not convertible in the requested format
+ */
+ public function test_renderArray_ShouldConvertMultiDimensionalIndexArrayToJson()
+ {
+ $input = array(array("firstElement",
+ array(
+ "firstElement",
+ "secondElement",
+ ),
+ "thirdElement"));
+
+ $this->builder->renderArray($input);
+ }
+
+ /**
+ * @expectedException \Exception
+ * @expectedExceptionMessage Data structure returned is not convertible in the requested format
+ */
+ public function test_renderArray_ShouldConvertMultiDimensionalMixedArrayToJson()
+ {
+ $input = array(
+ "firstElement" => "isFirst",
+ array(
+ "firstElement",
+ "secondElement",
+ ),
+ "thirdElement" => array(
+ "firstElement" => "isFirst",
+ "secondElement" => "isSecond",
+ )
+ );
+
+ $this->builder->renderArray($input);
+ }
+
+ private function makeBuilder($request)
+ {
+ return new Csv($request);
+ }
+}
diff --git a/plugins/API/tests/Unit/HtmlRendererTest.php b/plugins/API/tests/Unit/HtmlRendererTest.php
new file mode 100644
index 0000000000..374f33e0b6
--- /dev/null
+++ b/plugins/API/tests/Unit/HtmlRendererTest.php
@@ -0,0 +1,459 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+namespace Piwik\Plugins\API\tests\Unit;
+
+use Piwik\DataTable;
+use Piwik\Plugins\API\Renderer\Html;
+
+/**
+ * @group Plugin
+ * @group API
+ */
+class HtmlRendererTest extends \PHPUnit_Framework_TestCase
+{
+ /**
+ * @var Html
+ */
+ private $builder;
+
+ public function setUp()
+ {
+ $this->builder = $this->makeBuilder(array('method' => 'MultiSites_getAll'));
+ DataTable\Manager::getInstance()->deleteAll();
+ }
+
+ public function test_renderSuccess_shouldIncludeMessage()
+ {
+ $response = $this->builder->renderSuccess('ok');
+
+ $this->assertEquals('Success:ok', $response);
+ }
+
+ public function test_renderException_shouldIncludeTheMessageAndNotExceptionMessage()
+ {
+ $response = $this->builder->renderException("The error message", new \Exception('The other message'));
+
+ $this->assertEquals('The error message', $response);
+ }
+
+ public function test_renderException_shouldConvertNewLinesToBr()
+ {
+ $response = $this->builder->renderException("The\nerror\nmessage", new \Exception('The other message'));
+
+ $this->assertEquals('The<br />
+error<br />
+message', $response);
+ }
+
+ public function test_renderObject_shouldReturAnError()
+ {
+ $response = $this->builder->renderObject(new \stdClass());
+
+ $this->assertEquals('The API cannot handle this data structure.', $response);
+ }
+
+ public function test_renderResource_shouldReturAnError()
+ {
+ $response = $this->builder->renderResource(new \stdClass());
+
+ $this->assertEquals('The API cannot handle this data structure.', $response);
+ }
+
+ public function test_renderScalar_shouldReturnABooleanAsIntegerWrappedInTable()
+ {
+ $response = $this->builder->renderScalar(true);
+
+ $this->assertEquals('<table id="MultiSites_getAll" border="1">
+<thead>
+ <tr>
+ <th>value</th>
+ </tr>
+</thead>
+<tbody>
+ <tr>
+ <td>1</td>
+ </tr>
+</tbody>
+</table>
+', $response);
+ }
+
+ public function test_renderScalar_shouldReturnAnIntegerWrappedInTable()
+ {
+ $response = $this->builder->renderScalar(5);
+
+ $this->assertEquals('<table id="MultiSites_getAll" border="1">
+<thead>
+ <tr>
+ <th>value</th>
+ </tr>
+</thead>
+<tbody>
+ <tr>
+ <td>5</td>
+ </tr>
+</tbody>
+</table>
+', $response);
+ }
+
+ public function test_renderScalar_shouldReturnAStringWrappedInValue()
+ {
+ $response = $this->builder->renderScalar('The Output');
+
+ $this->assertEquals('<table id="MultiSites_getAll" border="1">
+<thead>
+ <tr>
+ <th>value</th>
+ </tr>
+</thead>
+<tbody>
+ <tr>
+ <td>The Output</td>
+ </tr>
+</tbody>
+</table>
+', $response);
+ }
+
+ public function test_renderScalar_shouldNotRemoveLineBreaks()
+ {
+ $response = $this->builder->renderScalar('The\nOutput');
+
+ $this->assertEquals('<table id="MultiSites_getAll" border="1">
+<thead>
+ <tr>
+ <th>value</th>
+ </tr>
+</thead>
+<tbody>
+ <tr>
+ <td>The\nOutput</td>
+ </tr>
+</tbody>
+</table>
+', $response);
+ }
+
+ public function test_renderDataTable_shouldRenderABasicDataTable()
+ {
+ $dataTable = new DataTable();
+ $dataTable->addRowFromSimpleArray(array('nb_visits' => 5, 'nb_random' => 10));
+
+ $response = $this->builder->renderDataTable($dataTable);
+
+ $this->assertEquals('<table id="MultiSites_getAll" border="1">
+<thead>
+ <tr>
+ <th>nb_visits</th>
+ <th>nb_random</th>
+ </tr>
+</thead>
+<tbody>
+ <tr>
+ <td>5</td>
+ <td>10</td>
+ </tr>
+</tbody>
+</table>
+', $response);
+ }
+
+ public function test_renderDataTable_shouldRenderSubtables()
+ {
+ $subtable = new DataTable();
+ $subtable->addRowFromSimpleArray(array('nb_visits' => 2, 'nb_random' => 6));
+
+ $dataTable = new DataTable();
+ $dataTable->addRowFromSimpleArray(array('nb_visits' => 5, 'nb_random' => 10));
+ $dataTable->getFirstRow()->setSubtable($subtable);
+
+ $response = $this->builder->renderDataTable($dataTable);
+
+ $this->assertEquals('<table id="MultiSites_getAll" border="1">
+<thead>
+ <tr>
+ <th>nb_visits</th>
+ <th>nb_random</th>
+ <th>_idSubtable</th>
+ </tr>
+</thead>
+<tbody>
+ <tr>
+ <td>5</td>
+ <td>10</td>
+ <td>1</td>
+ </tr>
+</tbody>
+</table>
+', $response);
+ }
+
+ public function test_renderDataTable_shouldRenderDataTableMaps()
+ {
+ $map = new DataTable\Map();
+
+ $dataTable = new DataTable();
+ $dataTable->addRowFromSimpleArray(array('nb_visits' => 5, 'nb_random' => 10));
+
+ $dataTable2 = new DataTable();
+ $dataTable2->addRowFromSimpleArray(array('nb_visits' => 3, 'nb_random' => 6));
+
+ $map->addTable($dataTable, 'table1');
+ $map->addTable($dataTable2, 'table2');
+
+ $response = $this->builder->renderDataTable($map);
+
+ $this->assertEquals('<table id="MultiSites_getAll" border="1">
+<thead>
+ <tr>
+ <th>_defaultKeyName</th>
+ <th>nb_visits</th>
+ <th>nb_random</th>
+ </tr>
+</thead>
+<tbody>
+ <tr>
+ <td>table1</td>
+ <td>5</td>
+ <td>10</td>
+ </tr>
+ <tr>
+ <td>table2</td>
+ <td>3</td>
+ <td>6</td>
+ </tr>
+</tbody>
+</table>
+', $response);
+ }
+
+ public function test_renderDataTable_shouldRenderSimpleDataTable()
+ {
+ $dataTable = new DataTable\Simple();
+ $dataTable->addRowsFromArray(array('nb_visits' => 3, 'nb_random' => 6));
+
+ $response = $this->builder->renderDataTable($dataTable);
+
+ $this->assertEquals('<table id="MultiSites_getAll" border="1">
+<thead>
+ <tr>
+ <th>nb_visits</th>
+ <th>nb_random</th>
+ </tr>
+</thead>
+<tbody>
+ <tr>
+ <td>3</td>
+ <td>6</td>
+ </tr>
+</tbody>
+</table>
+', $response);
+ }
+
+ public function test_renderArray_ShouldConvertSimpleArrayToJson()
+ {
+ $input = array(1, 2, 5, 'string', 10);
+
+ $response = $this->builder->renderArray($input);
+
+ $this->assertEquals('<table id="MultiSites_getAll" border="1">
+<thead>
+ <tr>
+ <th>value</th>
+ </tr>
+</thead>
+<tbody>
+ <tr>
+ <td>1</td>
+ </tr>
+ <tr>
+ <td>2</td>
+ </tr>
+ <tr>
+ <td>5</td>
+ </tr>
+ <tr>
+ <td>string</td>
+ </tr>
+ <tr>
+ <td>10</td>
+ </tr>
+</tbody>
+</table>
+', $response);
+ }
+
+ public function test_renderArray_ShouldRenderAnEmptyArray()
+ {
+ $response = $this->builder->renderArray(array());
+
+ $this->assertEquals('<table id="MultiSites_getAll" border="1">
+<thead>
+ <tr>
+ </tr>
+</thead>
+<tbody>
+</tbody>
+</table>
+', $response);
+ }
+
+ public function test_renderArray_ShouldConvertAssociativeArrayToJson()
+ {
+ $input = array('nb_visits' => 6, 'nb_random' => 8);
+
+ $response = $this->builder->renderArray($input);
+
+ $this->assertEquals('<table id="MultiSites_getAll" border="1">
+<thead>
+ <tr>
+ <th>nb_visits</th>
+ <th>nb_random</th>
+ </tr>
+</thead>
+<tbody>
+ <tr>
+ <td>6</td>
+ <td>8</td>
+ </tr>
+</tbody>
+</table>
+', $response);
+ }
+
+ public function test_renderArray_ShouldConvertsIndexedAssociativeArrayToJson()
+ {
+ $input = array(
+ array('nb_visits' => 6, 'nb_random' => 8),
+ array('nb_visits' => 3, 'nb_random' => 4)
+ );
+
+ $response = $this->builder->renderArray($input);
+
+ $this->assertEquals('<table id="MultiSites_getAll" border="1">
+<thead>
+ <tr>
+ <th>nb_visits</th>
+ <th>nb_random</th>
+ </tr>
+</thead>
+<tbody>
+ <tr>
+ <td>6</td>
+ <td>8</td>
+ </tr>
+ <tr>
+ <td>3</td>
+ <td>4</td>
+ </tr>
+</tbody>
+</table>
+', $response);
+ }
+
+ public function test_renderArray_ShouldConvertMultiDimensionalStandardArrayToJson()
+ {
+ $input = array("firstElement",
+ array(
+ "firstElement",
+ "secondElement",
+ ),
+ "thirdElement");
+
+ $actual = $this->builder->renderArray($input);
+ $this->assertEquals('<table id="MultiSites_getAll" border="1">
+<thead>
+ <tr>
+ <th>value</th>
+ <th>1</th>
+ <th>2</th>
+ </tr>
+</thead>
+<tbody>
+ <tr>
+ <td>firstElement</td>
+ <td>-</td>
+ <td>-</td>
+ </tr>
+ <tr>
+ <td>firstElement</td>
+ <td>secondElement</td>
+ <td>-</td>
+ </tr>
+ <tr>
+ <td>-</td>
+ <td>-</td>
+ <td>thirdElement</td>
+ </tr>
+</tbody>
+</table>
+', $actual);
+ }
+
+ /**
+ * @expectedException \Exception
+ * @expectedExceptionMessage Data structure returned is not convertible in the requested format
+ */
+ public function test_renderArray_ShouldConvertMultiDimensionalAssociativeArrayToJson()
+ {
+ $input = array(
+ "firstElement" => "isFirst",
+ "secondElement" => array(
+ "firstElement" => "isFirst",
+ "secondElement" => "isSecond",
+ ),
+ "thirdElement" => "isThird");
+
+ $this->builder->renderArray($input);
+ }
+
+ /**
+ * @expectedException \Exception
+ * @expectedExceptionMessage Data structure returned is not convertible in the requested format
+ */
+ public function test_renderArray_ShouldConvertMultiDimensionalIndexArrayToJson()
+ {
+ $input = array(array("firstElement",
+ array(
+ "firstElement",
+ "secondElement",
+ ),
+ "thirdElement"));
+
+ $this->builder->renderArray($input);
+ }
+
+ /**
+ * @expectedException \Exception
+ * @expectedExceptionMessage Data structure returned is not convertible in the requested format
+ */
+ public function test_renderArray_ShouldConvertMultiDimensionalMixedArrayToJson()
+ {
+ $input = array(
+ "firstElement" => "isFirst",
+ array(
+ "firstElement",
+ "secondElement",
+ ),
+ "thirdElement" => array(
+ "firstElement" => "isFirst",
+ "secondElement" => "isSecond",
+ )
+ );
+
+ $this->builder->renderArray($input);
+ }
+
+ private function makeBuilder($request)
+ {
+ return new Html($request);
+ }
+}
diff --git a/plugins/API/tests/Unit/JsonRendererTest.php b/plugins/API/tests/Unit/JsonRendererTest.php
new file mode 100644
index 0000000000..c4fa076483
--- /dev/null
+++ b/plugins/API/tests/Unit/JsonRendererTest.php
@@ -0,0 +1,385 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+namespace Piwik\Plugins\API\tests\Unit;
+
+use Piwik\DataTable;
+use Piwik\Plugins\API\Renderer\Json;
+use Piwik\Plugins\API\Renderer\Json2;
+
+/**
+ * @group Plugin
+ * @group API
+ * @group API_JsonRendererTest
+ */
+class JsonRendererTest extends \PHPUnit_Framework_TestCase
+{
+ /**
+ * @var Json
+ */
+ private $jsonBuilder;
+
+ public function setUp()
+ {
+ $this->jsonBuilder = $this->makeBuilder(array());
+ DataTable\Manager::getInstance()->deleteAll();
+ }
+
+ public function test_renderSuccess_shouldIncludeMessage()
+ {
+ $response = $this->jsonBuilder->renderSuccess('ok');
+
+ $this->assertEquals('{"result":"success","message":"ok"}', $response);
+ $this->assertEquals((array) array('result' => 'success', 'message' => 'ok'), json_decode($response, true));
+ $this->assertNoJsonError($response);
+ }
+
+ public function test_renderSuccess_shouldWrapIfEnabledAndCallbackShouldBePreferred()
+ {
+ $builder = $this->makeBuilder(array('callback' => 'myName', 'jsoncallback' => 'myOther'));
+ $response = $builder->renderSuccess('ok');
+
+ $this->assertEquals('myName({"result":"success","message":"ok"})', $response);
+ $this->assertNoJsonError($response);
+ }
+
+ public function test_renderSuccess_shouldWrapIfEnabledAndFallbackToJsonCallbackIfCallbackNotSet()
+ {
+ $builder = $this->makeBuilder(array('jsoncallback' => 'myOther'));
+ $response = $builder->renderSuccess('ok');
+
+ $this->assertEquals('myOther({"result":"success","message":"ok"})', $response);
+ $this->assertNoJsonError($response);
+ }
+
+ public function test_renderSuccess_shouldNotWrapIfCallbackContainsInvalidCharacters()
+ {
+ $builder = $this->makeBuilder(array('callback' => 'myOther#?._kek'));
+ $response = $builder->renderSuccess('ok');
+
+ $this->assertEquals('{"result":"success","message":"ok"}', $response);
+ $this->assertNoJsonError($response);
+ }
+
+ public function test_renderException_shouldIncludeTheMessageAndNotExceptionMessage()
+ {
+ $response = $this->jsonBuilder->renderException("The error message", new \Exception('The other message'));
+
+ $this->assertEquals('{"result":"error","message":"The error message"}', $response);
+ $this->assertEquals((array) array('result' => 'error', 'message' => 'The error message'), json_decode($response, true));
+ $this->assertNoJsonError($response);
+ }
+
+ public function test_renderException_shouldRemoveWhitespace()
+ {
+ $response = $this->jsonBuilder->renderException("The\nerror\r\nmessage", new \Exception());
+
+ $this->assertEquals('{"result":"error","message":"Theerrormessage"}', $response);
+ $this->assertEquals((array) array('result' => 'error', 'message' => 'Theerrormessage'), json_decode($response, true));
+ $this->assertNoJsonError($response);
+ }
+
+ public function test_renderException_shouldWrapIfEnabled()
+ {
+ $builder = $this->makeBuilder(array('callback' => 'myName'));
+ $response = $builder->renderException('error', new \Exception());
+
+ $this->assertEquals('myName({"result":"error","message":"error"})', $response);
+ $this->assertNoJsonError($response);
+ }
+
+ public function test_renderObject_shouldReturAnError()
+ {
+ $response = $this->jsonBuilder->renderObject(new \stdClass());
+
+ $this->assertEquals('{"result":"error","message":"The API cannot handle this data structure."}', $response);
+ $this->assertNoJsonError($response);
+ }
+
+ public function test_renderResource_shouldReturAnError()
+ {
+ $response = $this->jsonBuilder->renderResource(new \stdClass());
+
+ $this->assertEquals('{"result":"error","message":"The API cannot handle this data structure."}', $response);
+ $this->assertNoJsonError($response);
+ }
+
+ public function test_renderScalar_shouldReturnABooleanWrappedInValue()
+ {
+ $response = $this->jsonBuilder->renderScalar(true);
+
+ $this->assertEquals('{"value":true}', $response);
+ $this->assertNoJsonError($response);
+ }
+
+ public function test_renderScalar_shouldReturnAnIntegerWrappedInValue()
+ {
+ $response = $this->jsonBuilder->renderScalar(5);
+
+ $this->assertEquals('{"value":5}', $response);
+ $this->assertNoJsonError($response);
+ }
+
+ public function test_renderScalar_shouldReturnAStringWrappedInValue()
+ {
+ $response = $this->jsonBuilder->renderScalar('The Output');
+
+ $this->assertEquals('{"value":"The Output"}', $response);
+ $this->assertNoJsonError($response);
+ }
+
+ public function test_renderScalar_shouldNotRemoveLineBreaks()
+ {
+ $response = $this->jsonBuilder->renderScalar('The\nOutput');
+
+ $this->assertEquals('{"value":"The\\\\nOutput"}', $response);
+ $this->assertNoJsonError($response);
+ }
+
+ public function test_renderScalar_shouldWrapJsonIfNeeded()
+ {
+ $builder = $this->makeBuilder(array('callback' => 'myName'));
+ $response = $builder->renderScalar(true);
+
+ $this->assertEquals('myName({"value":true})', $response);
+ $this->assertNoJsonError($response);
+ }
+
+ public function test_renderDataTable_shouldRenderABasicDataTable()
+ {
+ $dataTable = new DataTable();
+ $dataTable->addRowFromSimpleArray(array('nb_visits' => 5, 'nb_random' => 10));
+
+ $response = $this->jsonBuilder->renderDataTable($dataTable);
+
+ $this->assertEquals('[{"nb_visits":5,"nb_random":10}]', $response);
+ $this->assertNoJsonError($response);
+ }
+
+ public function test_renderDataTable_shouldRenderSubtables()
+ {
+ $subtable = new DataTable();
+ $subtable->addRowFromSimpleArray(array('nb_visits' => 2, 'nb_random' => 6));
+
+ $dataTable = new DataTable();
+ $dataTable->addRowFromSimpleArray(array('nb_visits' => 5, 'nb_random' => 10));
+ $dataTable->getFirstRow()->setSubtable($subtable);
+
+ $response = $this->jsonBuilder->renderDataTable($dataTable);
+
+ $this->assertEquals('[{"nb_visits":5,"nb_random":10,"idsubdatatable":1}]', $response);
+ $this->assertNoJsonError($response);
+ }
+
+ public function test_renderDataTable_shouldRenderDataTableMaps()
+ {
+ $map = new DataTable\Map();
+
+ $dataTable = new DataTable();
+ $dataTable->addRowFromSimpleArray(array('nb_visits' => 5, 'nb_random' => 10));
+
+ $dataTable2 = new DataTable();
+ $dataTable2->addRowFromSimpleArray(array('nb_visits' => 3, 'nb_random' => 6));
+
+ $map->addTable($dataTable, 'table1');
+ $map->addTable($dataTable2, 'table2');
+
+ $response = $this->jsonBuilder->renderDataTable($map);
+
+ $this->assertEquals('{"table1":[{"nb_visits":5,"nb_random":10}],"table2":[{"nb_visits":3,"nb_random":6}]}', $response);
+ $this->assertNoJsonError($response);
+ }
+
+ public function test_renderDataTable_shouldRenderSimpleDataTable()
+ {
+ $dataTable = new DataTable\Simple();
+ $dataTable->addRowsFromArray(array('nb_visits' => 3, 'nb_random' => 6));
+
+ $response = $this->jsonBuilder->renderDataTable($dataTable);
+
+ $this->assertEquals('{"nb_visits":3,"nb_random":6}', $response);
+ $this->assertNoJsonError($response);
+ }
+
+ public function test_renderDataTable_shouldWrapADataTable()
+ {
+ $builder = $this->makeBuilder(array('callback' => 'myName'));
+ $dataTable = new DataTable();
+ $dataTable->addRowFromSimpleArray(array('nb_visits' => 5, 'nb_random' => 10));
+
+ $response = $builder->renderDataTable($dataTable);
+
+ $this->assertEquals('myName([{"nb_visits":5,"nb_random":10}])', $response);
+ $this->assertNoJsonError($response);
+ }
+
+ public function test_renderArray_ShouldConvertSimpleArrayToJson()
+ {
+ $input = array(1, 2, 5, 'string', 10);
+
+ $response = $this->jsonBuilder->renderArray($input);
+
+ $this->assertEquals('[1,2,5,"string",10]', $response);
+ $this->assertNoJsonError($response);
+ }
+
+ public function test_renderArray_ShouldWrapJsonIfRequested()
+ {
+ $input = array(1, 2, 5, 'string', 10);
+
+ $builder = $this->makeBuilder(array('jsoncallback' => 'myName'));
+ $response = $builder->renderArray($input);
+
+ $this->assertEquals('myName([1,2,5,"string",10])', $response);
+ }
+
+ public function test_renderArray_ShouldRenderAnEmptyArray()
+ {
+ $response = $this->jsonBuilder->renderArray(array());
+
+ $this->assertEquals('[]', $response);
+ $this->assertNoJsonError($response);
+ }
+
+ public function test_renderArray_ShouldConvertAssociativeArrayToJson()
+ {
+ $input = array('nb_visits' => 6, 'nb_random' => 8);
+
+ $response = $this->jsonBuilder->renderArray($input);
+ $expected = json_encode($input);
+
+ $this->assertEquals($expected, $response);
+ $this->assertNoJsonError($response);
+ }
+
+ public function test_renderArray_ShouldConvertsIndexedAssociativeArrayToJson()
+ {
+ $input = array(
+ array('nb_visits' => 6, 'nb_random' => 8),
+ array('nb_visits' => 3, 'nb_random' => 4)
+ );
+
+ $response = $this->jsonBuilder->renderArray($input);
+ $expected = json_encode($input);
+
+ $this->assertEquals($expected, $response);
+ $this->assertNoJsonError($response);
+ }
+
+ public function test_renderArray_ShouldConvertMultiDimensionalStandardArrayToJson()
+ {
+ $input = array("firstElement",
+ array(
+ "firstElement",
+ "secondElement",
+ ),
+ "thirdElement");
+
+ $expected = json_encode($input);
+
+ $actual = $this->jsonBuilder->renderArray($input);
+ $this->assertEquals($expected, $actual);
+ $this->assertNoJsonError($actual);
+ }
+
+ public function test_renderArray_ShouldConvertMultiDimensionalAssociativeArrayToJson()
+ {
+ $input = array(
+ "firstElement" => "isFirst",
+ "secondElement" => array(
+ "firstElement" => "isFirst",
+ "secondElement" => "isSecond",
+ ),
+ "thirdElement" => "isThird");
+
+ $expected = json_encode($input);
+
+ $actual = $this->jsonBuilder->renderArray($input);
+ $this->assertEquals($expected, $actual);
+ $this->assertNoJsonError($actual);
+ }
+
+ public function test_renderArray_ShouldConvertSingleDimensionalAssociativeArrayToJson()
+ {
+ $input = array(
+ "fistElement" => "isFirst",
+ "secondElement" => "isSecond"
+ );
+
+ $expected = json_encode($input);
+
+ $actual = $this->jsonBuilder->renderArray($input);
+ $this->assertEquals($expected, $actual);
+ $this->assertNoJsonError($actual);
+ }
+
+ public function test_renderArray_ShouldConvertMultiDimensionalIndexArrayToJson()
+ {
+ $input = array(array("firstElement",
+ array(
+ "firstElement",
+ "secondElement",
+ ),
+ "thirdElement"));
+
+ $expected = json_encode($input);
+
+ $actual = $this->jsonBuilder->renderArray($input);
+ $this->assertEquals($expected, $actual);
+ $this->assertNoJsonError($actual);
+ }
+
+ public function test_renderArray_ShouldConvertMultiDimensionalMixedArrayToJson()
+ {
+ $input = array(
+ "firstElement" => "isFirst",
+ array(
+ "firstElement",
+ "secondElement",
+ ),
+ "thirdElement" => array(
+ "firstElement" => "isFirst",
+ "secondElement" => "isSecond",
+ )
+ );
+
+ $expected = json_encode($input);
+
+ $actual = $this->jsonBuilder->renderArray($input);
+ $this->assertEquals($expected, $actual);
+ $this->assertNoJsonError($actual);
+ }
+
+ /**
+ * backwards compatibility test
+ */
+ public function test_oldJson_renderArray_ShouldConvertSingleDimensionalAssociativeArray()
+ {
+ $input = array(
+ "firstElement" => "isFirst",
+ "secondElement" => "isSecond"
+ );
+
+ $expected = '[{"firstElement":"isFirst","secondElement":"isSecond"}]';
+
+ $oldJsonBuilder = new Json($input);
+ $actual = $oldJsonBuilder->renderArray($input);
+ $this->assertEquals($expected, $actual);
+ $this->assertNoJsonError($actual);
+ }
+
+ private function makeBuilder($request)
+ {
+ return new Json2($request);
+ }
+
+ private function assertNoJsonError($response)
+ {
+ return null !== json_decode($response);
+ }
+}
diff --git a/plugins/API/tests/Unit/OriginalRendererTest.php b/plugins/API/tests/Unit/OriginalRendererTest.php
new file mode 100644
index 0000000000..bed40d1e29
--- /dev/null
+++ b/plugins/API/tests/Unit/OriginalRendererTest.php
Binary files differ
diff --git a/plugins/API/tests/Unit/PhpRendererTest.php b/plugins/API/tests/Unit/PhpRendererTest.php
new file mode 100644
index 0000000000..77a5efa568
--- /dev/null
+++ b/plugins/API/tests/Unit/PhpRendererTest.php
@@ -0,0 +1,218 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+namespace Piwik\Plugins\API\tests\Unit;
+
+use Piwik\DataTable;
+use Piwik\Plugins\API\Renderer\Php;
+
+/**
+ * @group Plugin
+ * @group API
+ * @group PhpRendererTest
+ */
+class PhpRendererTest extends \PHPUnit_Framework_TestCase
+{
+ /**
+ * @var Php
+ */
+ private $builder;
+
+ public function setUp()
+ {
+ $this->builder = $this->makeBuilder(array('serialize' => 0));
+ DataTable\Manager::getInstance()->deleteAll();
+ }
+
+ public function test_renderSuccess_shouldAlwaysReturnTrueAndIgnoreMessage()
+ {
+ $response = $this->builder->renderSuccess('ok');
+ $expected = array('result' => 'success', 'message' => 'ok');
+
+ $this->assertEquals($expected, $response);
+ }
+
+ public function test_renderSuccess_shouldSerializeByDefault()
+ {
+ $response = $this->makeBuilder(array())->renderSuccess('ok');
+ $expected = 'a:2:{s:6:"result";s:7:"success";s:7:"message";s:2:"ok";}';
+
+ $this->assertEquals($expected, $response);
+ }
+
+ public function test_renderException_shouldReturnTheMessageAndNotTheExceptionMessage()
+ {
+ $response = $this->builder->renderException('This message should be ignored', new \BadMethodCallException('The other message'));
+ $expected = array('result' => 'error', 'message' => 'This message should be ignored');
+
+ $this->assertEquals($expected, $response);
+ }
+
+ public function test_renderException_shouldSerializeByDefault()
+ {
+ $response = $this->makeBuilder(array())->renderException('This message should be ignored', new \BadMethodCallException('The other message'));
+ $expected = 'a:2:{s:6:"result";s:5:"error";s:7:"message";s:30:"This message should be ignored";}';
+
+ $this->assertEquals($expected, $response);
+ }
+
+ public function test_renderScalar_shouldReturnTheSameValue()
+ {
+ $response = $this->builder->renderScalar(true);
+ $this->assertEquals(true, $response);
+
+ $response = $this->builder->renderScalar(5);
+ $this->assertEquals(5, $response);
+
+ $response = $this->builder->renderScalar('string');
+ $this->assertEquals('string', $response);
+ }
+
+ public function test_renderObject_shouldReturnTheSameValue()
+ {
+ $response = $this->builder->renderObject($this);
+ $expected = array('result' => 'error', 'message' => 'The API cannot handle this data structure.');
+
+ $this->assertEquals($expected, $response);
+ }
+
+ public function test_renderResource_shouldReturnTheSameValue()
+ {
+ $resource = curl_init();
+ $response = $this->builder->renderResource($resource);
+ $expected = array('result' => 'error', 'message' => 'The API cannot handle this data structure.');
+
+ $this->assertEquals($expected, $response);
+ }
+
+ public function test_renderDataTable_shouldNotSerializeIfDisabled()
+ {
+ $dataTable = new DataTable();
+ $dataTable->addRowFromSimpleArray(array('nb_visits' => 5, 'nb_random' => 10));
+
+ $response = $this->builder->renderDataTable($dataTable);
+ $expected = array(
+ array('nb_visits' => 5, 'nb_random' => 10)
+ );
+ $this->assertEquals($expected, $response);
+ }
+
+ public function test_renderDataTable_shouldSerializeByDefault()
+ {
+ $dataTable = new DataTable();
+ $dataTable->addRowFromSimpleArray(array('nb_visits' => 5, 'nb_random' => 10));
+
+ $builder = $this->makeBuilder(array());
+ $response = $builder->renderDataTable($dataTable);
+
+ $expected = 'a:1:{i:0;a:2:{s:9:"nb_visits";i:5;s:9:"nb_random";i:10;}}';
+ $this->assertSame($expected, $response);
+ }
+
+ public function test_renderDataTable_shouldRenderSubtables()
+ {
+ $subtable = new DataTable();
+ $subtable->addRowFromSimpleArray(array('nb_visits' => 2, 'nb_random' => 6));
+
+ $dataTable = new DataTable();
+ $dataTable->addRowFromSimpleArray(array('nb_visits' => 5, 'nb_random' => 10));
+ $dataTable->getFirstRow()->setSubtable($subtable);
+
+ $response = $this->builder->renderDataTable($dataTable);
+ $expected = array(array('nb_visits' => 5, 'nb_random' => 10, 'idsubdatatable' => 1));
+
+ $this->assertEquals($expected, $response);
+ }
+
+ public function test_renderDataTable_shouldRenderDataTableMaps()
+ {
+ $map = new DataTable\Map();
+
+ $dataTable = new DataTable();
+ $dataTable->addRowFromSimpleArray(array('nb_visits' => 5, 'nb_random' => 10));
+
+ $dataTable2 = new DataTable();
+ $dataTable2->addRowFromSimpleArray(array('nb_visits' => 3, 'nb_random' => 6));
+
+ $map->addTable($dataTable, 'table1');
+ $map->addTable($dataTable2, 'table2');
+
+ $response = $this->builder->renderDataTable($map);
+ $expected = array(
+ 'table1' => array(array('nb_visits' => 5, 'nb_random' => 10)),
+ 'table2' => array(array('nb_visits' => 3, 'nb_random' => 6))
+ );
+
+ $this->assertEquals($expected, $response);
+ }
+
+ public function test_renderDataTable_shouldRenderSimpleDataTable()
+ {
+ $dataTable = new DataTable\Simple();
+ $dataTable->addRowsFromArray(array('nb_visits' => 3, 'nb_random' => 6));
+
+ $response = $this->builder->renderDataTable($dataTable);
+ $expected = array('nb_visits' => 3, 'nb_random' => 6);
+
+ $this->assertEquals($expected, $response);
+ }
+
+ public function test_renderArray_ShouldReturnSameArrayNotSerialize()
+ {
+ $input = array(1, 2, 5, 'string', 10);
+
+ // builder has serialize=0
+ $response = $this->builder->renderArray($input);
+
+ $this->assertSame($input, $response);
+ }
+
+ public function test_renderArray_ShouldSerializeByDefault()
+ {
+ $builder = $this->makeBuilder(array());
+ $input = array(1, 2, 5, 'string', 10);
+
+ $response = $builder->renderArray($input);
+
+ $this->assertSame('a:5:{i:0;i:1;i:1;i:2;i:2;i:5;i:3;s:6:"string";i:4;i:10;}', $response);
+ }
+
+ public function test_renderArray_ShouldSerializeByDefaulMultiDimensionalArray()
+ {
+ $input = array(
+ "firstElement" => "isFirst",
+ "secondElement" => array(
+ "firstElement" => "isFirst",
+ "secondElement" => "isSecond",
+ ),
+ "thirdElement" => "isThird");
+
+ $builder = $this->makeBuilder(array());
+ $actual = $builder->renderArray($input);
+ $this->assertSame( serialize($input), $actual);
+ }
+
+ public function test_renderArray_ShouldConvertMultiDimensionalAssociativeArrayToJson()
+ {
+ $input = array(
+ "firstElement" => "isFirst",
+ "secondElement" => array(
+ "firstElement" => "isFirst",
+ "secondElement" => "isSecond",
+ ),
+ "thirdElement" => "isThird");
+
+ $actual = $this->builder->renderArray($input);
+ $this->assertSame($input, $actual);
+ }
+
+ private function makeBuilder($request)
+ {
+ return new Php($request);
+ }
+}
diff --git a/plugins/API/tests/Unit/XmlRendererTest.php b/plugins/API/tests/Unit/XmlRendererTest.php
new file mode 100644
index 0000000000..f3ca71a10d
--- /dev/null
+++ b/plugins/API/tests/Unit/XmlRendererTest.php
@@ -0,0 +1,346 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+namespace Piwik\Plugins\API\tests\Unit;
+
+use Piwik\DataTable;
+use Piwik\Plugins\API\Renderer\Xml;
+
+/**
+ * @group Plugin
+ * @group API
+ */
+class XmlRendererTest extends \PHPUnit_Framework_TestCase
+{
+ /**
+ * @var Xml
+ */
+ private $builder;
+
+ public function setUp()
+ {
+ $this->builder = $this->makeBuilder(array());
+ DataTable\Manager::getInstance()->deleteAll();
+ }
+
+ public function test_renderSuccess_shouldIncludeMessage()
+ {
+ $response = $this->builder->renderSuccess('ok');
+
+ $this->assertEquals('<?xml version="1.0" encoding="utf-8" ?>
+<result>
+ <success message="ok" />
+</result>', $response);
+ }
+
+ public function test_renderException_shouldIncludeTheMessageAndNotExceptionMessage()
+ {
+ $response = $this->builder->renderException("The error message", new \Exception('The other message'));
+
+ $this->assertEquals('<?xml version="1.0" encoding="utf-8" ?>
+<result>
+ <error message="The error message" />
+</result>', $response);
+ }
+
+ public function test_renderObject_shouldReturAnError()
+ {
+ $response = $this->builder->renderObject(new \stdClass());
+
+ $this->assertEquals('<?xml version="1.0" encoding="utf-8" ?>
+<result>
+ <error message="The API cannot handle this data structure." />
+</result>', $response);
+ }
+
+ public function test_renderResource_shouldReturAnError()
+ {
+ $response = $this->builder->renderResource(new \stdClass());
+
+ $this->assertEquals('<?xml version="1.0" encoding="utf-8" ?>
+<result>
+ <error message="The API cannot handle this data structure." />
+</result>', $response);
+ }
+
+ public function test_renderScalar_shouldReturnABooleanAsIntegerWrappedInResult()
+ {
+ $response = $this->builder->renderScalar(true);
+
+ $this->assertEquals('<?xml version="1.0" encoding="utf-8" ?>
+<result>1</result>', $response);
+ }
+
+ public function test_renderScalar_shouldReturnAnIntegerWrappedInResult()
+ {
+ $response = $this->builder->renderScalar(5);
+
+ $this->assertEquals('<?xml version="1.0" encoding="utf-8" ?>
+<result>5</result>', $response);
+ }
+
+ public function test_renderScalar_shouldReturnAStringWrappedInValue()
+ {
+ $response = $this->builder->renderScalar('The Output');
+
+ $this->assertEquals('<?xml version="1.0" encoding="utf-8" ?>
+<result>The Output</result>', $response);
+ }
+
+ public function test_renderScalar_shouldNotRemoveLineBreaks()
+ {
+ $response = $this->builder->renderScalar('The\nOutput');
+
+ $this->assertEquals('<?xml version="1.0" encoding="utf-8" ?>
+<result>The\nOutput</result>', $response);
+ }
+
+ public function test_renderDataTable_shouldRenderABasicDataTable()
+ {
+ $dataTable = new DataTable();
+ $dataTable->addRowFromSimpleArray(array('nb_visits' => 5, 'nb_random' => 10));
+
+ $response = $this->builder->renderDataTable($dataTable);
+
+ $this->assertEquals('<?xml version="1.0" encoding="utf-8" ?>
+<result>
+ <row>
+ <nb_visits>5</nb_visits>
+ <nb_random>10</nb_random>
+ </row>
+</result>', $response);
+ }
+
+ public function test_renderDataTable_shouldRenderSubtables()
+ {
+ $subtable = new DataTable();
+ $subtable->addRowFromSimpleArray(array('nb_visits' => 2, 'nb_random' => 6));
+
+ $dataTable = new DataTable();
+ $dataTable->addRowFromSimpleArray(array('nb_visits' => 5, 'nb_random' => 10));
+ $dataTable->getFirstRow()->setSubtable($subtable);
+
+ $response = $this->builder->renderDataTable($dataTable);
+
+ $this->assertEquals('<?xml version="1.0" encoding="utf-8" ?>
+<result>
+ <row>
+ <nb_visits>5</nb_visits>
+ <nb_random>10</nb_random>
+ <idsubdatatable>1</idsubdatatable>
+ </row>
+</result>', $response);
+ }
+
+ public function test_renderDataTable_shouldRenderDataTableMaps()
+ {
+ $map = new DataTable\Map();
+
+ $dataTable = new DataTable();
+ $dataTable->addRowFromSimpleArray(array('nb_visits' => 5, 'nb_random' => 10));
+
+ $dataTable2 = new DataTable();
+ $dataTable2->addRowFromSimpleArray(array('nb_visits' => 3, 'nb_random' => 6));
+
+ $map->addTable($dataTable, 'table1');
+ $map->addTable($dataTable2, 'table2');
+
+ $response = $this->builder->renderDataTable($map);
+
+ $this->assertEquals('<?xml version="1.0" encoding="utf-8" ?>
+<results>
+ <result defaultKeyName="table1">
+ <row>
+ <nb_visits>5</nb_visits>
+ <nb_random>10</nb_random>
+ </row>
+ </result>
+ <result defaultKeyName="table2">
+ <row>
+ <nb_visits>3</nb_visits>
+ <nb_random>6</nb_random>
+ </row>
+ </result>
+</results>', $response);
+ }
+
+ public function test_renderDataTable_shouldRenderSimpleDataTable()
+ {
+ $dataTable = new DataTable\Simple();
+ $dataTable->addRowsFromArray(array('nb_visits' => 3, 'nb_random' => 6));
+
+ $response = $this->builder->renderDataTable($dataTable);
+
+ $this->assertEquals('<?xml version="1.0" encoding="utf-8" ?>
+<result>
+ <nb_visits>3</nb_visits>
+ <nb_random>6</nb_random>
+</result>', $response);
+ }
+
+ public function test_renderArray_ShouldConvertSimpleArrayToJson()
+ {
+ $input = array(1, 2, 5, 'string', 10);
+
+ $response = $this->builder->renderArray($input);
+
+ $this->assertEquals('<?xml version="1.0" encoding="utf-8" ?>
+<result>
+ <row>1</row>
+ <row>2</row>
+ <row>5</row>
+ <row>string</row>
+ <row>10</row>
+</result>', $response);
+ }
+
+ public function test_renderArray_ShouldRenderAnEmptyArray()
+ {
+ $response = $this->builder->renderArray(array());
+
+ $this->assertEquals('<?xml version="1.0" encoding="utf-8" ?>
+<result />', $response);
+ }
+
+ public function test_renderArray_ShouldConvertAssociativeArrayToJson()
+ {
+ $input = array('nb_visits' => 6, 'nb_random' => 8);
+
+ $response = $this->builder->renderArray($input);
+
+ $this->assertEquals('<?xml version="1.0" encoding="utf-8" ?>
+<result>
+ <row>
+ <nb_visits>6</nb_visits>
+ <nb_random>8</nb_random>
+ </row>
+</result>', $response);
+ }
+
+ public function test_renderArray_ShouldConvertsIndexedAssociativeArrayToJson()
+ {
+ $input = array(
+ array('nb_visits' => 6, 'nb_random' => 8),
+ array('nb_visits' => 3, 'nb_random' => 4)
+ );
+
+ $response = $this->builder->renderArray($input);
+
+ $this->assertEquals('<?xml version="1.0" encoding="utf-8" ?>
+<result>
+ <row>
+ <nb_visits>6</nb_visits>
+ <nb_random>8</nb_random>
+ </row>
+ <row>
+ <nb_visits>3</nb_visits>
+ <nb_random>4</nb_random>
+ </row>
+</result>', $response);
+ }
+
+ public function test_renderArray_ShouldConvertMultiDimensionalStandardArrayToJson()
+ {
+ $input = array("firstElement",
+ array(
+ "firstElement",
+ "secondElement",
+ ),
+ "thirdElement");
+
+ $actual = $this->builder->renderArray($input);
+ $this->assertEquals('<?xml version="1.0" encoding="utf-8" ?>
+<result>
+ <row>firstElement</row>
+ <row>
+ <row>firstElement</row>
+ <row>secondElement</row>
+ </row>
+ <row>thirdElement</row>
+</result>', $actual);
+ }
+
+ public function test_renderArray_ShouldConvertMultiDimensionalAssociativeArrayToJson()
+ {
+ $input = array(
+ "firstElement" => "isFirst",
+ "secondElement" => array(
+ "firstElement" => "isFirst",
+ "secondElement" => "isSecond",
+ ),
+ "thirdElement" => "isThird");
+
+ $actual = $this->builder->renderArray($input);
+ $this->assertEquals('<?xml version="1.0" encoding="utf-8" ?>
+<result>
+ <firstElement>isFirst</firstElement>
+ <secondElement>
+ <firstElement>isFirst</firstElement>
+ <secondElement>isSecond</secondElement>
+ </secondElement>
+ <thirdElement>isThird</thirdElement>
+</result>', $actual);
+ }
+
+ public function test_renderArray_ShouldConvertMultiDimensionalIndexArrayToJson()
+ {
+ $input = array(array("firstElement",
+ array(
+ "firstElement",
+ "secondElement",
+ ),
+ "thirdElement"));
+
+ $actual = $this->builder->renderArray($input);
+ $this->assertEquals('<?xml version="1.0" encoding="utf-8" ?>
+<result>
+ <row>
+ <row>firstElement</row>
+ <row>
+ <row>firstElement</row>
+ <row>secondElement</row>
+ </row>
+ <row>thirdElement</row>
+ </row>
+</result>', $actual);
+ }
+
+ public function test_renderArray_ShouldConvertMultiDimensionalMixedArrayToJson()
+ {
+ $input = array(
+ "firstElement" => "isFirst",
+ array(
+ "firstElement",
+ "secondElement",
+ ),
+ "thirdElement" => array(
+ "firstElement" => "isFirst",
+ "secondElement" => "isSecond",
+ )
+ );
+
+ $actual = $this->builder->renderArray($input);
+ $this->assertEquals('<?xml version="1.0" encoding="utf-8" ?>
+<result>
+ <firstElement>isFirst</firstElement>
+ <row key="0">
+ <row>firstElement</row>
+ <row>secondElement</row>
+ </row>
+ <thirdElement>
+ <firstElement>isFirst</firstElement>
+ <secondElement>isSecond</secondElement>
+ </thirdElement>
+</result>', $actual);
+ }
+
+ private function makeBuilder($request)
+ {
+ return new Xml($request);
+ }
+}
diff --git a/plugins/API/tests/XmlRendererTest.php b/plugins/API/tests/XmlRendererTest.php
deleted file mode 100644
index 1d222290bd..0000000000
--- a/plugins/API/tests/XmlRendererTest.php
+++ /dev/null
@@ -1,346 +0,0 @@
-<?php
-/**
- * Piwik - free/libre analytics platform
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- */
-
-namespace Piwik\Plugins\API\tests;
-
-use Piwik\DataTable;
-use Piwik\Plugins\API\Renderer\Xml;
-
-/**
- * @group Plugin
- * @group API
- */
-class XmlRendererTest extends \PHPUnit_Framework_TestCase
-{
- /**
- * @var Xml
- */
- private $builder;
-
- public function setUp()
- {
- $this->builder = $this->makeBuilder(array());
- DataTable\Manager::getInstance()->deleteAll();
- }
-
- public function test_renderSuccess_shouldIncludeMessage()
- {
- $response = $this->builder->renderSuccess('ok');
-
- $this->assertEquals('<?xml version="1.0" encoding="utf-8" ?>
-<result>
- <success message="ok" />
-</result>', $response);
- }
-
- public function test_renderException_shouldIncludeTheMessageAndNotExceptionMessage()
- {
- $response = $this->builder->renderException("The error message", new \Exception('The other message'));
-
- $this->assertEquals('<?xml version="1.0" encoding="utf-8" ?>
-<result>
- <error message="The error message" />
-</result>', $response);
- }
-
- public function test_renderObject_shouldReturAnError()
- {
- $response = $this->builder->renderObject(new \stdClass());
-
- $this->assertEquals('<?xml version="1.0" encoding="utf-8" ?>
-<result>
- <error message="The API cannot handle this data structure." />
-</result>', $response);
- }
-
- public function test_renderResource_shouldReturAnError()
- {
- $response = $this->builder->renderResource(new \stdClass());
-
- $this->assertEquals('<?xml version="1.0" encoding="utf-8" ?>
-<result>
- <error message="The API cannot handle this data structure." />
-</result>', $response);
- }
-
- public function test_renderScalar_shouldReturnABooleanAsIntegerWrappedInResult()
- {
- $response = $this->builder->renderScalar(true);
-
- $this->assertEquals('<?xml version="1.0" encoding="utf-8" ?>
-<result>1</result>', $response);
- }
-
- public function test_renderScalar_shouldReturnAnIntegerWrappedInResult()
- {
- $response = $this->builder->renderScalar(5);
-
- $this->assertEquals('<?xml version="1.0" encoding="utf-8" ?>
-<result>5</result>', $response);
- }
-
- public function test_renderScalar_shouldReturnAStringWrappedInValue()
- {
- $response = $this->builder->renderScalar('The Output');
-
- $this->assertEquals('<?xml version="1.0" encoding="utf-8" ?>
-<result>The Output</result>', $response);
- }
-
- public function test_renderScalar_shouldNotRemoveLineBreaks()
- {
- $response = $this->builder->renderScalar('The\nOutput');
-
- $this->assertEquals('<?xml version="1.0" encoding="utf-8" ?>
-<result>The\nOutput</result>', $response);
- }
-
- public function test_renderDataTable_shouldRenderABasicDataTable()
- {
- $dataTable = new DataTable();
- $dataTable->addRowFromSimpleArray(array('nb_visits' => 5, 'nb_random' => 10));
-
- $response = $this->builder->renderDataTable($dataTable);
-
- $this->assertEquals('<?xml version="1.0" encoding="utf-8" ?>
-<result>
- <row>
- <nb_visits>5</nb_visits>
- <nb_random>10</nb_random>
- </row>
-</result>', $response);
- }
-
- public function test_renderDataTable_shouldRenderSubtables()
- {
- $subtable = new DataTable();
- $subtable->addRowFromSimpleArray(array('nb_visits' => 2, 'nb_random' => 6));
-
- $dataTable = new DataTable();
- $dataTable->addRowFromSimpleArray(array('nb_visits' => 5, 'nb_random' => 10));
- $dataTable->getFirstRow()->setSubtable($subtable);
-
- $response = $this->builder->renderDataTable($dataTable);
-
- $this->assertEquals('<?xml version="1.0" encoding="utf-8" ?>
-<result>
- <row>
- <nb_visits>5</nb_visits>
- <nb_random>10</nb_random>
- <idsubdatatable>1</idsubdatatable>
- </row>
-</result>', $response);
- }
-
- public function test_renderDataTable_shouldRenderDataTableMaps()
- {
- $map = new DataTable\Map();
-
- $dataTable = new DataTable();
- $dataTable->addRowFromSimpleArray(array('nb_visits' => 5, 'nb_random' => 10));
-
- $dataTable2 = new DataTable();
- $dataTable2->addRowFromSimpleArray(array('nb_visits' => 3, 'nb_random' => 6));
-
- $map->addTable($dataTable, 'table1');
- $map->addTable($dataTable2, 'table2');
-
- $response = $this->builder->renderDataTable($map);
-
- $this->assertEquals('<?xml version="1.0" encoding="utf-8" ?>
-<results>
- <result defaultKeyName="table1">
- <row>
- <nb_visits>5</nb_visits>
- <nb_random>10</nb_random>
- </row>
- </result>
- <result defaultKeyName="table2">
- <row>
- <nb_visits>3</nb_visits>
- <nb_random>6</nb_random>
- </row>
- </result>
-</results>', $response);
- }
-
- public function test_renderDataTable_shouldRenderSimpleDataTable()
- {
- $dataTable = new DataTable\Simple();
- $dataTable->addRowsFromArray(array('nb_visits' => 3, 'nb_random' => 6));
-
- $response = $this->builder->renderDataTable($dataTable);
-
- $this->assertEquals('<?xml version="1.0" encoding="utf-8" ?>
-<result>
- <nb_visits>3</nb_visits>
- <nb_random>6</nb_random>
-</result>', $response);
- }
-
- public function test_renderArray_ShouldConvertSimpleArrayToJson()
- {
- $input = array(1, 2, 5, 'string', 10);
-
- $response = $this->builder->renderArray($input);
-
- $this->assertEquals('<?xml version="1.0" encoding="utf-8" ?>
-<result>
- <row>1</row>
- <row>2</row>
- <row>5</row>
- <row>string</row>
- <row>10</row>
-</result>', $response);
- }
-
- public function test_renderArray_ShouldRenderAnEmptyArray()
- {
- $response = $this->builder->renderArray(array());
-
- $this->assertEquals('<?xml version="1.0" encoding="utf-8" ?>
-<result />', $response);
- }
-
- public function test_renderArray_ShouldConvertAssociativeArrayToJson()
- {
- $input = array('nb_visits' => 6, 'nb_random' => 8);
-
- $response = $this->builder->renderArray($input);
-
- $this->assertEquals('<?xml version="1.0" encoding="utf-8" ?>
-<result>
- <row>
- <nb_visits>6</nb_visits>
- <nb_random>8</nb_random>
- </row>
-</result>', $response);
- }
-
- public function test_renderArray_ShouldConvertsIndexedAssociativeArrayToJson()
- {
- $input = array(
- array('nb_visits' => 6, 'nb_random' => 8),
- array('nb_visits' => 3, 'nb_random' => 4)
- );
-
- $response = $this->builder->renderArray($input);
-
- $this->assertEquals('<?xml version="1.0" encoding="utf-8" ?>
-<result>
- <row>
- <nb_visits>6</nb_visits>
- <nb_random>8</nb_random>
- </row>
- <row>
- <nb_visits>3</nb_visits>
- <nb_random>4</nb_random>
- </row>
-</result>', $response);
- }
-
- public function test_renderArray_ShouldConvertMultiDimensionalStandardArrayToJson()
- {
- $input = array("firstElement",
- array(
- "firstElement",
- "secondElement",
- ),
- "thirdElement");
-
- $actual = $this->builder->renderArray($input);
- $this->assertEquals('<?xml version="1.0" encoding="utf-8" ?>
-<result>
- <row>firstElement</row>
- <row>
- <row>firstElement</row>
- <row>secondElement</row>
- </row>
- <row>thirdElement</row>
-</result>', $actual);
- }
-
- public function test_renderArray_ShouldConvertMultiDimensionalAssociativeArrayToJson()
- {
- $input = array(
- "firstElement" => "isFirst",
- "secondElement" => array(
- "firstElement" => "isFirst",
- "secondElement" => "isSecond",
- ),
- "thirdElement" => "isThird");
-
- $actual = $this->builder->renderArray($input);
- $this->assertEquals('<?xml version="1.0" encoding="utf-8" ?>
-<result>
- <firstElement>isFirst</firstElement>
- <secondElement>
- <firstElement>isFirst</firstElement>
- <secondElement>isSecond</secondElement>
- </secondElement>
- <thirdElement>isThird</thirdElement>
-</result>', $actual);
- }
-
- public function test_renderArray_ShouldConvertMultiDimensionalIndexArrayToJson()
- {
- $input = array(array("firstElement",
- array(
- "firstElement",
- "secondElement",
- ),
- "thirdElement"));
-
- $actual = $this->builder->renderArray($input);
- $this->assertEquals('<?xml version="1.0" encoding="utf-8" ?>
-<result>
- <row>
- <row>firstElement</row>
- <row>
- <row>firstElement</row>
- <row>secondElement</row>
- </row>
- <row>thirdElement</row>
- </row>
-</result>', $actual);
- }
-
- public function test_renderArray_ShouldConvertMultiDimensionalMixedArrayToJson()
- {
- $input = array(
- "firstElement" => "isFirst",
- array(
- "firstElement",
- "secondElement",
- ),
- "thirdElement" => array(
- "firstElement" => "isFirst",
- "secondElement" => "isSecond",
- )
- );
-
- $actual = $this->builder->renderArray($input);
- $this->assertEquals('<?xml version="1.0" encoding="utf-8" ?>
-<result>
- <firstElement>isFirst</firstElement>
- <row key="0">
- <row>firstElement</row>
- <row>secondElement</row>
- </row>
- <thirdElement>
- <firstElement>isFirst</firstElement>
- <secondElement>isSecond</secondElement>
- </thirdElement>
-</result>', $actual);
- }
-
- private function makeBuilder($request)
- {
- return new Xml($request);
- }
-}
diff --git a/plugins/Actions/tests/Unit/ArchiverTest.php b/plugins/Actions/tests/Unit/ArchiverTest.php
new file mode 100644
index 0000000000..a3ba57511a
--- /dev/null
+++ b/plugins/Actions/tests/Unit/ArchiverTest.php
@@ -0,0 +1,130 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+namespace Piwik\Plugins\PrivacyManager\tests\Unit;
+
+use Piwik\Plugins\Actions\ArchivingHelper;
+use Piwik\Tracker\Action;
+use Piwik\Translate;
+
+require_once PIWIK_INCLUDE_PATH . '/plugins/Actions/Actions.php';
+
+/**
+ * @group Actions
+ * @group ArchiverTest
+ * @group Plugins
+ */
+class ArchiverTests extends \PHPUnit_Framework_TestCase
+{
+ public function setUp()
+ {
+ Translate::reloadLanguage('en');
+ }
+
+ public function tearDown()
+ {
+ Translate::unloadEnglishTranslation();
+ }
+
+ public function getActionNameTestData()
+ {
+ return array(
+ array(
+ 'params' => array('name' => 'http://example.org/', 'type' => Action::TYPE_PAGE_URL, 'urlPrefix' => null),
+ 'expected' => array('/index'),
+ ),
+ array(
+ 'params' => array('name' => 'example.org/', 'type' => Action::TYPE_PAGE_URL, 'urlPrefix' => 1),
+ 'expected' => array('/index'),
+ ),
+ array(
+ 'params' => array('name' => 'example.org/', 'type' => Action::TYPE_PAGE_URL, 'urlPrefix' => 2),
+ 'expected' => array('/index'),
+ ),
+ array(
+ 'params' => array('name' => 'example.org/', 'type' => Action::TYPE_PAGE_URL, 'urlPrefix' => 3),
+ 'expected' => array('/index'),
+ ),
+ array(
+ 'params' => array('name' => 'example.org/', 'type' => Action::TYPE_PAGE_URL, 'urlPrefix' => 4),
+ 'expected' => array('/index'),
+ ),
+ array(
+ 'params' => array('name' => 'example.org/path/', 'type' => Action::TYPE_PAGE_URL, 'urlPrefix' => 4),
+ 'expected' => array('path', '/index'),
+ ),
+ array(
+ 'params' => array('name' => 'example.org/test/path', 'type' => Action::TYPE_PAGE_URL, 'urlPrefix' => 1),
+ 'expected' => array('test', '/path'),
+ ),
+ array(
+ 'params' => array('name' => 'http://example.org/path/', 'type' => Action::TYPE_PAGE_URL),
+ 'expected' => array('path', '/index'),
+ ),
+ array(
+ 'params' => array('name' => 'example.org/test/path', 'type' => Action::TYPE_PAGE_URL, 'urlPrefix' => 1),
+ 'expected' => array('test', '/path'),
+ ),
+ array(
+ 'params' => array('name' => 'Test / Path', 'type' => Action::TYPE_PAGE_URL),
+ 'expected' => array('Test', '/Path'),
+ ),
+ array(
+ 'params' => array('name' => ' Test trim ', 'type' => Action::TYPE_PAGE_URL),
+ 'expected' => array('/Test trim'),
+ ),
+ array(
+ 'params' => array('name' => 'Category / Subcategory', 'type' => Action::TYPE_PAGE_TITLE),
+ 'expected' => array('Category', ' Subcategory'),
+ ),
+ array(
+ 'params' => array('name' => '/path/index.php?var=test', 'type' => Action::TYPE_PAGE_TITLE),
+ 'expected' => array('path', ' index.php?var=test'),
+ ),
+ array(
+ 'params' => array('name' => 'http://example.org/path/Default.aspx#anchor', 'type' => Action::TYPE_PAGE_TITLE),
+ 'expected' => array('path', ' Default.aspx#anchor'),
+ ),
+ array(
+ 'params' => array('name' => '', 'type' => Action::TYPE_PAGE_TITLE),
+ 'expected' => array('Page Name not defined'),
+ ),
+ array(
+ 'params' => array('name' => '', 'type' => Action::TYPE_PAGE_URL),
+ 'expected' => array('Page URL not defined'),
+ ),
+ array(
+ 'params' => array('name' => 'http://example.org/download.zip', 'type' => Action::TYPE_DOWNLOAD),
+ 'expected' => array('example.org', '/download.zip'),
+ ),
+ array(
+ 'params' => array('name' => 'http://example.org/download/1/', 'type' => Action::TYPE_DOWNLOAD),
+ 'expected' => array('example.org', '/download/1/'),
+ ),
+ array(
+ 'params' => array('name' => 'http://example.org/link', 'type' => Action::TYPE_OUTLINK),
+ 'expected' => array('example.org', '/link'),
+ ),
+ array(
+ 'params' => array('name' => 'http://example.org/some/path/', 'type' => Action::TYPE_OUTLINK),
+ 'expected' => array('example.org', '/some/path/'),
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider getActionNameTestData
+ */
+ public function testGetActionExplodedNames($params, $expected)
+ {
+ ArchivingHelper::reloadConfig();
+ $processed = ArchivingHelper::getActionExplodedNames($params['name'], $params['type'], (isset($params['urlPrefix']) ? $params['urlPrefix'] : null));
+ $this->assertEquals($expected, $processed);
+ }
+}
+
diff --git a/plugins/Contents/.gitignore b/plugins/Contents/.gitignore
index b141f4501f..c8c9480010 100644
--- a/plugins/Contents/.gitignore
+++ b/plugins/Contents/.gitignore
@@ -1 +1 @@
-tests/processed/*xml \ No newline at end of file
+tests/System/processed/*xml \ No newline at end of file
diff --git a/plugins/Contents/tests/ContentsTest.php b/plugins/Contents/tests/ContentsTest.php
deleted file mode 100644
index 68875db127..0000000000
--- a/plugins/Contents/tests/ContentsTest.php
+++ /dev/null
@@ -1,128 +0,0 @@
-<?php
-/**
- * Piwik - free/libre analytics platform
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- */
-namespace Piwik\Plugins\Contents\tests;
-
-use Piwik\Tests\IntegrationTestCase;
-use Piwik\Plugins\Contents\tests\Fixtures\TwoVisitsWithContents;
-
-/**
- * Testing Contents
- *
- * @group ContentsTest
- * @group Integration
- * @group Plugins
- */
-class ContentsTest extends IntegrationTestCase
-{
- public static $fixture = null; // initialized below class definition
-
- /**
- * @dataProvider getApiForTesting
- */
- public function testApi($api, $params)
- {
- $this->runApiTests($api, $params);
- }
-
- protected function getApiToCall()
- {
- return array(
- 'Contents.getContentNames',
- 'Contents.getContentPieces',
- 'Actions.get',
- 'Actions.getPageUrls',
- 'Live.getLastVisitsDetails'
- );
- }
-
- protected function tearDown()
- {
- parent::tearDown();
- }
-
- public function getApiForTesting()
- {
- $dateTime = self::$fixture->dateTime;
- $idSite1 = self::$fixture->idSite;
-
- $apiToCallProcessedReportMetadata = $this->getApiToCall();
-
- $dayPeriod = 'day';
- $periods = array($dayPeriod, 'month');
-
- $apisToTest = array('Contents', 'Actions.getPageUrls', 'Live.getLastVisitsDetails');
- $result = array(
- array($apiToCallProcessedReportMetadata, array(
- 'idSite' => $idSite1,
- 'date' => $dateTime,
- 'periods' => $periods,
- 'setDateLastN' => false,
- 'testSuffix' => '')),
-
- array($apisToTest, array(
- 'idSite' => $idSite1,
- 'date' => $dateTime,
- 'periods' => $dayPeriod,
- 'segment' => "contentName==ImageAd,contentPiece==".urlencode('Click to download Piwik now'),
- 'setDateLastN' => false,
- 'testSuffix' => 'contentNameOrPieceMatch')
- ),
-
- array($apisToTest, array(
- 'idSite' => $idSite1,
- 'date' => $dateTime,
- 'periods' => $dayPeriod,
- 'segment' => "contentTarget==".urlencode('http://www.example.com'),
- 'setDateLastN' => false,
- 'testSuffix' => '_contentTargetMatch')
- ),
-
- array($apisToTest, array(
- 'idSite' => $idSite1,
- 'date' => $dateTime,
- 'periods' => $dayPeriod,
- 'segment' => "contentInteraction==click",
- 'setDateLastN' => false,
- 'testSuffix' => '_contentInteractionMatch')
- )
- );
-
- $apiToCallProcessedReportMetadata = array(
- 'Contents.getContentNames',
- 'Contents.getContentPieces'
- );
- // testing metadata API for Contents reports
- foreach ($apiToCallProcessedReportMetadata as $api) {
- list($apiModule, $apiAction) = explode(".", $api);
-
- $result[] = array(
- 'API.getProcessedReport', array('idSite' => $idSite1,
- 'date' => $dateTime,
- 'periods' => $dayPeriod,
- 'setDateLastN' => true,
- 'apiModule' => $apiModule,
- 'apiAction' => $apiAction,
- 'testSuffix' => '_' . $api . '_lastN')
- );
- }
-
- return $result;
- }
-
- public static function getOutputPrefix()
- {
- return 'Contents';
- }
-
- public static function getPathToTestDirectory()
- {
- return dirname(__FILE__);
- }
-}
-
-ContentsTest::$fixture = new TwoVisitsWithContents(); \ No newline at end of file
diff --git a/plugins/Contents/tests/Fixtures/TwoVisitsWithContents.php b/plugins/Contents/tests/Fixtures/TwoVisitsWithContents.php
index 0446672cbd..9d4c08746a 100644
--- a/plugins/Contents/tests/Fixtures/TwoVisitsWithContents.php
+++ b/plugins/Contents/tests/Fixtures/TwoVisitsWithContents.php
@@ -9,7 +9,7 @@ namespace Piwik\Plugins\Contents\tests\Fixtures;
use Piwik\Date;
use Piwik\Plugins\Goals\API as APIGoals;
-use Piwik\Tests\Fixture;
+use Piwik\Tests\Impl\Fixture;
use PiwikTracker;
/**
diff --git a/plugins/Contents/tests/System/ContentsTest.php b/plugins/Contents/tests/System/ContentsTest.php
new file mode 100644
index 0000000000..c5304fb19e
--- /dev/null
+++ b/plugins/Contents/tests/System/ContentsTest.php
@@ -0,0 +1,135 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+namespace Piwik\Plugins\Contents\tests\System;
+
+use Piwik\Tests\Impl\SystemTestCase;
+use Piwik\Plugins\Contents\tests\Fixtures\TwoVisitsWithContents;
+use Piwik\Translate;
+
+/**
+ * Testing Contents
+ *
+ * @group ContentsTest
+ * @group System
+ * @group Plugins
+ */
+class ContentsTest extends SystemTestCase
+{
+ public static $fixture = null; // initialized below class definition
+
+ /**
+ * @dataProvider getApiForTesting
+ */
+ public function testApi($api, $params)
+ {
+ $this->runApiTests($api, $params);
+ }
+
+ protected function getApiToCall()
+ {
+ return array(
+ 'Contents.getContentNames',
+ 'Contents.getContentPieces',
+ 'Actions.get',
+ 'Actions.getPageUrls',
+ 'Live.getLastVisitsDetails'
+ );
+ }
+
+ protected function setup()
+ {
+ parent::setup();
+ Translate::reloadLanguage('en');
+ }
+
+ protected function tearDown()
+ {
+ parent::tearDown();
+ }
+
+ public function getApiForTesting()
+ {
+ $dateTime = self::$fixture->dateTime;
+ $idSite1 = self::$fixture->idSite;
+
+ $apiToCallProcessedReportMetadata = $this->getApiToCall();
+
+ $dayPeriod = 'day';
+ $periods = array($dayPeriod, 'month');
+
+ $apisToTest = array('Contents', 'Actions.getPageUrls', 'Live.getLastVisitsDetails');
+ $result = array(
+ array($apiToCallProcessedReportMetadata, array(
+ 'idSite' => $idSite1,
+ 'date' => $dateTime,
+ 'periods' => $periods,
+ 'setDateLastN' => false,
+ 'testSuffix' => '')),
+
+ array($apisToTest, array(
+ 'idSite' => $idSite1,
+ 'date' => $dateTime,
+ 'periods' => $dayPeriod,
+ 'segment' => "contentName==ImageAd,contentPiece==".urlencode('Click to download Piwik now'),
+ 'setDateLastN' => false,
+ 'testSuffix' => 'contentNameOrPieceMatch')
+ ),
+
+ array($apisToTest, array(
+ 'idSite' => $idSite1,
+ 'date' => $dateTime,
+ 'periods' => $dayPeriod,
+ 'segment' => "contentTarget==".urlencode('http://www.example.com'),
+ 'setDateLastN' => false,
+ 'testSuffix' => '_contentTargetMatch')
+ ),
+
+ array($apisToTest, array(
+ 'idSite' => $idSite1,
+ 'date' => $dateTime,
+ 'periods' => $dayPeriod,
+ 'segment' => "contentInteraction==click",
+ 'setDateLastN' => false,
+ 'testSuffix' => '_contentInteractionMatch')
+ )
+ );
+
+ $apiToCallProcessedReportMetadata = array(
+ 'Contents.getContentNames',
+ 'Contents.getContentPieces'
+ );
+ // testing metadata API for Contents reports
+ foreach ($apiToCallProcessedReportMetadata as $api) {
+ list($apiModule, $apiAction) = explode(".", $api);
+
+ $result[] = array(
+ 'API.getProcessedReport', array('idSite' => $idSite1,
+ 'date' => $dateTime,
+ 'periods' => $dayPeriod,
+ 'setDateLastN' => true,
+ 'apiModule' => $apiModule,
+ 'apiAction' => $apiAction,
+ 'testSuffix' => '_' . $api . '_lastN')
+ );
+ }
+
+ return $result;
+ }
+
+ public static function getOutputPrefix()
+ {
+ return 'Contents';
+ }
+
+ public static function getPathToTestDirectory()
+ {
+ return dirname(__FILE__);
+ }
+}
+
+ContentsTest::$fixture = new TwoVisitsWithContents(); \ No newline at end of file
diff --git a/plugins/Contents/tests/expected/test_Contents_Contents.getContentNames_lastN__API.getProcessedReport_day.xml b/plugins/Contents/tests/System/expected/test_Contents_Contents.getContentNames_lastN__API.getProcessedReport_day.xml
index d3e1af1e2e..d3e1af1e2e 100644
--- a/plugins/Contents/tests/expected/test_Contents_Contents.getContentNames_lastN__API.getProcessedReport_day.xml
+++ b/plugins/Contents/tests/System/expected/test_Contents_Contents.getContentNames_lastN__API.getProcessedReport_day.xml
diff --git a/plugins/Contents/tests/expected/test_Contents_Contents.getContentPieces_lastN__API.getProcessedReport_day.xml b/plugins/Contents/tests/System/expected/test_Contents_Contents.getContentPieces_lastN__API.getProcessedReport_day.xml
index 402909f7d5..402909f7d5 100644
--- a/plugins/Contents/tests/expected/test_Contents_Contents.getContentPieces_lastN__API.getProcessedReport_day.xml
+++ b/plugins/Contents/tests/System/expected/test_Contents_Contents.getContentPieces_lastN__API.getProcessedReport_day.xml
diff --git a/plugins/Contents/tests/expected/test_Contents__Actions.getPageUrls_day.xml b/plugins/Contents/tests/System/expected/test_Contents__Actions.getPageUrls_day.xml
index fde347f2b5..fde347f2b5 100644
--- a/plugins/Contents/tests/expected/test_Contents__Actions.getPageUrls_day.xml
+++ b/plugins/Contents/tests/System/expected/test_Contents__Actions.getPageUrls_day.xml
diff --git a/plugins/Contents/tests/expected/test_Contents__Actions.getPageUrls_month.xml b/plugins/Contents/tests/System/expected/test_Contents__Actions.getPageUrls_month.xml
index 3dc775d40a..3dc775d40a 100644
--- a/plugins/Contents/tests/expected/test_Contents__Actions.getPageUrls_month.xml
+++ b/plugins/Contents/tests/System/expected/test_Contents__Actions.getPageUrls_month.xml
diff --git a/plugins/Contents/tests/expected/test_Contents__Actions.get_day.xml b/plugins/Contents/tests/System/expected/test_Contents__Actions.get_day.xml
index f51cfaf913..f51cfaf913 100644
--- a/plugins/Contents/tests/expected/test_Contents__Actions.get_day.xml
+++ b/plugins/Contents/tests/System/expected/test_Contents__Actions.get_day.xml
diff --git a/plugins/Contents/tests/expected/test_Contents__Actions.get_month.xml b/plugins/Contents/tests/System/expected/test_Contents__Actions.get_month.xml
index f51cfaf913..f51cfaf913 100644
--- a/plugins/Contents/tests/expected/test_Contents__Actions.get_month.xml
+++ b/plugins/Contents/tests/System/expected/test_Contents__Actions.get_month.xml
diff --git a/plugins/Contents/tests/expected/test_Contents__Contents.getContentNames_day.xml b/plugins/Contents/tests/System/expected/test_Contents__Contents.getContentNames_day.xml
index 957c6fa85a..957c6fa85a 100644
--- a/plugins/Contents/tests/expected/test_Contents__Contents.getContentNames_day.xml
+++ b/plugins/Contents/tests/System/expected/test_Contents__Contents.getContentNames_day.xml
diff --git a/plugins/Contents/tests/expected/test_Contents__Contents.getContentNames_month.xml b/plugins/Contents/tests/System/expected/test_Contents__Contents.getContentNames_month.xml
index 44bfdfd54e..44bfdfd54e 100644
--- a/plugins/Contents/tests/expected/test_Contents__Contents.getContentNames_month.xml
+++ b/plugins/Contents/tests/System/expected/test_Contents__Contents.getContentNames_month.xml
diff --git a/plugins/Contents/tests/expected/test_Contents__Contents.getContentPieces_day.xml b/plugins/Contents/tests/System/expected/test_Contents__Contents.getContentPieces_day.xml
index 8927f8a8ec..8927f8a8ec 100644
--- a/plugins/Contents/tests/expected/test_Contents__Contents.getContentPieces_day.xml
+++ b/plugins/Contents/tests/System/expected/test_Contents__Contents.getContentPieces_day.xml
diff --git a/plugins/Contents/tests/expected/test_Contents__Contents.getContentPieces_month.xml b/plugins/Contents/tests/System/expected/test_Contents__Contents.getContentPieces_month.xml
index b604544417..b604544417 100644
--- a/plugins/Contents/tests/expected/test_Contents__Contents.getContentPieces_month.xml
+++ b/plugins/Contents/tests/System/expected/test_Contents__Contents.getContentPieces_month.xml
diff --git a/plugins/Contents/tests/expected/test_Contents__Live.getLastVisitsDetails_day.xml b/plugins/Contents/tests/System/expected/test_Contents__Live.getLastVisitsDetails_day.xml
index 857c554b17..857c554b17 100644
--- a/plugins/Contents/tests/expected/test_Contents__Live.getLastVisitsDetails_day.xml
+++ b/plugins/Contents/tests/System/expected/test_Contents__Live.getLastVisitsDetails_day.xml
diff --git a/plugins/Contents/tests/expected/test_Contents__Live.getLastVisitsDetails_month.xml b/plugins/Contents/tests/System/expected/test_Contents__Live.getLastVisitsDetails_month.xml
index 857c554b17..857c554b17 100644
--- a/plugins/Contents/tests/expected/test_Contents__Live.getLastVisitsDetails_month.xml
+++ b/plugins/Contents/tests/System/expected/test_Contents__Live.getLastVisitsDetails_month.xml
diff --git a/plugins/Contents/tests/expected/test_Contents_contentInteractionMatch__Actions.getPageUrls_day.xml b/plugins/Contents/tests/System/expected/test_Contents_contentInteractionMatch__Actions.getPageUrls_day.xml
index c234bed59e..c234bed59e 100644
--- a/plugins/Contents/tests/expected/test_Contents_contentInteractionMatch__Actions.getPageUrls_day.xml
+++ b/plugins/Contents/tests/System/expected/test_Contents_contentInteractionMatch__Actions.getPageUrls_day.xml
diff --git a/plugins/Contents/tests/expected/test_Contents_contentInteractionMatch__Contents.getContentNames_day.xml b/plugins/Contents/tests/System/expected/test_Contents_contentInteractionMatch__Contents.getContentNames_day.xml
index c234bed59e..c234bed59e 100644
--- a/plugins/Contents/tests/expected/test_Contents_contentInteractionMatch__Contents.getContentNames_day.xml
+++ b/plugins/Contents/tests/System/expected/test_Contents_contentInteractionMatch__Contents.getContentNames_day.xml
diff --git a/plugins/Contents/tests/expected/test_Contents_contentInteractionMatch__Contents.getContentPieces_day.xml b/plugins/Contents/tests/System/expected/test_Contents_contentInteractionMatch__Contents.getContentPieces_day.xml
index c234bed59e..c234bed59e 100644
--- a/plugins/Contents/tests/expected/test_Contents_contentInteractionMatch__Contents.getContentPieces_day.xml
+++ b/plugins/Contents/tests/System/expected/test_Contents_contentInteractionMatch__Contents.getContentPieces_day.xml
diff --git a/plugins/Contents/tests/expected/test_Contents_contentInteractionMatch__Live.getLastVisitsDetails_day.xml b/plugins/Contents/tests/System/expected/test_Contents_contentInteractionMatch__Live.getLastVisitsDetails_day.xml
index 857c554b17..857c554b17 100644
--- a/plugins/Contents/tests/expected/test_Contents_contentInteractionMatch__Live.getLastVisitsDetails_day.xml
+++ b/plugins/Contents/tests/System/expected/test_Contents_contentInteractionMatch__Live.getLastVisitsDetails_day.xml
diff --git a/plugins/Contents/tests/expected/test_Contents_contentTargetMatch__Actions.getPageUrls_day.xml b/plugins/Contents/tests/System/expected/test_Contents_contentTargetMatch__Actions.getPageUrls_day.xml
index c234bed59e..c234bed59e 100644
--- a/plugins/Contents/tests/expected/test_Contents_contentTargetMatch__Actions.getPageUrls_day.xml
+++ b/plugins/Contents/tests/System/expected/test_Contents_contentTargetMatch__Actions.getPageUrls_day.xml
diff --git a/plugins/Contents/tests/expected/test_Contents_contentTargetMatch__Contents.getContentNames_day.xml b/plugins/Contents/tests/System/expected/test_Contents_contentTargetMatch__Contents.getContentNames_day.xml
index 5212486a1c..5212486a1c 100644
--- a/plugins/Contents/tests/expected/test_Contents_contentTargetMatch__Contents.getContentNames_day.xml
+++ b/plugins/Contents/tests/System/expected/test_Contents_contentTargetMatch__Contents.getContentNames_day.xml
diff --git a/plugins/Contents/tests/expected/test_Contents_contentTargetMatch__Contents.getContentPieces_day.xml b/plugins/Contents/tests/System/expected/test_Contents_contentTargetMatch__Contents.getContentPieces_day.xml
index ac1d39a577..ac1d39a577 100644
--- a/plugins/Contents/tests/expected/test_Contents_contentTargetMatch__Contents.getContentPieces_day.xml
+++ b/plugins/Contents/tests/System/expected/test_Contents_contentTargetMatch__Contents.getContentPieces_day.xml
diff --git a/plugins/Contents/tests/expected/test_Contents_contentTargetMatch__Live.getLastVisitsDetails_day.xml b/plugins/Contents/tests/System/expected/test_Contents_contentTargetMatch__Live.getLastVisitsDetails_day.xml
index 857c554b17..857c554b17 100644
--- a/plugins/Contents/tests/expected/test_Contents_contentTargetMatch__Live.getLastVisitsDetails_day.xml
+++ b/plugins/Contents/tests/System/expected/test_Contents_contentTargetMatch__Live.getLastVisitsDetails_day.xml
diff --git a/plugins/Contents/tests/expected/test_ContentscontentNameOrPieceMatch__Actions.getPageUrls_day.xml b/plugins/Contents/tests/System/expected/test_ContentscontentNameOrPieceMatch__Actions.getPageUrls_day.xml
index c234bed59e..c234bed59e 100644
--- a/plugins/Contents/tests/expected/test_ContentscontentNameOrPieceMatch__Actions.getPageUrls_day.xml
+++ b/plugins/Contents/tests/System/expected/test_ContentscontentNameOrPieceMatch__Actions.getPageUrls_day.xml
diff --git a/plugins/Contents/tests/expected/test_ContentscontentNameOrPieceMatch__Contents.getContentNames_day.xml b/plugins/Contents/tests/System/expected/test_ContentscontentNameOrPieceMatch__Contents.getContentNames_day.xml
index 17b781db1c..17b781db1c 100644
--- a/plugins/Contents/tests/expected/test_ContentscontentNameOrPieceMatch__Contents.getContentNames_day.xml
+++ b/plugins/Contents/tests/System/expected/test_ContentscontentNameOrPieceMatch__Contents.getContentNames_day.xml
diff --git a/plugins/Contents/tests/expected/test_ContentscontentNameOrPieceMatch__Contents.getContentPieces_day.xml b/plugins/Contents/tests/System/expected/test_ContentscontentNameOrPieceMatch__Contents.getContentPieces_day.xml
index 7df6e4f0e1..7df6e4f0e1 100644
--- a/plugins/Contents/tests/expected/test_ContentscontentNameOrPieceMatch__Contents.getContentPieces_day.xml
+++ b/plugins/Contents/tests/System/expected/test_ContentscontentNameOrPieceMatch__Contents.getContentPieces_day.xml
diff --git a/plugins/Contents/tests/expected/test_ContentscontentNameOrPieceMatch__Live.getLastVisitsDetails_day.xml b/plugins/Contents/tests/System/expected/test_ContentscontentNameOrPieceMatch__Live.getLastVisitsDetails_day.xml
index 857c554b17..857c554b17 100644
--- a/plugins/Contents/tests/expected/test_ContentscontentNameOrPieceMatch__Live.getLastVisitsDetails_day.xml
+++ b/plugins/Contents/tests/System/expected/test_ContentscontentNameOrPieceMatch__Live.getLastVisitsDetails_day.xml
diff --git a/plugins/Contents/tests/processed/.gitkeep b/plugins/Contents/tests/System/processed/.gitkeep
index e69de29bb2..e69de29bb2 100644
--- a/plugins/Contents/tests/processed/.gitkeep
+++ b/plugins/Contents/tests/System/processed/.gitkeep
diff --git a/plugins/CoreConsole/Commands/CodeCoverage.php b/plugins/CoreConsole/Commands/CodeCoverage.php
index 348d7d3980..6dbc2004c0 100644
--- a/plugins/CoreConsole/Commands/CodeCoverage.php
+++ b/plugins/CoreConsole/Commands/CodeCoverage.php
@@ -13,6 +13,7 @@ use Piwik\Plugin\ConsoleCommand;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
/**
@@ -23,7 +24,8 @@ class CodeCoverage extends ConsoleCommand
{
$this->setName('tests:coverage');
$this->setDescription('Run all phpunit tests and generate a combined code coverage');
- $this->addArgument('group', InputArgument::OPTIONAL, 'Run only a specific test group. Separate multiple groups by comma, for instance core,integration', '');
+ $this->addOption('testsuite', null, InputOption::VALUE_REQUIRED, 'Run only a specific test suite, for instance UnitTests, IntegrationTests or SystemTests.');
+ $this->addArgument('group', InputArgument::OPTIONAL, 'Run only a specific test group. Separate multiple groups by comma, for instance core,plugins', '');
}
protected function execute(InputInterface $input, OutputInterface $output)
@@ -39,9 +41,14 @@ class CodeCoverage extends ConsoleCommand
$command = $this->getApplication()->find('tests:run');
$arguments = array(
'command' => 'tests:run',
- '--options' => sprintf('--coverage-php %s/tests/results/logs/%%group%%.cov', PIWIK_DOCUMENT_ROOT),
+ '--options' => sprintf('--coverage-php %s/tests/results/logs/%%suite%%%%group%%.cov', PIWIK_DOCUMENT_ROOT),
);
+ $suite = $input->getOption('testsuite');
+ if (!empty($suite)) {
+ $arguments['--testsuite'] = $suite;
+ }
+
$groups = $input->getArgument('group');
if (!empty($groups)) {
$arguments['group'] = $groups;
diff --git a/plugins/CoreConsole/Commands/DevelopmentManageTestFiles.php b/plugins/CoreConsole/Commands/DevelopmentManageTestFiles.php
index 429612ae9c..d2d96a8edf 100644
--- a/plugins/CoreConsole/Commands/DevelopmentManageTestFiles.php
+++ b/plugins/CoreConsole/Commands/DevelopmentManageTestFiles.php
@@ -42,7 +42,7 @@ class DevelopmentManageTestFiles extends ConsoleCommand
{
$file = $input->getOption('file');
- $prefix = PIWIK_INCLUDE_PATH . '/tests/PHPUnit/Integration/processed/';
+ $prefix = PIWIK_INCLUDE_PATH . '/tests/PHPUnit/System/processed/';
$guesses = array(
'/' . $file,
$prefix . $file,
@@ -55,6 +55,6 @@ class DevelopmentManageTestFiles extends ConsoleCommand
}
}
- copy($file, PIWIK_INCLUDE_PATH . '/tests/PHPUnit/Integration/expected/' . basename($file));
+ copy($file, PIWIK_INCLUDE_PATH . '/tests/PHPUnit/System/expected/' . basename($file));
}
} \ No newline at end of file
diff --git a/plugins/CoreConsole/Commands/GenerateReport.php b/plugins/CoreConsole/Commands/GenerateReport.php
index 9bf09099ec..7afd139380 100644
--- a/plugins/CoreConsole/Commands/GenerateReport.php
+++ b/plugins/CoreConsole/Commands/GenerateReport.php
@@ -42,8 +42,7 @@ class GenerateReport extends GeneratePluginBase
$apiName = $this->getApiName($reportName);
$exampleFolder = PIWIK_INCLUDE_PATH . '/plugins/ExampleReport';
- $replace = array('ExampleReport' => $pluginName,
- 'GetExampleReport' => ucfirst($apiName),
+ $replace = array('GetExampleReport' => ucfirst($apiName),
'getExampleReport' => lcfirst($apiName),
'getApiReport' => lcfirst($apiName),
'ExampleCategory' => $category,
@@ -51,7 +50,8 @@ class GenerateReport extends GeneratePluginBase
'ExampleReportDocumentation' => $documentation,
'999' => $order,
'new ExitPageUrl()' => $dimension,
- 'use Piwik\Plugins\Actions\Columns\ExitPageUrl;' => $dimensionClass
+ 'use Piwik\Plugins\Actions\Columns\ExitPageUrl;' => $dimensionClass,
+ 'ExampleReport' => $pluginName,
);
$whitelistFiles = array('/Reports', '/Reports/Base.php', '/Reports/GetExampleReport.php');
diff --git a/plugins/CoreConsole/Commands/GenerateTest.php b/plugins/CoreConsole/Commands/GenerateTest.php
index ff68eec784..6047f2ddc7 100644
--- a/plugins/CoreConsole/Commands/GenerateTest.php
+++ b/plugins/CoreConsole/Commands/GenerateTest.php
@@ -24,7 +24,7 @@ class GenerateTest extends GeneratePluginBase
->setDescription('Adds a test to an existing plugin')
->addOption('pluginname', null, InputOption::VALUE_REQUIRED, 'The name of an existing plugin')
->addOption('testname', null, InputOption::VALUE_REQUIRED, 'The name of the test to create')
- ->addOption('testtype', null, InputOption::VALUE_REQUIRED, 'Whether you want to create a "unit", "integration" or "database" test');
+ ->addOption('testtype', null, InputOption::VALUE_REQUIRED, 'Whether you want to create a "unit", "integration" or "system" test');
}
protected function execute(InputInterface $input, OutputInterface $output)
@@ -35,18 +35,11 @@ class GenerateTest extends GeneratePluginBase
$exampleFolder = PIWIK_INCLUDE_PATH . '/plugins/ExamplePlugin';
$replace = array(
- 'ExamplePlugin' => $pluginName,
- 'SimpleTest' => $testName,
- 'SimpleIntegrationTest' => $testName,
- '@group Plugins' => '@group ' . $testType
+ 'ExamplePlugin' => $pluginName,
+ 'SimpleTest' => $testName,
+ 'SimpleSystemTest' => $testName
);
- $testClass = $this->getTestClass($testType);
- if (!empty($testClass)) {
- $replace['\PHPUnit_Framework_TestCase'] = $testClass;
-
- }
-
$whitelistFiles = $this->getTestFilesWhitelist($testType);
$this->copyTemplateToPlugin($exampleFolder, $pluginName, $replace, $whitelistFiles);
@@ -113,30 +106,15 @@ class GenerateTest extends GeneratePluginBase
return $this->askPluginNameAndValidate($input, $output, $pluginNames, $invalidName);
}
- /**
- * @param InputInterface $input
- * @return string
- */
- private function getTestClass($testType)
- {
- if ('Database' == $testType) {
- return '\DatabaseTestCase';
- }
- if ('Unit' == $testType) {
- return '\PHPUnit_Framework_TestCase';
- }
- return false;
- }
-
public function getValidTypes()
{
- return array('unit', 'integration', 'database');
+ return array('unit', 'integration', 'system');
}
/**
* @param InputInterface $input
* @param OutputInterface $output
- * @return string Unit, Integration, Database
+ * @return string Unit, Integration, System
*/
private function getTestType(InputInterface $input, OutputInterface $output)
{
@@ -167,23 +145,35 @@ class GenerateTest extends GeneratePluginBase
*/
protected function getTestFilesWhitelist($testType)
{
- if ('Integration' == $testType) {
+ if ('System' == $testType) {
return array(
'/.gitignore',
'/tests',
- '/tests/SimpleIntegrationTest.php',
- '/tests/expected',
- '/tests/expected/test___API.get_day.xml',
- '/tests/expected/test___Goals.getItemsSku_day.xml',
- '/tests/processed',
- '/tests/processed/.gitignore',
- '/tests/fixtures',
- '/tests/fixtures/SimpleFixtureTrackFewVisits.php'
+ '/tests/System',
+ '/tests/System/SimpleSystemTest.php',
+ '/tests/System/expected',
+ '/tests/System/expected/test___API.get_day.xml',
+ '/tests/System/expected/test___Goals.getItemsSku_day.xml',
+ '/tests/System/processed',
+ '/tests/System/processed/.gitignore',
+ '/tests/Fixtures',
+ '/tests/Fixtures/SimpleFixtureTrackFewVisits.php'
+ );
+ }
+
+ if ('Integration' == $testType) {
+
+ return array(
+ '/tests',
+ '/tests/Integration',
+ '/tests/Integration/SimpleTest.php'
);
}
+
return array(
'/tests',
- '/tests/SimpleTest.php'
+ '/tests/Unit',
+ '/tests/Unit/SimpleTest.php'
);
}
}
diff --git a/plugins/CoreConsole/Commands/GenerateTravisYmlFile.php b/plugins/CoreConsole/Commands/GenerateTravisYmlFile.php
index 1bd68cf0f7..13bcc5ad2f 100644
--- a/plugins/CoreConsole/Commands/GenerateTravisYmlFile.php
+++ b/plugins/CoreConsole/Commands/GenerateTravisYmlFile.php
@@ -44,7 +44,7 @@ class GenerateTravisYmlFile extends ConsoleCommand
protected function execute(InputInterface $input, OutputInterface $output)
{
- $targetPlugin = $input->getOption('plugin');
+ $targetPlugin = $input->getOption('plugin');
$outputYmlPath = $this->getTravisYmlOutputPath($input, $targetPlugin);
$view = $this->createTravisYmlView($input, $output, $targetPlugin, $outputYmlPath);
diff --git a/plugins/CoreConsole/Commands/TestsRun.php b/plugins/CoreConsole/Commands/TestsRun.php
index 5e00bd6230..cf2d49b6a1 100644
--- a/plugins/CoreConsole/Commands/TestsRun.php
+++ b/plugins/CoreConsole/Commands/TestsRun.php
@@ -9,6 +9,7 @@
namespace Piwik\Plugins\CoreConsole\Commands;
+use Piwik\Common;
use Piwik\Profiler;
use Piwik\Plugin\ConsoleCommand;
use Symfony\Component\Console\Input\InputArgument;
@@ -24,20 +25,20 @@ class TestsRun extends ConsoleCommand
protected function configure()
{
$this->setName('tests:run');
- $this->setDescription('Run Piwik PHPUnit tests one group after the other');
- $this->addArgument('group', InputArgument::OPTIONAL, 'Run only a specific test group. Separate multiple groups by comma, for instance core,integration', '');
+ $this->setDescription('Run Piwik PHPUnit tests one testsuite after the other');
+ $this->addArgument('group', InputArgument::OPTIONAL, 'Run only a specific test group. Separate multiple groups by comma, for instance core,plugins', '');
$this->addOption('options', 'o', InputOption::VALUE_OPTIONAL, 'All options will be forwarded to phpunit', '');
$this->addOption('xhprof', null, InputOption::VALUE_NONE, 'Profile using xhprof.');
$this->addOption('file', null, InputOption::VALUE_REQUIRED, 'Execute tests within this file. Should be a path relative to the tests/PHPUnit directory.');
+ $this->addOption('testsuite', null, InputOption::VALUE_REQUIRED, 'Execute tests of a specific test suite, for instance UnitTests, IntegrationTests or SystemTests.');
}
protected function execute(InputInterface $input, OutputInterface $output)
{
$options = $input->getOption('options');
- $groups = $input->getArgument('group');
+ $groups = $input->getArgument('group');
$groups = explode(",", $groups);
- $groups = array_map('ucfirst', $groups);
$groups = array_filter($groups, 'strlen');
$command = '../../vendor/phpunit/phpunit/phpunit';
@@ -81,12 +82,17 @@ class TestsRun extends ConsoleCommand
if (!empty($testFile)) {
$this->executeTestFile($testFile, $options, $command, $output);
} else {
- $this->executeTestGroups($groups, $options, $command, $output);
+ $suite = $this->getTestsuite($input);
+ $this->executeTestGroups($suite, $groups, $options, $command, $output);
}
}
private function executeTestFile($testFile, $options, $command, OutputInterface $output)
{
+ if ('/' !== substr($testFile, 0, 1)) {
+ $testFile = '../../' . $testFile;
+ }
+
$params = $options . " " . $testFile;
$cmd = $this->getCommand($command, $params);
$output->writeln('Executing command: <info>' . $cmd . '</info>');
@@ -94,24 +100,27 @@ class TestsRun extends ConsoleCommand
$output->writeln("");
}
- private function executeTestGroups($groups, $options, $command, OutputInterface $output)
+ private function executeTestGroups($suite, $groups, $options, $command, OutputInterface $output)
{
- if (empty($groups)) {
- $groups = $this->getTestsGroups();
- }
+ if (empty($suite) && empty($groups)) {
+ foreach ($this->getTestsSuites() as $suite) {
+ $suite = $this->buildTestSuiteName($suite);
+ $this->executeTestGroups($suite, $groups, $options, $command, $output);
+ }
- foreach ($groups as $group) {
- $params = '--group ' . $group . ' ' . str_replace('%group%', $group, $options);
- $cmd = $this->getCommand($command, $params);
- $output->writeln('Executing command: <info>' . $cmd . '</info>');
- passthru($cmd);
- $output->writeln("");
+ return;
}
+
+ $params = $this->buildPhpUnitCliParams($suite, $groups, $options);
+ $cmd = $this->getCommand($command, $params);
+ $output->writeln('Executing command: <info>' . $cmd . '</info>');
+ passthru($cmd);
+ $output->writeln("");
}
- private function getTestsGroups()
+ private function getTestsSuites()
{
- return array('Core', 'Plugins', 'Integration', 'UI');
+ return array('unit', 'integration', 'system');
}
/**
@@ -121,7 +130,53 @@ class TestsRun extends ConsoleCommand
*/
private function getCommand($command, $params)
{
- $cmd = sprintf('cd %s/tests/PHPUnit && %s %s', PIWIK_DOCUMENT_ROOT, $command, $params);
- return $cmd;
+ return sprintf('cd %s/tests/PHPUnit && %s %s', PIWIK_DOCUMENT_ROOT, $command, $params);
+ }
+
+ private function buildPhpUnitCliParams($suite, $groups, $options)
+ {
+ $params = $options;
+
+ if (!empty($groups)) {
+ $groups = implode(',', $groups);
+ $params .= '--group ' . $groups . ' ';
+ } else {
+ $groups = '';
+ }
+
+ if (!empty($suite)) {
+ $params .= ' --testsuite ' . $suite;
+ } else {
+ $suite = '';
+ }
+
+ $params = str_replace('%suite%', $suite, $params);
+ $params = str_replace('%group%', $groups, $params);
+
+ return $params;
+ }
+
+ private function getTestsuite(InputInterface $input)
+ {
+ $suite = $input->getOption('testsuite');
+
+ if (empty($suite)) {
+ return;
+ }
+
+ $availableSuites = $this->getTestsSuites();
+
+ if (!in_array($suite, $availableSuites)) {
+ throw new \InvalidArgumentException('Invalid testsuite specified. Use one of: ' . implode(', ', $availableSuites));
+ }
+
+ $suite = $this->buildTestSuiteName($suite);
+
+ return $suite;
+ }
+
+ private function buildTestSuiteName($suite)
+ {
+ return ucfirst($suite) . 'Tests';
}
} \ No newline at end of file
diff --git a/plugins/CoreConsole/Commands/TestsSetupFixture.php b/plugins/CoreConsole/Commands/TestsSetupFixture.php
index cc5481d7e4..11f5761b93 100644
--- a/plugins/CoreConsole/Commands/TestsSetupFixture.php
+++ b/plugins/CoreConsole/Commands/TestsSetupFixture.php
@@ -11,7 +11,7 @@ namespace Piwik\Plugins\CoreConsole\Commands;
use Piwik\Config;
use Piwik\Plugin\ConsoleCommand;
use Piwik\Url;
-use Piwik\Tests\Fixture;
+use Piwik\Tests\Impl\Fixture;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
@@ -216,9 +216,11 @@ class TestsSetupFixture extends ConsoleCommand
require_once PIWIK_INCLUDE_PATH . '/libs/PiwikTracker/PiwikTracker.php';
require_once PIWIK_INCLUDE_PATH . '/tests/PHPUnit/FakeAccess.php';
require_once PIWIK_INCLUDE_PATH . '/tests/PHPUnit/TestingEnvironment.php';
+ require_once PIWIK_INCLUDE_PATH . '/tests/PHPUnit/Impl/SystemTestCase.php';
+ require_once PIWIK_INCLUDE_PATH . '/tests/PHPUnit/Impl/Fixture.php';
+ require_once PIWIK_INCLUDE_PATH . '/tests/PHPUnit/Impl/IntegrationTestCase.php';
require_once PIWIK_INCLUDE_PATH . '/tests/PHPUnit/IntegrationTestCase.php';
require_once PIWIK_INCLUDE_PATH . '/tests/PHPUnit/Fixture.php';
- require_once PIWIK_INCLUDE_PATH . '/tests/PHPUnit/IntegrationTestCase.php';
$fixturesToLoad = array(
'/tests/PHPUnit/Fixtures/*.php',
diff --git a/plugins/CoreConsole/tests/Integration/TravisYmlViewTest.php b/plugins/CoreConsole/tests/Integration/TravisYmlViewTest.php
new file mode 100644
index 0000000000..7dd32b2b67
--- /dev/null
+++ b/plugins/CoreConsole/tests/Integration/TravisYmlViewTest.php
@@ -0,0 +1,165 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\CoreConsole\tests\Integration;
+
+use Symfony\Component\Console\Output\ConsoleOutput;
+use Piwik\Plugins\CoreConsole\TravisYmlView;
+use Piwik\Plugin\Manager as PluginManager;
+use PHPUnit_Framework_TestCase;
+use Spyc; // DeviceDectector requires Spyc
+
+/**
+ * @group CoreConsole
+ * @group CoreConsole_TravisYmlViewTest
+ */
+class TravisYmlViewTest extends PHPUnit_Framework_TestCase
+{
+ public function setUp()
+ {
+ PluginManager::getInstance()->loadPlugin('Morpheus');
+ PluginManager::getInstance()->loadPlugin('CoreConsole');
+ }
+
+ public function testViewGeneratesCorrectLookingYAML()
+ {
+ $view = new TravisYmlView();
+ $view->setPlugin('ExamplePlugin');
+ $view->setExtraGlobalEnvVars(array('secure: artifactspass', 'secure: githubtoken'));
+ $view->setGenerateYmlCommand('./console generate:travis-yml \'arg1\' arg2');
+ $output = $view->render();
+
+ $yaml = Spyc::YAMLLoadString($output);
+
+ $this->assertNotEmpty($yaml['env']);
+ $this->assertNotEmpty($yaml['env']['global']);
+ $this->assertContains("PLUGIN_NAME=ExamplePlugin", $yaml['env']['global']);
+ $this->assertContains("PIWIK_ROOT_DIR=\$TRAVIS_BUILD_DIR/piwik", $yaml['env']['global']);
+ $this->assertContains(array('secure' => 'artifactspass'), $yaml['env']['global']);
+ $this->assertContains(array('secure' => 'githubtoken'), $yaml['env']['global']);
+
+ $this->assertNotEmpty($yaml['env']['matrix']);
+ $this->assertContains("TEST_SUITE=PluginTests MYSQL_ADAPTER=PDO_MYSQL", $yaml['env']['matrix']);
+ $this->assertContains("TEST_SUITE=PluginTests MYSQL_ADAPTER=PDO_MYSQL TEST_AGAINST_CORE=latest_stable", $yaml['env']['matrix']);
+ $this->assertNotContains("TEST_SUITE=UITests MYSQL_ADAPTER=PDO_MYSQL", $yaml['env']['matrix']);
+
+ $this->assertBuildSectionsNotEmpty($yaml);
+
+ $this->assertContains("export GENERATE_TRAVIS_YML_COMMAND=\"./console generate:travis-yml \\'arg1\\' arg2\"", $yaml['before_script']);
+
+ $this->assertViewUsesPluginSpecifiedTravisCommands($yaml);
+ }
+
+ public function testViewPreservesCommentsAndEnvVarsIfExistingYml()
+ {
+ $view = new TravisYmlView();
+ $view->setPlugin('ExamplePlugin');
+ $view->setExtraGlobalEnvVars(array('secure: artifactspass', 'secure: githubtoken'));
+ $view->setGenerateYmlCommand('./console generate:travis-yml arg1 arg2');
+ $view->processExistingTravisYml(PIWIK_INCLUDE_PATH . '/plugins/CoreConsole/tests/resources/test.travis.yml');
+ $output = $view->render();
+
+ $yaml = Spyc::YAMLLoadString($output);
+
+ $this->assertNotEmpty($yaml['env']);
+ $this->assertNotEmpty($yaml['env']['global']);
+
+ $this->assertContains("PRESERVED_VAR=123", $yaml['env']['global']);
+ $this->assertContains(array('secure' => 'anotherpreservedvar'), $yaml['env']['global']);
+ $this->assertNotContains("PLUGIN_NAME=ExamplePlugin", $yaml['env']['global']);
+ $this->assertNotContains("PIWIK_ROOT_DIR=\$TRAVIS_BUILD_DIR/piwik", $yaml['env']['global']);
+
+ $this->assertBuildSectionsNotEmpty($yaml);
+
+ $this->assertNotEmpty($yaml['custom_section']);
+ $this->assertContains("custom_section:\n - this will be preserved\n # as should this", $output);
+
+ $this->assertNotEmpty($yaml['notifications']);
+ $this->assertContains("notifications:\n # another section\n - a\n - b\n - c", $output);
+
+ $this->assertViewUsesPluginSpecifiedTravisCommands($yaml);
+ }
+
+ public function testViewGeneratesCorrectLookingYAMLForCore()
+ {
+ $view = new TravisYmlView();
+ // no setPlugin call here signifies generating for core
+ $view->processExistingTravisYml(PIWIK_INCLUDE_PATH . '/.travis.yml');
+ $view->setExtraGlobalEnvVars(array('secure: artifactspass', 'secure: githubtoken'));
+ $view->setGenerateYmlCommand('./console generate:travis-yml \'arg1\' arg2');
+ $output = $view->render();
+
+ $yaml = Spyc::YAMLLoadString($output);
+
+ $this->assertNotEmpty($yaml['env']);
+ $this->assertNotEmpty($yaml['env']['global']);
+
+ $this->assertBuildSectionsNotEmpty($yaml);
+
+ $this->assertViewDoesNotUsePluginSpecifiedTravisCommands($yaml);
+ }
+
+ public function testViewGeneratesCorrectLookingYAMLWhenCustomPhpVersionsUsed()
+ {
+ $view = new TravisYmlView();
+ $view->setPlugin('ExamplePlugin');
+ $view->setPhpVersions(array('5.4', '5.6', 'hhvm'));
+ $view->setGenerateYmlCommand('./console generate:travis-yml arg1 arg2');
+ $output = $view->render();
+
+ $yaml = Spyc::YAMLLoadString($output);
+
+ $this->assertNotEmpty($yaml['php']);
+ $this->assertEquals(array('5.4', '5.6', 'hhvm'), $yaml['php']);
+ }
+
+ private function assertBuildSectionsNotEmpty($yaml)
+ {
+ $this->assertNotEmpty($yaml['before_install']);
+ $this->assertNotEmpty($yaml['install']);
+ $this->assertNotEmpty($yaml['before_script']);
+ $this->assertNotEmpty($yaml['after_script']);
+ $this->assertNotEmpty($yaml['after_success']);
+ }
+
+ private function assertViewUsesPluginSpecifiedTravisCommands($yaml)
+ {
+ $this->assertEquals("before_install hook line 1", reset($yaml['before_install']));
+ $this->assertEquals("before_install hook line 2", end($yaml['before_install']));
+
+ $this->assertEquals("before_script hook line 1", reset($yaml['before_script']));
+ $this->assertEquals("before_script hook line 2", end($yaml['before_script']));
+
+ $this->assertEquals("install hook line 1", reset($yaml['install']));
+ $this->assertEquals("install hook line 2", end($yaml['install']));
+
+ $this->assertEquals("after_success hook line 1", reset($yaml['after_success']));
+ $this->assertEquals("after_success hook line 2", end($yaml['after_success']));
+
+ $this->assertEquals("after_script hook line 1", reset($yaml['after_script']));
+ $this->assertEquals("after_script hook line 2", end($yaml['after_script']));
+ }
+
+ private function assertViewDoesNotUsePluginSpecifiedTravisCommands($yaml)
+ {
+ $this->assertNotEquals("before_install hook line 1", reset($yaml['before_install']));
+ $this->assertNotEquals("before_install hook line 2", end($yaml['before_install']));
+
+ $this->assertNotEquals("before_script hook line 1", reset($yaml['before_script']));
+ $this->assertNotEquals("before_script hook line 2", end($yaml['before_script']));
+
+ $this->assertNotEquals("install hook line 1", reset($yaml['install']));
+ $this->assertNotEquals("install hook line 2", end($yaml['install']));
+
+ $this->assertNotEquals("after_success hook line 1", reset($yaml['after_success']));
+ $this->assertNotEquals("after_success hook line 2", end($yaml['after_success']));
+
+ $this->assertNotEquals("after_script hook line 1", reset($yaml['after_script']));
+ $this->assertNotEquals("after_script hook line 2", end($yaml['after_script']));
+ }
+} \ No newline at end of file
diff --git a/plugins/CoreConsole/tests/Unit/TravisYmlViewTest.php b/plugins/CoreConsole/tests/Unit/TravisYmlViewTest.php
deleted file mode 100644
index eba77d25ba..0000000000
--- a/plugins/CoreConsole/tests/Unit/TravisYmlViewTest.php
+++ /dev/null
@@ -1,165 +0,0 @@
-<?php
-/**
- * Piwik - free/libre analytics platform
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- *
- */
-namespace Piwik\Plugins\CoreConsole\tests\Unit;
-
-use Symfony\Component\Console\Output\ConsoleOutput;
-use Piwik\Plugins\CoreConsole\TravisYmlView;
-use Piwik\Plugin\Manager as PluginManager;
-use PHPUnit_Framework_TestCase;
-use Spyc; // DeviceDectector requires Spyc
-
-/**
- * @group CoreConsole
- * @group CoreConsole_TravisYmlViewTest
- */
-class TravisYmlViewTest extends PHPUnit_Framework_TestCase
-{
- public function setUp()
- {
- PluginManager::getInstance()->loadPlugin('Morpheus');
- PluginManager::getInstance()->loadPlugin('CoreConsole');
- }
-
- public function testViewGeneratesCorrectLookingYAML()
- {
- $view = new TravisYmlView();
- $view->setPlugin('ExamplePlugin');
- $view->setExtraGlobalEnvVars(array('secure: artifactspass', 'secure: githubtoken'));
- $view->setGenerateYmlCommand('./console generate:travis-yml \'arg1\' arg2');
- $output = $view->render();
-
- $yaml = Spyc::YAMLLoadString($output);
-
- $this->assertNotEmpty($yaml['env']);
- $this->assertNotEmpty($yaml['env']['global']);
- $this->assertContains("PLUGIN_NAME=ExamplePlugin", $yaml['env']['global']);
- $this->assertContains("PIWIK_ROOT_DIR=\$TRAVIS_BUILD_DIR/piwik", $yaml['env']['global']);
- $this->assertContains(array('secure' => 'artifactspass'), $yaml['env']['global']);
- $this->assertContains(array('secure' => 'githubtoken'), $yaml['env']['global']);
-
- $this->assertNotEmpty($yaml['env']['matrix']);
- $this->assertContains("TEST_SUITE=PluginTests MYSQL_ADAPTER=PDO_MYSQL", $yaml['env']['matrix']);
- $this->assertContains("TEST_SUITE=PluginTests MYSQL_ADAPTER=PDO_MYSQL TEST_AGAINST_CORE=latest_stable", $yaml['env']['matrix']);
- $this->assertNotContains("TEST_SUITE=UITests MYSQL_ADAPTER=PDO_MYSQL", $yaml['env']['matrix']);
-
- $this->assertBuildSectionsNotEmpty($yaml);
-
- $this->assertContains("export GENERATE_TRAVIS_YML_COMMAND=\"./console generate:travis-yml \\'arg1\\' arg2\"", $yaml['before_script']);
-
- $this->assertViewUsesPluginSpecifiedTravisCommands($yaml);
- }
-
- public function testViewPreservesCommentsAndEnvVarsIfExistingYml()
- {
- $view = new TravisYmlView();
- $view->setPlugin('ExamplePlugin');
- $view->setExtraGlobalEnvVars(array('secure: artifactspass', 'secure: githubtoken'));
- $view->setGenerateYmlCommand('./console generate:travis-yml arg1 arg2');
- $view->processExistingTravisYml(PIWIK_INCLUDE_PATH . '/plugins/CoreConsole/tests/resources/test.travis.yml');
- $output = $view->render();
-
- $yaml = Spyc::YAMLLoadString($output);
-
- $this->assertNotEmpty($yaml['env']);
- $this->assertNotEmpty($yaml['env']['global']);
-
- $this->assertContains("PRESERVED_VAR=123", $yaml['env']['global']);
- $this->assertContains(array('secure' => 'anotherpreservedvar'), $yaml['env']['global']);
- $this->assertNotContains("PLUGIN_NAME=ExamplePlugin", $yaml['env']['global']);
- $this->assertNotContains("PIWIK_ROOT_DIR=\$TRAVIS_BUILD_DIR/piwik", $yaml['env']['global']);
-
- $this->assertBuildSectionsNotEmpty($yaml);
-
- $this->assertNotEmpty($yaml['custom_section']);
- $this->assertContains("custom_section:\n - this will be preserved\n # as should this", $output);
-
- $this->assertNotEmpty($yaml['notifications']);
- $this->assertContains("notifications:\n # another section\n - a\n - b\n - c", $output);
-
- $this->assertViewUsesPluginSpecifiedTravisCommands($yaml);
- }
-
- public function testViewGeneratesCorrectLookingYAMLForCore()
- {
- $view = new TravisYmlView();
- // no setPlugin call here signifies generating for core
- $view->processExistingTravisYml(PIWIK_INCLUDE_PATH . '/.travis.yml');
- $view->setExtraGlobalEnvVars(array('secure: artifactspass', 'secure: githubtoken'));
- $view->setGenerateYmlCommand('./console generate:travis-yml \'arg1\' arg2');
- $output = $view->render();
-
- $yaml = Spyc::YAMLLoadString($output);
-
- $this->assertNotEmpty($yaml['env']);
- $this->assertNotEmpty($yaml['env']['global']);
-
- $this->assertBuildSectionsNotEmpty($yaml);
-
- $this->assertViewDoesNotUsePluginSpecifiedTravisCommands($yaml);
- }
-
- public function testViewGeneratesCorrectLookingYAMLWhenCustomPhpVersionsUsed()
- {
- $view = new TravisYmlView();
- $view->setPlugin('ExamplePlugin');
- $view->setPhpVersions(array('5.4', '5.6', 'hhvm'));
- $view->setGenerateYmlCommand('./console generate:travis-yml arg1 arg2');
- $output = $view->render();
-
- $yaml = Spyc::YAMLLoadString($output);
-
- $this->assertNotEmpty($yaml['php']);
- $this->assertEquals(array('5.4', '5.6', 'hhvm'), $yaml['php']);
- }
-
- private function assertBuildSectionsNotEmpty($yaml)
- {
- $this->assertNotEmpty($yaml['before_install']);
- $this->assertNotEmpty($yaml['install']);
- $this->assertNotEmpty($yaml['before_script']);
- $this->assertNotEmpty($yaml['after_script']);
- $this->assertNotEmpty($yaml['after_success']);
- }
-
- private function assertViewUsesPluginSpecifiedTravisCommands($yaml)
- {
- $this->assertEquals("before_install hook line 1", reset($yaml['before_install']));
- $this->assertEquals("before_install hook line 2", end($yaml['before_install']));
-
- $this->assertEquals("before_script hook line 1", reset($yaml['before_script']));
- $this->assertEquals("before_script hook line 2", end($yaml['before_script']));
-
- $this->assertEquals("install hook line 1", reset($yaml['install']));
- $this->assertEquals("install hook line 2", end($yaml['install']));
-
- $this->assertEquals("after_success hook line 1", reset($yaml['after_success']));
- $this->assertEquals("after_success hook line 2", end($yaml['after_success']));
-
- $this->assertEquals("after_script hook line 1", reset($yaml['after_script']));
- $this->assertEquals("after_script hook line 2", end($yaml['after_script']));
- }
-
- private function assertViewDoesNotUsePluginSpecifiedTravisCommands($yaml)
- {
- $this->assertNotEquals("before_install hook line 1", reset($yaml['before_install']));
- $this->assertNotEquals("before_install hook line 2", end($yaml['before_install']));
-
- $this->assertNotEquals("before_script hook line 1", reset($yaml['before_script']));
- $this->assertNotEquals("before_script hook line 2", end($yaml['before_script']));
-
- $this->assertNotEquals("install hook line 1", reset($yaml['install']));
- $this->assertNotEquals("install hook line 2", end($yaml['install']));
-
- $this->assertNotEquals("after_success hook line 1", reset($yaml['after_success']));
- $this->assertNotEquals("after_success hook line 2", end($yaml['after_success']));
-
- $this->assertNotEquals("after_script hook line 1", reset($yaml['after_script']));
- $this->assertNotEquals("after_script hook line 2", end($yaml['after_script']));
- }
-} \ No newline at end of file
diff --git a/plugins/CoreConsole/tests/resources/test.travis.yml b/plugins/CoreConsole/tests/resources/test.travis.yml
index 1cdc845f18..e92dabeba1 100644
--- a/plugins/CoreConsole/tests/resources/test.travis.yml
+++ b/plugins/CoreConsole/tests/resources/test.travis.yml
@@ -8,7 +8,7 @@ env:
- PRESERVED_VAR=123
- secure: anotherpreservedvar
matrix:
- - TEST_SUITE=CoreTests MYSQL_ADAPTER=PDO_MYSQL
+ - TEST_SUITE=UnitTests MYSQL_ADAPTER=PDO_MYSQL
- TEST_SUITE=PluginTests MYSQL_ADAPTER=PDO_MYSQL
script: ./travis.sh
diff --git a/plugins/CorePluginsAdmin/tests/Integration/UpdateCommunicationTest.php b/plugins/CorePluginsAdmin/tests/Integration/UpdateCommunicationTest.php
new file mode 100644
index 0000000000..5743c42e46
--- /dev/null
+++ b/plugins/CorePluginsAdmin/tests/Integration/UpdateCommunicationTest.php
@@ -0,0 +1,186 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+namespace Piwik\Plugins\CorePluginsAdmin\tests\Integration;
+
+use Piwik\Config;
+use Piwik\Option;
+use Piwik\Plugins\CorePluginsAdmin\UpdateCommunication;
+use Piwik\Tests\Impl\IntegrationTestCase;
+
+/**
+ * Class Plugins_CorePluginsAdmin_UpdateCommunicationTest
+ *
+ * @group Plugins
+ */
+class UpdateCommunicationTest extends IntegrationTestCase
+{
+ /**
+ * @var UpdateCommunication
+ */
+ private $updateCommunication;
+
+ public function setUp()
+ {
+ parent::setUp();
+
+ $this->updateCommunication = new UpdateCommunication();
+ $this->updateCommunication->enable();
+ }
+
+ public function test_canBeEnabled()
+ {
+ $this->assertTrue($this->updateCommunication->canBeEnabled());
+
+ Config::getInstance()->General['enable_update_communication'] = 0;
+ $this->assertFalse($this->updateCommunication->canBeEnabled());
+
+ Config::getInstance()->General['enable_update_communication'] = 1;
+ $this->assertTrue($this->updateCommunication->canBeEnabled());
+ }
+
+ public function test_enable()
+ {
+ $this->updateCommunication->enable();
+ $this->assertTrue($this->updateCommunication->isEnabled());
+ }
+
+ public function test_disable()
+ {
+ $this->assertTrue($this->updateCommunication->isEnabled());
+
+ $this->updateCommunication->disable();
+ $this->assertFalse($this->updateCommunication->isEnabled());
+ }
+
+ public function test_isEnabled_shouldReturnFalse_IfCannotBeEnabled()
+ {
+ $this->assertTrue($this->updateCommunication->isEnabled());
+
+ Config::getInstance()->General['enable_update_communication'] = 0;
+ $this->assertFalse($this->updateCommunication->isEnabled());
+ }
+
+ public function test_sendNotificationIfUpdatesAvailable_shouldNotSendNotification_IfNoUpdateAvailable()
+ {
+ $mock = $this->getCommunicationMock(array());
+ $mock->expects($this->never())->method('sendEmailNotification');
+ $mock->sendNotificationIfUpdatesAvailable();
+ }
+
+ /**
+ * @dataProvider provideSendNotificationData
+ */
+ public function test_sendNotificationIfUpdatesAvailable($latestVersion, $lastSentVersion, $expects, $expectedLastSentVersion)
+ {
+ $pluginsHavingUpdate = array(
+ array('name' => 'MyTest', 'latestVersion' => $latestVersion, 'isTheme' => false)
+ );
+ $this->setLastSentVersion('MyTest', $lastSentVersion);
+
+ $mock = $this->getCommunicationMock($pluginsHavingUpdate);
+ $mock->expects($expects)->method('sendEmailNotification');
+ $mock->sendNotificationIfUpdatesAvailable();
+
+ $this->assertEquals($expectedLastSentVersion, $this->getLastSentVersion('MyTest'));
+ }
+
+ public function provideSendNotificationData()
+ {
+ return array(
+ array('33.0.0', '33.0.0', $this->never(), '33.0.0'), // shouldNotSend_IfAlreadyNotified
+ array('31.0.0', '33.0.0', $this->never(), '33.0.0'), // shouldNotSend_IfAlreadyNotifiedAboutLaterRelease
+ array('33.0.0', false, $this->once(), '33.0.0'), // shouldSend_IfUpdateAvailableAndNeverSentAnyBefore
+ array('33.0.0', '31.0.0', $this->once(), '33.0.0'), // shouldSend_IfUpdateAvailable,
+ );
+ }
+
+ public function test_sendNotificationIfUpdatesAvailable_ShouldSendOnlyOneEmail_IfMultipleUpdatesAreAvailable()
+ {
+ $mock = $this->getCommunicationMockHavingManyUpdates();
+ $mock->expects($this->once())->method('sendEmailNotification');
+ $mock->sendNotificationIfUpdatesAvailable();
+ }
+
+ public function test_sendNotificationIfUpdatesAvailable_ShouldUpdateAllSentVersions_IfMultipleUpdatesAreAvailable()
+ {
+ $mock = $this->getCommunicationMockHavingManyUpdates();
+ $mock->expects($this->once())->method('sendEmailNotification');
+ $mock->sendNotificationIfUpdatesAvailable();
+
+ $this->assertEquals('33.0.0', $this->getLastSentVersion('MyTest1'));
+ $this->assertEquals('32.0.0', $this->getLastSentVersion('MyTest2'));
+ $this->assertEquals('31.0.0', $this->getLastSentVersion('MyTest3'));
+ }
+
+ public function test_sendNotificationIfUpdatesAvailable_ShouldSendCorrectText()
+ {
+ $subject = 'CoreUpdater_NotificationSubjectAvailablePluginUpdate';
+ $message = 'ScheduledReports_EmailHello
+
+CoreUpdater_ThereIsNewPluginVersionAvailableForUpdate
+
+ * MyTest1 33.0.0
+ * MyTest2 32.0.0
+ * MyTest3 31.0.0
+
+CoreUpdater_NotificationClickToUpdatePlugins
+index.php?module=CorePluginsAdmin&action=plugins
+
+Installation_HappyAnalysing';
+
+ $mock = $this->getCommunicationMockHavingManyUpdates();
+
+ $mock->expects($this->once())->method('sendEmailNotification')
+ ->with($this->equalTo($subject), $this->equalTo($message));
+
+ $mock->sendNotificationIfUpdatesAvailable();
+ }
+
+ private function setLastSentVersion($pluginName, $version)
+ {
+ Option::set('last_update_communication_sent_plugin_' . $pluginName, $version);
+ }
+
+ private function getLastSentVersion($pluginName)
+ {
+ return Option::get('last_update_communication_sent_plugin_' . $pluginName);
+ }
+
+ /**
+ * @param array $pluginsHavingUpdate
+ * @return UpdateCommunication
+ */
+ private function getCommunicationMock($pluginsHavingUpdate)
+ {
+ $mock = $this->getMock('\Piwik\Plugins\CorePluginsAdmin\UpdateCommunication', array('getPluginsHavingUpdate', 'sendEmailNotification'));
+
+ $mock->expects($this->any())
+ ->method('getPluginsHavingUpdate')
+ ->will($this->returnValue($pluginsHavingUpdate));
+
+ return $mock;
+ }
+
+ private function getCommunicationMockHavingManyUpdates()
+ {
+ $pluginsHavingUpdate = array(
+ array('name' => 'MyTest1', 'latestVersion' => '33.0.0', 'isTheme' => false),
+ array('name' => 'MyTest2', 'latestVersion' => '32.0.0', 'isTheme' => false),
+ array('name' => 'MyTest3', 'latestVersion' => '31.0.0', 'isTheme' => false),
+ );
+
+ $this->setLastSentVersion('MyTest1', false);
+ $this->setLastSentVersion('MyTest2', false);
+ $this->setLastSentVersion('MyTest3', false);
+
+ $mock = $this->getCommunicationMock($pluginsHavingUpdate);
+
+ return $mock;
+ }
+}
diff --git a/plugins/CoreUpdater/tests/Integration/UpdateCommunicationTest.php b/plugins/CoreUpdater/tests/Integration/UpdateCommunicationTest.php
new file mode 100644
index 0000000000..10f408206f
--- /dev/null
+++ b/plugins/CoreUpdater/tests/Integration/UpdateCommunicationTest.php
@@ -0,0 +1,122 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+namespace Piwik\Plugins\CoreUpdater\tests;
+
+use Piwik\Config;
+use Piwik\Option;
+use Piwik\Plugins\CoreUpdater\UpdateCommunication;
+use Piwik\UpdateCheck;
+use Piwik\Version;
+use Piwik\Tests\Impl\IntegrationTestCase;
+
+/**
+ * Class Plugins_CoreUpdater_UpdateCommunicationTest
+ *
+ * @group Plugins
+ */
+class UpdateCommunicationTest extends IntegrationTestCase
+{
+ public function setUp()
+ {
+ parent::setUp();
+ }
+
+ public function test_isEnabled()
+ {
+ $updateCommunication = new UpdateCommunication();
+
+ $this->assertTrue($updateCommunication->isEnabled());
+
+ Config::getInstance()->General['enable_update_communication'] = 0;
+ $this->assertFalse($updateCommunication->isEnabled());
+
+ Config::getInstance()->General['enable_update_communication'] = 1;
+ $this->assertTrue($updateCommunication->isEnabled());
+ }
+
+ /**
+ * @dataProvider provideSendNotificationData
+ */
+ public function test_sendNotificationIfUpdateAvailable($latestVersion, $lastSentVersion, $expects, $expectedLastSentVersion)
+ {
+ $this->setLatestVersion($latestVersion);
+ $this->setLastSentVersion($lastSentVersion);
+
+ $mock = $this->getCommunicationMock(array('sendNotifications'));
+ $mock->expects($expects)->method('sendNotifications');
+ $mock->sendNotificationIfUpdateAvailable();
+
+ $this->assertEquals($expectedLastSentVersion, $this->getLastSentVersion());
+ }
+
+ public function provideSendNotificationData()
+ {
+ return array(
+ array(Version::VERSION, false, $this->never(), false), // shouldNotSend_IfNoUpdateAvailable
+ array('33.0.0', '33.0.0', $this->never(), '33.0.0'), // shouldNotSend_IfAlreadyNotified
+ array('31.0.0', '33.0.0', $this->never(), '33.0.0'), // shouldNotSend_IfAlreadyNotifiedAboutLaterRelease
+ array('3333.3333.3333-beta10', '31.0.0', $this->never(), '31.0.0'), // shouldNotSend_IfLatestVersionIsNotVersionLike,
+ array('33.0.0', false, $this->once(), '33.0.0'), // shouldSend_IfUpdateAvailableAndNeverSentAnyBefore
+ array('33.0.0', '31.0.0', $this->once(), '33.0.0'), // shouldSend_IfUpdateAvailable
+ );
+ }
+
+ public function test_sendNotifications_shouldSentCorrectEmail()
+ {
+ $this->setLatestVersion('33.0.0');
+
+ $subject = 'CoreUpdater_NotificationSubjectAvailableCoreUpdate';
+ $message = 'ScheduledReports_EmailHello
+
+CoreUpdater_ThereIsNewVersionAvailableForUpdate
+
+CoreUpdater_YouCanUpgradeAutomaticallyOrDownloadPackage
+
+index.php?module=CoreUpdater&action=newVersionAvailable
+
+CoreUpdater_FeedbackRequest
+http://piwik.org/contact/';
+
+ $mock = $this->getCommunicationMock(array('sendEmailNotification'));
+ $mock->expects($this->once())
+ ->method('sendEmailNotification')
+ ->with($this->equalTo($subject), $this->equalTo($message));
+ $mock->sendNotificationIfUpdateAvailable();
+ }
+
+ private function setLastSentVersion($value)
+ {
+ Option::set('last_update_communication_sent_core', $value);
+ }
+
+ private function getLastSentVersion()
+ {
+ return Option::get('last_update_communication_sent_core');
+ }
+
+ private function setLatestVersion($value)
+ {
+ $this->preventVersionIsOverwrittenByActualVersionCheck();
+ Option::set(UpdateCheck::LATEST_VERSION, $value);
+ }
+
+ private function preventVersionIsOverwrittenByActualVersionCheck()
+ {
+ Config::getInstance()->General['enable_auto_update'] = false;
+ }
+
+ /**
+ * @param array $methodsToOverwrite
+ * @return UpdateCommunication
+ */
+ private function getCommunicationMock($methodsToOverwrite)
+ {
+ return $this->getMock('\Piwik\Plugins\CoreUpdater\UpdateCommunication', $methodsToOverwrite);
+ }
+}
diff --git a/plugins/CoreUpdater/tests/ModelTest.php b/plugins/CoreUpdater/tests/Unit/ModelTest.php
index 3098595b77..3098595b77 100644
--- a/plugins/CoreUpdater/tests/ModelTest.php
+++ b/plugins/CoreUpdater/tests/Unit/ModelTest.php
diff --git a/plugins/CoreVisualizations/Visualizations/Cloud.php b/plugins/CoreVisualizations/Visualizations/Cloud.php
index 0a78e219e6..d5a317da25 100644
--- a/plugins/CoreVisualizations/Visualizations/Cloud.php
+++ b/plugins/CoreVisualizations/Visualizations/Cloud.php
@@ -29,7 +29,7 @@ class Cloud extends Visualization
const FOOTER_ICON = 'plugins/Morpheus/images/tagcloud.png';
const FOOTER_ICON_TITLE = 'General_TagCloud';
- /** Used by integration tests to make sure output is consistent. */
+ /** Used by system tests to make sure output is consistent. */
public static $debugDisableShuffle = false;
public $truncatingLimit = 50;
diff --git a/plugins/CustomAlerts b/plugins/CustomAlerts
-Subproject f5557b8bcdb2ef6936b651a39f4e4f510b83bf6
+Subproject 8e754d154afe8ae64c5a9f667a24c99ad673bd1
diff --git a/plugins/CustomVariables/.gitignore b/plugins/CustomVariables/.gitignore
new file mode 100644
index 0000000000..c8c9480010
--- /dev/null
+++ b/plugins/CustomVariables/.gitignore
@@ -0,0 +1 @@
+tests/System/processed/*xml \ No newline at end of file
diff --git a/plugins/CustomVariables/tests/Commands/InfoTest.php b/plugins/CustomVariables/tests/Commands/InfoTest.php
index 28f3d86cc7..455cdd10e2 100644
--- a/plugins/CustomVariables/tests/Commands/InfoTest.php
+++ b/plugins/CustomVariables/tests/Commands/InfoTest.php
@@ -13,14 +13,15 @@ use Piwik\Plugins\CustomVariables\Commands\Info;
use Piwik\Plugins\CustomVariables\Model;
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Tester\CommandTester;
+use Piwik\Tests\Impl\IntegrationTestCase;
/**
* @group CustomVariables
* @group CustomVariablesTest
- * @group Database
+ * @group Plugins
* @group Plugins
*/
-class InfoTest extends \DatabaseTestCase
+class InfoTest extends IntegrationTestCase
{
public function testExecute_ShouldOutputInfoSuccess_IfEverythingIsOk()
{
diff --git a/plugins/CustomVariables/tests/Commands/SetNumberOfCustomVariablesTest.php b/plugins/CustomVariables/tests/Commands/SetNumberOfCustomVariablesTest.php
index 521684cac3..f48473b5e9 100644
--- a/plugins/CustomVariables/tests/Commands/SetNumberOfCustomVariablesTest.php
+++ b/plugins/CustomVariables/tests/Commands/SetNumberOfCustomVariablesTest.php
@@ -13,14 +13,15 @@ use Piwik\Plugins\CustomVariables\Commands\SetNumberOfCustomVariables;
use Piwik\Plugins\CustomVariables\CustomVariables;
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Tester\CommandTester;
+use Piwik\Tests\Impl\IntegrationTestCase;
/**
* @group CustomVariables
* @group CustomVariablesTest
- * @group Database
+ * @group Plugins
* @group Plugins
*/
-class SetNumberOfCustomVariablesTest extends \DatabaseTestCase
+class SetNumberOfCustomVariablesTest extends IntegrationTestCase
{
/**
* @expectedException \RuntimeException
diff --git a/plugins/CustomVariables/tests/CustomVariablesIntegrationTest.php b/plugins/CustomVariables/tests/CustomVariablesIntegrationTest.php
deleted file mode 100644
index 0cffce2a7c..0000000000
--- a/plugins/CustomVariables/tests/CustomVariablesIntegrationTest.php
+++ /dev/null
@@ -1,61 +0,0 @@
-<?php
-/**
- * Piwik - free/libre analytics platform
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- */
-
-namespace Piwik\Plugins\CustomVariables\tests;
-
-use Piwik\Tests\IntegrationTestCase;
-
-/**
- * @group CustomVariables
- * @group CustomVariablesIntegrationTest
- * @group Database
- */
-class CustomVariablesIntegrationTest extends IntegrationTestCase
-{
- /**
- * @var Fixtures\VisitWithManyCustomVariables
- */
- public static $fixture = null; // initialized below class definition
-
- public static function getOutputPrefix()
- {
- return 'CustomVariablesIntegrationTest';
- }
-
- /**
- * @dataProvider getApiForTesting
- * @group Integration
- */
- public function testApi($api, $params)
- {
- $this->runApiTests($api, $params);
- }
-
- public function getApiForTesting()
- {
- $apiToCall = array('CustomVariables.getCustomVariables', 'Live.getLastVisitsDetails');
-
- return array(
- array($apiToCall, array(
- 'idSite' => self::$fixture->idSite,
- 'date' => self::$fixture->dateTime,
- 'periods' => array('day'))
- )
- );
- }
-
- /**
- * Path where expected/processed output files are stored.
- */
- public static function getPathToTestDirectory()
- {
- return __DIR__;
- }
-}
-
-CustomVariablesIntegrationTest::$fixture = new Fixtures\VisitWithManyCustomVariables(); \ No newline at end of file
diff --git a/plugins/CustomVariables/tests/CustomVariablesTest.php b/plugins/CustomVariables/tests/CustomVariablesTest.php
deleted file mode 100644
index 8e95aff299..0000000000
--- a/plugins/CustomVariables/tests/CustomVariablesTest.php
+++ /dev/null
@@ -1,43 +0,0 @@
-<?php
-/**
- * Piwik - free/libre analytics platform
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- */
-
-namespace Piwik\Plugins\CustomVariables\tests;
-use Piwik\Plugins\CustomVariables\CustomVariables;
-use Piwik\Tracker\Cache;
-
-/**
- * @group CustomVariables
- * @group CustomVariablesTest
- * @group Database
- */
-class CustomVariablesTest extends \DatabaseTestCase
-{
- public function testGetMaxCustomVariables_ShouldDetectCorrectNumberOfVariables()
- {
- Cache::clearCacheGeneral();
- $this->assertSame(5, CustomVariables::getMaxCustomVariables());
- }
-
- public function testGetMaxCustomVariables_ShouldCacheTheResult()
- {
- CustomVariables::getMaxCustomVariables();
- $cache = Cache::getCacheGeneral();
-
- $this->assertSame(5, $cache['CustomVariables.MaxNumCustomVariables']);
- }
-
- public function testGetMaxCustomVariables_ShouldReadFromCacheIfPossible()
- {
- $cache = Cache::getCacheGeneral();
- $cache['CustomVariables.MaxNumCustomVariables'] = 10;
- Cache::setCacheGeneral($cache);
-
- $this->assertSame(10, CustomVariables::getMaxCustomVariables());
- }
-
-}
diff --git a/plugins/CustomVariables/tests/Fixtures/VisitWithManyCustomVariables.php b/plugins/CustomVariables/tests/Fixtures/VisitWithManyCustomVariables.php
index 8060eb25a7..82b8129bbb 100644
--- a/plugins/CustomVariables/tests/Fixtures/VisitWithManyCustomVariables.php
+++ b/plugins/CustomVariables/tests/Fixtures/VisitWithManyCustomVariables.php
@@ -9,7 +9,7 @@ namespace Piwik\Plugins\CustomVariables\tests\Fixtures;
use Piwik\Plugins\CustomVariables\Model;
use Piwik\Plugins\Goals\API;
-use Piwik\Tests\Fixture;
+use Piwik\Tests\Impl\Fixture;
/**
* Adds one site with two goals and tracks two visits with custom variables.
diff --git a/plugins/CustomVariables/tests/Integration/CustomVariablesTest.php b/plugins/CustomVariables/tests/Integration/CustomVariablesTest.php
new file mode 100644
index 0000000000..5144dc4489
--- /dev/null
+++ b/plugins/CustomVariables/tests/Integration/CustomVariablesTest.php
@@ -0,0 +1,44 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+namespace Piwik\Plugins\CustomVariables\tests;
+use Piwik\Plugins\CustomVariables\CustomVariables;
+use Piwik\Tracker\Cache;
+use Piwik\Tests\Impl\IntegrationTestCase;
+
+/**
+ * @group CustomVariables
+ * @group CustomVariablesTest
+ * @group Plugins
+ */
+class CustomVariablesTest extends IntegrationTestCase
+{
+ public function testGetMaxCustomVariables_ShouldDetectCorrectNumberOfVariables()
+ {
+ Cache::clearCacheGeneral();
+ $this->assertSame(5, CustomVariables::getMaxCustomVariables());
+ }
+
+ public function testGetMaxCustomVariables_ShouldCacheTheResult()
+ {
+ CustomVariables::getMaxCustomVariables();
+ $cache = Cache::getCacheGeneral();
+
+ $this->assertSame(5, $cache['CustomVariables.MaxNumCustomVariables']);
+ }
+
+ public function testGetMaxCustomVariables_ShouldReadFromCacheIfPossible()
+ {
+ $cache = Cache::getCacheGeneral();
+ $cache['CustomVariables.MaxNumCustomVariables'] = 10;
+ Cache::setCacheGeneral($cache);
+
+ $this->assertSame(10, CustomVariables::getMaxCustomVariables());
+ }
+
+}
diff --git a/plugins/CustomVariables/tests/Integration/ModelTest.php b/plugins/CustomVariables/tests/Integration/ModelTest.php
new file mode 100644
index 0000000000..384d204478
--- /dev/null
+++ b/plugins/CustomVariables/tests/Integration/ModelTest.php
@@ -0,0 +1,199 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+namespace Piwik\Plugins\CustomVariables\tests;
+use Piwik\Db;
+use Piwik\Plugins\CustomVariables\Model;
+use Piwik\Tests\Impl\IntegrationTestCase;
+
+/**
+ * @group CustomVariables
+ * @group ModelTest
+ * @group Plugins
+ * @group CustomVariables_ModelTest
+ */
+class ModelTest extends IntegrationTestCase
+{
+ private static $cvarScopes = array('log_link_visit_action', 'log_visit', 'log_conversion');
+
+ public function setUp()
+ {
+ // do not call parent::setUp() since it expects database to be created,
+ // but DB for this test is removed in tearDown
+
+ self::$fixture->performSetUp();
+ }
+
+ public function tearDown()
+ {
+ parent::tearDown();
+
+ self::$fixture->performTearDown();
+ }
+
+ /**
+ * @expectedException \Exception
+ */
+ public function test_construct_shouldFailInCaseOfEmptyScope()
+ {
+ new Model(null);
+ }
+
+ /**
+ * @expectedException \Exception
+ */
+ public function test_construct_shouldFailInCaseOfInvalidScope()
+ {
+ new Model('inValId');
+ }
+
+ public function testGetAllScopes()
+ {
+ $this->assertEquals(self::$cvarScopes, Model::getScopes());
+ }
+
+ public function test_Install_Uninstall()
+ {
+ $this->assertEquals(5, $this->getPageScope()->getCurrentNumCustomVars());
+ $this->assertEquals(5, $this->getVisitScope()->getCurrentNumCustomVars());
+ $this->assertEquals(5, $this->getConversionScope()->getCurrentNumCustomVars());
+
+ Model::uninstall();
+
+ $this->assertEquals(0, $this->getPageScope()->getCurrentNumCustomVars());
+ $this->assertEquals(0, $this->getVisitScope()->getCurrentNumCustomVars());
+ $this->assertEquals(0, $this->getConversionScope()->getCurrentNumCustomVars());
+
+ $this->getPageScope()->addCustomVariable();
+ $this->getPageScope()->addCustomVariable();
+ $this->getVisitScope()->addCustomVariable();
+
+ $this->assertEquals(2, $this->getPageScope()->getCurrentNumCustomVars());
+ $this->assertEquals(1, $this->getVisitScope()->getCurrentNumCustomVars());
+ $this->assertEquals(0, $this->getConversionScope()->getCurrentNumCustomVars());
+
+ Model::install();
+
+ $this->assertEquals(5, $this->getPageScope()->getCurrentNumCustomVars());
+ $this->assertEquals(5, $this->getVisitScope()->getCurrentNumCustomVars());
+ $this->assertEquals(5, $this->getConversionScope()->getCurrentNumCustomVars());
+ }
+
+ public function testGetCustomVariableIndexFromFieldName()
+ {
+ $this->assertSame(0, Model::getCustomVariableIndexFromFieldName('custom_var_k0'));
+ $this->assertSame(0, Model::getCustomVariableIndexFromFieldName('custom_var_v0'));
+ $this->assertSame(5, Model::getCustomVariableIndexFromFieldName('custom_var_k5'));
+ $this->assertSame(5, Model::getCustomVariableIndexFromFieldName('custom_var_v5'));
+ $this->assertSame(938, Model::getCustomVariableIndexFromFieldName('custom_var_k938'));
+ $this->assertSame(938, Model::getCustomVariableIndexFromFieldName('custom_var_v938'));
+ $this->assertSame(null, Model::getCustomVariableIndexFromFieldName('otherfield'));
+ }
+
+ public function testGetScopeName()
+ {
+ $this->assertEquals('Page', $this->getPageScope()->getScopeName());
+ $this->assertEquals('Visit', $this->getVisitScope()->getScopeName());
+ $this->assertEquals('Conversion', $this->getConversionScope()->getScopeName());
+ }
+
+ public function test_getCurrentNumCustomVars()
+ {
+ $this->assertEquals(5, $this->getPageScope()->getCurrentNumCustomVars());
+ $this->assertEquals(5, $this->getVisitScope()->getCurrentNumCustomVars());
+ $this->assertEquals(5, $this->getConversionScope()->getCurrentNumCustomVars());
+
+ $this->getPageScope()->addCustomVariable();
+ $this->getConversionScope()->removeCustomVariable();
+
+ $this->assertEquals(6, $this->getPageScope()->getCurrentNumCustomVars());
+ $this->assertEquals(5, $this->getVisitScope()->getCurrentNumCustomVars());
+ $this->assertEquals(4, $this->getConversionScope()->getCurrentNumCustomVars());
+ }
+
+ public function test_getCustomVarIndexes()
+ {
+ $this->assertEquals(array(1,2,3,4,5), $this->getPageScope()->getCustomVarIndexes());
+ $this->assertEquals(array(1,2,3,4,5), $this->getVisitScope()->getCustomVarIndexes());
+ $this->assertEquals(array(1,2,3,4,5), $this->getConversionScope()->getCustomVarIndexes());
+
+ $this->getPageScope()->addCustomVariable();
+ $this->getConversionScope()->removeCustomVariable();
+
+ $this->assertEquals(array(1,2,3,4,5,6), $this->getPageScope()->getCustomVarIndexes());
+ $this->assertEquals(array(1,2,3,4,5), $this->getVisitScope()->getCustomVarIndexes());
+ $this->assertEquals(array(1,2,3,4), $this->getConversionScope()->getCustomVarIndexes());
+ }
+
+ public function test_getHighestCustomVarIndex_addCustomVariable_removeCustomVariable()
+ {
+ $this->assertEquals(5, $this->getPageScope()->getHighestCustomVarIndex());
+ $this->assertEquals(5, $this->getVisitScope()->getHighestCustomVarIndex());
+ $this->assertEquals(5, $this->getConversionScope()->getHighestCustomVarIndex());
+
+ $this->getPageScope()->addCustomVariable();
+ $this->getConversionScope()->removeCustomVariable();
+
+ $this->assertEquals(6, $this->getPageScope()->getHighestCustomVarIndex());
+ $this->assertEquals(5, $this->getVisitScope()->getHighestCustomVarIndex());
+ $this->assertEquals(4, $this->getConversionScope()->getHighestCustomVarIndex());
+
+ $this->getConversionScope()->removeCustomVariable();
+ $this->getPageScope()->addCustomVariable();
+ $this->getVisitScope()->addCustomVariable();
+ $this->getPageScope()->addCustomVariable();
+ $this->getConversionScope()->removeCustomVariable();
+
+ $this->assertEquals(8, $this->getPageScope()->getHighestCustomVarIndex());
+ $this->assertEquals(6, $this->getVisitScope()->getHighestCustomVarIndex());
+ $this->assertEquals(2, $this->getConversionScope()->getHighestCustomVarIndex());
+ }
+
+ public function test_removeCustomVariable_shouldNotFailIfRemovesMoreThanExist()
+ {
+ $scope = $this->getPageScope();
+
+ $this->assertEquals(5, $scope->getHighestCustomVarIndex());
+
+ for ($index = 0; $index < 5; $index++) {
+ $scope->removeCustomVariable();
+ $this->assertEquals(4 - $index, $scope->getHighestCustomVarIndex());
+ }
+
+ $this->assertNull($scope->removeCustomVariable());
+ $this->assertEquals(0, $scope->getHighestCustomVarIndex());
+ $this->assertEquals(0, $scope->getCurrentNumCustomVars());
+ }
+
+ public function test_removeCustomVariable_addCustomVariable_ReturnsIndex()
+ {
+ $scopeToAdd = $this->getPageScope();
+ $scopeToRemove = $this->getVisitScope();
+
+ for ($index = 0; $index < 5; $index++) {
+ $this->assertEquals(5 - $index, $scopeToRemove->removeCustomVariable());
+ $this->assertEquals(6 + $index, $scopeToAdd->addCustomVariable());
+ }
+ }
+
+ private function getPageScope()
+ {
+ return new Model(Model::SCOPE_PAGE);
+ }
+
+ private function getVisitScope()
+ {
+ return new Model(Model::SCOPE_VISIT);
+ }
+
+ private function getConversionScope()
+ {
+ return new Model(Model::SCOPE_CONVERSION);
+ }
+
+}
diff --git a/plugins/CustomVariables/tests/ModelTest.php b/plugins/CustomVariables/tests/ModelTest.php
deleted file mode 100644
index 3ed82f552a..0000000000
--- a/plugins/CustomVariables/tests/ModelTest.php
+++ /dev/null
@@ -1,200 +0,0 @@
-<?php
-/**
- * Piwik - free/libre analytics platform
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- */
-
-namespace Piwik\Plugins\CustomVariables\tests;
-use Piwik\Common;
-use Piwik\Db;
-use Piwik\DbHelper;
-use Piwik\Plugins\CustomVariables\Model;
-
-/**
- * @group CustomVariables
- * @group ModelTest
- * @group Database
- * @group CustomVariables_ModelTest
- */
-class ModelTest extends \DatabaseTestCase
-{
- private static $cvarScopes = array('log_link_visit_action', 'log_visit', 'log_conversion');
-
- public function setUp()
- {
- // do not call parent::setUp() since it expects database to be created,
- // but DB for this test is removed in tearDown
-
- self::$fixture->performSetUp();
- }
-
- public function tearDown()
- {
- parent::tearDown();
-
- self::$fixture->performTearDown();
- }
-
- /**
- * @expectedException \Exception
- */
- public function test_construct_shouldFailInCaseOfEmptyScope()
- {
- new Model(null);
- }
-
- /**
- * @expectedException \Exception
- */
- public function test_construct_shouldFailInCaseOfInvalidScope()
- {
- new Model('inValId');
- }
-
- public function testGetAllScopes()
- {
- $this->assertEquals(self::$cvarScopes, Model::getScopes());
- }
-
- public function test_Install_Uninstall()
- {
- $this->assertEquals(5, $this->getPageScope()->getCurrentNumCustomVars());
- $this->assertEquals(5, $this->getVisitScope()->getCurrentNumCustomVars());
- $this->assertEquals(5, $this->getConversionScope()->getCurrentNumCustomVars());
-
- Model::uninstall();
-
- $this->assertEquals(0, $this->getPageScope()->getCurrentNumCustomVars());
- $this->assertEquals(0, $this->getVisitScope()->getCurrentNumCustomVars());
- $this->assertEquals(0, $this->getConversionScope()->getCurrentNumCustomVars());
-
- $this->getPageScope()->addCustomVariable();
- $this->getPageScope()->addCustomVariable();
- $this->getVisitScope()->addCustomVariable();
-
- $this->assertEquals(2, $this->getPageScope()->getCurrentNumCustomVars());
- $this->assertEquals(1, $this->getVisitScope()->getCurrentNumCustomVars());
- $this->assertEquals(0, $this->getConversionScope()->getCurrentNumCustomVars());
-
- Model::install();
-
- $this->assertEquals(5, $this->getPageScope()->getCurrentNumCustomVars());
- $this->assertEquals(5, $this->getVisitScope()->getCurrentNumCustomVars());
- $this->assertEquals(5, $this->getConversionScope()->getCurrentNumCustomVars());
- }
-
- public function testGetCustomVariableIndexFromFieldName()
- {
- $this->assertSame(0, Model::getCustomVariableIndexFromFieldName('custom_var_k0'));
- $this->assertSame(0, Model::getCustomVariableIndexFromFieldName('custom_var_v0'));
- $this->assertSame(5, Model::getCustomVariableIndexFromFieldName('custom_var_k5'));
- $this->assertSame(5, Model::getCustomVariableIndexFromFieldName('custom_var_v5'));
- $this->assertSame(938, Model::getCustomVariableIndexFromFieldName('custom_var_k938'));
- $this->assertSame(938, Model::getCustomVariableIndexFromFieldName('custom_var_v938'));
- $this->assertSame(null, Model::getCustomVariableIndexFromFieldName('otherfield'));
- }
-
- public function testGetScopeName()
- {
- $this->assertEquals('Page', $this->getPageScope()->getScopeName());
- $this->assertEquals('Visit', $this->getVisitScope()->getScopeName());
- $this->assertEquals('Conversion', $this->getConversionScope()->getScopeName());
- }
-
- public function test_getCurrentNumCustomVars()
- {
- $this->assertEquals(5, $this->getPageScope()->getCurrentNumCustomVars());
- $this->assertEquals(5, $this->getVisitScope()->getCurrentNumCustomVars());
- $this->assertEquals(5, $this->getConversionScope()->getCurrentNumCustomVars());
-
- $this->getPageScope()->addCustomVariable();
- $this->getConversionScope()->removeCustomVariable();
-
- $this->assertEquals(6, $this->getPageScope()->getCurrentNumCustomVars());
- $this->assertEquals(5, $this->getVisitScope()->getCurrentNumCustomVars());
- $this->assertEquals(4, $this->getConversionScope()->getCurrentNumCustomVars());
- }
-
- public function test_getCustomVarIndexes()
- {
- $this->assertEquals(array(1,2,3,4,5), $this->getPageScope()->getCustomVarIndexes());
- $this->assertEquals(array(1,2,3,4,5), $this->getVisitScope()->getCustomVarIndexes());
- $this->assertEquals(array(1,2,3,4,5), $this->getConversionScope()->getCustomVarIndexes());
-
- $this->getPageScope()->addCustomVariable();
- $this->getConversionScope()->removeCustomVariable();
-
- $this->assertEquals(array(1,2,3,4,5,6), $this->getPageScope()->getCustomVarIndexes());
- $this->assertEquals(array(1,2,3,4,5), $this->getVisitScope()->getCustomVarIndexes());
- $this->assertEquals(array(1,2,3,4), $this->getConversionScope()->getCustomVarIndexes());
- }
-
- public function test_getHighestCustomVarIndex_addCustomVariable_removeCustomVariable()
- {
- $this->assertEquals(5, $this->getPageScope()->getHighestCustomVarIndex());
- $this->assertEquals(5, $this->getVisitScope()->getHighestCustomVarIndex());
- $this->assertEquals(5, $this->getConversionScope()->getHighestCustomVarIndex());
-
- $this->getPageScope()->addCustomVariable();
- $this->getConversionScope()->removeCustomVariable();
-
- $this->assertEquals(6, $this->getPageScope()->getHighestCustomVarIndex());
- $this->assertEquals(5, $this->getVisitScope()->getHighestCustomVarIndex());
- $this->assertEquals(4, $this->getConversionScope()->getHighestCustomVarIndex());
-
- $this->getConversionScope()->removeCustomVariable();
- $this->getPageScope()->addCustomVariable();
- $this->getVisitScope()->addCustomVariable();
- $this->getPageScope()->addCustomVariable();
- $this->getConversionScope()->removeCustomVariable();
-
- $this->assertEquals(8, $this->getPageScope()->getHighestCustomVarIndex());
- $this->assertEquals(6, $this->getVisitScope()->getHighestCustomVarIndex());
- $this->assertEquals(2, $this->getConversionScope()->getHighestCustomVarIndex());
- }
-
- public function test_removeCustomVariable_shouldNotFailIfRemovesMoreThanExist()
- {
- $scope = $this->getPageScope();
-
- $this->assertEquals(5, $scope->getHighestCustomVarIndex());
-
- for ($index = 0; $index < 5; $index++) {
- $scope->removeCustomVariable();
- $this->assertEquals(4 - $index, $scope->getHighestCustomVarIndex());
- }
-
- $this->assertNull($scope->removeCustomVariable());
- $this->assertEquals(0, $scope->getHighestCustomVarIndex());
- $this->assertEquals(0, $scope->getCurrentNumCustomVars());
- }
-
- public function test_removeCustomVariable_addCustomVariable_ReturnsIndex()
- {
- $scopeToAdd = $this->getPageScope();
- $scopeToRemove = $this->getVisitScope();
-
- for ($index = 0; $index < 5; $index++) {
- $this->assertEquals(5 - $index, $scopeToRemove->removeCustomVariable());
- $this->assertEquals(6 + $index, $scopeToAdd->addCustomVariable());
- }
- }
-
- private function getPageScope()
- {
- return new Model(Model::SCOPE_PAGE);
- }
-
- private function getVisitScope()
- {
- return new Model(Model::SCOPE_VISIT);
- }
-
- private function getConversionScope()
- {
- return new Model(Model::SCOPE_CONVERSION);
- }
-
-}
diff --git a/plugins/CustomVariables/tests/System/CustomVariablesSystemTest.php b/plugins/CustomVariables/tests/System/CustomVariablesSystemTest.php
new file mode 100644
index 0000000000..00158a1e48
--- /dev/null
+++ b/plugins/CustomVariables/tests/System/CustomVariablesSystemTest.php
@@ -0,0 +1,60 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+namespace Piwik\Plugins\CustomVariables\tests;
+
+use Piwik\Tests\Impl\SystemTestCase;
+
+/**
+ * @group CustomVariables
+ * @group CustomVariablesSystemTest
+ * @group Plugins
+ */
+class CustomVariablesSystemTest extends SystemTestCase
+{
+ /**
+ * @var Fixtures\VisitWithManyCustomVariables
+ */
+ public static $fixture = null; // initialized below class definition
+
+ public static function getOutputPrefix()
+ {
+ return 'CustomVariablesSystemTest';
+ }
+
+ /**
+ * @dataProvider getApiForTesting
+ */
+ public function testApi($api, $params)
+ {
+ $this->runApiTests($api, $params);
+ }
+
+ public function getApiForTesting()
+ {
+ $apiToCall = array('CustomVariables.getCustomVariables', 'Live.getLastVisitsDetails');
+
+ return array(
+ array($apiToCall, array(
+ 'idSite' => self::$fixture->idSite,
+ 'date' => self::$fixture->dateTime,
+ 'periods' => array('day'))
+ )
+ );
+ }
+
+ /**
+ * Path where expected/processed output files are stored.
+ */
+ public static function getPathToTestDirectory()
+ {
+ return __DIR__;
+ }
+}
+
+CustomVariablesSystemTest::$fixture = new Fixtures\VisitWithManyCustomVariables(); \ No newline at end of file
diff --git a/plugins/CustomVariables/tests/expected/test_CustomVariablesIntegrationTest__CustomVariables.getCustomVariables_day.xml b/plugins/CustomVariables/tests/System/expected/test_CustomVariablesSystemTest__CustomVariables.getCustomVariables_day.xml
index 1ecaf61b08..1ecaf61b08 100644
--- a/plugins/CustomVariables/tests/expected/test_CustomVariablesIntegrationTest__CustomVariables.getCustomVariables_day.xml
+++ b/plugins/CustomVariables/tests/System/expected/test_CustomVariablesSystemTest__CustomVariables.getCustomVariables_day.xml
diff --git a/plugins/CustomVariables/tests/expected/test_CustomVariablesIntegrationTest__Live.getLastVisitsDetails_day.xml b/plugins/CustomVariables/tests/System/expected/test_CustomVariablesSystemTest__Live.getLastVisitsDetails_day.xml
index 91f9066c9b..91f9066c9b 100644
--- a/plugins/CustomVariables/tests/expected/test_CustomVariablesIntegrationTest__Live.getLastVisitsDetails_day.xml
+++ b/plugins/CustomVariables/tests/System/expected/test_CustomVariablesSystemTest__Live.getLastVisitsDetails_day.xml
diff --git a/plugins/CustomVariables/tests/processed/test_CustomVariablesIntegrationTest__CustomVariables.getCustomVariables_day.xml b/plugins/CustomVariables/tests/processed/test_CustomVariablesIntegrationTest__CustomVariables.getCustomVariables_day.xml
deleted file mode 100644
index 1ecaf61b08..0000000000
--- a/plugins/CustomVariables/tests/processed/test_CustomVariablesIntegrationTest__CustomVariables.getCustomVariables_day.xml
+++ /dev/null
@@ -1,395 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<result>
- <row>
- <label>Name_PAGE_1</label>
- <nb_actions>1</nb_actions>
- <subtable>
- <row>
- <label>Val_PAGE1</label>
- <nb_visits>1</nb_visits>
- <nb_actions>1</nb_actions>
- </row>
- </subtable>
- </row>
- <row>
- <label>Name_PAGE_2</label>
- <nb_actions>1</nb_actions>
- <subtable>
- <row>
- <label>Val_PAGE2</label>
- <nb_visits>1</nb_visits>
- <nb_actions>1</nb_actions>
- </row>
- </subtable>
- </row>
- <row>
- <label>Name_PAGE_3</label>
- <nb_actions>1</nb_actions>
- <subtable>
- <row>
- <label>Val_PAGE3</label>
- <nb_visits>1</nb_visits>
- <nb_actions>1</nb_actions>
- </row>
- </subtable>
- </row>
- <row>
- <label>Name_PAGE_4</label>
- <nb_actions>1</nb_actions>
- <subtable>
- <row>
- <label>Val_PAGE4</label>
- <nb_visits>1</nb_visits>
- <nb_actions>1</nb_actions>
- </row>
- </subtable>
- </row>
- <row>
- <label>Name_PAGE_5</label>
- <nb_actions>1</nb_actions>
- <subtable>
- <row>
- <label>Val_PAGE5</label>
- <nb_visits>1</nb_visits>
- <nb_actions>1</nb_actions>
- </row>
- </subtable>
- </row>
- <row>
- <label>Name_PAGE_6</label>
- <nb_actions>1</nb_actions>
- <subtable>
- <row>
- <label>Val_PAGE6</label>
- <nb_visits>1</nb_visits>
- <nb_actions>1</nb_actions>
- </row>
- </subtable>
- </row>
- <row>
- <label>Name_PAGE_7</label>
- <nb_actions>1</nb_actions>
- <subtable>
- <row>
- <label>Val_PAGE7</label>
- <nb_visits>1</nb_visits>
- <nb_actions>1</nb_actions>
- </row>
- </subtable>
- </row>
- <row>
- <label>Name_PAGE_8</label>
- <nb_actions>1</nb_actions>
- <subtable>
- <row>
- <label>Val_PAGE8</label>
- <nb_visits>1</nb_visits>
- <nb_actions>1</nb_actions>
- </row>
- </subtable>
- </row>
- <row>
- <label>Name_VISIT_1</label>
- <nb_visits>1</nb_visits>
- <nb_actions>1</nb_actions>
- <nb_users>0</nb_users>
- <max_actions>1</max_actions>
- <sum_visit_length>4</sum_visit_length>
- <bounce_count>1</bounce_count>
- <goals>
- <row idgoal='1'>
- <nb_conversions>1</nb_conversions>
- <nb_visits_converted>1</nb_visits_converted>
- <revenue>0</revenue>
- </row>
- </goals>
- <nb_conversions>1</nb_conversions>
- <revenue>0</revenue>
- <subtable>
- <row>
- <label>Val_VISIT1</label>
- <nb_visits>1</nb_visits>
- <nb_actions>1</nb_actions>
- <nb_users>0</nb_users>
- <max_actions>1</max_actions>
- <sum_visit_length>4</sum_visit_length>
- <bounce_count>1</bounce_count>
- <goals>
- <row idgoal='1'>
- <nb_conversions>1</nb_conversions>
- <nb_visits_converted>1</nb_visits_converted>
- <revenue>0</revenue>
- </row>
- </goals>
- <nb_conversions>1</nb_conversions>
- <revenue>0</revenue>
- </row>
- </subtable>
- </row>
- <row>
- <label>Name_VISIT_2</label>
- <nb_visits>1</nb_visits>
- <nb_actions>1</nb_actions>
- <nb_users>0</nb_users>
- <max_actions>1</max_actions>
- <sum_visit_length>4</sum_visit_length>
- <bounce_count>1</bounce_count>
- <goals>
- <row idgoal='1'>
- <nb_conversions>1</nb_conversions>
- <nb_visits_converted>1</nb_visits_converted>
- <revenue>0</revenue>
- </row>
- </goals>
- <nb_conversions>1</nb_conversions>
- <revenue>0</revenue>
- <subtable>
- <row>
- <label>Val_VISIT2</label>
- <nb_visits>1</nb_visits>
- <nb_actions>1</nb_actions>
- <nb_users>0</nb_users>
- <max_actions>1</max_actions>
- <sum_visit_length>4</sum_visit_length>
- <bounce_count>1</bounce_count>
- <goals>
- <row idgoal='1'>
- <nb_conversions>1</nb_conversions>
- <nb_visits_converted>1</nb_visits_converted>
- <revenue>0</revenue>
- </row>
- </goals>
- <nb_conversions>1</nb_conversions>
- <revenue>0</revenue>
- </row>
- </subtable>
- </row>
- <row>
- <label>Name_VISIT_3</label>
- <nb_visits>1</nb_visits>
- <nb_actions>1</nb_actions>
- <nb_users>0</nb_users>
- <max_actions>1</max_actions>
- <sum_visit_length>4</sum_visit_length>
- <bounce_count>1</bounce_count>
- <goals>
- <row idgoal='1'>
- <nb_conversions>1</nb_conversions>
- <nb_visits_converted>1</nb_visits_converted>
- <revenue>0</revenue>
- </row>
- </goals>
- <nb_conversions>1</nb_conversions>
- <revenue>0</revenue>
- <subtable>
- <row>
- <label>Val_VISIT3</label>
- <nb_visits>1</nb_visits>
- <nb_actions>1</nb_actions>
- <nb_users>0</nb_users>
- <max_actions>1</max_actions>
- <sum_visit_length>4</sum_visit_length>
- <bounce_count>1</bounce_count>
- <goals>
- <row idgoal='1'>
- <nb_conversions>1</nb_conversions>
- <nb_visits_converted>1</nb_visits_converted>
- <revenue>0</revenue>
- </row>
- </goals>
- <nb_conversions>1</nb_conversions>
- <revenue>0</revenue>
- </row>
- </subtable>
- </row>
- <row>
- <label>Name_VISIT_4</label>
- <nb_visits>1</nb_visits>
- <nb_actions>1</nb_actions>
- <nb_users>0</nb_users>
- <max_actions>1</max_actions>
- <sum_visit_length>4</sum_visit_length>
- <bounce_count>1</bounce_count>
- <goals>
- <row idgoal='1'>
- <nb_conversions>1</nb_conversions>
- <nb_visits_converted>1</nb_visits_converted>
- <revenue>0</revenue>
- </row>
- </goals>
- <nb_conversions>1</nb_conversions>
- <revenue>0</revenue>
- <subtable>
- <row>
- <label>Val_VISIT4</label>
- <nb_visits>1</nb_visits>
- <nb_actions>1</nb_actions>
- <nb_users>0</nb_users>
- <max_actions>1</max_actions>
- <sum_visit_length>4</sum_visit_length>
- <bounce_count>1</bounce_count>
- <goals>
- <row idgoal='1'>
- <nb_conversions>1</nb_conversions>
- <nb_visits_converted>1</nb_visits_converted>
- <revenue>0</revenue>
- </row>
- </goals>
- <nb_conversions>1</nb_conversions>
- <revenue>0</revenue>
- </row>
- </subtable>
- </row>
- <row>
- <label>Name_VISIT_5</label>
- <nb_visits>1</nb_visits>
- <nb_actions>1</nb_actions>
- <nb_users>0</nb_users>
- <max_actions>1</max_actions>
- <sum_visit_length>4</sum_visit_length>
- <bounce_count>1</bounce_count>
- <goals>
- <row idgoal='1'>
- <nb_conversions>1</nb_conversions>
- <nb_visits_converted>1</nb_visits_converted>
- <revenue>0</revenue>
- </row>
- </goals>
- <nb_conversions>1</nb_conversions>
- <revenue>0</revenue>
- <subtable>
- <row>
- <label>Val_VISIT5</label>
- <nb_visits>1</nb_visits>
- <nb_actions>1</nb_actions>
- <nb_users>0</nb_users>
- <max_actions>1</max_actions>
- <sum_visit_length>4</sum_visit_length>
- <bounce_count>1</bounce_count>
- <goals>
- <row idgoal='1'>
- <nb_conversions>1</nb_conversions>
- <nb_visits_converted>1</nb_visits_converted>
- <revenue>0</revenue>
- </row>
- </goals>
- <nb_conversions>1</nb_conversions>
- <revenue>0</revenue>
- </row>
- </subtable>
- </row>
- <row>
- <label>Name_VISIT_6</label>
- <nb_visits>1</nb_visits>
- <nb_actions>1</nb_actions>
- <nb_users>0</nb_users>
- <max_actions>1</max_actions>
- <sum_visit_length>4</sum_visit_length>
- <bounce_count>1</bounce_count>
- <goals>
- <row idgoal='1'>
- <nb_conversions>1</nb_conversions>
- <nb_visits_converted>1</nb_visits_converted>
- <revenue>0</revenue>
- </row>
- </goals>
- <nb_conversions>1</nb_conversions>
- <revenue>0</revenue>
- <subtable>
- <row>
- <label>Val_VISIT6</label>
- <nb_visits>1</nb_visits>
- <nb_actions>1</nb_actions>
- <nb_users>0</nb_users>
- <max_actions>1</max_actions>
- <sum_visit_length>4</sum_visit_length>
- <bounce_count>1</bounce_count>
- <goals>
- <row idgoal='1'>
- <nb_conversions>1</nb_conversions>
- <nb_visits_converted>1</nb_visits_converted>
- <revenue>0</revenue>
- </row>
- </goals>
- <nb_conversions>1</nb_conversions>
- <revenue>0</revenue>
- </row>
- </subtable>
- </row>
- <row>
- <label>Name_VISIT_7</label>
- <nb_visits>1</nb_visits>
- <nb_actions>1</nb_actions>
- <nb_users>0</nb_users>
- <max_actions>1</max_actions>
- <sum_visit_length>4</sum_visit_length>
- <bounce_count>1</bounce_count>
- <goals>
- <row idgoal='1'>
- <nb_conversions>1</nb_conversions>
- <nb_visits_converted>1</nb_visits_converted>
- <revenue>0</revenue>
- </row>
- </goals>
- <nb_conversions>1</nb_conversions>
- <revenue>0</revenue>
- <subtable>
- <row>
- <label>Val_VISIT7</label>
- <nb_visits>1</nb_visits>
- <nb_actions>1</nb_actions>
- <nb_users>0</nb_users>
- <max_actions>1</max_actions>
- <sum_visit_length>4</sum_visit_length>
- <bounce_count>1</bounce_count>
- <goals>
- <row idgoal='1'>
- <nb_conversions>1</nb_conversions>
- <nb_visits_converted>1</nb_visits_converted>
- <revenue>0</revenue>
- </row>
- </goals>
- <nb_conversions>1</nb_conversions>
- <revenue>0</revenue>
- </row>
- </subtable>
- </row>
- <row>
- <label>Name_VISIT_8</label>
- <nb_visits>1</nb_visits>
- <nb_actions>1</nb_actions>
- <nb_users>0</nb_users>
- <max_actions>1</max_actions>
- <sum_visit_length>4</sum_visit_length>
- <bounce_count>1</bounce_count>
- <goals>
- <row idgoal='1'>
- <nb_conversions>1</nb_conversions>
- <nb_visits_converted>1</nb_visits_converted>
- <revenue>0</revenue>
- </row>
- </goals>
- <nb_conversions>1</nb_conversions>
- <revenue>0</revenue>
- <subtable>
- <row>
- <label>Val_VISIT8</label>
- <nb_visits>1</nb_visits>
- <nb_actions>1</nb_actions>
- <nb_users>0</nb_users>
- <max_actions>1</max_actions>
- <sum_visit_length>4</sum_visit_length>
- <bounce_count>1</bounce_count>
- <goals>
- <row idgoal='1'>
- <nb_conversions>1</nb_conversions>
- <nb_visits_converted>1</nb_visits_converted>
- <revenue>0</revenue>
- </row>
- </goals>
- <nb_conversions>1</nb_conversions>
- <revenue>0</revenue>
- </row>
- </subtable>
- </row>
-</result> \ No newline at end of file
diff --git a/plugins/CustomVariables/tests/processed/test_CustomVariablesIntegrationTest__Live.getLastVisitsDetails_day.xml b/plugins/CustomVariables/tests/processed/test_CustomVariablesIntegrationTest__Live.getLastVisitsDetails_day.xml
deleted file mode 100644
index 91f9066c9b..0000000000
--- a/plugins/CustomVariables/tests/processed/test_CustomVariablesIntegrationTest__Live.getLastVisitsDetails_day.xml
+++ /dev/null
@@ -1,176 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<result>
- <row>
- <idSite>1</idSite>
- <idVisit>1</idVisit>
- <visitIp>156.5.3.2</visitIp>
-
- <actionDetails>
- <row>
- <type>goal</type>
- <goalName>triggered js</goalName>
- <goalId>1</goalId>
- <revenue>0</revenue>
- <goalPageId />
-
- <url>http://localhost</url>
- <icon>plugins/Morpheus/images/goal.png</icon>
- </row>
- <row>
- <type>action</type>
- <url>http://localhost</url>
- <pageTitle>Profile page</pageTitle>
- <pageIdAction>2</pageIdAction>
-
- <pageId>1</pageId>
- <customVariables>
- <row>
- <customVariablePageName1>Name_PAGE_1</customVariablePageName1>
- <customVariablePageValue1>Val_PAGE1</customVariablePageValue1>
- </row>
- <row>
- <customVariablePageName2>Name_PAGE_2</customVariablePageName2>
- <customVariablePageValue2>Val_PAGE2</customVariablePageValue2>
- </row>
- <row>
- <customVariablePageName3>Name_PAGE_3</customVariablePageName3>
- <customVariablePageValue3>Val_PAGE3</customVariablePageValue3>
- </row>
- <row>
- <customVariablePageName4>Name_PAGE_4</customVariablePageName4>
- <customVariablePageValue4>Val_PAGE4</customVariablePageValue4>
- </row>
- <row>
- <customVariablePageName5>Name_PAGE_5</customVariablePageName5>
- <customVariablePageValue5>Val_PAGE5</customVariablePageValue5>
- </row>
- <row>
- <customVariablePageName6>Name_PAGE_6</customVariablePageName6>
- <customVariablePageValue6>Val_PAGE6</customVariablePageValue6>
- </row>
- <row>
- <customVariablePageName7>Name_PAGE_7</customVariablePageName7>
- <customVariablePageValue7>Val_PAGE7</customVariablePageValue7>
- </row>
- <row>
- <customVariablePageName8>Name_PAGE_8</customVariablePageName8>
- <customVariablePageValue8>Val_PAGE8</customVariablePageValue8>
- </row>
- </customVariables>
- <icon />
- </row>
- </actionDetails>
- <goalConversions>1</goalConversions>
- <siteCurrency>USD</siteCurrency>
- <siteCurrencySymbol>$</siteCurrencySymbol>
-
-
-
-
- <searches>0</searches>
- <actions>1</actions>
- <userId />
- <visitorType>new</visitorType>
- <visitorTypeIcon />
- <visitConverted>1</visitConverted>
- <visitConvertedIcon>plugins/Morpheus/images/goal.png</visitConvertedIcon>
- <visitCount>1</visitCount>
-
- <visitEcommerceStatus>none</visitEcommerceStatus>
- <visitEcommerceStatusIcon />
- <daysSinceFirstVisit>0</daysSinceFirstVisit>
- <daysSinceLastEcommerceOrder>0</daysSinceLastEcommerceOrder>
- <visitDuration>4</visitDuration>
- <visitDurationPretty>4s</visitDurationPretty>
- <customVariables>
- <row>
- <customVariableName1>Name_VISIT_1</customVariableName1>
- <customVariableValue1>Val_VISIT1</customVariableValue1>
- </row>
- <row>
- <customVariableName2>Name_VISIT_2</customVariableName2>
- <customVariableValue2>Val_VISIT2</customVariableValue2>
- </row>
- <row>
- <customVariableName3>Name_VISIT_3</customVariableName3>
- <customVariableValue3>Val_VISIT3</customVariableValue3>
- </row>
- <row>
- <customVariableName4>Name_VISIT_4</customVariableName4>
- <customVariableValue4>Val_VISIT4</customVariableValue4>
- </row>
- <row>
- <customVariableName5>Name_VISIT_5</customVariableName5>
- <customVariableValue5>Val_VISIT5</customVariableValue5>
- </row>
- <row>
- <customVariableName6>Name_VISIT_6</customVariableName6>
- <customVariableValue6>Val_VISIT6</customVariableValue6>
- </row>
- <row>
- <customVariableName7>Name_VISIT_7</customVariableName7>
- <customVariableValue7>Val_VISIT7</customVariableValue7>
- </row>
- <row>
- <customVariableName8>Name_VISIT_8</customVariableName8>
- <customVariableValue8>Val_VISIT8</customVariableValue8>
- </row>
- </customVariables>
- <deviceType>Desktop</deviceType>
- <browserFamily>Gecko</browserFamily>
- <browserFamilyDescription>Gecko (Firefox)</browserFamilyDescription>
- <events>0</events>
- <provider>Unknown</provider>
- <providerName>Unknown</providerName>
- <providerUrl />
- <referrerType>search</referrerType>
- <referrerTypeName>Search Engines</referrerTypeName>
- <referrerName>Google</referrerName>
- <referrerKeyword>this keyword should be ranked</referrerKeyword>
- <referrerKeywordPosition>1</referrerKeywordPosition>
- <referrerUrl>http://www.google.com/search?q=this+keyword+should+be+ranked</referrerUrl>
- <referrerSearchEngineUrl>http://google.com</referrerSearchEngineUrl>
- <referrerSearchEngineIcon>plugins/Referrers/images/searchEngines/google.com.png</referrerSearchEngineIcon>
- <continent>Europe</continent>
- <continentCode>eur</continentCode>
- <country>France</country>
- <countryCode>fr</countryCode>
- <countryFlag>plugins/UserCountry/images/flags/fr.png</countryFlag>
- <region />
- <regionCode />
- <city />
- <location>France</location>
- <latitude />
- <longitude />
- <operatingSystem>Windows XP</operatingSystem>
- <operatingSystemCode>WXP</operatingSystemCode>
- <operatingSystemShortName>Win XP</operatingSystemShortName>
- <operatingSystemIcon>plugins/UserSettings/images/os/WXP.gif</operatingSystemIcon>
- <browserName>Firefox 3.6</browserName>
- <browserIcon>plugins/UserSettings/images/browsers/FF.gif</browserIcon>
- <browserCode>FF</browserCode>
- <browserVersion>3.6</browserVersion>
- <screenType>normal</screenType>
- <resolution>1024x768</resolution>
- <screenTypeIcon>plugins/UserSettings/images/screens/normal.gif</screenTypeIcon>
- <plugins>flash, java</plugins>
- <pluginsIcons>
- <row>
- <pluginIcon>plugins/UserSettings/images/plugins/flash.gif</pluginIcon>
- <pluginName>flash</pluginName>
- </row>
- <row>
- <pluginIcon>plugins/UserSettings/images/plugins/java.gif</pluginIcon>
- <pluginName>java</pluginName>
- </row>
- </pluginsIcons>
- <visitLocalTime>12:34:06</visitLocalTime>
- <visitLocalHour>12</visitLocalHour>
- <daysSinceLastVisit>0</daysSinceLastVisit>
-
-
-
-
-
- </row>
-</result> \ No newline at end of file
diff --git a/plugins/ExamplePlugin/.gitignore b/plugins/ExamplePlugin/.gitignore
index b141f4501f..c8c9480010 100644
--- a/plugins/ExamplePlugin/.gitignore
+++ b/plugins/ExamplePlugin/.gitignore
@@ -1 +1 @@
-tests/processed/*xml \ No newline at end of file
+tests/System/processed/*xml \ No newline at end of file
diff --git a/plugins/ExamplePlugin/.travis.yml b/plugins/ExamplePlugin/.travis.yml
index 7dd870605f..f20c564fdf 100644
--- a/plugins/ExamplePlugin/.travis.yml
+++ b/plugins/ExamplePlugin/.travis.yml
@@ -5,8 +5,8 @@ php:
env:
matrix:
- - TEST_SUITE=CoreTests MYSQL_ADAPTER=PDO_MYSQL
- - TEST_SUITE=PluginTests MYSQL_ADAPTER=PDO_MYSQL
+ - TEST_SUITE=UnitTests MYSQL_ADAPTER=PDO_MYSQL
+ - TEST_SUITE=IntegrationTests MYSQL_ADAPTER=PDO_MYSQL
script: ./travis.sh
diff --git a/plugins/ExamplePlugin/tests/Fixtures/SimpleFixtureTrackFewVisits.php b/plugins/ExamplePlugin/tests/Fixtures/SimpleFixtureTrackFewVisits.php
new file mode 100644
index 0000000000..2c0b38d172
--- /dev/null
+++ b/plugins/ExamplePlugin/tests/Fixtures/SimpleFixtureTrackFewVisits.php
@@ -0,0 +1,77 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+namespace Piwik\Plugins\ExamplePlugin\tests\Fixtures;
+
+use Piwik\Date;
+use Piwik\Tests\Impl\Fixture;
+
+/**
+ * Generates tracker testing data for our SimpleSystemTest
+ *
+ * This Simple fixture adds one website and tracks one visit with couple pageviews and an ecommerce conversion
+ */
+class SimpleFixtureTrackFewVisits extends Fixture
+{
+ public $dateTime = '2013-01-23 01:23:45';
+ public $idSite = 1;
+
+ public function setUp()
+ {
+ $this->setUpWebsite();
+ $this->trackFirstVisit();
+ $this->trackSecondVisit();
+ }
+
+ public function tearDown()
+ {
+ // empty
+ }
+
+ private function setUpWebsite()
+ {
+ if (!self::siteCreated($this->idSite)) {
+ $idSite = self::createWebsite($this->dateTime, $ecommerce = 1);
+ $this->assertSame($this->idSite, $idSite);
+ }
+ }
+
+ protected function trackFirstVisit()
+ {
+ $t = self::getTracker($this->idSite, $this->dateTime, $defaultInit = true);
+
+ $t->setForceVisitDateTime(Date::factory($this->dateTime)->addHour(0.1)->getDatetime());
+ $t->setUrl('http://example.com/');
+ self::checkResponse($t->doTrackPageView('Viewing homepage'));
+
+ $t->setForceVisitDateTime(Date::factory($this->dateTime)->addHour(0.2)->getDatetime());
+ $t->setUrl('http://example.com/sub/page');
+ self::checkResponse($t->doTrackPageView('Second page view'));
+
+ $t->setForceVisitDateTime(Date::factory($this->dateTime)->addHour(0.25)->getDatetime());
+ $t->addEcommerceItem($sku = 'SKU_ID', $name = 'Test item!', $category = 'Test & Category', $price = 777, $quantity = 33);
+ self::checkResponse($t->doTrackEcommerceOrder('TestingOrder', $grandTotal = 33 * 77));
+ }
+
+ protected function trackSecondVisit()
+ {
+ $t = self::getTracker($this->idSite, $this->dateTime, $defaultInit = true);
+ $t->setIp('56.11.55.73');
+
+ $t->setForceVisitDateTime(Date::factory($this->dateTime)->addHour(0.1)->getDatetime());
+ $t->setUrl('http://example.com/sub/page');
+ self::checkResponse($t->doTrackPageView('Viewing homepage'));
+
+ $t->setForceVisitDateTime(Date::factory($this->dateTime)->addHour(0.2)->getDatetime());
+ $t->setUrl('http://example.com/?search=this is a site search query');
+ self::checkResponse($t->doTrackPageView('Site search query'));
+
+ $t->setForceVisitDateTime(Date::factory($this->dateTime)->addHour(0.3)->getDatetime());
+ $t->addEcommerceItem($sku = 'SKU_ID2', $name = 'A durable item', $category = 'Best seller', $price = 321);
+ self::checkResponse($t->doTrackEcommerceCartUpdate($grandTotal = 33 * 77));
+ }
+} \ No newline at end of file
diff --git a/plugins/ExamplePlugin/tests/Integration/SimpleTest.php b/plugins/ExamplePlugin/tests/Integration/SimpleTest.php
new file mode 100644
index 0000000000..01ff197cf8
--- /dev/null
+++ b/plugins/ExamplePlugin/tests/Integration/SimpleTest.php
@@ -0,0 +1,26 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+namespace Piwik\Plugins\ExamplePlugin\tests\Integration;
+
+use Piwik\Tests\Impl\IntegrationTestCase;
+
+/**
+ * @group ExamplePlugin
+ * @group SimpleTest
+ * @group Plugins
+ */
+class SimpleTest extends IntegrationTestCase
+{
+
+ public function testSimpleAddition()
+ {
+ $this->assertEquals(2, 1+1);
+ }
+
+}
diff --git a/plugins/ExamplePlugin/tests/SimpleIntegrationTest.php b/plugins/ExamplePlugin/tests/SimpleIntegrationTest.php
deleted file mode 100644
index f9cebb8c72..0000000000
--- a/plugins/ExamplePlugin/tests/SimpleIntegrationTest.php
+++ /dev/null
@@ -1,64 +0,0 @@
-<?php
-/**
- * Piwik - free/libre analytics platform
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- */
-
-namespace Piwik\Plugins\ExamplePlugin\tests;
-
-use Piwik\Plugins\ExamplePlugin\tests\fixtures\SimpleFixtureTrackFewVisits;
-use Piwik\Tests\IntegrationTestCase;
-
-/**
- * @group ExamplePlugin
- * @group SimpleIntegrationTest
- * @group Plugins
- */
-class SimpleIntegrationTest extends IntegrationTestCase
-{
- /**
- * @var SimpleFixtureTrackFewVisits
- */
- public static $fixture = null; // initialized below class definition
-
- /**
- * @dataProvider getApiForTesting
- * @group SimpleIntegrationTest
- */
- public function testApi($api, $params)
- {
- $this->runApiTests($api, $params);
- }
-
- public function getApiForTesting()
- {
- $api = array('API.get',
- 'Goals.getItemsSku');
-
- $apiToTest = array();
- $apiToTest[] = array($api,
- array( 'idSite' => 1,
- 'date' => self::$fixture->dateTime,
- 'periods' => array('day'),
- 'testSuffix' => ''
-
- ));
-
- return $apiToTest;
- }
-
- public static function getOutputPrefix()
- {
- return '';
- }
-
- public static function getPathToTestDirectory()
- {
- return dirname(__FILE__);
- }
-
-}
-
-SimpleIntegrationTest::$fixture = new SimpleFixtureTrackFewVisits(); \ No newline at end of file
diff --git a/plugins/ExamplePlugin/tests/SimpleTest.php b/plugins/ExamplePlugin/tests/SimpleTest.php
deleted file mode 100644
index 0fdc86062c..0000000000
--- a/plugins/ExamplePlugin/tests/SimpleTest.php
+++ /dev/null
@@ -1,24 +0,0 @@
-<?php
-/**
- * Piwik - free/libre analytics platform
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- */
-
-namespace Piwik\Plugins\ExamplePlugin\tests;
-
-/**
- * @group ExamplePlugin
- * @group SimpleTest
- * @group Plugins
- */
-class SimpleTest extends \PHPUnit_Framework_TestCase
-{
-
- public function testSimpleAddition()
- {
- $this->assertEquals(2, 1+1);
- }
-
-}
diff --git a/plugins/ExamplePlugin/tests/System/SimpleSystemTest.php b/plugins/ExamplePlugin/tests/System/SimpleSystemTest.php
new file mode 100644
index 0000000000..873c4e4fbe
--- /dev/null
+++ b/plugins/ExamplePlugin/tests/System/SimpleSystemTest.php
@@ -0,0 +1,66 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+namespace Piwik\Plugins\ExamplePlugin\tests\System;
+
+use Piwik\Plugins\ExamplePlugin\tests\fixtures\SimpleFixtureTrackFewVisits;
+use Piwik\Tests\Impl\SystemTestCase;
+
+/**
+ * @group ExamplePlugin
+ * @group SimpleSystemTest
+ * @group Plugins
+ */
+class SimpleSystemTest extends SystemTestCase
+{
+ /**
+ * @var SimpleFixtureTrackFewVisits
+ */
+ public static $fixture = null; // initialized below class definition
+
+ /**
+ * @dataProvider getApiForTesting
+ */
+ public function testApi($api, $params)
+ {
+ $this->runApiTests($api, $params);
+ }
+
+ public function getApiForTesting()
+ {
+ $api = array(
+ 'API.get',
+ 'Goals.getItemsSku'
+ );
+
+ $apiToTest = array();
+ $apiToTest[] = array($api,
+ array(
+ 'idSite' => 1,
+ 'date' => self::$fixture->dateTime,
+ 'periods' => array('day'),
+ 'testSuffix' => ''
+ )
+ );
+
+ return $apiToTest;
+ }
+
+ public static function getOutputPrefix()
+ {
+ return '';
+ }
+
+ public static function getPathToTestDirectory()
+ {
+ return dirname(__FILE__);
+ }
+
+}
+
+SimpleSystemTest::$fixture = new SimpleFixtureTrackFewVisits(); \ No newline at end of file
diff --git a/plugins/ExamplePlugin/tests/expected/test___API.get_day.xml b/plugins/ExamplePlugin/tests/System/expected/test___API.get_day.xml
index 58296797c0..58296797c0 100644
--- a/plugins/ExamplePlugin/tests/expected/test___API.get_day.xml
+++ b/plugins/ExamplePlugin/tests/System/expected/test___API.get_day.xml
diff --git a/plugins/ExamplePlugin/tests/expected/test___Goals.getItemsSku_day.xml b/plugins/ExamplePlugin/tests/System/expected/test___Goals.getItemsSku_day.xml
index ba820ed649..ba820ed649 100644
--- a/plugins/ExamplePlugin/tests/expected/test___Goals.getItemsSku_day.xml
+++ b/plugins/ExamplePlugin/tests/System/expected/test___Goals.getItemsSku_day.xml
diff --git a/plugins/ExamplePlugin/tests/processed/.gitkeep b/plugins/ExamplePlugin/tests/System/processed/.gitkeep
index e69de29bb2..e69de29bb2 100644
--- a/plugins/ExamplePlugin/tests/processed/.gitkeep
+++ b/plugins/ExamplePlugin/tests/System/processed/.gitkeep
diff --git a/plugins/ExamplePlugin/tests/Unit/SimpleTest.php b/plugins/ExamplePlugin/tests/Unit/SimpleTest.php
new file mode 100644
index 0000000000..396ee20785
--- /dev/null
+++ b/plugins/ExamplePlugin/tests/Unit/SimpleTest.php
@@ -0,0 +1,24 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+namespace Piwik\Plugins\ExamplePlugin\tests\Unit;
+
+/**
+ * @group ExamplePlugin
+ * @group SimpleTest
+ * @group Plugins
+ */
+class SimpleTest extends \PHPUnit_Framework_TestCase
+{
+
+ public function testSimpleAddition()
+ {
+ $this->assertEquals(2, 1+1);
+ }
+
+}
diff --git a/plugins/ExamplePlugin/tests/fixtures/SimpleFixtureTrackFewVisits.php b/plugins/ExamplePlugin/tests/fixtures/SimpleFixtureTrackFewVisits.php
deleted file mode 100644
index f0515abfb1..0000000000
--- a/plugins/ExamplePlugin/tests/fixtures/SimpleFixtureTrackFewVisits.php
+++ /dev/null
@@ -1,79 +0,0 @@
-<?php
-/**
- * Piwik - free/libre analytics platform
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- */
-namespace Piwik\Plugins\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
-{
- public $dateTime = '2013-01-23 01:23:45';
- public $idSite = 1;
-
- public function setUp()
- {
- $this->setUpWebsite();
- $this->trackFirstVisit();
- $this->trackSecondVisit();
- }
-
- public function tearDown()
- {
- // empty
- }
-
- private function setUpWebsite()
- {
- if (!self::siteCreated($this->idSite)) {
- $idSite = self::createWebsite($this->dateTime, $ecommerce = 1);
- $this->assertSame($this->idSite, $idSite);
- }
- }
-
- protected function trackFirstVisit()
- {
- $t = self::getTracker($this->idSite, $this->dateTime, $defaultInit = true);
-
- $t->setForceVisitDateTime(Date::factory($this->dateTime)->addHour(0.1)->getDatetime());
- $t->setUrl('http://example.com/');
- self::checkResponse($t->doTrackPageView('Viewing homepage'));
-
- $t->setForceVisitDateTime(Date::factory($this->dateTime)->addHour(0.2)->getDatetime());
- $t->setUrl('http://example.com/sub/page');
- self::checkResponse($t->doTrackPageView('Second page view'));
-
- $t->setForceVisitDateTime(Date::factory($this->dateTime)->addHour(0.25)->getDatetime());
- $t->addEcommerceItem($sku = 'SKU_ID', $name = 'Test item!', $category = 'Test & Category', $price = 777, $quantity = 33);
- self::checkResponse($t->doTrackEcommerceOrder('TestingOrder', $grandTotal = 33 * 77));
-
- }
-
- protected function trackSecondVisit()
- {
- $t = self::getTracker($this->idSite, $this->dateTime, $defaultInit = true);
- $t->setIp('56.11.55.73');
-
- $t->setForceVisitDateTime(Date::factory($this->dateTime)->addHour(0.1)->getDatetime());
- $t->setUrl('http://example.com/sub/page');
- self::checkResponse($t->doTrackPageView('Viewing homepage'));
-
- $t->setForceVisitDateTime(Date::factory($this->dateTime)->addHour(0.2)->getDatetime());
- $t->setUrl('http://example.com/?search=this is a site search query');
- self::checkResponse($t->doTrackPageView('Site search query'));
-
- $t->setForceVisitDateTime(Date::factory($this->dateTime)->addHour(0.3)->getDatetime());
- $t->addEcommerceItem($sku = 'SKU_ID2', $name = 'A durable item', $category = 'Best seller', $price = 321);
- self::checkResponse($t->doTrackEcommerceCartUpdate($grandTotal = 33 * 77));
-
- }
-} \ No newline at end of file
diff --git a/plugins/Goals/tests/APITest.php b/plugins/Goals/tests/APITest.php
deleted file mode 100644
index 3263bc4972..0000000000
--- a/plugins/Goals/tests/APITest.php
+++ /dev/null
@@ -1,232 +0,0 @@
-<?php
-/**
- * Piwik - free/libre analytics platform
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- */
-
-namespace Piwik\Plugins\Goals\tests;
-use Piwik\Access;
-use Piwik\Piwik;
-use Piwik\Plugins\Goals\API;
-use Piwik\Tests\Fixture;
-
-/**
- * @group Goals
- * @group Plugins
- * @group APITest
- * @group Database
- */
-class APITest extends \DatabaseTestCase
-{
- /**
- * @var API
- */
- private $api;
-
- private $idSite = 1;
-
- public function setUp()
- {
- parent::setUp();
- $this->api = API::getInstance();
-
- Fixture::createAccessInstance();
- Piwik::setUserHasSuperUserAccess();
-
- Fixture::createWebsite('2014-01-01 00:00:00');
- Fixture::createWebsite('2014-01-01 00:00:00');
- }
-
- public function test_addGoal_shouldReturnGoalId_IfCreationIsSuccessful()
- {
- $idGoal = $this->createAnyGoal();
-
- $this->assertSame(1, $idGoal);
- }
-
- public function test_addGoal_shouldSucceed_IfOnlyMinimumFieldsGiven()
- {
- $idGoal = $this->api->addGoal($this->idSite, 'MyName', 'url', 'http://www.test.de', 'exact');
-
- $this->assertGoal($idGoal, 'MyName', 'url', 'http://www.test.de', 'exact', 0, 0, 0);
- }
-
- public function test_addGoal_ShouldSucceed_IfAllFieldsGiven()
- {
- $idGoal = $this->api->addGoal($this->idSite, 'MyName', 'url', 'http://www.test.de', 'exact', true, 50, true);
-
- $this->assertGoal($idGoal, 'MyName', 'url', 'http://www.test.de', 'exact', 1, 50, 1);
- }
-
- /**
- * @expectedException \Exception
- * @expectedExceptionMessage Goals_ExceptionInvalidMatchingString
- */
- public function test_addGoal_shouldThrowException_IfPatternTypeIsExactAndMatchAttributeNotEvent()
- {
- $this->api->addGoal($this->idSite, 'MyName', 'url', 'www.test.de', 'exact');
- }
-
- /**
- * @expectedException \Exception
- * @expectedExceptionMessage Goals_ExceptionInvalidMatchingString
- */
- public function test_addGoal_shouldThrowException_IfPatternTypeIsExactAndMatchAttributeNotEvent2()
- {
- $this->api->addGoal($this->idSite, 'MyName', 'external_website', 'www.test.de', 'exact');
- }
-
- public function test_addGoal_shouldNotThrowException_IfPatternTypeIsExactAndMatchAttributeIsEvent()
- {
- $this->api->addGoal($this->idSite, 'MyName1', 'event_action', 'test', 'exact');
- $this->api->addGoal($this->idSite, 'MyName2', 'event_name', 'test', 'exact');
- $idGoal = $this->api->addGoal($this->idSite, 'MyName3', 'event_category', 'test', 'exact');
-
- $this->assertSame('3', (string)$idGoal);
- }
-
- /**
- * @expectedException \Exception
- * @expectedExceptionMessage checkUserHasAdminAccess Fake exception
- */
- public function test_addGoal_shouldThrowException_IfNotEnoughPermission()
- {
- $this->setNonAdminUser();
- $this->createAnyGoal();
- }
-
- /**
- * @expectedException \Exception
- * @expectedExceptionMessage checkUserHasAdminAccess Fake exception
- */
- public function test_updateGoal_shouldThrowException_IfNotEnoughPermission()
- {
- $idGoal = $this->createAnyGoal();
- $this->assertSame(1, $idGoal); // make sure goal is created and does not already fail here
- $this->setNonAdminUser();
- $this->api->updateGoal($this->idSite, $idGoal, 'MyName', 'url', 'www.test.de', 'exact');
- }
-
- /**
- * @expectedException \Exception
- * @expectedExceptionMessage Goals_ExceptionInvalidMatchingString
- */
- public function test_updateGoal_shouldThrowException_IfPatternTypeIsExactAndMatchAttributeNotEvent()
- {
- $idGoal = $this->createAnyGoal();
- $this->api->updateGoal($this->idSite, $idGoal, 'MyName', 'url', 'www.test.de', 'exact');
- }
-
- public function test_updateGoal_shouldNotThrowException_IfPatternTypeIsExactAndMatchAttributeIsEvent()
- {
- $idGoal = $this->createAnyGoal();
- $this->api->updateGoal($this->idSite, $idGoal, 'MyName', 'event_action', 'www.test.de', 'exact');
- $this->api->updateGoal($this->idSite, $idGoal, 'MyName', 'event_category', 'www.test.de', 'exact');
- $this->api->updateGoal($this->idSite, $idGoal, 'MyName', 'event_name', 'www.test.de', 'exact');
-
- $this->assertSame(1, $idGoal);
- }
-
- public function test_updateGoal_shouldUpdateAllGivenFields()
- {
- $idGoal = $this->createAnyGoal();
- $this->api->updateGoal($this->idSite, $idGoal, 'UpdatedName', 'file', 'http://www.updatetest.de', 'contains', true, 999, true);
-
- $this->assertGoal($idGoal, 'UpdatedName', 'file', 'http://www.updatetest.de', 'contains', 1, 999, 1);
- }
-
- public function test_updateGoal_shouldUpdateMinimalFields_ShouldLeaveOtherFieldsUntouched()
- {
- $idGoal = $this->createAnyGoal();
- $this->api->updateGoal($this->idSite, $idGoal, 'UpdatedName', 'file', 'http://www.updatetest.de', 'contains');
-
- $this->assertGoal($idGoal, 'UpdatedName', 'file', 'http://www.updatetest.de', 'contains', 0, 0, 0);
- }
-
- public function test_deleteGoal_shouldNotDeleteAGoal_IfGoalIdDoesNotExist()
- {
- $this->assertHasNoGoals();
-
- $this->createAnyGoal();
- $this->assertHasGoals();
-
- $this->api->deleteGoal($this->idSite, 999);
- $this->assertHasGoals();
- }
-
- public function test_deleteGoal_shouldNotDeleteAGoal_IfSiteDoesNotMatchGoalId()
- {
- $this->assertHasNoGoals();
-
- $idGoal = $this->createAnyGoal();
- $this->assertHasGoals();
-
- $this->api->deleteGoal($idSite = 2, $idGoal);
- $this->assertHasGoals();
- }
-
- public function test_deleteGoal_shouldDeleteAGoal_IfGoalAndSiteMatches()
- {
- $this->assertHasNoGoals();
-
- $idGoal = $this->createAnyGoal();
- $this->assertHasGoals();
-
- $this->api->deleteGoal($this->idSite, $idGoal);
- $this->assertHasNoGoals();
- }
-
- private function assertHasGoals()
- {
- $goals = $this->getGoals();
- $this->assertNotEmpty($goals);
- }
-
- private function assertHasNoGoals()
- {
- $goals = $this->getGoals();
- $this->assertEmpty($goals);
- }
-
- private function assertGoal($idGoal, $name, $url, $pattern, $patternType, $caseSenstive = 0, $revenue = 0, $allowMultiple = 0)
- {
- $expected = array($idGoal => array(
- 'idsite' => $this->idSite,
- 'idgoal' => $idGoal,
- 'name' => $name,
- 'match_attribute' => $url,
- 'pattern' => $pattern,
- 'pattern_type' => $patternType,
- 'case_sensitive' => $caseSenstive,
- 'allow_multiple' => $allowMultiple,
- 'revenue' => $revenue,
- 'deleted' => 0
- ));
-
- $goals = $this->getGoals();
-
- $this->assertEquals($expected, $goals);
- }
-
- private function getGoals()
- {
- return $this->api->getGoals($this->idSite);
- }
-
- private function createAnyGoal()
- {
- return $this->api->addGoal($this->idSite, 'MyName1', 'event_action', 'test', 'exact');
- }
-
- protected function setNonAdminUser()
- {
- $pseudoMockAccess = new \FakeAccess;
- \FakeAccess::setSuperUserAccess(false);
- \FakeAccess::$idSitesView = array(99);
- \FakeAccess::$identity = 'aUser';
- Access::setSingletonInstance($pseudoMockAccess);
- }
-
-}
diff --git a/plugins/Goals/tests/Integration/APITest.php b/plugins/Goals/tests/Integration/APITest.php
new file mode 100644
index 0000000000..bc3a960e83
--- /dev/null
+++ b/plugins/Goals/tests/Integration/APITest.php
@@ -0,0 +1,234 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+namespace Piwik\Plugins\Goals\tests\Integration;
+
+use Piwik\Access;
+use Piwik\Piwik;
+use Piwik\Plugins\Goals\API;
+use Piwik\Tests\Impl\Fixture;
+use Piwik\Tests\Impl\IntegrationTestCase;
+
+/**
+ * @group Goals
+ * @group Plugins
+ * @group APITest
+ * @group Plugins
+ */
+class APITest extends IntegrationTestCase
+{
+ /**
+ * @var API
+ */
+ private $api;
+
+ private $idSite = 1;
+
+ public function setUp()
+ {
+ parent::setUp();
+ $this->api = API::getInstance();
+
+ Fixture::createAccessInstance();
+ Piwik::setUserHasSuperUserAccess();
+
+ Fixture::createWebsite('2014-01-01 00:00:00');
+ Fixture::createWebsite('2014-01-01 00:00:00');
+ }
+
+ public function test_addGoal_shouldReturnGoalId_IfCreationIsSuccessful()
+ {
+ $idGoal = $this->createAnyGoal();
+
+ $this->assertSame(1, $idGoal);
+ }
+
+ public function test_addGoal_shouldSucceed_IfOnlyMinimumFieldsGiven()
+ {
+ $idGoal = $this->api->addGoal($this->idSite, 'MyName', 'url', 'http://www.test.de', 'exact');
+
+ $this->assertGoal($idGoal, 'MyName', 'url', 'http://www.test.de', 'exact', 0, 0, 0);
+ }
+
+ public function test_addGoal_ShouldSucceed_IfAllFieldsGiven()
+ {
+ $idGoal = $this->api->addGoal($this->idSite, 'MyName', 'url', 'http://www.test.de', 'exact', true, 50, true);
+
+ $this->assertGoal($idGoal, 'MyName', 'url', 'http://www.test.de', 'exact', 1, 50, 1);
+ }
+
+ /**
+ * @expectedException \Exception
+ * @expectedExceptionMessage Goals_ExceptionInvalidMatchingString
+ */
+ public function test_addGoal_shouldThrowException_IfPatternTypeIsExactAndMatchAttributeNotEvent()
+ {
+ $this->api->addGoal($this->idSite, 'MyName', 'url', 'www.test.de', 'exact');
+ }
+
+ /**
+ * @expectedException \Exception
+ * @expectedExceptionMessage Goals_ExceptionInvalidMatchingString
+ */
+ public function test_addGoal_shouldThrowException_IfPatternTypeIsExactAndMatchAttributeNotEvent2()
+ {
+ $this->api->addGoal($this->idSite, 'MyName', 'external_website', 'www.test.de', 'exact');
+ }
+
+ public function test_addGoal_shouldNotThrowException_IfPatternTypeIsExactAndMatchAttributeIsEvent()
+ {
+ $this->api->addGoal($this->idSite, 'MyName1', 'event_action', 'test', 'exact');
+ $this->api->addGoal($this->idSite, 'MyName2', 'event_name', 'test', 'exact');
+ $idGoal = $this->api->addGoal($this->idSite, 'MyName3', 'event_category', 'test', 'exact');
+
+ $this->assertSame('3', (string)$idGoal);
+ }
+
+ /**
+ * @expectedException \Exception
+ * @expectedExceptionMessage checkUserHasAdminAccess Fake exception
+ */
+ public function test_addGoal_shouldThrowException_IfNotEnoughPermission()
+ {
+ $this->setNonAdminUser();
+ $this->createAnyGoal();
+ }
+
+ /**
+ * @expectedException \Exception
+ * @expectedExceptionMessage checkUserHasAdminAccess Fake exception
+ */
+ public function test_updateGoal_shouldThrowException_IfNotEnoughPermission()
+ {
+ $idGoal = $this->createAnyGoal();
+ $this->assertSame(1, $idGoal); // make sure goal is created and does not already fail here
+ $this->setNonAdminUser();
+ $this->api->updateGoal($this->idSite, $idGoal, 'MyName', 'url', 'www.test.de', 'exact');
+ }
+
+ /**
+ * @expectedException \Exception
+ * @expectedExceptionMessage Goals_ExceptionInvalidMatchingString
+ */
+ public function test_updateGoal_shouldThrowException_IfPatternTypeIsExactAndMatchAttributeNotEvent()
+ {
+ $idGoal = $this->createAnyGoal();
+ $this->api->updateGoal($this->idSite, $idGoal, 'MyName', 'url', 'www.test.de', 'exact');
+ }
+
+ public function test_updateGoal_shouldNotThrowException_IfPatternTypeIsExactAndMatchAttributeIsEvent()
+ {
+ $idGoal = $this->createAnyGoal();
+ $this->api->updateGoal($this->idSite, $idGoal, 'MyName', 'event_action', 'www.test.de', 'exact');
+ $this->api->updateGoal($this->idSite, $idGoal, 'MyName', 'event_category', 'www.test.de', 'exact');
+ $this->api->updateGoal($this->idSite, $idGoal, 'MyName', 'event_name', 'www.test.de', 'exact');
+
+ $this->assertSame(1, $idGoal);
+ }
+
+ public function test_updateGoal_shouldUpdateAllGivenFields()
+ {
+ $idGoal = $this->createAnyGoal();
+ $this->api->updateGoal($this->idSite, $idGoal, 'UpdatedName', 'file', 'http://www.updatetest.de', 'contains', true, 999, true);
+
+ $this->assertGoal($idGoal, 'UpdatedName', 'file', 'http://www.updatetest.de', 'contains', 1, 999, 1);
+ }
+
+ public function test_updateGoal_shouldUpdateMinimalFields_ShouldLeaveOtherFieldsUntouched()
+ {
+ $idGoal = $this->createAnyGoal();
+ $this->api->updateGoal($this->idSite, $idGoal, 'UpdatedName', 'file', 'http://www.updatetest.de', 'contains');
+
+ $this->assertGoal($idGoal, 'UpdatedName', 'file', 'http://www.updatetest.de', 'contains', 0, 0, 0);
+ }
+
+ public function test_deleteGoal_shouldNotDeleteAGoal_IfGoalIdDoesNotExist()
+ {
+ $this->assertHasNoGoals();
+
+ $this->createAnyGoal();
+ $this->assertHasGoals();
+
+ $this->api->deleteGoal($this->idSite, 999);
+ $this->assertHasGoals();
+ }
+
+ public function test_deleteGoal_shouldNotDeleteAGoal_IfSiteDoesNotMatchGoalId()
+ {
+ $this->assertHasNoGoals();
+
+ $idGoal = $this->createAnyGoal();
+ $this->assertHasGoals();
+
+ $this->api->deleteGoal($idSite = 2, $idGoal);
+ $this->assertHasGoals();
+ }
+
+ public function test_deleteGoal_shouldDeleteAGoal_IfGoalAndSiteMatches()
+ {
+ $this->assertHasNoGoals();
+
+ $idGoal = $this->createAnyGoal();
+ $this->assertHasGoals();
+
+ $this->api->deleteGoal($this->idSite, $idGoal);
+ $this->assertHasNoGoals();
+ }
+
+ private function assertHasGoals()
+ {
+ $goals = $this->getGoals();
+ $this->assertNotEmpty($goals);
+ }
+
+ private function assertHasNoGoals()
+ {
+ $goals = $this->getGoals();
+ $this->assertEmpty($goals);
+ }
+
+ private function assertGoal($idGoal, $name, $url, $pattern, $patternType, $caseSenstive = 0, $revenue = 0, $allowMultiple = 0)
+ {
+ $expected = array($idGoal => array(
+ 'idsite' => $this->idSite,
+ 'idgoal' => $idGoal,
+ 'name' => $name,
+ 'match_attribute' => $url,
+ 'pattern' => $pattern,
+ 'pattern_type' => $patternType,
+ 'case_sensitive' => $caseSenstive,
+ 'allow_multiple' => $allowMultiple,
+ 'revenue' => $revenue,
+ 'deleted' => 0
+ ));
+
+ $goals = $this->getGoals();
+
+ $this->assertEquals($expected, $goals);
+ }
+
+ private function getGoals()
+ {
+ return $this->api->getGoals($this->idSite);
+ }
+
+ private function createAnyGoal()
+ {
+ return $this->api->addGoal($this->idSite, 'MyName1', 'event_action', 'test', 'exact');
+ }
+
+ protected function setNonAdminUser()
+ {
+ $pseudoMockAccess = new \FakeAccess;
+ \FakeAccess::setSuperUserAccess(false);
+ \FakeAccess::$idSitesView = array(99);
+ \FakeAccess::$identity = 'aUser';
+ Access::setSingletonInstance($pseudoMockAccess);
+ }
+
+}
diff --git a/plugins/Insights/tests/ApiTest.php b/plugins/Insights/tests/ApiTest.php
deleted file mode 100644
index e769252e9d..0000000000
--- a/plugins/Insights/tests/ApiTest.php
+++ /dev/null
@@ -1,267 +0,0 @@
-<?php
-/**
- * Piwik - free/libre analytics platform
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- */
-
-namespace Piwik\Plugins\Insights\tests;
-use Piwik\API\Request as ApiRequest;
-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
- * @group ApiTest
- * @group Database
- * @group Plugins
- */
-class ApiTest extends IntegrationTestCase
-{
- /**
- * @var SomeVisitsDifferentPathsOnTwoDays
- */
- public static $fixture = null;
-
- /**
- * @var API
- */
- private $api;
- private $idSite;
-
- public function setUp()
- {
- parent::setUp();
-
- $this->api = API::getInstance();
- }
-
- /**
- * '/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()
- {
- $insights = $this->requestInsights(array());
- $metadata = $insights->getAllTableMetadata();
-
- $expectedMetadata = array(
- 'reportName' => 'Page URLs',
- 'metricName' => 'Unique Pageviews',
- 'date' => self::$fixture->date1,
- 'lastDate' => self::$fixture->date2,
- 'period' => 'day',
- 'orderBy' => 'absolute',
- 'metric' => 'nb_visits',
- 'totalValue' => 50,
- 'minChangeMovers' => 1,
- 'minIncreaseNew' => 1,
- 'minDecreaseDisappeared' => 1,
- 'minGrowthPercentPositive' => 20,
- 'minGrowthPercentNegative' => -20,
- 'minMoversPercent' => 2,
- 'minNewPercent' => 2,
- 'minDisappearedPercent' => 2,
- 'lastTotalValue' => 59,
- 'evolutionTotal' => -15.3,
- 'evolutionDifference' => -9
- );
-
- $this->assertInternalType('array', $metadata['report']);
- $this->assertEquals('Actions', $metadata['report']['module']);
- $this->assertEquals('getPageUrls', $metadata['report']['action']);
- unset($metadata['report']);
- unset($metadata['totals']);
-
- $this->assertEquals($expectedMetadata, $metadata);
- }
-
- public function test_getInsights_ShouldGoBackInPastDependingOnComparedToParameter()
- {
- $insights = $this->requestInsights(array('comparedToXPeriods' => 3));
-
- $metadata = $insights->getAllTableMetadata();
-
- $this->assertEquals('2010-12-11', $metadata['lastDate']);
- }
-
- public function test_getInsights_ShouldGoBackInPastDependingOnPeriod()
- {
- $insights = $this->requestInsights(array('period' => 'month'));
-
- $metadata = $insights->getAllTableMetadata();
-
- $this->assertEquals('2010-11-14', $metadata['lastDate']);
- }
-
- public function test_getInsights_ShouldReturnAllRowsIfMinValuesArelow()
- {
- $insights = $this->requestInsights(array('minImpactPercent' => 0, 'minGrowthPercent' => 1));
-
- $expectedLabels = array(
- '/Mover1',
- '/New1',
- '/New2',
- '/Mover2',
- '/Old1',
- '/Old2',
- '/Mover3'
- );
- $this->assertRows($expectedLabels, $insights);
- }
-
- public function test_getInsights_ShouldReturnReturnNothingIfminImpactPercentIsTooHigh()
- {
- $insights = $this->requestInsights(array('minImpactPercent' => 10000, 'minGrowthPercent' => 0));
-
- $this->assertRows(array(), $insights);
- }
-
- public function test_getInsights_ShouldReturnReturnNothingIfMinGrowthIsHigh()
- {
- $insights = $this->requestInsights(array('minImpactPercent' => 0, 'minGrowthPercent' => 10000));
-
- $this->assertRows(array(), $insights);
- }
-
- public function test_getInsights_ShouldOrderAbsoluteByDefault()
- {
- $insights = $this->requestInsights(array('minImpactPercent' => 0, 'minGrowthPercent' => 0));
-
- $expectedLabels = array(
- '/Mover1',
- '/New1',
- '/New2',
- '/Mover2',
- '/Old1',
- '/Old2',
- '/Mover3'
- );
- $this->assertRows($expectedLabels, $insights);
- }
-
- public function test_getInsights_ShouldBeAbleToOrderRelative()
- {
- $insights = $this->requestInsights(array('minImpactPercent' => 0, 'minGrowthPercent' => 0, 'orderBy' => 'relative'));
-
- $expectedLabels = array(
- '/Mover1',
- '/New1',
- '/New2',
- '/Old1',
- '/Old2',
- '/Mover2',
- '/Mover3'
- );
- $this->assertRows($expectedLabels, $insights);
- }
-
- public function test_getInsights_ShouldBeAbleToOrderByImportance()
- {
- $insights = $this->requestInsights(array('minImpactPercent' => 0, 'minGrowthPercent' => 0, 'orderBy' => 'importance'));
-
- $expectedLabels = array(
- '/Mover2',
- '/Old1',
- '/Mover1',
- '/New1',
- '/Old2',
- '/New2',
- '/Mover3'
- );
- $this->assertRows($expectedLabels, $insights);
- }
-
- public function test_getInsights_ShouldApplyTheLimit()
- {
- $insights = $this->requestInsights(array('limitIncreaser' => 1, 'limitDecreaser' => 1));
-
- $expectedLabels = array(
- '/Mover1',
- '/Mover2'
- );
- $this->assertRows($expectedLabels, $insights);
- }
-
- public function test_getInsights_ShouldBeAbleToShowOnlyMovers()
- {
- $insights = $this->requestInsights(array('minImpactPercent' => 0, 'minGrowthPercent' => 0, 'filterBy' => 'movers'));
-
- $expectedLabels = array(
- '/Mover1',
- '/Mover2',
- '/Mover3'
- );
- $this->assertRows($expectedLabels, $insights);
- }
-
- public function test_getInsights_ShouldBeAbleToShowOnlyNew()
- {
- $insights = $this->requestInsights(array('minImpactPercent' => 0, 'minGrowthPercent' => 0, 'filterBy' => 'new'));
-
- $expectedLabels = array(
- '/New1',
- '/New2'
- );
- $this->assertRows($expectedLabels, $insights);
- }
-
- public function test_getInsights_ShouldBeAbleToShowOnlyDisappeared()
- {
- $insights = $this->requestInsights(array('minImpactPercent' => 0, 'minGrowthPercent' => 0, 'filterBy' => 'disappeared'));
-
- $expectedLabels = array(
- '/Old1',
- '/Old2'
- );
- $this->assertRows($expectedLabels, $insights);
- }
-
- public function test_canGenerateInsights()
- {
- $this->assertTrue($this->api->canGenerateInsights('2012-12-12', 'day'));
- $this->assertTrue($this->api->canGenerateInsights('2012-12-12', 'week'));
- $this->assertTrue($this->api->canGenerateInsights('2012-12-12', 'month'));
-
- $this->assertFalse($this->api->canGenerateInsights('last10', 'day'));
- $this->assertFalse($this->api->canGenerateInsights('2012-11-11,2012-12-12', 'range'));
- }
-
- private function requestInsights($requestParams)
- {
- $params = array(
- 'method' => 'Insights.getInsights',
- 'idSite' => self::$fixture->idSite,
- 'date' => self::$fixture->date1,
- 'period' => 'day',
- 'format' => 'original',
- 'reportUniqueId' => 'Actions_getPageUrls',
- );
-
- if (!empty($requestParams)) {
- foreach ($requestParams as $key => $value) {
- $params[$key] = $value;
- }
- }
-
- $request = new ApiRequest($params);
- return $request->process();
- }
-
- private function assertRows($expectedLabels, DataTable $dataTable)
- {
- $this->assertEquals($expectedLabels, $dataTable->getColumn('label'));
- $this->assertEquals(count($expectedLabels), $dataTable->getRowsCount());
- }
-}
-
-ApiTest::$fixture = new SomeVisitsDifferentPathsOnTwoDays(); \ No newline at end of file
diff --git a/plugins/Insights/tests/Fixtures/SomeVisitsDifferentPathsOnTwoDays.php b/plugins/Insights/tests/Fixtures/SomeVisitsDifferentPathsOnTwoDays.php
index c5314d3aa3..7041e6b573 100644
--- a/plugins/Insights/tests/Fixtures/SomeVisitsDifferentPathsOnTwoDays.php
+++ b/plugins/Insights/tests/Fixtures/SomeVisitsDifferentPathsOnTwoDays.php
@@ -9,7 +9,7 @@
namespace Piwik\Plugins\Insights\tests\Fixtures;
use Piwik\Date;
-use Piwik\Tests\Fixture;
+use Piwik\Tests\Impl\Fixture;
/**
* Adds one website and tracks several visits from one visitor on
diff --git a/plugins/Insights/tests/Integration/ApiTest.php b/plugins/Insights/tests/Integration/ApiTest.php
new file mode 100644
index 0000000000..2a75247021
--- /dev/null
+++ b/plugins/Insights/tests/Integration/ApiTest.php
@@ -0,0 +1,276 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+namespace Piwik\Plugins\Insights\tests;
+use Piwik\API\Request as ApiRequest;
+use Piwik\Cache\PluginAwareStaticCache;
+use Piwik\Cache\StaticCache;
+use Piwik\DataTable;
+use Piwik\DataTable\Row;
+use Piwik\Plugins\Insights\API;
+use Piwik\Plugins\Insights\tests\Fixtures\SomeVisitsDifferentPathsOnTwoDays;
+use Piwik\Tests\Impl\IntegrationTestCase;
+use Piwik\Tests\Impl\SystemTestCase;
+use Piwik\Tracker\Cache;
+use Piwik\Translate;
+
+/**
+ * @group Insights
+ * @group ApiTest
+ * @group Plugins
+ * @group Plugins
+ */
+class ApiTest extends SystemTestCase
+{
+ /**
+ * @var SomeVisitsDifferentPathsOnTwoDays
+ */
+ public static $fixture = null;
+
+ /**
+ * @var API
+ */
+ private $api;
+ private $idSite;
+
+ public function setUp()
+ {
+ parent::setUp();
+
+ StaticCache::clearAll();
+ PluginAwareStaticCache::clearAll();
+
+ Translate::reloadLanguage('en');
+ $this->api = API::getInstance();
+ }
+
+ /**
+ * '/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()
+ {
+ $insights = $this->requestInsights(array());
+ $metadata = $insights->getAllTableMetadata();
+
+ $expectedMetadata = array(
+ 'reportName' => 'Page URLs',
+ 'metricName' => 'Unique Pageviews',
+ 'date' => self::$fixture->date1,
+ 'lastDate' => self::$fixture->date2,
+ 'period' => 'day',
+ 'orderBy' => 'absolute',
+ 'metric' => 'nb_visits',
+ 'totalValue' => 50,
+ 'minChangeMovers' => 1,
+ 'minIncreaseNew' => 1,
+ 'minDecreaseDisappeared' => 1,
+ 'minGrowthPercentPositive' => 20,
+ 'minGrowthPercentNegative' => -20,
+ 'minMoversPercent' => 2,
+ 'minNewPercent' => 2,
+ 'minDisappearedPercent' => 2,
+ 'lastTotalValue' => 59,
+ 'evolutionTotal' => -15.3,
+ 'evolutionDifference' => -9
+ );
+
+ $this->assertInternalType('array', $metadata['report']);
+ $this->assertEquals('Actions', $metadata['report']['module']);
+ $this->assertEquals('getPageUrls', $metadata['report']['action']);
+ unset($metadata['report']);
+ unset($metadata['totals']);
+
+ $this->assertEquals($expectedMetadata, $metadata);
+ }
+
+ public function test_getInsights_ShouldGoBackInPastDependingOnComparedToParameter()
+ {
+ $insights = $this->requestInsights(array('comparedToXPeriods' => 3));
+
+ $metadata = $insights->getAllTableMetadata();
+
+ $this->assertEquals('2010-12-11', $metadata['lastDate']);
+ }
+
+ public function test_getInsights_ShouldGoBackInPastDependingOnPeriod()
+ {
+ $insights = $this->requestInsights(array('period' => 'month'));
+
+ $metadata = $insights->getAllTableMetadata();
+
+ $this->assertEquals('2010-11-14', $metadata['lastDate']);
+ }
+
+ public function test_getInsights_ShouldReturnAllRowsIfMinValuesArelow()
+ {
+ $insights = $this->requestInsights(array('minImpactPercent' => 0, 'minGrowthPercent' => 1));
+
+ $expectedLabels = array(
+ '/Mover1',
+ '/New1',
+ '/New2',
+ '/Mover2',
+ '/Old1',
+ '/Old2',
+ '/Mover3'
+ );
+ $this->assertRows($expectedLabels, $insights);
+ }
+
+ public function test_getInsights_ShouldReturnReturnNothingIfminImpactPercentIsTooHigh()
+ {
+ $insights = $this->requestInsights(array('minImpactPercent' => 10000, 'minGrowthPercent' => 0));
+
+ $this->assertRows(array(), $insights);
+ }
+
+ public function test_getInsights_ShouldReturnReturnNothingIfMinGrowthIsHigh()
+ {
+ $insights = $this->requestInsights(array('minImpactPercent' => 0, 'minGrowthPercent' => 10000));
+
+ $this->assertRows(array(), $insights);
+ }
+
+ public function test_getInsights_ShouldOrderAbsoluteByDefault()
+ {
+ $insights = $this->requestInsights(array('minImpactPercent' => 0, 'minGrowthPercent' => 0));
+
+ $expectedLabels = array(
+ '/Mover1',
+ '/New1',
+ '/New2',
+ '/Mover2',
+ '/Old1',
+ '/Old2',
+ '/Mover3'
+ );
+ $this->assertRows($expectedLabels, $insights);
+ }
+
+ public function test_getInsights_ShouldBeAbleToOrderRelative()
+ {
+ $insights = $this->requestInsights(array('minImpactPercent' => 0, 'minGrowthPercent' => 0, 'orderBy' => 'relative'));
+
+ $expectedLabels = array(
+ '/Mover1',
+ '/New1',
+ '/New2',
+ '/Old1',
+ '/Old2',
+ '/Mover2',
+ '/Mover3'
+ );
+ $this->assertRows($expectedLabels, $insights);
+ }
+
+ public function test_getInsights_ShouldBeAbleToOrderByImportance()
+ {
+ $insights = $this->requestInsights(array('minImpactPercent' => 0, 'minGrowthPercent' => 0, 'orderBy' => 'importance'));
+
+ $expectedLabels = array(
+ '/Mover2',
+ '/Old1',
+ '/Mover1',
+ '/New1',
+ '/Old2',
+ '/New2',
+ '/Mover3'
+ );
+ $this->assertRows($expectedLabels, $insights);
+ }
+
+ public function test_getInsights_ShouldApplyTheLimit()
+ {
+ $insights = $this->requestInsights(array('limitIncreaser' => 1, 'limitDecreaser' => 1));
+
+ $expectedLabels = array(
+ '/Mover1',
+ '/Mover2'
+ );
+ $this->assertRows($expectedLabels, $insights);
+ }
+
+ public function test_getInsights_ShouldBeAbleToShowOnlyMovers()
+ {
+ $insights = $this->requestInsights(array('minImpactPercent' => 0, 'minGrowthPercent' => 0, 'filterBy' => 'movers'));
+
+ $expectedLabels = array(
+ '/Mover1',
+ '/Mover2',
+ '/Mover3'
+ );
+ $this->assertRows($expectedLabels, $insights);
+ }
+
+ public function test_getInsights_ShouldBeAbleToShowOnlyNew()
+ {
+ $insights = $this->requestInsights(array('minImpactPercent' => 0, 'minGrowthPercent' => 0, 'filterBy' => 'new'));
+
+ $expectedLabels = array(
+ '/New1',
+ '/New2'
+ );
+ $this->assertRows($expectedLabels, $insights);
+ }
+
+ public function test_getInsights_ShouldBeAbleToShowOnlyDisappeared()
+ {
+ $insights = $this->requestInsights(array('minImpactPercent' => 0, 'minGrowthPercent' => 0, 'filterBy' => 'disappeared'));
+
+ $expectedLabels = array(
+ '/Old1',
+ '/Old2'
+ );
+ $this->assertRows($expectedLabels, $insights);
+ }
+
+ public function test_canGenerateInsights()
+ {
+ $this->assertTrue($this->api->canGenerateInsights('2012-12-12', 'day'));
+ $this->assertTrue($this->api->canGenerateInsights('2012-12-12', 'week'));
+ $this->assertTrue($this->api->canGenerateInsights('2012-12-12', 'month'));
+
+ $this->assertFalse($this->api->canGenerateInsights('last10', 'day'));
+ $this->assertFalse($this->api->canGenerateInsights('2012-11-11,2012-12-12', 'range'));
+ }
+
+ private function requestInsights($requestParams)
+ {
+ $params = array(
+ 'method' => 'Insights.getInsights',
+ 'idSite' => self::$fixture->idSite,
+ 'date' => self::$fixture->date1,
+ 'period' => 'day',
+ 'format' => 'original',
+ 'reportUniqueId' => 'Actions_getPageUrls',
+ );
+
+ if (!empty($requestParams)) {
+ foreach ($requestParams as $key => $value) {
+ $params[$key] = $value;
+ }
+ }
+
+ $request = new ApiRequest($params);
+ return $request->process();
+ }
+
+ private function assertRows($expectedLabels, DataTable $dataTable)
+ {
+ $this->assertEquals($expectedLabels, $dataTable->getColumn('label'));
+ $this->assertEquals(count($expectedLabels), $dataTable->getRowsCount());
+ }
+}
+
+ApiTest::$fixture = new SomeVisitsDifferentPathsOnTwoDays(); \ No newline at end of file
diff --git a/plugins/Insights/tests/Integration/ModelTest.php b/plugins/Insights/tests/Integration/ModelTest.php
new file mode 100644
index 0000000000..4f62630bd9
--- /dev/null
+++ b/plugins/Insights/tests/Integration/ModelTest.php
@@ -0,0 +1,189 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+namespace Piwik\Plugins\Insights\tests;
+
+use Piwik\DataTable;
+use Piwik\Plugins\Insights\Model;
+use Piwik\Plugins\Insights\tests\Fixtures\SomeVisitsDifferentPathsOnTwoDays;
+use Piwik\Tests\Impl\SystemTestCase;
+
+/**
+ * @group Insights
+ * @group ModelTest
+ * @group Plugins
+ * @group Plugins
+ */
+class ModelTest extends SystemTestCase
+{
+ /**
+ * @var SomeVisitsDifferentPathsOnTwoDays
+ */
+ public static $fixture = null;
+
+ /**
+ * @var Model
+ */
+ private $model;
+
+ public function setUp()
+ {
+ parent::setUp();
+
+ $this->model = new Model();
+ }
+
+ public function test_requestReport_shouldReturnTheDataTableOfTheReport_AndContainReportTotals()
+ {
+ $idSite = self::$fixture->idSite;
+ $date = self::$fixture->date1;
+ $metric = 'nb_visits';
+
+ $table = $this->model->requestReport($idSite, 'day', $date, 'Actions_getPageUrls', $metric, false);
+
+ $this->assertEquals(5, $table->getRowsCount());
+
+ $totals = $table->getMetadata('totals');
+ $this->assertEquals(50, $totals[$metric]);
+ }
+
+ public function test_getReportByUniqueId_shouldReturnReport()
+ {
+ $report = $this->model->getReportByUniqueId(self::$fixture->idSite, 'Actions_getPageUrls');
+
+ $this->assertEquals('Actions', $report['module']);
+ $this->assertEquals('getPageUrls', $report['action']);
+ }
+
+ public function test_getLastDate_shouldReturnTheLastDateDependingOnPeriod()
+ {
+ $date = $this->model->getLastDate('2012-12-12', 'day', 1);
+ $this->assertEquals('2012-12-11', $date);
+
+ $date = $this->model->getLastDate('2012-12-12', 'week', 1);
+ $this->assertEquals('2012-12-05', $date);
+
+ $date = $this->model->getLastDate('2012-12-03', 'week', 1);
+ $this->assertEquals('2012-11-26', $date);
+
+ $date = $this->model->getLastDate('2012-12-02', 'week', 1);
+ $this->assertEquals('2012-11-25', $date);
+
+ $date = $this->model->getLastDate('2012-12-12', 'month', 1);
+ $this->assertEquals('2012-11-12', $date);
+
+ $date = $this->model->getLastDate('2012-12-01', 'month', 1);
+ $this->assertEquals('2012-11-01', $date);
+ }
+
+ public function test_getLastDate_shouldReturnTheLastDateDependingOnComparedTo()
+ {
+ $date = $this->model->getLastDate('2012-12-12', 'day', 1);
+ $this->assertEquals('2012-12-11', $date);
+
+ $date = $this->model->getLastDate('2012-12-12', 'day', 2);
+ $this->assertEquals('2012-12-10', $date);
+
+ $date = $this->model->getLastDate('2012-12-12', 'day', 7);
+ $this->assertEquals('2012-12-05', $date);
+ }
+
+ public function test_getMetricTotalValue_shouldReturnTheTotalValueFromMetadata()
+ {
+ $table = $this->getTableWithTotal('17');
+
+ $total = $this->model->getMetricTotalValue($table, 'nb_visits');
+
+ $this->assertEquals(17, $total);
+ $this->assertInternalType('integer', $total);
+ }
+
+ public function test_getMetricTotalValue_shouldReturnZeroIfMetricHasNoTotal()
+ {
+ $table = new DataTable();
+ $table->setMetadata('totals', array('nb_visits' => '17'));
+
+ $total = $this->model->getMetricTotalValue($table, 'unknown_metric');
+
+ $this->assertEquals(0, $total);
+ }
+
+ /**
+ * @expectedException \Exception
+ */
+ public function test_getLastDate_shouldThrowExceptionIfNotPossibleToGetLastDate()
+ {
+ $this->model->getLastDate('last10', 'day', 1);
+ }
+
+ /**
+ * @expectedException \Exception
+ */
+ public function test_getLastDate_shouldThrowExceptionInCaseOfRangePeriod()
+ {
+ $this->model->getLastDate('2012-11-11,2012-12-12', 'range', 1);
+ }
+
+ public function test_getTotalValue_shouldCalculateTotals()
+ {
+ $total = $this->model->getTotalValue(self::$fixture->idSite, 'day', self::$fixture->date1, 'nb_visits', false);
+ $this->assertEquals(50, $total);
+
+ $total = $this->model->getTotalValue(self::$fixture->idSite, 'day', self::$fixture->date2, 'nb_visits', false);
+ $this->assertEquals(59, $total);
+ }
+
+ public function test_getTotalValue_shouldCalculateTotalsAndApplySegment()
+ {
+ $total = $this->model->getTotalValue(self::$fixture->idSite, 'day', self::$fixture->date1, 'nb_visits', 'visitIp==156.15.13.1');
+ $this->assertEquals(1, $total);
+ }
+
+ /**
+ * @expectedException \Exception
+ */
+ public function test_getTotalValue_shouldReturnZero_IfColumnDoesNotExist()
+ {
+ $this->model->getTotalValue(self::$fixture->idSite, 'day', self::$fixture->date1, 'unknown_ColUmn', false);
+ }
+
+ public function test_getRelevantTotalValue_shouldReturnTotalValue_IfMetricTotalIsHighEnough()
+ {
+ $table = $this->getTableWithTotal(25);
+ $total = $this->model->getRelevantTotalValue($table, 'nb_visits', 50);
+ $this->assertEquals(50, $total);
+ }
+
+ public function test_getRelevantTotalValue_shouldReturnMetricTotal_IfMetricTotalIsHigherThanTotalValue()
+ {
+ $table = $this->getTableWithTotal(80);
+ $total = $this->model->getRelevantTotalValue($table, 'nb_visits', 50);
+ $this->assertEquals(80, $total);
+ }
+
+ public function test_getRelevantTotalValue_shouldReturnMetricTotal_IfMetricTotalIsTooLow()
+ {
+ $table = $this->getTableWithTotal(24);
+ $total = $this->model->getRelevantTotalValue($table, 'nb_visits', 50);
+ $this->assertEquals(24, $total);
+
+ $table = $this->getTableWithTotal(0);
+ $total = $this->model->getRelevantTotalValue($table, 'nb_visits', 50);
+ $this->assertEquals(0, $total);
+ }
+
+ private function getTableWithTotal($total)
+ {
+ $table = new DataTable();
+ $table->setMetadata('totals', array('nb_visits' => $total));
+ return $table;
+ }
+
+}
+
+ModelTest::$fixture = new SomeVisitsDifferentPathsOnTwoDays(); \ No newline at end of file
diff --git a/plugins/Insights/tests/ModelTest.php b/plugins/Insights/tests/ModelTest.php
deleted file mode 100644
index fdabe70561..0000000000
--- a/plugins/Insights/tests/ModelTest.php
+++ /dev/null
@@ -1,189 +0,0 @@
-<?php
-/**
- * Piwik - free/libre analytics platform
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- */
-
-namespace Piwik\Plugins\Insights\tests;
-
-use Piwik\DataTable;
-use Piwik\Plugins\Insights\Model;
-use Piwik\Plugins\Insights\tests\Fixtures\SomeVisitsDifferentPathsOnTwoDays;
-use Piwik\Tests\IntegrationTestCase;
-
-/**
- * @group Insights
- * @group ModelTest
- * @group Database
- * @group Plugins
- */
-class ModelTest extends IntegrationTestCase
-{
- /**
- * @var SomeVisitsDifferentPathsOnTwoDays
- */
- public static $fixture = null;
-
- /**
- * @var Model
- */
- private $model;
-
- public function setUp()
- {
- parent::setUp();
-
- $this->model = new Model();
- }
-
- public function test_requestReport_shouldReturnTheDataTableOfTheReport_AndContainReportTotals()
- {
- $idSite = self::$fixture->idSite;
- $date = self::$fixture->date1;
- $metric = 'nb_visits';
-
- $table = $this->model->requestReport($idSite, 'day', $date, 'Actions_getPageUrls', $metric, false);
-
- $this->assertEquals(5, $table->getRowsCount());
-
- $totals = $table->getMetadata('totals');
- $this->assertEquals(50, $totals[$metric]);
- }
-
- public function test_getReportByUniqueId_shouldReturnReport()
- {
- $report = $this->model->getReportByUniqueId(self::$fixture->idSite, 'Actions_getPageUrls');
-
- $this->assertEquals('Actions', $report['module']);
- $this->assertEquals('getPageUrls', $report['action']);
- }
-
- public function test_getLastDate_shouldReturnTheLastDateDependingOnPeriod()
- {
- $date = $this->model->getLastDate('2012-12-12', 'day', 1);
- $this->assertEquals('2012-12-11', $date);
-
- $date = $this->model->getLastDate('2012-12-12', 'week', 1);
- $this->assertEquals('2012-12-05', $date);
-
- $date = $this->model->getLastDate('2012-12-03', 'week', 1);
- $this->assertEquals('2012-11-26', $date);
-
- $date = $this->model->getLastDate('2012-12-02', 'week', 1);
- $this->assertEquals('2012-11-25', $date);
-
- $date = $this->model->getLastDate('2012-12-12', 'month', 1);
- $this->assertEquals('2012-11-12', $date);
-
- $date = $this->model->getLastDate('2012-12-01', 'month', 1);
- $this->assertEquals('2012-11-01', $date);
- }
-
- public function test_getLastDate_shouldReturnTheLastDateDependingOnComparedTo()
- {
- $date = $this->model->getLastDate('2012-12-12', 'day', 1);
- $this->assertEquals('2012-12-11', $date);
-
- $date = $this->model->getLastDate('2012-12-12', 'day', 2);
- $this->assertEquals('2012-12-10', $date);
-
- $date = $this->model->getLastDate('2012-12-12', 'day', 7);
- $this->assertEquals('2012-12-05', $date);
- }
-
- public function test_getMetricTotalValue_shouldReturnTheTotalValueFromMetadata()
- {
- $table = $this->getTableWithTotal('17');
-
- $total = $this->model->getMetricTotalValue($table, 'nb_visits');
-
- $this->assertEquals(17, $total);
- $this->assertInternalType('integer', $total);
- }
-
- public function test_getMetricTotalValue_shouldReturnZeroIfMetricHasNoTotal()
- {
- $table = new DataTable();
- $table->setMetadata('totals', array('nb_visits' => '17'));
-
- $total = $this->model->getMetricTotalValue($table, 'unknown_metric');
-
- $this->assertEquals(0, $total);
- }
-
- /**
- * @expectedException \Exception
- */
- public function test_getLastDate_shouldThrowExceptionIfNotPossibleToGetLastDate()
- {
- $this->model->getLastDate('last10', 'day', 1);
- }
-
- /**
- * @expectedException \Exception
- */
- public function test_getLastDate_shouldThrowExceptionInCaseOfRangePeriod()
- {
- $this->model->getLastDate('2012-11-11,2012-12-12', 'range', 1);
- }
-
- public function test_getTotalValue_shouldCalculateTotals()
- {
- $total = $this->model->getTotalValue(self::$fixture->idSite, 'day', self::$fixture->date1, 'nb_visits', false);
- $this->assertEquals(50, $total);
-
- $total = $this->model->getTotalValue(self::$fixture->idSite, 'day', self::$fixture->date2, 'nb_visits', false);
- $this->assertEquals(59, $total);
- }
-
- public function test_getTotalValue_shouldCalculateTotalsAndApplySegment()
- {
- $total = $this->model->getTotalValue(self::$fixture->idSite, 'day', self::$fixture->date1, 'nb_visits', 'visitIp==156.15.13.1');
- $this->assertEquals(1, $total);
- }
-
- /**
- * @expectedException \Exception
- */
- public function test_getTotalValue_shouldReturnZero_IfColumnDoesNotExist()
- {
- $this->model->getTotalValue(self::$fixture->idSite, 'day', self::$fixture->date1, 'unknown_ColUmn', false);
- }
-
- public function test_getRelevantTotalValue_shouldReturnTotalValue_IfMetricTotalIsHighEnough()
- {
- $table = $this->getTableWithTotal(25);
- $total = $this->model->getRelevantTotalValue($table, 'nb_visits', 50);
- $this->assertEquals(50, $total);
- }
-
- public function test_getRelevantTotalValue_shouldReturnMetricTotal_IfMetricTotalIsHigherThanTotalValue()
- {
- $table = $this->getTableWithTotal(80);
- $total = $this->model->getRelevantTotalValue($table, 'nb_visits', 50);
- $this->assertEquals(80, $total);
- }
-
- public function test_getRelevantTotalValue_shouldReturnMetricTotal_IfMetricTotalIsTooLow()
- {
- $table = $this->getTableWithTotal(24);
- $total = $this->model->getRelevantTotalValue($table, 'nb_visits', 50);
- $this->assertEquals(24, $total);
-
- $table = $this->getTableWithTotal(0);
- $total = $this->model->getRelevantTotalValue($table, 'nb_visits', 50);
- $this->assertEquals(0, $total);
- }
-
- private function getTableWithTotal($total)
- {
- $table = new DataTable();
- $table->setMetadata('totals', array('nb_visits' => $total));
- return $table;
- }
-
-}
-
-ModelTest::$fixture = new SomeVisitsDifferentPathsOnTwoDays(); \ No newline at end of file
diff --git a/plugins/Insights/tests/BaseUnitTest.php b/plugins/Insights/tests/Unit/BaseUnitTest.php
index 97c2c78580..97c2c78580 100644
--- a/plugins/Insights/tests/BaseUnitTest.php
+++ b/plugins/Insights/tests/Unit/BaseUnitTest.php
diff --git a/plugins/Insights/tests/FilterExcludeLowValueTest.php b/plugins/Insights/tests/Unit/FilterExcludeLowValueTest.php
index 51c0192ef6..51c0192ef6 100644
--- a/plugins/Insights/tests/FilterExcludeLowValueTest.php
+++ b/plugins/Insights/tests/Unit/FilterExcludeLowValueTest.php
diff --git a/plugins/Insights/tests/FilterInsightTest.php b/plugins/Insights/tests/Unit/FilterInsightTest.php
index 67c216b192..67c216b192 100644
--- a/plugins/Insights/tests/FilterInsightTest.php
+++ b/plugins/Insights/tests/Unit/FilterInsightTest.php
diff --git a/plugins/Insights/tests/FilterLimitTest.php b/plugins/Insights/tests/Unit/FilterLimitTest.php
index 6f6d703b0a..6f6d703b0a 100644
--- a/plugins/Insights/tests/FilterLimitTest.php
+++ b/plugins/Insights/tests/Unit/FilterLimitTest.php
diff --git a/plugins/Insights/tests/FilterMinGrowthTest.php b/plugins/Insights/tests/Unit/FilterMinGrowthTest.php
index a53245b891..a53245b891 100644
--- a/plugins/Insights/tests/FilterMinGrowthTest.php
+++ b/plugins/Insights/tests/Unit/FilterMinGrowthTest.php
diff --git a/plugins/Insights/tests/FilterOrderByTest.php b/plugins/Insights/tests/Unit/FilterOrderByTest.php
index 8239204a2f..8239204a2f 100644
--- a/plugins/Insights/tests/FilterOrderByTest.php
+++ b/plugins/Insights/tests/Unit/FilterOrderByTest.php
diff --git a/plugins/Insights/tests/InsightReportTest.php b/plugins/Insights/tests/Unit/InsightReportTest.php
index 32901409ac..32901409ac 100644
--- a/plugins/Insights/tests/InsightReportTest.php
+++ b/plugins/Insights/tests/Unit/InsightReportTest.php
diff --git a/plugins/LanguagesManager/tests/Integration/LanguagesManagerTest.php b/plugins/LanguagesManager/tests/Integration/LanguagesManagerTest.php
new file mode 100755
index 0000000000..3ed219acf4
--- /dev/null
+++ b/plugins/LanguagesManager/tests/Integration/LanguagesManagerTest.php
@@ -0,0 +1,182 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+namespace Piwik\Plugins\LanguagesManager\tests;
+
+use Piwik\Common;
+use Piwik\Plugins\LanguagesManager\API;
+use Piwik\Translate\Filter\ByParameterCount;
+use Piwik\Translate\Filter\EmptyTranslations;
+use Piwik\Translate\Filter\EncodedEntities;
+use Piwik\Translate\Filter\UnnecassaryWhitespaces;
+use Piwik\Translate\Validate\CoreTranslations;
+use Piwik\Translate\Validate\NoScripts;
+use Piwik\Translate\Writer;
+use \Exception;
+
+require_once PIWIK_INCLUDE_PATH . '/plugins/LanguagesManager/API.php';
+
+class LanguagesManagerTest extends \PHPUnit_Framework_TestCase
+{
+ public function setUp()
+ {
+ parent::setUp();
+ include PIWIK_INCLUDE_PATH . '/core/DataFiles/Languages.php';
+ }
+
+ function getTestDataForLanguageFiles()
+ {
+ // we also test that none of the language php files outputs any character on the screen (eg. space before the <?php)
+ $languages = API::getInstance()->getAvailableLanguages();
+
+ $plugins = \Piwik\Plugin\Manager::getInstance()->readPluginsDirectory();
+
+ $pluginsWithTranslation = array();
+
+ foreach ($plugins as $plugin) {
+
+ if (API::getInstance()->getPluginTranslationsForLanguage($plugin, 'en')) {
+
+ $pluginsWithTranslation[] = $plugin;
+ }
+ }
+
+ $return = array();
+ foreach ($languages as $language) {
+ if ($language != 'en') {
+ $return[] = array($language, null);
+
+ foreach ($pluginsWithTranslation as $plugin) {
+
+ $return[] = array($language, $plugin);
+ }
+ }
+ }
+
+ return $return;
+ }
+
+ /**
+ * test all languages
+ *
+ * @group Plugins
+ *
+ * @dataProvider getTestDataForLanguageFiles
+ */
+ function testGetTranslationsForLanguages($language, $plugin)
+ {
+ $translationWriter = new Writer($language, $plugin);
+
+ $baseTranslations = $translationWriter->getTranslations('en');
+
+ $translationWriter->addValidator(new NoScripts());
+ if (empty($plugin)) {
+ $translationWriter->addValidator(new CoreTranslations($baseTranslations));
+ }
+
+ // prevent build from failing when translations string have been deleted
+// $translationWriter->addFilter(new ByBaseTranslations($baseTranslations));
+ $translationWriter->addFilter(new EmptyTranslations());
+ $translationWriter->addFilter(new ByParameterCount($baseTranslations));
+ $translationWriter->addFilter(new UnnecassaryWhitespaces($baseTranslations));
+ $translationWriter->addFilter(new EncodedEntities());
+
+ $translations = $translationWriter->getTranslations($language);
+
+ if (empty($translations)) {
+ return; // skip language / plugin combinations that aren't present
+ }
+
+ $translationWriter->setTranslations($translations);
+
+ $this->assertTrue($translationWriter->isValid(), $translationWriter->getValidationMessage());
+
+ if ($translationWriter->wasFiltered()) {
+
+ $translationWriter->saveTemporary();
+ $this->fail(implode("\n", $translationWriter->getFilterMessages()) . "\n"
+ . 'Translation file errors detected in ' . $language . "...\n"
+ . "To overwrite you could manually fix the language files, or run the following command may work if you have access to oTrance: \n"
+ . "$ ./console translations:update [--plugin=XYZ] \n");
+ }
+ }
+
+ /**
+ * test language when it's not defined
+ *
+ * @group Plugins
+ *
+ * @expectedException Exception
+ */
+ function testWriterInvalidPlugin()
+ {
+ new Writer('de', 'iNvaLiDPluGin'); // invalid plugin throws exception
+ }
+
+ /**
+ * test language when it's not defined
+ *
+ * @group Plugins
+ */
+ function testGetTranslationsForLanguagesNot()
+ {
+ $this->assertFalse(API::getInstance()->getTranslationsForLanguage("../no-language"));
+ }
+
+ /**
+ * test English short name for language
+ *
+ * @group Plugins
+ */
+ function testGetLanguageNamesInEnglish()
+ {
+ $languages = API::getInstance()->getAvailableLanguages();
+ foreach ($languages as $language) {
+ $data = file_get_contents(PIWIK_INCLUDE_PATH . "/lang/$language.json");
+ $translations = json_decode($data, true);
+ $name = $translations['General']['EnglishLanguageName'];
+
+ if ($language != 'en') {
+ $this->assertFalse($name == 'English', "for $language");
+ }
+
+ $languageCode = substr($language, 0, 2);
+ $this->assertTrue(isset($GLOBALS['Piwik_LanguageList'][$languageCode]));
+ $names = $GLOBALS['Piwik_LanguageList'][$languageCode];
+
+ if (isset($GLOBALS['Piwik_LanguageList'][$language])) {
+ if (is_array($names)) {
+ $this->assertTrue(in_array($name, $names), "$language: failed because $name not a known language name");
+ } else {
+ $this->assertTrue($name == $names, "$language: failed because $name == $names");
+ }
+ } else {
+ if (is_array($names)) {
+ $this->assertTrue(strpos($name, $names[0]) !== false);
+ } else {
+ $this->fail("$language: expected an array of language names");
+ }
+ }
+ }
+ }
+
+ /**
+ * test format of DataFile/Languages.php
+ *
+ * @group Plugins
+ */
+ function testGetLanguagesList()
+ {
+ $languages = Common::getLanguagesList();
+ $this->assertTrue(count($languages) > 0);
+ foreach ($languages as $langCode => $langs) {
+ $this->assertTrue(strlen($langCode) == 2, "$langCode length = 2");
+ $this->assertTrue(is_array($langs) && count($langs) >= 1, "$langCode array(names) >= 1");
+ }
+ }
+}
diff --git a/plugins/LeftMenu/tests/APITest.php b/plugins/LeftMenu/tests/APITest.php
deleted file mode 100644
index 05d0f34aed..0000000000
--- a/plugins/LeftMenu/tests/APITest.php
+++ /dev/null
@@ -1,144 +0,0 @@
-<?php
-/**
- * Piwik - free/libre analytics platform
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- */
-
-namespace Piwik\Plugins\LeftMenu\tests;
-
-use Piwik\Access;
-use Piwik\Plugins\LeftMenu\API;
-use Piwik\Plugins\LeftMenu\Settings;
-use \FakeAccess;
-
-/**
- * @group LeftMenu
- * @group APITest
- * @group Database
- */
-class APITest extends \DatabaseTestCase
-{
- /**
- * @var API
- */
- private $api;
-
- /**
- * @var Settings
- */
- private $settings;
-
- public function setUp()
- {
- parent::setUp();
-
- $this->api = API::getInstance();
- $this->createSettings();
- }
-
- public function test_isEnabled_shouldReturnFalse_ByDefault()
- {
- $this->assertLeftMenuIsDisabled();
-
- $this->setUser();
- $this->assertLeftMenuIsDisabled();
-
- $this->setSuperUser();
- $this->assertLeftMenuIsDisabled();
- }
-
- public function test_isEnabled_shouldReturnTrue_IfEnabledSystemWideAndNoUserPreference()
- {
- $this->enableLeftMenuForAll();
-
- $this->assertLeftMenuIsEnabled();
-
- $this->setUser();
- $this->assertLeftMenuIsEnabled();
-
- $this->setAnonymous();
- $this->assertLeftMenuIsEnabled();
- }
-
- public function test_isEnabled_AUserPreferenceShouldOverwriteASystemPreference_DefaultDisabled()
- {
- $this->assertLeftMenuIsDisabled();
-
- $this->setUser();
- $this->setUserSettingValue('yes');
-
- $this->assertLeftMenuIsEnabled();
-
- $this->setAnonymous();
- $this->assertLeftMenuIsDisabled();
- }
-
- public function test_isEnabled_AUserPreferenceShouldOverwriteASystemPreference_DefaultEnabled()
- {
- $this->enableLeftMenuForAll();
-
- $this->assertLeftMenuIsEnabled();
-
- $this->setUser();
- $this->setUserSettingValue('no');
-
- $this->assertLeftMenuIsDisabled();
-
- $this->setAnonymous();
- $this->assertLeftMenuIsEnabled();
- }
-
- private function assertLeftMenuIsEnabled()
- {
- $this->assertTrue($this->api->isEnabled());
- }
-
- private function assertLeftMenuIsDisabled()
- {
- $this->assertFalse($this->api->isEnabled());
- }
-
- private function setSuperUser()
- {
- $pseudoMockAccess = new FakeAccess;
- FakeAccess::$superUser = true;
- FakeAccess::$superUserLogin = 'superUserLogin';
- Access::setSingletonInstance($pseudoMockAccess);
- $this->createSettings();
- }
-
- private function setAnonymous()
- {
- Access::setSingletonInstance(null);
- $this->createSettings();
- }
-
- private function setUser()
- {
- $pseudoMockAccess = new FakeAccess;
- FakeAccess::$idSitesView = array(1);
- FakeAccess::$identity = 'userLogin';
- Access::setSingletonInstance($pseudoMockAccess);
- $this->createSettings();
- }
-
- private function enableLeftMenuForAll()
- {
- $this->setSuperUser();
- $this->settings->globalEnabled->setValue(true);
- $this->settings->save();
- }
-
- private function createSettings()
- {
- $this->settings = new Settings('LeftMenu');
- }
-
- private function setUserSettingValue($value)
- {
- $this->settings->userEnabled->setValue($value);
- $this->settings->save();
- }
-}
diff --git a/plugins/LeftMenu/tests/Integration/APITest.php b/plugins/LeftMenu/tests/Integration/APITest.php
new file mode 100644
index 0000000000..e4500b2e41
--- /dev/null
+++ b/plugins/LeftMenu/tests/Integration/APITest.php
@@ -0,0 +1,145 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+namespace Piwik\Plugins\LeftMenu\tests\Integration;
+
+use Piwik\Access;
+use Piwik\Plugins\LeftMenu\API;
+use Piwik\Plugins\LeftMenu\Settings;
+use \FakeAccess;
+use Piwik\Tests\Impl\IntegrationTestCase;
+
+/**
+ * @group LeftMenu
+ * @group APITest
+ * @group Plugins
+ */
+class APITest extends IntegrationTestCase
+{
+ /**
+ * @var API
+ */
+ private $api;
+
+ /**
+ * @var Settings
+ */
+ private $settings;
+
+ public function setUp()
+ {
+ parent::setUp();
+
+ $this->api = API::getInstance();
+ $this->createSettings();
+ }
+
+ public function test_isEnabled_shouldReturnFalse_ByDefault()
+ {
+ $this->assertLeftMenuIsDisabled();
+
+ $this->setUser();
+ $this->assertLeftMenuIsDisabled();
+
+ $this->setSuperUser();
+ $this->assertLeftMenuIsDisabled();
+ }
+
+ public function test_isEnabled_shouldReturnTrue_IfEnabledSystemWideAndNoUserPreference()
+ {
+ $this->enableLeftMenuForAll();
+
+ $this->assertLeftMenuIsEnabled();
+
+ $this->setUser();
+ $this->assertLeftMenuIsEnabled();
+
+ $this->setAnonymous();
+ $this->assertLeftMenuIsEnabled();
+ }
+
+ public function test_isEnabled_AUserPreferenceShouldOverwriteASystemPreference_DefaultDisabled()
+ {
+ $this->assertLeftMenuIsDisabled();
+
+ $this->setUser();
+ $this->setUserSettingValue('yes');
+
+ $this->assertLeftMenuIsEnabled();
+
+ $this->setAnonymous();
+ $this->assertLeftMenuIsDisabled();
+ }
+
+ public function test_isEnabled_AUserPreferenceShouldOverwriteASystemPreference_DefaultEnabled()
+ {
+ $this->enableLeftMenuForAll();
+
+ $this->assertLeftMenuIsEnabled();
+
+ $this->setUser();
+ $this->setUserSettingValue('no');
+
+ $this->assertLeftMenuIsDisabled();
+
+ $this->setAnonymous();
+ $this->assertLeftMenuIsEnabled();
+ }
+
+ private function assertLeftMenuIsEnabled()
+ {
+ $this->assertTrue($this->api->isEnabled());
+ }
+
+ private function assertLeftMenuIsDisabled()
+ {
+ $this->assertFalse($this->api->isEnabled());
+ }
+
+ private function setSuperUser()
+ {
+ $pseudoMockAccess = new FakeAccess;
+ FakeAccess::$superUser = true;
+ FakeAccess::$superUserLogin = 'superUserLogin';
+ Access::setSingletonInstance($pseudoMockAccess);
+ $this->createSettings();
+ }
+
+ private function setAnonymous()
+ {
+ Access::setSingletonInstance(null);
+ $this->createSettings();
+ }
+
+ private function setUser()
+ {
+ $pseudoMockAccess = new FakeAccess;
+ FakeAccess::$idSitesView = array(1);
+ FakeAccess::$identity = 'userLogin';
+ Access::setSingletonInstance($pseudoMockAccess);
+ $this->createSettings();
+ }
+
+ private function enableLeftMenuForAll()
+ {
+ $this->setSuperUser();
+ $this->settings->globalEnabled->setValue(true);
+ $this->settings->save();
+ }
+
+ private function createSettings()
+ {
+ $this->settings = new Settings('LeftMenu');
+ }
+
+ private function setUserSettingValue($value)
+ {
+ $this->settings->userEnabled->setValue($value);
+ $this->settings->save();
+ }
+}
diff --git a/plugins/Live/tests/APITest.php b/plugins/Live/tests/APITest.php
deleted file mode 100644
index cf48da8d5b..0000000000
--- a/plugins/Live/tests/APITest.php
+++ /dev/null
@@ -1,153 +0,0 @@
-<?php
-/**
- * Piwik - free/libre analytics platform
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- */
-
-namespace Piwik\Plugins\Live\tests;
-
-use Piwik\Date;
-use Piwik\Db;
-use Piwik\Plugins\Goals\API as GoalsApi;
-use Piwik\Plugins\Live\API;
-use FakeAccess;
-use Piwik\Access;
-use Piwik\Tests\Fixture;
-use Piwik\Tests\IntegrationTestCase;
-
-/**
- * @group Live
- * @group APITest
- * @group Integration
- * @group Plugins
- */
-class APITest extends IntegrationTestCase
-{
- /**
- * @var API
- */
- private $api;
- private $idSite = 1;
-
- public function setUp()
- {
- parent::setUp();
-
- $this->api = API::getInstance();
- $this->setSuperUser();
- $this->createSite();
- }
-
- /**
- * @expectedException \Exception
- * @expectedExceptionMessage checkUserHasViewAccess Fake exception
- */
- public function test_GetCounters_ShouldFail_IfUserHasNoPermission()
- {
- $this->setAnonymous();
- $this->api->getCounters($this->idSite, 5);
- }
-
- public function test_GetCounters_ShouldReturnZeroForAllCounters_IfThereAreNoVisitsEtc()
- {
- $counters = $this->api->getCounters($this->idSite, 5);
-
- $this->assertEquals($this->buildCounter(0, 0, 0, 0), $counters);
- }
-
- public function test_GetCounters_ShouldOnlyReturnResultsOfLastMinutes()
- {
- $this->trackSomeVisits();
-
- $counters = $this->api->getCounters($this->idSite, 5);
- $this->assertEquals($this->buildCounter(19, 32, 16, 16), $counters);
-
- $counters = $this->api->getCounters($this->idSite, 20);
- $this->assertEquals($this->buildCounter(24, 60, 20, 40), $counters);
-
- $counters = $this->api->getCounters($this->idSite, 0);
- $this->assertEquals($this->buildCounter(0, 0, 0, 0), $counters);
- }
-
- private function trackSomeVisits()
- {
- $nowTimestamp = time();
-
- // use local tracker so mock location provider can be used
- $t = Fixture::getTracker($this->idSite, $nowTimestamp, $defaultInit = true, $useLocal = false);
- $t->enableBulkTracking();
-
- for ($i = 0; $i != 20; ++$i) {
- $t->setForceNewVisit();
- $t->setVisitorId( substr(md5($i * 1000), 0, $t::LENGTH_VISITOR_ID));
-
- $factor = 10;
- if ($i > 15) {
- $factor = 30; // make sure first 15 visits are always within 5 minutes to prevent any random fails
- }
- $time = $nowTimestamp - ($i * $factor);
-
- // first visit -> this one is > 5 minutes and should be ignored in one test
- $date = Date::factory($time - 600);
- $t->setForceVisitDateTime($date->getDatetime());
- $t->setUrl("http://piwik.net/space/quest/iv");
- $t->doTrackPageView("Space Quest XV");
-
- $t->doTrackGoal(1); // this one is > 5 minutes and should be ignored in one test
-
- // second visit
- $date = Date::factory($time - 1);
- $t->setForceVisitDateTime($date->getDatetime());
- $t->setUrl("http://piwik.net/space/quest/iv");
- $t->doTrackPageView("Space Quest XII");
-
- if ($i % 6 == 0) {
- $t->setForceNewVisit(); // to test visitors vs visits
- }
-
- // third visit
- $date = Date::factory($time);
- $t->setForceVisitDateTime($date->getDatetime());
- $t->setUrl("http://piwik.net/grue/$i");
- $t->doTrackPageView('It is pitch black...');
-
- $t->doTrackGoal(2);
- }
-
- $t->doBulkTrack();
- }
-
- private function buildCounter($visits, $actions, $visitors, $visitsConverted)
- {
- return array(array(
- 'visits' => $visits,
- 'actions' => $actions,
- 'visitors' => $visitors,
- 'visitsConverted' => $visitsConverted,
- ));
- }
-
- private function createSite()
- {
- Fixture::createWebsite('2013-01-23 01:23:45');
- GoalsApi::getInstance()->addGoal(1, 'MyName', 'manually', '', 'contains');
- GoalsApi::getInstance()->addGoal(1, 'MyGoal', 'manually', '', 'contains');
- }
-
- private function setSuperUser()
- {
- $pseudoMockAccess = new FakeAccess();
- FakeAccess::$superUser = true;
- Access::setSingletonInstance($pseudoMockAccess);
- }
-
- private function setAnonymous()
- {
- $pseudoMockAccess = new FakeAccess();
- FakeAccess::$superUser = false;
- Access::setSingletonInstance($pseudoMockAccess);
- }
-
-}
diff --git a/plugins/Live/tests/Integration/APITest.php b/plugins/Live/tests/Integration/APITest.php
new file mode 100644
index 0000000000..fcfc410bcf
--- /dev/null
+++ b/plugins/Live/tests/Integration/APITest.php
@@ -0,0 +1,152 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+namespace Piwik\Plugins\Live\tests\Integration;
+
+use Piwik\Date;
+use Piwik\Db;
+use Piwik\Plugins\Goals\API as GoalsApi;
+use Piwik\Plugins\Live\API;
+use FakeAccess;
+use Piwik\Access;
+use Piwik\Tests\Impl\Fixture;
+use Piwik\Tests\Impl\SystemTestCase;
+
+/**
+ * @group Live
+ * @group APITest
+ * @group Plugins
+ */
+class APITest extends SystemTestCase
+{
+ /**
+ * @var API
+ */
+ private $api;
+ private $idSite = 1;
+
+ public function setUp()
+ {
+ parent::setUp();
+
+ $this->api = API::getInstance();
+ $this->setSuperUser();
+ $this->createSite();
+ }
+
+ /**
+ * @expectedException \Exception
+ * @expectedExceptionMessage checkUserHasViewAccess Fake exception
+ */
+ public function test_GetCounters_ShouldFail_IfUserHasNoPermission()
+ {
+ $this->setAnonymous();
+ $this->api->getCounters($this->idSite, 5);
+ }
+
+ public function test_GetCounters_ShouldReturnZeroForAllCounters_IfThereAreNoVisitsEtc()
+ {
+ $counters = $this->api->getCounters($this->idSite, 5);
+
+ $this->assertEquals($this->buildCounter(0, 0, 0, 0), $counters);
+ }
+
+ public function test_GetCounters_ShouldOnlyReturnResultsOfLastMinutes()
+ {
+ $this->trackSomeVisits();
+
+ $counters = $this->api->getCounters($this->idSite, 5);
+ $this->assertEquals($this->buildCounter(19, 32, 16, 16), $counters);
+
+ $counters = $this->api->getCounters($this->idSite, 20);
+ $this->assertEquals($this->buildCounter(24, 60, 20, 40), $counters);
+
+ $counters = $this->api->getCounters($this->idSite, 0);
+ $this->assertEquals($this->buildCounter(0, 0, 0, 0), $counters);
+ }
+
+ private function trackSomeVisits()
+ {
+ $nowTimestamp = time();
+
+ // use local tracker so mock location provider can be used
+ $t = Fixture::getTracker($this->idSite, $nowTimestamp, $defaultInit = true, $useLocal = false);
+ $t->enableBulkTracking();
+
+ for ($i = 0; $i != 20; ++$i) {
+ $t->setForceNewVisit();
+ $t->setVisitorId( substr(md5($i * 1000), 0, $t::LENGTH_VISITOR_ID));
+
+ $factor = 10;
+ if ($i > 15) {
+ $factor = 30; // make sure first 15 visits are always within 5 minutes to prevent any random fails
+ }
+ $time = $nowTimestamp - ($i * $factor);
+
+ // first visit -> this one is > 5 minutes and should be ignored in one test
+ $date = Date::factory($time - 600);
+ $t->setForceVisitDateTime($date->getDatetime());
+ $t->setUrl("http://piwik.net/space/quest/iv");
+ $t->doTrackPageView("Space Quest XV");
+
+ $t->doTrackGoal(1); // this one is > 5 minutes and should be ignored in one test
+
+ // second visit
+ $date = Date::factory($time - 1);
+ $t->setForceVisitDateTime($date->getDatetime());
+ $t->setUrl("http://piwik.net/space/quest/iv");
+ $t->doTrackPageView("Space Quest XII");
+
+ if ($i % 6 == 0) {
+ $t->setForceNewVisit(); // to test visitors vs visits
+ }
+
+ // third visit
+ $date = Date::factory($time);
+ $t->setForceVisitDateTime($date->getDatetime());
+ $t->setUrl("http://piwik.net/grue/$i");
+ $t->doTrackPageView('It is pitch black...');
+
+ $t->doTrackGoal(2);
+ }
+
+ $t->doBulkTrack();
+ }
+
+ private function buildCounter($visits, $actions, $visitors, $visitsConverted)
+ {
+ return array(array(
+ 'visits' => $visits,
+ 'actions' => $actions,
+ 'visitors' => $visitors,
+ 'visitsConverted' => $visitsConverted,
+ ));
+ }
+
+ private function createSite()
+ {
+ Fixture::createWebsite('2013-01-23 01:23:45');
+ GoalsApi::getInstance()->addGoal(1, 'MyName', 'manually', '', 'contains');
+ GoalsApi::getInstance()->addGoal(1, 'MyGoal', 'manually', '', 'contains');
+ }
+
+ private function setSuperUser()
+ {
+ $pseudoMockAccess = new FakeAccess();
+ FakeAccess::$superUser = true;
+ Access::setSingletonInstance($pseudoMockAccess);
+ }
+
+ private function setAnonymous()
+ {
+ $pseudoMockAccess = new FakeAccess();
+ FakeAccess::$superUser = false;
+ Access::setSingletonInstance($pseudoMockAccess);
+ }
+
+}
diff --git a/plugins/Login/tests/Integration/LoginTest.php b/plugins/Login/tests/Integration/LoginTest.php
new file mode 100644
index 0000000000..4007061bd5
--- /dev/null
+++ b/plugins/Login/tests/Integration/LoginTest.php
@@ -0,0 +1,404 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+namespace Piwik\Plugins\Login\tests\Integration;
+
+use Piwik\Access;
+use Piwik\AuthResult;
+use Piwik\DbHelper;
+use Piwik\Plugins\Login\Auth;
+use Piwik\Plugins\UsersManager\API;
+use Piwik\Tests\Impl\IntegrationTestCase;
+use FakeAccess;
+
+require_once PIWIK_INCLUDE_PATH . '/plugins/Login/Auth.php';
+
+/**
+ * Class Plugins_LoginTest
+ *
+ * @group Plugins
+ * @group Plugins_LoginTest
+ */
+class LoginTest extends IntegrationTestCase
+{
+
+ /**
+ * @var Auth
+ */
+ private $auth;
+
+ public function setUp()
+ {
+ parent::setUp();
+
+ // setup the access layer
+ $pseudoMockAccess = new FakeAccess;
+ FakeAccess::setIdSitesView(array(1, 2));
+ FakeAccess::setIdSitesAdmin(array(3, 4));
+
+ //finally we set the user as a Super User by default
+ FakeAccess::$superUser = true;
+ Access::setSingletonInstance($pseudoMockAccess);
+
+ $this->auth = new Auth();
+ }
+
+ /**
+ * @group Plugins
+ */
+ public function testAuthenticateFailureNoLoginNoTokenAuth()
+ {
+ // no login; no token auth
+ $rc = $this->auth->authenticate();
+ $this->assertFailedLogin($rc);
+ }
+
+ /**
+ * @group Plugins
+ */
+ public function testAuthenticateFailureEmptyLoginNoTokenAuth()
+ {
+ // empty login; no token auth
+ $this->auth->setLogin('');
+ $rc = $this->auth->authenticate();
+ $this->assertFailedLogin($rc);
+ }
+
+ /**
+ * @group Plugins
+ */
+ public function testAuthenticateFailureNonExistentUser()
+ {
+ // non-existent user
+ $this->auth->setLogin('nobody');
+ $rc = $this->auth->authenticate();
+ $this->assertFailedLogin($rc);
+ }
+
+ /**
+ * @group Plugins
+ */
+ public function testAuthenticateFailureAnonymousNotExisting()
+ {
+ // anonymous user doesn't exist yet
+ $rc = $this->authenticate($login = 'anonymous', $authToken = '');
+ $this->assertFailedLogin($rc);
+ }
+
+ /**
+ * @group Plugins
+ */
+ public function testAuthenticateFailureAnonymousNotExistentEmptyLogin()
+ {
+ // empty login; anonymous user doesn't exist yet
+ $rc = $this->authenticate($login = '', $authToken = 'anonymous');
+
+ $this->assertFailedLogin($rc);
+ }
+
+ /**
+ * @group Plugins
+ */
+ public function testAuthenticateFailureAnonymousNotExistentEmptyLoginWithTokenAuth()
+ {
+ // API authentication; anonymous user doesn't exist yet
+ $rc = $this->authenticate($login = null, $authToken = 'anonymous');
+ $this->assertFailedLogin($rc);
+ }
+
+ /**
+ * @group Plugins
+ */
+ public function testAuthenticateFailureAnonymousNotExistentWithLoginAndTokenAuth()
+ {
+ // anonymous user doesn't exist yet
+ $rc = $this->authenticate($login = 'anonymous', $authToken = 'anonymous');
+ $this->assertFailedLogin($rc);
+ }
+
+ /**
+ * @group Plugins
+ */
+ public function testAuthenticateFailureAnonymousWithLogin()
+ {
+ DbHelper::createAnonymousUser();
+
+ // missing token_auth
+ $rc = $this->authenticate($login = 'anonymous', $authToken = '');
+ $this->assertFailedLogin($rc);
+ }
+
+ /**
+ * @group Plugins
+ */
+ public function testAuthenticateFailureAnonymousEmptyLoginWithTokenAuth()
+ {
+ DbHelper::createAnonymousUser();
+
+ // empty login
+ $rc = $this->authenticate($login = '', $authToken = 'anonymous');
+ $this->assertFailedLogin($rc);
+ }
+
+ /**
+ * @group Plugins
+ */
+ public function testAuthenticateFailureAnonymousLoginTokenAuthMissmatch()
+ {
+ DbHelper::createAnonymousUser();
+
+ // not equal
+ $rc = $this->authenticate($login = 'anonymous', $authToken = 0);
+ $this->assertFailedLogin($rc);
+ }
+
+ /**
+ * @group Plugins
+ */
+ public function testAuthenticateSuccessAnonymousWithTokenAuth()
+ {
+ DbHelper::createAnonymousUser();
+
+ // API authentication
+ $rc = $this->authenticate($login = null, $authToken = 'anonymous');
+ $this->assertUserLogin($rc, $login = 'anonymous', $tokenLength = 9);
+ }
+
+ /**
+ * @group Plugins
+ */
+ public function testAuthenticateSuccessAnonymous()
+ {
+ DbHelper::createAnonymousUser();
+
+ // valid login & token auth
+ $rc = $this->authenticate($login = 'anonymous', $authToken = 'anonymous');
+ $this->assertUserLogin($rc, $login = 'anonymous', $tokenLength = 9);
+ }
+
+ /**
+ * @group Plugins
+ */
+ public function testAuthenticateFailureUserEmptyTokenAuth()
+ {
+ $user = $this->_setUpUser();
+
+ // empty token auth
+ $rc = $this->authenticate($login = $user['login'], $authToken = '');
+ $this->assertFailedLogin($rc);
+ }
+
+ /**
+ * @group Plugins
+ */
+ public function testAuthenticateFailureUserInvalidTokenAuth()
+ {
+ $user = $this->_setUpUser();
+
+ // not a token auth
+ $rc = $this->authenticate($login = $user['login'], $authToken = $user['password']);
+ $this->assertFailedLogin($rc);
+ }
+
+ /**
+ * @group Plugins
+ */
+ public function testAuthenticateFailureUserInvalidTokenAuth2()
+ {
+ $user = $this->_setUpUser();
+
+ // not a token auth
+ $rc = $this->authenticate($login = $user['login'], $authToken = md5($user['password']));
+ $this->assertFailedLogin($rc);
+ }
+
+ /**
+ * @group Plugins
+ */
+ public function testAuthenticateFailureUserEmptyLogin()
+ {
+ $user = $this->_setUpUser();
+
+ // empty login
+ $rc = $this->authenticate($login = '', $user['tokenAuth']);
+ $this->assertFailedLogin($rc);
+ }
+
+ /**
+ * @group Plugins
+ */
+ public function testAuthenticateFailureUserWithSuperUserAccessEmptyLogin()
+ {
+ $user = $this->_setUpUser();
+ $this->_setUpSuperUserAccessViaDb();
+
+ // empty login
+ $rc = $this->authenticate($login = '', $user['tokenAuth']);
+ $this->assertFailedLogin($rc);
+ }
+
+ /**
+ * @group Plugins
+ */
+ public function testAuthenticateFailureUserLoginTokenAuthMissmatch()
+ {
+ $this->_setUpUser();
+
+ // not equal
+ $rc = $this->authenticate($login = 0, $authToken = 0);
+ $this->assertFailedLogin($rc);
+ }
+
+ /**
+ * @group Plugins
+ */
+ public function testAuthenticateFailureUserLoginTokenAuthMissmatch2()
+ {
+ $user = $this->_setUpUser();
+
+ // not equal
+ $rc = $this->authenticate($login = 0, $user['tokenAuth']);
+ $this->assertFailedLogin($rc);
+ }
+
+ /**
+ * @group Plugins
+ */
+ public function testAuthenticateFailureUserLoginTokenAuthMissmatch3()
+ {
+ $user = $this->_setUpUser();
+
+ // not equal
+ $rc = $this->authenticate($user['login'], $authToken = 0);
+ $this->assertFailedLogin($rc);
+ }
+
+ /**
+ * @group Plugins
+ */
+ public function testAuthenticateFailureUserWithSuperUserAccessLoginTokenAuthMissmatch()
+ {
+ $user = $this->_setUpUser();
+ $this->_setUpSuperUserAccessViaDb();
+
+ // not equal
+ $rc = $this->authenticate($login = null, $authToken = $user['password']);
+ $this->assertFailedLogin($rc);
+ }
+
+ /**
+ * @group Plugins
+ */
+ public function testAuthenticateSuccessUserTokenAuth()
+ {
+ $user = $this->_setUpUser();
+
+ // API authentication
+ $rc = $this->authenticate($login = null, $user['tokenAuth']);
+ $this->assertUserLogin($rc);
+ }
+
+ /**
+ * @group Plugins
+ */
+ public function testAuthenticateSuccessUserWithSuperUserAccessByTokenAuth()
+ {
+ $user = $this->_setUpUser();
+ $this->_setUpSuperUserAccessViaDb();
+
+ // API authentication
+ $rc = $this->authenticate($login = null, $user['tokenAuth']);
+ $this->assertSuperUserLogin($rc, 'user');
+ }
+
+ /**
+ * @group Plugins
+ */
+ public function testAuthenticateSuccessUserLoginAndTokenAuth()
+ {
+ $user = $this->_setUpUser();
+
+ // valid login & token auth
+ $rc = $this->authenticate($user['login'], $user['tokenAuth']);
+ $this->assertUserLogin($rc);
+ }
+
+ /**
+ * @group Plugins
+ */
+ public function testAuthenticateSuccessUserWithSuperUserAccessLoginAndTokenAuth()
+ {
+ $user = $this->_setUpUser();
+ $this->_setUpSuperUserAccessViaDb();
+
+ // valid login & token auth
+ $rc = $this->authenticate($user['login'], $user['tokenAuth']);
+ $this->assertSuperUserLogin($rc, 'user');
+ }
+
+ /**
+ * @group Plugins
+ */
+ public function testAuthenticateSuccessLoginAndHashedTokenAuth()
+ {
+ $user = $this->_setUpUser();
+ $hash = \Piwik\Plugins\Login\SessionInitializer::getHashTokenAuth($user['login'], $user['tokenAuth']);
+
+ // valid login & hashed token auth
+ $rc = $this->authenticate($user['login'], $tokenAuth = $hash);
+ $this->assertUserLogin($rc);
+ }
+
+ protected function _setUpUser()
+ {
+ $user = array('login' => 'user',
+ 'password' => 'geqgeagae',
+ 'email' => 'test@test.com',
+ 'alias' => 'alias',
+ 'superuser_access' => 0);
+
+ API::getInstance()->addUser($user['login'], $user['password'], $user['email'], $user['alias']);
+
+ $user['tokenAuth'] = API::getInstance()->getTokenAuth($user['login'], md5($user['password']));
+
+ return $user;
+ }
+
+ private function _setUpSuperUserAccessViaDb()
+ {
+ API::getInstance()->setSuperUserAccess('user', true);
+ }
+
+ private function authenticate($login, $tokenAuth)
+ {
+ $this->auth->setLogin($login);
+ $this->auth->setTokenAuth($tokenAuth);
+
+ return $this->auth->authenticate();
+ }
+
+ private function assertFailedLogin(AuthResult $authResult)
+ {
+ $this->assertEquals(AuthResult::FAILURE, $authResult->getCode());
+ }
+
+ private function assertSuperUserLogin(AuthResult $authResult, $login = 'superUserLogin', $tokenLength = 32)
+ {
+ $this->assertEquals(AuthResult::SUCCESS_SUPERUSER_AUTH_CODE, $authResult->getCode());
+ $this->assertEquals($login, $authResult->getIdentity());
+ $this->assertEquals($tokenLength, strlen($authResult->getTokenAuth()));
+ }
+
+ private function assertUserLogin(AuthResult $authResult, $login = 'user', $tokenLength = 32)
+ {
+ $this->assertEquals(AuthResult::SUCCESS, $authResult->getCode());
+ $this->assertEquals($login, $authResult->getIdentity());
+ $this->assertEquals($tokenLength, strlen($authResult->getTokenAuth()));
+ }
+
+}
diff --git a/plugins/MobileMessaging/tests/Integration/MobileMessagingTest.php b/plugins/MobileMessaging/tests/Integration/MobileMessagingTest.php
new file mode 100644
index 0000000000..f387534bf3
--- /dev/null
+++ b/plugins/MobileMessaging/tests/Integration/MobileMessagingTest.php
@@ -0,0 +1,262 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+namespace Piwik\Plugins\MobileMessaging\tests\Integration;
+
+use Piwik\Access;
+use Piwik\Plugins\MobileMessaging\API as APIMobileMessaging;
+use Piwik\Plugins\MobileMessaging\MobileMessaging;
+use Piwik\Plugins\MobileMessaging\SMSProvider;
+use Piwik\Plugins\ScheduledReports\API as APIScheduledReports;
+use Piwik\Plugins\SitesManager\API as APISitesManager;
+use Piwik\Tests\Impl\IntegrationTestCase;
+use FakeAccess;
+
+/**
+ * Class Plugins_MobileMessagingTest
+ *
+ * @group Plugins
+ */
+class MobileMessagingTest extends IntegrationTestCase
+{
+ protected $idSiteAccess;
+
+ public function setUp()
+ {
+ parent::setUp();
+
+ // setup the access layer
+ $pseudoMockAccess = new FakeAccess;
+ FakeAccess::$superUser = true;
+ //finally we set the user as a Super User by default
+ Access::setSingletonInstance($pseudoMockAccess);
+
+ $this->idSiteAccess = APISitesManager::getInstance()->addSite("test", "http://test");
+
+ \Piwik\Plugin\Manager::getInstance()->loadPlugins(array('ScheduledReports', 'MobileMessaging', 'MultiSites'));
+ \Piwik\Plugin\Manager::getInstance()->installLoadedPlugins();
+ }
+
+ /**
+ * When the MultiSites plugin is not activated, the SMS content should invite the user to activate it back
+ *
+ * @group Plugins
+ */
+ public function testWarnUserViaSMSMultiSitesDeactivated()
+ {
+ // safety net
+ \Piwik\Plugin\Manager::getInstance()->loadPlugins(array('ScheduledReports', 'MobileMessaging'));
+ $this->assertFalse(\Piwik\Plugin\Manager::getInstance()->isPluginActivated('MultiSites'));
+
+ $APIScheduledReports = APIScheduledReports::getInstance();
+ $reportId = $APIScheduledReports->addReport(
+ $this->idSiteAccess,
+ 'description',
+ 'month',
+ 0,
+ 'mobile',
+ 'sms',
+ array(),
+ array("phoneNumbers" => array('33698896656'))
+ );
+
+ list($outputFilename, $prettyDate, $websiteName, $additionalFiles) =
+ $APIScheduledReports->generateReport(
+ $reportId,
+ '01-01-2010',
+ 'en',
+ 2
+ );
+
+ $handle = fopen($outputFilename, "r");
+ $contents = fread($handle, filesize($outputFilename));
+ fclose($handle);
+
+ $this->assertEquals(
+ \Piwik\Piwik::translate('MobileMessaging_MultiSites_Must_Be_Activated'),
+ $contents
+ );
+ }
+
+ /**
+ * Dataprovider for testTruncate
+ */
+ public function getTruncateTestCases()
+ {
+
+ $stdGSMx459 = str_repeat('a', 459);
+
+ $extGSMx229 = str_repeat('€', 229);
+
+ $alternatedGSMx153 = str_repeat('a€', 153);
+
+ $GSMWithRegExpSpecialChars = $stdGSMx459 . '[\^$.|?*/+()';
+
+ $UCS2x201 = str_repeat('控', 201);
+
+ // appended strings
+ $stdGSMAppendedString = 'too long';
+ $extGSMAppendedString = '[too long]';
+ $UCS2AppendedString = '[控控]';
+
+ return array(
+
+ // maximum number of standard GSM characters
+ array($stdGSMx459, $stdGSMx459, 3, 'N/A'),
+
+ // maximum number of extended GSM characters
+ array($extGSMx229, $extGSMx229, 3, 'N/A'),
+
+ // maximum number of alternated GSM characters
+ array($alternatedGSMx153, $alternatedGSMx153, 3, 'N/A'),
+
+ // standard GSM, one 'a' too many, appended with standard GSM characters
+ array(str_repeat('a', 451) . $stdGSMAppendedString, $stdGSMx459 . 'a', 3, $stdGSMAppendedString),
+
+ // standard GSM, one 'a' too many, appended with extended GSM characters
+ array(str_repeat('a', 447) . $extGSMAppendedString, $stdGSMx459 . 'a', 3, $extGSMAppendedString),
+
+ // standard GSM, one 'a' too many, appended with UCS2 characters
+ array(str_repeat('a', 197) . $UCS2AppendedString, $stdGSMx459 . 'a', 3, $UCS2AppendedString),
+
+ // extended GSM, one '€' too many, appended with standard GSM characters
+ array(str_repeat('€', 225) . $stdGSMAppendedString, $extGSMx229 . '€', 3, $stdGSMAppendedString),
+
+ // extended GSM, one '€' too many, appended with extended GSM characters
+ array(str_repeat('€', 223) . $extGSMAppendedString, $extGSMx229 . '€', 3, $extGSMAppendedString),
+
+ // extended GSM, one '€' too many, appended with UCS2 characters
+ array(str_repeat('€', 197) . $UCS2AppendedString, $extGSMx229 . '€', 3, $UCS2AppendedString),
+
+ // alternated GSM, one 'a' too many, appended with standard GSM characters
+ array(str_repeat('a€', 150) . 'a' . $stdGSMAppendedString, $alternatedGSMx153 . 'a', 3, $stdGSMAppendedString),
+
+ // alternated GSM, one 'a' too many, appended with extended GSM characters
+ array(str_repeat('a€', 149) . $extGSMAppendedString, $alternatedGSMx153 . 'a', 3, $extGSMAppendedString),
+
+ // alternated GSM, one 'a' too many, appended with UCS2 characters
+ array(str_repeat('a€', 98) . 'a' . $UCS2AppendedString, $alternatedGSMx153 . 'a', 3, $UCS2AppendedString),
+
+ // alternated GSM, one '€' too many, appended with standard GSM characters
+ array(str_repeat('a€', 150) . 'a' . $stdGSMAppendedString, $alternatedGSMx153 . '€', 3, $stdGSMAppendedString),
+
+ // alternated GSM, one '€' too many, appended with extended GSM characters
+ array(str_repeat('a€', 149) . $extGSMAppendedString, $alternatedGSMx153 . '€', 3, $extGSMAppendedString),
+
+ // alternated GSM, one '€' too many, appended with UCS2 characters
+ array(str_repeat('a€', 98) . 'a' . $UCS2AppendedString, $alternatedGSMx153 . '€', 3, $UCS2AppendedString),
+
+ // GSM with RegExp reserved special chars
+ array(str_repeat('a', 451) . $stdGSMAppendedString, $GSMWithRegExpSpecialChars, 3, $stdGSMAppendedString),
+
+ // maximum number of UCS-2 characters
+ array($UCS2x201, $UCS2x201, 3, 'N/A'),
+
+ // UCS-2, one '控' too many, appended with UCS2 characters
+ array(str_repeat('控', 197) . $UCS2AppendedString, $UCS2x201 . '控', 3, $UCS2AppendedString),
+
+ // UCS-2, one '控' too many, appended with standard GSM characters
+ array(str_repeat('控', 193) . $stdGSMAppendedString, $UCS2x201 . '控', 3, $stdGSMAppendedString)
+ );
+ }
+
+ /**
+ * @group Plugins
+ *
+ * @dataProvider getTruncateTestCases
+ */
+ public function testTruncate($expected, $stringToTruncate, $maximumNumberOfConcatenatedSMS, $appendedString)
+ {
+ $this->assertEquals(
+ $expected,
+ SMSProvider::truncate($stringToTruncate, $maximumNumberOfConcatenatedSMS, $appendedString)
+ );
+ }
+
+ /**
+ * Dataprovider for testContainsUCS2Characters
+ */
+ public function getContainsUCS2CharactersTestCases()
+ {
+ return array(
+ array(false, 'too long'),
+ array(false, '[too long]'),
+ array(false, '€'),
+ array(true, '[控控]'),
+ );
+ }
+
+ /**
+ * @group Plugins
+ *
+ * @dataProvider getContainsUCS2CharactersTestCases
+ */
+ public function testContainsUCS2Characters($expected, $stringToTest)
+ {
+ $this->assertEquals(
+ $expected,
+ SMSProvider::containsUCS2Characters($stringToTest)
+ );
+ }
+
+ /**
+ * @group Plugins
+ */
+ public function testSanitizePhoneNumber()
+ {
+ $this->assertEquals('676932647', APIMobileMessaging::sanitizePhoneNumber(' 6 76 93 26 47'));
+ }
+
+ /**
+ * @group Plugins
+ */
+ public function testPhoneNumberIsSanitized()
+ {
+ $mobileMessagingAPI = APIMobileMessaging::getInstance();
+ $mobileMessagingAPI->setSMSAPICredential('StubbedProvider', '');
+ $mobileMessagingAPI->addPhoneNumber(' 6 76 93 26 47');
+ $this->assertEquals('676932647', key($mobileMessagingAPI->getPhoneNumbers()));
+ }
+
+ /**
+ * Dataprovider for testSendReport
+ */
+ public function getSendReportTestCases()
+ {
+ return array(
+ array('reportContent', '0101010101', 'Piwik.org', 'reportContent', '0101010101', 'Piwik.org'),
+ array('reportContent', '0101010101', 'General_Reports', 'reportContent', '0101010101', 'General_MultiSitesSummary'),
+ );
+ }
+
+ /**
+ * @group Plugins
+ *
+ * @dataProvider getSendReportTestCases
+ */
+ public function testSendReport($expectedReportContent, $expectedPhoneNumber, $expectedFrom, $reportContent, $phoneNumber, $reportSubject)
+ {
+ $report = array(
+ 'parameters' => array(MobileMessaging::PHONE_NUMBERS_PARAMETER => array($phoneNumber)),
+ );
+
+ $stubbedAPIMobileMessaging = $this->getMock('\\Piwik\\Plugins\\MobileMessaging\\API', array('sendSMS', 'getInstance'), $arguments = array(), $mockClassName = '', $callOriginalConstructor = false);
+ $stubbedAPIMobileMessaging->expects($this->once())->method('sendSMS')->with(
+ $this->equalTo($expectedReportContent, 0),
+ $this->equalTo($expectedPhoneNumber, 1),
+ $this->equalTo($expectedFrom, 2)
+ );
+
+ \Piwik\Plugins\MobileMessaging\API::setSingletonInstance($stubbedAPIMobileMessaging);
+
+ $mobileMessaging = new MobileMessaging();
+ $mobileMessaging->sendReport(MobileMessaging::MOBILE_TYPE, $report, $reportContent, null, null, $reportSubject, null, null, null, false);
+
+ \Piwik\Plugins\MobileMessaging\API::unsetInstance();
+ }
+}
diff --git a/plugins/MultiSites/tests/Integration/MultiSitesTest.php b/plugins/MultiSites/tests/Integration/MultiSitesTest.php
new file mode 100644
index 0000000000..a5f372b7a5
--- /dev/null
+++ b/plugins/MultiSites/tests/Integration/MultiSitesTest.php
@@ -0,0 +1,52 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+namespace Piwik\Plugins\MultiSites\tests\Integration;
+
+use Piwik\Access;
+use Piwik\Plugins\MultiSites\API as APIMultiSites;
+use Piwik\Plugins\SitesManager\API as APISitesManager;
+use Piwik\Tests\Impl\IntegrationTestCase;
+
+/**
+ * Class Plugins_MultiSitesTest
+ *
+ * @group Plugins
+ */
+class MultiSitesTest extends IntegrationTestCase
+{
+ protected $idSiteAccess;
+
+ public function setUp()
+ {
+ parent::setUp();
+
+ $access = Access::getInstance();
+ $access->setSuperUserAccess(true);
+
+ $this->idSiteAccess = APISitesManager::getInstance()->addSite("test", "http://test");
+
+ \Piwik\Plugin\Manager::getInstance()->loadPlugins(array('MultiSites', 'VisitsSummary', 'Actions'));
+ \Piwik\Plugin\Manager::getInstance()->installLoadedPlugins();
+ }
+
+ /**
+ * Testing that getOne returns a row even when there are no data
+ * This is necessary otherwise ResponseBuilder throws 'Call to a member function getColumns() on a non-object'
+ *
+ * @group Plugins
+ */
+ public function testWhenNoDataGetOneReturnsRow()
+ {
+ $dataTable = APIMultiSites::getInstance()->getOne($this->idSiteAccess, 'month', '01-01-2010');
+ $this->assertEquals(1, $dataTable->getRowsCount());
+
+ // safety net
+ $this->assertEquals(0, $dataTable->getFirstRow()->getColumn('nb_visits'));
+ }
+}
diff --git a/plugins/PrivacyManager/tests/Integration/PrivacyManagerConfigTest.php b/plugins/PrivacyManager/tests/Integration/PrivacyManagerConfigTest.php
new file mode 100644
index 0000000000..07092248fe
--- /dev/null
+++ b/plugins/PrivacyManager/tests/Integration/PrivacyManagerConfigTest.php
@@ -0,0 +1,102 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+namespace Piwik\Plugins\PrivacyManager\tests;
+
+use Piwik\Option;
+use Piwik\Plugins\PrivacyManager\Config as PrivacyManagerConfig;
+use Piwik\Tests\Impl\IntegrationTestCase;
+
+/**
+ * Class Plugins_SitesManagerTest
+ *
+ * @group Plugins
+ */
+class PrivacyManagerConfigTest extends IntegrationTestCase
+{
+ /**
+ * @var PrivacyManagerConfig
+ */
+ private $config;
+
+ public function setUp()
+ {
+ parent::setUp();
+
+ $this->config = new PrivacyManagerConfig();
+ }
+
+ public function test_useAnonymizedIpForVisitEnrichment()
+ {
+ $this->assertTrue($this->config->useAnonymizedIpForVisitEnrichment);
+
+ $this->config->useAnonymizedIpForVisitEnrichment = false;
+
+ $this->assertFalse($this->config->useAnonymizedIpForVisitEnrichment);
+
+ $this->config->useAnonymizedIpForVisitEnrichment = true;
+
+ $this->assertTrue($this->config->useAnonymizedIpForVisitEnrichment);
+ }
+
+ public function test_doNotTrackEnabled()
+ {
+ $this->assertTrue($this->config->doNotTrackEnabled);
+
+ $this->config->doNotTrackEnabled = true;
+
+ $this->assertTrue($this->config->doNotTrackEnabled);
+
+ $this->config->doNotTrackEnabled = false;
+
+ $this->assertFalse($this->config->doNotTrackEnabled);
+ }
+
+ public function test_ipAnonymizerEnabled()
+ {
+ $this->assertFalse($this->config->ipAnonymizerEnabled);
+
+ $this->config->ipAnonymizerEnabled = true;
+
+ $this->assertTrue($this->config->ipAnonymizerEnabled);
+ }
+
+ public function test_ipAddressMaskLength()
+ {
+ $this->assertSame(1, $this->config->ipAddressMaskLength);
+
+ $this->config->ipAddressMaskLength = '19';
+
+ $this->assertSame(19, $this->config->ipAddressMaskLength);
+ }
+
+ public function test_setTrackerCacheContent()
+ {
+ $content = $this->config->setTrackerCacheGeneral(array('existingEntry' => 'test'));
+
+ $expected = array(
+ 'existingEntry' => 'test',
+ 'PrivacyManager.ipAddressMaskLength' => 1,
+ 'PrivacyManager.ipAnonymizerEnabled' => false,
+ 'PrivacyManager.doNotTrackEnabled' => true,
+ 'PrivacyManager.useAnonymizedIpForVisitEnrichment' => true,
+ );
+
+ $this->assertEquals($expected, $content);
+ }
+
+ public function test_setTrackerCacheContent_ShouldGetValuesFromConfig()
+ {
+ Option::set('PrivacyManager.ipAddressMaskLength', '232');
+
+ $content = $this->config->setTrackerCacheGeneral(array('existingEntry' => 'test'));
+
+ $this->assertEquals(232, $content['PrivacyManager.ipAddressMaskLength']);
+ }
+
+}
diff --git a/plugins/PrivacyManager/tests/Integration/PrivacyManagerTest.php b/plugins/PrivacyManager/tests/Integration/PrivacyManagerTest.php
new file mode 100644
index 0000000000..50fce5f0a7
--- /dev/null
+++ b/plugins/PrivacyManager/tests/Integration/PrivacyManagerTest.php
@@ -0,0 +1,86 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+namespace Piwik\Plugins\PrivacyManager\tests;
+
+use Piwik\Plugins\PrivacyManager\PrivacyManager;
+use Piwik\Tests\Impl\IntegrationTestCase;
+
+/**
+ * Class Plugins_SitesManagerTest
+ *
+ * @group Plugins
+ */
+class PrivacyManagerTest extends IntegrationTestCase
+{
+ /**
+ * @var PrivacyManager
+ */
+ private $manager;
+
+ public function setUp()
+ {
+ parent::setUp();
+
+ $this->manager = new PrivacyManager();
+ \Piwik\Option::set('delete_logs_enable', 1);
+ \Piwik\Option::set('delete_logs_older_than', 270);
+ \Piwik\Option::set('delete_reports_keep_week_reports', 1);
+ }
+
+ public function test_getPurgeDataSettings_shouldUseOnlyConfigValuesIfUIisDisabled()
+ {
+ $this->setUIEnabled(false);
+
+ $settings = $this->manager->getPurgeDataSettings();
+ $expected = $this->getDefaultPurgeSettings();
+
+ $this->assertEquals($expected, $settings);
+ }
+
+ public function test_getPurgeDataSettings_shouldAlsoUseOptionValuesIfUIisEnabled()
+ {
+ $this->setUIEnabled(true);
+
+ $settings = $this->manager->getPurgeDataSettings();
+ $expected = $this->getDefaultPurgeSettings();
+
+ $expected['delete_logs_enable'] = 1;
+ $expected['delete_logs_older_than'] = 270;
+ $expected['delete_reports_keep_week_reports'] = 1;
+
+ $this->assertEquals($expected, $settings);
+ }
+
+ private function setUIEnabled($enabled)
+ {
+ \Piwik\Config::getInstance()->General['enable_delete_old_data_settings_admin'] = $enabled;
+ }
+
+ private function getDefaultPurgeSettings()
+ {
+ $expected = array(
+ 'delete_logs_enable' => 0,
+ 'delete_logs_schedule_lowest_interval' => 7,
+ 'delete_logs_older_than' => 180,
+ 'delete_logs_max_rows_per_query' => 100000,
+ 'enable_auto_database_size_estimate' => 1,
+ 'delete_reports_enable' => 0,
+ 'delete_reports_older_than' => 12,
+ 'delete_reports_keep_basic_metrics' => 1,
+ 'delete_reports_keep_day_reports' => 0,
+ 'delete_reports_keep_week_reports' => 0,
+ 'delete_reports_keep_month_reports' => 1,
+ 'delete_reports_keep_year_reports' => 1,
+ 'delete_reports_keep_range_reports' => 0,
+ 'delete_reports_keep_segment_reports' => 0,
+ );
+ return $expected;
+ }
+
+}
diff --git a/plugins/PrivacyManager/tests/Unit/AnonymizeIPTest.php b/plugins/PrivacyManager/tests/Unit/AnonymizeIPTest.php
new file mode 100644
index 0000000000..0ed4e6e4ca
--- /dev/null
+++ b/plugins/PrivacyManager/tests/Unit/AnonymizeIPTest.php
@@ -0,0 +1,92 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+namespace Piwik\Plugins\PrivacyManager\tests;
+
+use Piwik\IP;
+use Piwik\Plugins\PrivacyManager\IPAnonymizer;
+
+require_once PIWIK_INCLUDE_PATH . '/plugins/PrivacyManager/IPAnonymizer.php';
+
+class AnonymizeIPTest extends \PHPUnit_Framework_TestCase
+{
+ // IPv4 addresses and expected results
+ public function getipv4Addresses()
+ {
+ return array(
+ // ip, array( expected0, expected1, expected2, expected3, expected4 ),
+ array('0.0.0.0', array("\x00\x00\x00\x00", "\x00\x00\x00\x00", "\x00\x00\x00\x00", "\x00\x00\x00\x00", "\x00\x00\x00\x00")),
+ array('0.0.0.1', array("\x00\x00\x00\x01", "\x00\x00\x00\x00", "\x00\x00\x00\x00", "\x00\x00\x00\x00", "\x00\x00\x00\x00")),
+ array('0.0.0.255', array("\x00\x00\x00\xff", "\x00\x00\x00\x00", "\x00\x00\x00\x00", "\x00\x00\x00\x00", "\x00\x00\x00\x00")),
+ array('0.0.1.0', array("\x00\x00\x01\x00", "\x00\x00\x01\x00", "\x00\x00\x00\x00", "\x00\x00\x00\x00", "\x00\x00\x00\x00")),
+ array('0.0.1.1', array("\x00\x00\x01\x01", "\x00\x00\x01\x00", "\x00\x00\x00\x00", "\x00\x00\x00\x00", "\x00\x00\x00\x00")),
+ array('0.0.255.255', array("\x00\x00\xff\xff", "\x00\x00\xff\x00", "\x00\x00\x00\x00", "\x00\x00\x00\x00", "\x00\x00\x00\x00")),
+ array('0.1.0.0', array("\x00\x01\x00\x00", "\x00\x01\x00\x00", "\x00\x01\x00\x00", "\x00\x00\x00\x00", "\x00\x00\x00\x00")),
+ array('0.1.1.1', array("\x00\x01\x01\x01", "\x00\x01\x01\x00", "\x00\x01\x00\x00", "\x00\x00\x00\x00", "\x00\x00\x00\x00")),
+ array('0.255.255.255', array("\x00\xff\xff\xff", "\x00\xff\xff\x00", "\x00\xff\x00\x00", "\x00\x00\x00\x00", "\x00\x00\x00\x00")),
+ array('1.0.0.0', array("\x01\x00\x00\x00", "\x01\x00\x00\x00", "\x01\x00\x00\x00", "\x01\x00\x00\x00", "\x00\x00\x00\x00")),
+ array('127.255.255.255', array("\x7f\xff\xff\xff", "\x7f\xff\xff\x00", "\x7f\xff\x00\x00", "\x7f\x00\x00\x00", "\x00\x00\x00\x00")),
+ array('128.0.0.0', array("\x80\x00\x00\x00", "\x80\x00\x00\x00", "\x80\x00\x00\x00", "\x80\x00\x00\x00", "\x00\x00\x00\x00")),
+ array('255.255.255.255', array("\xff\xff\xff\xff", "\xff\xff\xff\x00", "\xff\xff\x00\x00", "\xff\x00\x00\x00", "\x00\x00\x00\x00")),
+ );
+ }
+
+ public function getipv6Addresses()
+ {
+ return array(
+ array('2001:db8:0:8d3:0:8a2e:70:7344', array(
+ "\x20\x01\x0d\xb8\x00\x00\x08\xd3\x00\x00\x8a\x2e\x00\x70\x73\x44",
+ "\x20\x01\x0d\xb8\x00\x00\x08\xd3\x00\x00\x00\x00\x00\x00\x00\x00", // mask 64 bits
+ "\x20\x01\x0d\xb8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // mask 80 bits
+ "\x20\x01\x0d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" // mask 104 bits
+ )),
+ array('2001:6f8:900:724::2', array(
+ "\x20\x01\x06\xf8\x09\x00\x07\x24\x00\x00\x00\x00\x00\x00\x00\x02",
+ "\x20\x01\x06\xf8\x09\x00\x07\x24\x00\x00\x00\x00\x00\x00\x00\x00",
+ "\x20\x01\x06\xf8\x09\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00",
+ "\x20\x01\x06\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00",
+ ))
+ );
+ }
+
+ /**
+ * @dataProvider getipv4Addresses
+ * @group Plugins
+ */
+ public function testApplyIPMask($ip, $expected)
+ {
+ // each IP is tested with 0 to 4 octets masked
+ for ($maskLength = 0; $maskLength <= 4; $maskLength++) {
+ $res = IPAnonymizer::applyIPMask(IP::P2N($ip), $maskLength);
+ $this->assertEquals($expected[$maskLength], $res, "Got " . bin2hex($res) . ", Expected " . bin2hex($expected[$maskLength]));
+ }
+
+ // edge case (bounds check)
+ $this->assertEquals("\x00\x00\x00\x00", IPAnonymizer::applyIPMask(IP::P2N($ip), 5));
+
+ // mask IPv4 mapped addresses
+ for ($maskLength = 0; $maskLength <= 4; $maskLength++) {
+ $res = IPAnonymizer::applyIPMask(IP::P2N('::ffff:' . $ip), $maskLength);
+ $this->assertEquals($res, "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff" . $expected[$maskLength], "Got " . bin2hex($res) . ", Expected " . bin2hex($expected[$maskLength]));
+ }
+ $this->assertEquals("\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\x00\x00\x00\x00\x00", IPAnonymizer::applyIPMask(IP::P2N('::ffff:' . $ip), 5));
+ }
+
+ /**
+ * @dataProvider getipv6Addresses
+ * @group Plugins
+ */
+ public function testApplyIPMask6($ip, $expected)
+ {
+ // each IP is tested with 0 to 4 octets masked
+ for ($maskLength = 0; $maskLength < 4; $maskLength++) {
+ $res = IPAnonymizer::applyIPMask(IP::P2N($ip), $maskLength);
+ $this->assertEquals($expected[$maskLength], $res, "Got " . bin2hex($res) . ", Expected " . bin2hex($expected[$maskLength]) . ", Mask Level " . $maskLength);
+ }
+ }
+} \ No newline at end of file
diff --git a/plugins/Proxy/tests/Unit/ProxyTest.php b/plugins/Proxy/tests/Unit/ProxyTest.php
new file mode 100644
index 0000000000..fa0175d040
--- /dev/null
+++ b/plugins/Proxy/tests/Unit/ProxyTest.php
@@ -0,0 +1,48 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+namespace Piwik\Plugins\Proxy\tests\Unit;
+
+use Piwik\Plugins\Proxy\Controller;
+
+/**
+ * @group Proxy
+ * @group ProxyTest
+ * @group Plugins
+ */
+class ProxyTest extends \PHPUnit_Framework_TestCase
+{
+ public function getAcceptableRemoteUrls()
+ {
+ return array(
+ // piwik white list (and used in homepage)
+ array('http://piwik.org/', true),
+
+ array('http://piwik.org', true),
+ array('http://qa.piwik.org/', true),
+ array('http://forum.piwik.org/', true),
+ array('http://dev.piwik.org/', true),
+ array('http://demo.piwik.org/', true),
+
+ // not in the piwik white list
+ array('http://www.piwik.org/', false),
+ array('https://piwik.org/', false),
+ array('http://example.org/', false),
+ );
+ }
+
+ /**
+ * @dataProvider getAcceptableRemoteUrls
+ * @group Plugins
+ */
+ public function testIsAcceptableRemoteUrl($url, $expected)
+ {
+ $this->assertEquals($expected, Controller::isPiwikUrl($url));
+ }
+}
+
diff --git a/plugins/Referrers/tests/Unit/ReferrersTest.php b/plugins/Referrers/tests/Unit/ReferrersTest.php
new file mode 100644
index 0000000000..909e6bf65e
--- /dev/null
+++ b/plugins/Referrers/tests/Unit/ReferrersTest.php
@@ -0,0 +1,246 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+namespace Piwik\Plugins\Referrers\tests;
+
+use Piwik\DataTable;
+use Piwik\DataTable\Row;
+use Piwik\Period;
+
+require_once PIWIK_INCLUDE_PATH . '/plugins/Referrers/Referrers.php';
+
+class ReferrersTest extends \PHPUnit_Framework_TestCase
+{
+ /**
+ * Dataprovider serving all search engine data
+ */
+ public function getSearchEngines()
+ {
+ include PIWIK_PATH_TEST_TO_ROOT . '/core/DataFiles/SearchEngines.php';
+
+ $searchEngines = array();
+ foreach ($GLOBALS['Piwik_SearchEngines'] as $url => $searchEngine) {
+ $searchEngines[] = array($url, $searchEngine);
+ }
+ return $searchEngines;
+ }
+
+ /**
+ * search engine has at least one keyword
+ *
+ * @group Plugins
+ *
+ * @dataProvider getSearchEngines
+ */
+ public function testMissingSearchEngineKeyword($url, $searchEngine)
+ {
+ // Get list of search engines and first appearing URL
+ static $searchEngines = array();
+
+ $name = parse_url('http://' . $url);
+ if (!array_key_exists($searchEngine[0], $searchEngines)) {
+ $searchEngines[$searchEngine[0]] = $url;
+
+ $this->assertTrue(!empty($searchEngine[1]), $name['host']);
+ }
+ }
+
+ /**
+ * search engine is defined in DataFiles/SearchEngines.php but there's no favicon
+ *
+ * @group Plugins
+ *
+ * @dataProvider getSearchEngines
+ */
+ public function testMissingSearchEngineIcons($url, $searchEngine)
+ {
+ // Get list of existing favicons
+ $favicons = scandir(PIWIK_PATH_TEST_TO_ROOT . '/plugins/Referrers/images/searchEngines/');
+
+ // Get list of search engines and first appearing URL
+ static $searchEngines = array();
+
+ $name = parse_url('http://' . $url);
+ if (!array_key_exists($searchEngine[0], $searchEngines)) {
+ $searchEngines[$searchEngine[0]] = $url;
+
+ $this->assertTrue(in_array($name['host'] . '.png', $favicons), $name['host']);
+ }
+ }
+
+ /**
+ * favicon exists but there's no corresponding search engine defined in DataFiles/SearchEngines.php
+ *
+ * @group Plugins
+ */
+ public function testObsoleteSearchEngineIcons()
+ {
+ include PIWIK_PATH_TEST_TO_ROOT . '/core/DataFiles/SearchEngines.php';
+
+ // Get list of search engines and first appearing URL
+ $searchEngines = array();
+ foreach ($GLOBALS['Piwik_SearchEngines'] as $url => $searchEngine) {
+ $name = parse_url('http://' . $url);
+ if (!array_key_exists($name['host'], $searchEngines)) {
+ $searchEngines[$name['host']] = true;
+ }
+ }
+
+ // Get list of existing favicons
+ $favicons = scandir(PIWIK_PATH_TEST_TO_ROOT . '/plugins/Referrers/images/searchEngines/');
+ foreach ($favicons as $name) {
+ if ($name[0] == '.' || strpos($name, 'xx.') === 0) {
+ continue;
+ }
+
+ $host = substr($name, 0, -4);
+ $this->assertTrue(array_key_exists($host, $searchEngines), $host);
+ }
+ }
+
+ /**
+ * get search engine host from url
+ *
+ * @group Plugins
+ */
+ public function testGetSearchEngineHostFromUrl()
+ {
+ $data = array(
+ 'http://www.google.com/cse' => array('www.google.com', 'www.google.com/cse'),
+ 'http://www.google.com' => array('www.google.com', 'www.google.com'),
+ );
+
+ foreach ($data as $url => $expected) {
+ $this->assertEquals($expected[0], \Piwik\Plugins\Referrers\getSearchEngineHostFromUrl($url));
+ $this->assertEquals($expected[1], \Piwik\Plugins\Referrers\getSearchEngineHostPathFromUrl($url));
+ }
+ }
+
+ /**
+ * Dataprovider for testGetSearchEngineUrlFromUrlAndKeyword
+ */
+ public function getSearchEngineUrlFromUrlAndKeywordTestData()
+ {
+ return array(
+ array('http://apollo.lv/portal/search/', 'piwik', 'http://apollo.lv/portal/search/?cof=FORID%3A11&q=piwik&search_where=www'),
+ array('http://bing.com/images/search', 'piwik', 'http://bing.com/images/search/?q=piwik'),
+ array('http://google.com', 'piwik', 'http://google.com/search?q=piwik'),
+ );
+ }
+
+ /**
+ * get search engine url from name and keyword
+ *
+ * @group Plugins
+ *
+ * @dataProvider getSearchEngineUrlFromUrlAndKeywordTestData
+ */
+ public function testGetSearchEngineUrlFromUrlAndKeyword($url, $keyword, $expected)
+ {
+ include PIWIK_PATH_TEST_TO_ROOT . '/core/DataFiles/SearchEngines.php';
+ $this->assertEquals($expected, \Piwik\Plugins\Referrers\getSearchEngineUrlFromUrlAndKeyword($url, $keyword));
+ }
+
+ /**
+ * Dataprovider for getSocialNetworkFromDomainTestData
+ */
+ public function getSocialNetworkFromDomainTestData()
+ {
+ return array(
+ array('http://www.facebook.com', 'Facebook'),
+ array('http://www.facebook.com/piwik', 'Facebook'),
+ array('http://m.facebook.com', 'Facebook'),
+ array('https://m.facebook.com', 'Facebook'),
+ array('m.facebook.com', 'Facebook'),
+ array('http://lastfm.com.tr', 'Last.fm'),
+ array('http://t.co/test', 'Twitter'),
+ array('http://xxt.co/test', \Piwik\Piwik::translate('General_Unknown')),
+ array('asdfasdfadsf.com', \Piwik\Piwik::translate('General_Unknown')),
+ array('http://xwayn.com', \Piwik\Piwik::translate('General_Unknown')),
+ array('http://live.com/test', \Piwik\Piwik::translate('General_Unknown')),
+ );
+ }
+
+ /**
+ * @group Plugins
+ *
+ * @dataProvider getSocialNetworkFromDomainTestData
+ */
+ public function testGetSocialNetworkFromDomain($url, $expected)
+ {
+ include PIWIK_INCLUDE_PATH . '/core/DataFiles/Socials.php';
+ $this->assertEquals($expected, \Piwik\Plugins\Referrers\getSocialNetworkFromDomain($url));
+ }
+
+ public function getSocialsLogoFromUrlTestData()
+ {
+ return array(
+ array('http://www.facebook.com', 'facebook.com.png'),
+ array('www.facebook.com', 'facebook.com.png',),
+ array('http://lastfm.com.tr', 'last.fm.png'),
+ array('http://asdfasdf.org/test', 'xx.png'),
+ array('http://www.google.com', 'xx.png'),
+ );
+ }
+
+ /**
+ * @group Plugins
+ *
+ * @dataProvider getSocialsLogoFromUrlTestData
+ */
+ public function testGetSocialsLogoFromUrl($url, $expected)
+ {
+ include PIWIK_INCLUDE_PATH . '/core/DataFiles/Socials.php';
+ $this->assertContains($expected, \Piwik\Plugins\Referrers\getSocialsLogoFromUrl($url));
+ }
+
+ public function isSocialUrlTestData()
+ {
+ return array(
+ array('http://www.facebook.com', 'Facebook', true),
+ array('http://www.facebook.com', 'Twitter', false),
+ array('http://m.facebook.com', false, true),
+ array('http://lastfm.com.tr', 'Last.fm', true),
+ array('http://asdfasdf.org/test', false, false),
+ array('http://asdfasdf.com/test', 'Facebook', false),
+ );
+ }
+
+ /**
+ * @group Plugins
+ *
+ * @dataProvider isSocialUrlTestData
+ */
+ public function testIsSocialUrl($url, $assumedSocial, $expected)
+ {
+ include PIWIK_INCLUDE_PATH . '/core/DataFiles/Socials.php';
+ $this->assertEquals($expected, \Piwik\Plugins\Referrers\isSocialUrl($url, $assumedSocial));
+ }
+
+ public function removeUrlProtocolTestData()
+ {
+ return array(
+ array('http://www.facebook.com', 'www.facebook.com'),
+ array('https://bla.fr', 'bla.fr'),
+ array('ftp://bla.fr', 'bla.fr'),
+ array('udp://bla.fr', 'bla.fr'),
+ array('bla.fr', 'bla.fr'),
+ array('ASDasdASDDasd', 'ASDasdASDDasd'),
+ );
+ }
+
+ /**
+ * @group Plugins
+ *
+ * @dataProvider removeUrlProtocolTestData
+ */
+ public function testRemoveUrlProtocol($url, $expected)
+ {
+ $this->assertEquals($expected, \Piwik\Plugins\Referrers\removeUrlProtocol($url));
+ }
+}
diff --git a/plugins/SEO/tests/Integration/SEOTest.php b/plugins/SEO/tests/Integration/SEOTest.php
new file mode 100644
index 0000000000..14f8666d61
--- /dev/null
+++ b/plugins/SEO/tests/Integration/SEOTest.php
@@ -0,0 +1,68 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+namespace Piwik\Plugins\SEO\tests\Integration;
+
+use Piwik\Access;
+use Piwik\DataTable\Renderer;
+use Piwik\Plugins\SEO\API;
+use FakeAccess;
+use Exception;
+
+/**
+ * @group SEO
+ * @group SEOTest
+ * @group Plugins
+ */
+class SEOTest extends \PHPUnit_Framework_TestCase
+{
+ public function setUp()
+ {
+ parent::setUp();
+
+ // setup the access layer
+ $pseudoMockAccess = new FakeAccess;
+ FakeAccess::setIdSitesView(array(1, 2));
+ FakeAccess::setIdSitesAdmin(array(3, 4));
+
+ //finally we set the user as a Super User by default
+ FakeAccess::$superUser = true;
+ Access::setSingletonInstance($pseudoMockAccess);
+
+ $user_agents = array(
+ 'Mozilla/6.0 (Macintosh; I; Intel Mac OS X 11_7_9; de-LI; rv:1.9b4) Gecko/2012010317 Firefox/10.0a4',
+ 'Mozilla/5.0 (compatible; MSIE 10.6; Windows NT 6.1; Trident/5.0; InfoPath.2; SLCC1; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET CLR 2.0.50727) 3gpp-gba UNTRUSTED/1.0',
+ 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/18.6.872.0 Safari/535.2 UNTRUSTED/1.0 3gpp-gba UNTRUSTED/1.0',
+ 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_8; de-at) AppleWebKit/533.21.1 (KHTML, like Gecko) Version/5.0.5 Safari/533.21.1',
+ );
+
+ $_SERVER['HTTP_USER_AGENT'] = $user_agents[mt_rand(0, count($user_agents) - 1)];
+ }
+
+ /**
+ * tell us when the API is broken
+ */
+ public function test_API()
+ {
+ try {
+ $dataTable = API::getInstance()->getRank('http://www.microsoft.com/');
+ } catch(Exception $e) {
+ $this->markTestSkipped('A SEO http request failed, Skipping this test for now. Error was: '.$e->getMessage());
+ }
+ $renderer = Renderer::factory('php');
+ $renderer->setSerialize(false);
+ $ranks = $renderer->render($dataTable);
+ foreach ($ranks as $rank) {
+ $message = $rank['id'] . ' expected non-zero rank, got [' . $rank['rank'] . ']';
+ if(empty($rank['rank'])) {
+ $this->markTestSkipped("Skipped to avoid random build failure: " . $message);
+ }
+ $this->assertNotEmpty($rank['rank'], $message);
+ }
+ }
+}
diff --git a/plugins/ScheduledReports/tests/Integration/ApiTest.php b/plugins/ScheduledReports/tests/Integration/ApiTest.php
new file mode 100644
index 0000000000..be13cb2b10
--- /dev/null
+++ b/plugins/ScheduledReports/tests/Integration/ApiTest.php
@@ -0,0 +1,514 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+namespace Piwik\Plugins\ScheduledReports\tests;
+
+use Piwik\Access;
+use Piwik\Plugins\MobileMessaging\API as APIMobileMessaging;
+use Piwik\Plugins\MobileMessaging\MobileMessaging;
+use Piwik\Plugins\ScheduledReports\API as APIScheduledReports;
+use Piwik\Plugins\ScheduledReports\Menu;
+use Piwik\Plugins\ScheduledReports\Tasks;
+use Piwik\Plugins\SitesManager\API as APISitesManager;
+use Piwik\ScheduledTask;
+use Piwik\ScheduledTime\Monthly;
+use Piwik\ScheduledTime;
+use Piwik\Site;
+use Piwik\Tests\Impl\IntegrationTestCase;
+use FakeAccess;
+use Exception;
+use ReflectionMethod;
+
+require_once PIWIK_INCLUDE_PATH . '/plugins/ScheduledReports/ScheduledReports.php';
+
+/**
+ * Class Plugins_ScheduledReportsTest
+ *
+ * @group Plugins
+ * @group ScheduledReportsTest
+ */
+class ApiTest extends IntegrationTestCase
+{
+ private $idSite = 1;
+
+ public function setUp()
+ {
+ parent::setUp();
+
+ // setup the access layer
+ self::setSuperUser();
+ \Piwik\Plugin\Manager::getInstance()->loadPlugins(array('API', 'UserCountry', 'ScheduledReports', 'MobileMessaging'));
+ \Piwik\Plugin\Manager::getInstance()->installLoadedPlugins();
+
+ APISitesManager::getInstance()->addSite("Test", array("http://piwik.net"));
+
+ APISitesManager::getInstance()->addSite("Test", array("http://piwik.net"));
+ FakeAccess::setIdSitesView(array($this->idSite, 2));
+ APIScheduledReports::$cache = array();
+ }
+
+ /**
+ * @group Plugins
+ */
+ public function testAddReportGetReports()
+ {
+ $data = array(
+ 'idsite' => $this->idSite,
+ 'description' => 'test description"',
+ 'type' => 'email',
+ 'period' => ScheduledTime::PERIOD_DAY,
+ 'hour' => '4',
+ 'format' => 'pdf',
+ 'reports' => array('UserCountry_getCountry'),
+ 'parameters' => array(
+ 'displayFormat' => '1',
+ 'emailMe' => true,
+ 'additionalEmails' => array('test@test.com', 't2@test.com'),
+ 'evolutionGraph' => true
+ )
+ );
+
+ $dataWebsiteTwo = $data;
+ $dataWebsiteTwo['idsite'] = 2;
+ $dataWebsiteTwo['period'] = ScheduledTime::PERIOD_MONTH;
+
+ self::addReport($dataWebsiteTwo);
+
+ // Testing getReports without parameters
+ $tmp = APIScheduledReports::getInstance()->getReports();
+ $report = reset($tmp);
+ $this->assertReportsEqual($report, $dataWebsiteTwo);
+
+ $idReport = self::addReport($data);
+
+ // Passing 3 parameters
+ $tmp = APIScheduledReports::getInstance()->getReports($this->idSite, $data['period'], $idReport);
+ $report = reset($tmp);
+ $this->assertReportsEqual($report, $data);
+
+ // Passing only idsite
+ $tmp = APIScheduledReports::getInstance()->getReports($this->idSite);
+ $report = reset($tmp);
+ $this->assertReportsEqual($report, $data);
+
+ // Passing only period
+ $tmp = APIScheduledReports::getInstance()->getReports($idSite = false, $data['period']);
+ $report = reset($tmp);
+ $this->assertReportsEqual($report, $data);
+
+ // Passing only idreport
+ $tmp = APIScheduledReports::getInstance()->getReports($idSite = false, $period = false, $idReport);
+ $report = reset($tmp);
+ $this->assertReportsEqual($report, $data);
+ }
+
+ /**
+ * @group Plugins
+ */
+ public function testGetReportsIdReportNotFound()
+ {
+ try {
+ APIScheduledReports::getInstance()->getReports($idSite = false, $period = false, $idReport = 1);
+ } catch (Exception $e) {
+ return;
+ }
+ $this->fail('Expected exception not raised');
+ }
+
+ /**
+ * @group Plugins
+ */
+ public function testGetReportsInvalidPermission()
+ {
+ try {
+ APIScheduledReports::getInstance()->getReports(
+ $idSite = 44,
+ $period = false,
+ self::addReport(self::getDailyPDFReportData($this->idSite))
+ );
+
+ } catch (Exception $e) {
+ return;
+ }
+ $this->fail('Expected exception not raised');
+ }
+
+ /**
+ * @group Plugins
+ */
+ public function testAddReportInvalidWebsite()
+ {
+ try {
+ self::addReport(self::getDailyPDFReportData(33));
+ } catch (Exception $e) {
+ return;
+ }
+ $this->fail('Expected exception not raised');
+ }
+
+ /**
+ * @group Plugins
+ */
+ public function testAddReportInvalidPeriod()
+ {
+ try {
+ $data = self::getDailyPDFReportData($this->idSite);
+ $data['period'] = 'dx';
+ self::addReport($data);
+ } catch (Exception $e) {
+ return;
+ }
+ $this->fail('Expected exception not raised');
+ }
+
+ /**
+ * @group Plugins
+ */
+ public function testUpdateReport()
+ {
+ $idReport = self::addReport(self::getDailyPDFReportData($this->idSite));
+ $dataAfter = self::getMonthlyEmailReportData($this->idSite);
+
+ self::updateReport($idReport, $dataAfter);
+
+ $reports = APIScheduledReports::getInstance()->getReports($idSite = false, $period = false, $idReport);
+
+ $this->assertReportsEqual(
+ reset($reports),
+ $dataAfter
+ );
+ }
+
+ /**
+ * @group Plugins
+ */
+ public function testDeleteReport()
+ {
+ // Deletes non existing report throws exception
+ try {
+ APIScheduledReports::getInstance()->deleteReport($idReport = 1);
+ $this->fail('Exception not raised');
+ } catch (Exception $e) {
+ }
+
+ $idReport = self::addReport(self::getMonthlyEmailReportData($this->idSite));
+ $this->assertEquals(1, count(APIScheduledReports::getInstance()->getReports()));
+ APIScheduledReports::getInstance()->deleteReport($idReport);
+ $this->assertEquals(0, count(APIScheduledReports::getInstance()->getReports()));
+ }
+
+ /**
+ * @group Plugins
+ */
+ public function testGetTopMenuTranslationKeyMobileMessagingInactive()
+ {
+ // unload MobileMessaging plugin
+ \Piwik\Plugin\Manager::getInstance()->loadPlugins(array('ScheduledReports'));
+
+ $pdfReportPlugin = new Menu();
+ $this->assertEquals(
+ Menu::PDF_REPORTS_TOP_MENU_TRANSLATION_KEY,
+ $pdfReportPlugin->getTopMenuTranslationKey()
+ );
+ }
+
+ /**
+ * @group Plugins
+ */
+ public function testGetTopMenuTranslationKeyUserIsAnonymous()
+ {
+ $anonymousAccess = new FakeAccess;
+ FakeAccess::$identity = 'anonymous';
+ Access::setSingletonInstance($anonymousAccess);
+
+ $pdfReportPlugin = new Menu();
+ $this->assertEquals(
+ Menu::MOBILE_MESSAGING_TOP_MENU_TRANSLATION_KEY,
+ $pdfReportPlugin->getTopMenuTranslationKey()
+ );
+ }
+
+ /**
+ * top menu should display 'Email & SMS reports' when the user has set-up a valid mobile provider account
+ * even though there is no sms reports configured
+ *
+ * @group Plugins
+ */
+ public function testGetTopMenuTranslationKeyNoReportMobileAccountOK()
+ {
+ // set mobile provider account
+ self::setSuperUser();
+ APIMobileMessaging::getInstance()->setSMSAPICredential('StubbedProvider', '');
+
+ $pdfReportPlugin = new Menu();
+ $this->assertEquals(
+ Menu::MOBILE_MESSAGING_TOP_MENU_TRANSLATION_KEY,
+ $pdfReportPlugin->getTopMenuTranslationKey()
+ );
+ }
+
+ /**
+ * top menu should display 'Email reports' when the user has not set-up a valid mobile provider account
+ * and no reports at all have been configured
+ *
+ * @group Plugins
+ */
+ public function testGetTopMenuTranslationKeyNoReportMobileAccountKO()
+ {
+ $pdfReportPlugin = new Menu();
+ $this->assertEquals(
+ Menu::PDF_REPORTS_TOP_MENU_TRANSLATION_KEY,
+ $pdfReportPlugin->getTopMenuTranslationKey()
+ );
+ }
+
+ /**
+ * top menu should display 'Email & SMS reports' if there is at least one sms report
+ * whatever the status of the mobile provider account
+ *
+ * @group Plugins
+ */
+ public function testGetTopMenuTranslationKeyOneSMSReportMobileAccountKO()
+ {
+ APIScheduledReports::getInstance()->addReport(
+ 1,
+ '',
+ ScheduledTime::PERIOD_DAY,
+ 0,
+ MobileMessaging::MOBILE_TYPE,
+ MobileMessaging::SMS_FORMAT,
+ array(),
+ array(
+ MobileMessaging::PHONE_NUMBERS_PARAMETER => array()
+ )
+ );
+
+ $pdfReportPlugin = new Menu();
+ $this->assertEquals(
+ Menu::MOBILE_MESSAGING_TOP_MENU_TRANSLATION_KEY,
+ $pdfReportPlugin->getTopMenuTranslationKey()
+ );
+ }
+
+ /**
+ * top menu should display 'Email reports' if there are no SMS reports and at least one email report
+ * whatever the status of the mobile provider account
+ *
+ * @group Plugins
+ */
+ public function testGetTopMenuTranslationKeyNoSMSReportAccountOK()
+ {
+ // set mobile provider account
+ self::setSuperUser();
+ APIMobileMessaging::getInstance()->setSMSAPICredential('StubbedProvider', '');
+
+ self::addReport(self::getMonthlyEmailReportData($this->idSite));
+
+ $pdfReportPlugin = new Menu();
+ $this->assertEquals(
+ Menu::PDF_REPORTS_TOP_MENU_TRANSLATION_KEY,
+ $pdfReportPlugin->getTopMenuTranslationKey()
+ );
+ }
+
+ /**
+ * @group Plugins
+ */
+ public function testGetScheduledTasks()
+ {
+ // stub API to control getReports() return values
+ $report1 = self::getDailyPDFReportData($this->idSite);
+ $report1['idreport'] = 1;
+ $report1['hour'] = 0;
+ $report1['deleted'] = 0;
+
+ $report2 = self::getMonthlyEmailReportData($this->idSite);
+ $report2['idreport'] = 2;
+ $report2['idsite'] = 2;
+ $report2['hour'] = 0;
+ $report2['deleted'] = 0;
+
+ $report3 = self::getMonthlyEmailReportData($this->idSite);
+ $report3['idreport'] = 3;
+ $report3['deleted'] = 1; // should not be scheduled
+
+ $report4 = self::getMonthlyEmailReportData($this->idSite);
+ $report4['idreport'] = 4;
+ $report4['idsite'] = 1;
+ $report4['hour'] = 8;
+ $report4['deleted'] = 0;
+
+ $report5 = self::getMonthlyEmailReportData($this->idSite);
+ $report5['idreport'] = 5;
+ $report5['idsite'] = 2;
+ $report5['hour'] = 8;
+ $report5['deleted'] = 0;
+
+ // test no exception is raised when a scheduled report is set to never send
+ $report6 = self::getMonthlyEmailReportData($this->idSite);
+ $report6['idreport'] = 6;
+ $report6['period'] = ScheduledTime::PERIOD_NEVER;
+ $report6['deleted'] = 0;
+
+ $stubbedAPIScheduledReports = $this->getMock('\\Piwik\\Plugins\\ScheduledReports\\API', array('getReports', 'getInstance'), $arguments = array(), $mockClassName = '', $callOriginalConstructor = false);
+ $stubbedAPIScheduledReports->expects($this->any())->method('getReports')->will($this->returnValue(
+ array($report1, $report2, $report3, $report4, $report5, $report6))
+ );
+ \Piwik\Plugins\ScheduledReports\API::setSingletonInstance($stubbedAPIScheduledReports);
+
+ // initialize sites 1 and 2
+ Site::setSites( array(
+ 1 => array('timezone' => 'Europe/Paris'),
+ 2 => array('timezone' => 'UTC-6.5'),
+ ));
+
+ // expected tasks
+ $scheduleTask1 = ScheduledTime::factory('daily');
+ $scheduleTask1->setHour(0); // paris is UTC-1, period ends at 23h UTC
+ $scheduleTask1->setTimezone('Europe/Paris');
+
+ $scheduleTask2 = new Monthly();
+ $scheduleTask2->setHour(0); // site is UTC-6.5, period ends at 6h30 UTC, smallest resolution is hour
+ $scheduleTask2->setTimezone('UTC-6.5');
+
+ $scheduleTask3 = new Monthly();
+ $scheduleTask3->setHour(8); // paris is UTC-1, configured to be sent at 8h
+ $scheduleTask3->setTimezone('Europe/Paris');
+
+ $scheduleTask4 = new Monthly();
+ $scheduleTask4->setHour(8); // site is UTC-6.5, configured to be sent at 8h
+ $scheduleTask4->setTimezone('UTC-6.5');
+
+ $expectedTasks = array(
+ new ScheduledTask (APIScheduledReports::getInstance(), 'sendReport', 1, $scheduleTask1),
+ new ScheduledTask (APIScheduledReports::getInstance(), 'sendReport', 2, $scheduleTask2),
+ new ScheduledTask (APIScheduledReports::getInstance(), 'sendReport', 4, $scheduleTask3),
+ new ScheduledTask (APIScheduledReports::getInstance(), 'sendReport', 5, $scheduleTask4),
+ );
+
+ $pdfReportPlugin = new Tasks();
+ $pdfReportPlugin->schedule();
+ $tasks = $pdfReportPlugin->getScheduledTasks();
+ $this->assertEquals($expectedTasks, $tasks);
+
+ \Piwik\Plugins\ScheduledReports\API::unsetInstance();
+
+ }
+
+ /**
+ * Dataprovider for testGetReportSubjectAndReportTitle
+ */
+ public function getGetReportSubjectAndReportTitleTestCases()
+ {
+ return array(
+ array('<Piwik.org>', '<Piwik.org>', '<Piwik.org>', array('UserSettings_getBrowserType')),
+ array('Piwik.org', 'Piwik.org', 'Piwik.org', array('MultiSites_getAll', 'UserSettings_getBrowserType')),
+ array('General_MultiSitesSummary', 'General_MultiSitesSummary', 'Piwik.org', array('MultiSites_getAll')),
+ );
+ }
+
+ /**
+ * @group Plugins
+ *
+ * @dataProvider getGetReportSubjectAndReportTitleTestCases
+ */
+ public function testGetReportSubjectAndReportTitle($expectedReportSubject, $expectedReportTitle, $websiteName, $reports)
+ {
+ $getReportSubjectAndReportTitle = new ReflectionMethod(
+ '\\Piwik\\Plugins\\ScheduledReports\\API', 'getReportSubjectAndReportTitle'
+ );
+ $getReportSubjectAndReportTitle->setAccessible(true);
+
+ list($reportSubject, $reportTitle) = $getReportSubjectAndReportTitle->invoke( APIScheduledReports::getInstance(), $websiteName, $reports);
+ $this->assertEquals($expectedReportSubject, $reportSubject);
+ $this->assertEquals($expectedReportTitle, $reportTitle);
+ }
+
+ private function assertReportsEqual($report, $data)
+ {
+ foreach ($data as $key => $value) {
+ if ($key == 'description') $value = substr($value, 0, 250);
+ $this->assertEquals($value, $report[$key], "Error for $key for report " . var_export($report, true) . " and data " . var_export($data, true));
+ }
+ }
+
+ private static function addReport($data)
+ {
+ $idReport = APIScheduledReports::getInstance()->addReport(
+ $data['idsite'],
+ $data['description'],
+ $data['period'],
+ $data['hour'],
+ $data['type'],
+ $data['format'],
+ $data['reports'],
+ $data['parameters']
+ );
+ return $idReport;
+ }
+
+ private static function getDailyPDFReportData($idSite)
+ {
+ return array(
+ 'idsite' => $idSite,
+ 'description' => 'test description"',
+ 'period' => ScheduledTime::PERIOD_DAY,
+ 'hour' => '7',
+ 'type' => 'email',
+ 'format' => 'pdf',
+ 'reports' => array('UserCountry_getCountry'),
+ 'parameters' => array(
+ 'displayFormat' => '1',
+ 'emailMe' => true,
+ 'additionalEmails' => array('test@test.com', 't2@test.com'),
+ 'evolutionGraph' => false
+ )
+ );
+ }
+
+ private static function getMonthlyEmailReportData($idSite)
+ {
+ return array(
+ 'idsite' => $idSite,
+ 'description' => 'very very long and possibly truncated description. very very long and possibly truncated description. very very long and possibly truncated description. very very long and possibly truncated description. very very long and possibly truncated description. ',
+ 'period' => ScheduledTime::PERIOD_MONTH,
+ 'hour' => '0',
+ 'type' => 'email',
+ 'format' => 'pdf',
+ 'reports' => array('UserCountry_getContinent'),
+ 'parameters' => array(
+ 'displayFormat' => '1',
+ 'emailMe' => false,
+ 'additionalEmails' => array('blabla@ec.fr'),
+ 'evolutionGraph' => false
+ )
+ );
+ }
+
+ private static function updateReport($idReport, $data)
+ {
+ $idReport = APIScheduledReports::getInstance()->updateReport(
+ $idReport,
+ $data['idsite'],
+ $data['description'],
+ $data['period'],
+ $data['hour'],
+ $data['type'],
+ $data['format'],
+ $data['reports'],
+ $data['parameters']);
+ return $idReport;
+ }
+
+ private static function setSuperUser()
+ {
+ $pseudoMockAccess = new FakeAccess;
+ FakeAccess::$superUser = true;
+ Access::setSingletonInstance($pseudoMockAccess);
+ }
+}
diff --git a/plugins/ScheduledReports/tests/Integration/ScheduledReportsTest.php b/plugins/ScheduledReports/tests/Integration/ScheduledReportsTest.php
new file mode 100644
index 0000000000..b0bb56363f
--- /dev/null
+++ b/plugins/ScheduledReports/tests/Integration/ScheduledReportsTest.php
@@ -0,0 +1,164 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+namespace Piwik\Plugins\ScheduledReports\tests;
+use Piwik\Access;
+use Piwik\Db;
+use Piwik\Piwik;
+use Piwik\Plugins\ScheduledReports\API;
+use Piwik\Plugins\ScheduledReports\ScheduledReports;
+use Piwik\Tests\Impl\Fixture;
+use Piwik\Tests\Impl\IntegrationTestCase;
+
+/**
+ * @group ScheduledReports
+ * @group ScheduledReportsTest
+ * @group Plugins
+ */
+class ScheduledReportsTest extends IntegrationTestCase
+{
+ /**
+ * @var ScheduledReports
+ */
+ private $reports;
+ private $reportIds = array();
+
+ public function setUp()
+ {
+ parent::setUp();
+
+ $this->reports = new ScheduledReports();
+ $this->setIdentity('userlogin');
+
+ for ($i = 1; $i <= 4; $i++) {
+ Fixture::createWebsite('2014-01-01 00:00:00');
+ $this->addReport('userlogin', $i);
+ }
+
+ $this->addReport('otherUser', 1);
+ $this->addReport('anotherUser', 2);
+ }
+
+ public function test_deleteUserReportForSites_shouldNotRemoveAnythingIfNoSitesOrNoLogin()
+ {
+ $this->reports->deleteUserReportForSites('userLogin', array());
+
+ $this->assertHasReport('userlogin', 1);
+ $this->assertHasReport('userlogin', 2);
+ $this->assertHasReport('userlogin', 3);
+ $this->assertHasReport('userlogin', 4);
+ $this->assertHasReport('otherUser', 1);
+ $this->assertHasReport('anotherUser', 2);
+
+ $this->reports->deleteUserReportForSites('', array(1, 2, 3, 4));
+
+ $this->assertHasReport('userlogin', 1);
+ $this->assertHasReport('userlogin', 2);
+ $this->assertHasReport('userlogin', 3);
+ $this->assertHasReport('userlogin', 4);
+ $this->assertHasReport('otherUser', 1);
+ $this->assertHasReport('anotherUser', 2);
+ }
+
+ public function test_deleteUserReportForSites_shouldNotFailIfUserHasNoReports()
+ {
+ $this->reports->deleteUserReportForSites('unk', array());
+
+ $this->assertHasReport('userlogin', 1);
+ $this->assertHasReport('userlogin', 2);
+ $this->assertHasReport('userlogin', 3);
+ $this->assertHasReport('userlogin', 4);
+ $this->assertHasReport('otherUser', 1);
+ $this->assertHasReport('anotherUser', 2);
+ }
+
+ public function test_deleteUserReportForSites_shouldRemoveOnlyReportsForGivenSitesAndLogin()
+ {
+ $this->reports->deleteUserReportForSites('userLogin', array(1, 2));
+
+ $this->assertHasNotReport('userlogin', 1);
+ $this->assertHasNotReport('userlogin', 2);
+
+ $this->assertHasReport('userlogin', 3);
+ $this->assertHasReport('userlogin', 4);
+ $this->assertHasReport('otherUser', 1);
+ $this->assertHasReport('anotherUser', 2);
+ }
+
+ public function test_ScheduledReports_shouldRemoveOnlyReportsForGivenSitesAndLogin_IfEventIsTriggered()
+ {
+ Piwik::postEvent('UsersManager.removeSiteAccess', array('userLogin', array(1, 2)));
+
+ $this->assertHasNotReport('userlogin', 1);
+ $this->assertHasNotReport('userlogin', 2);
+
+ $this->assertHasReport('userlogin', 3);
+ $this->assertHasReport('userlogin', 4);
+ $this->assertHasReport('otherUser', 1);
+ $this->assertHasReport('anotherUser', 2);
+ }
+
+ public function test_deleteUserReport_shouldRemoveAllReportsOfASpecificUser()
+ {
+ $this->reports->deleteUserReport('userLogin');
+
+ $this->assertHasNotReport('userlogin', 1);
+ $this->assertHasNotReport('userlogin', 2);
+ $this->assertHasNotReport('userlogin', 3);
+ $this->assertHasNotReport('userlogin', 4);
+
+ $this->assertHasReport('otherUser', 1);
+ $this->assertHasReport('anotherUser', 2);
+ }
+
+ private function assertHasReport($login, $idSite)
+ {
+ $report = $this->getReport($login, $idSite);
+
+ $this->assertNotEmpty($report, "Report for $login, $idSite should exist but does not");
+ }
+
+ private function assertHasNotReport($login, $idSite)
+ {
+ try {
+ $this->getReport($login, $idSite);
+ $this->fail("Report for $login, $idSite should not exist but does");
+ } catch (\Exception $e) {
+ $this->assertContains("Requested report couldn't be found", $e->getMessage());
+ }
+ }
+
+ private function getReport($login, $idSite)
+ {
+ $this->setIdentity($login);
+
+ return API::getInstance()->getReports($idSite, 'day', $this->reportIds[$login . '_' . $idSite]);
+ }
+
+ private function addReport($login, $idSite)
+ {
+ $this->setIdentity($login);
+
+ $reportType = 'email';
+ $reportFormat = 'pdf';
+ $reports = array();
+ $parameters = array(ScheduledReports::DISPLAY_FORMAT_PARAMETER => ScheduledReports::DISPLAY_FORMAT_TABLES_ONLY);
+
+ $reportId = API::getInstance()->addReport($idSite, 'description', 'day', 3, $reportType, $reportFormat, $reports, $parameters);
+ $this->reportIds[$login . '_' . $idSite] = $reportId;
+ }
+
+ private function setIdentity($login)
+ {
+ $pseudoMockAccess = new \FakeAccess();
+ $pseudoMockAccess::$identity = $login;
+ $pseudoMockAccess::$superUser = true;
+ Access::setSingletonInstance($pseudoMockAccess);
+ }
+
+}
diff --git a/plugins/ScheduledReports/tests/ScheduledReportsTest.php b/plugins/ScheduledReports/tests/ScheduledReportsTest.php
deleted file mode 100644
index d11a8e402e..0000000000
--- a/plugins/ScheduledReports/tests/ScheduledReportsTest.php
+++ /dev/null
@@ -1,163 +0,0 @@
-<?php
-/**
- * Piwik - free/libre analytics platform
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- */
-
-namespace Piwik\Plugins\ScheduledReports\tests;
-use Piwik\Access;
-use Piwik\Db;
-use Piwik\Piwik;
-use Piwik\Plugins\ScheduledReports\API;
-use Piwik\Plugins\ScheduledReports\ScheduledReports;
-use Piwik\Tests\Fixture;
-
-/**
- * @group ScheduledReports
- * @group ScheduledReportsTest
- * @group Database
- */
-class ScheduledReportsTest extends \DatabaseTestCase
-{
- /**
- * @var ScheduledReports
- */
- private $reports;
- private $reportIds = array();
-
- public function setUp()
- {
- parent::setUp();
-
- $this->reports = new ScheduledReports();
- $this->setIdentity('userlogin');
-
- for ($i = 1; $i <= 4; $i++) {
- Fixture::createWebsite('2014-01-01 00:00:00');
- $this->addReport('userlogin', $i);
- }
-
- $this->addReport('otherUser', 1);
- $this->addReport('anotherUser', 2);
- }
-
- public function test_deleteUserReportForSites_shouldNotRemoveAnythingIfNoSitesOrNoLogin()
- {
- $this->reports->deleteUserReportForSites('userLogin', array());
-
- $this->assertHasReport('userlogin', 1);
- $this->assertHasReport('userlogin', 2);
- $this->assertHasReport('userlogin', 3);
- $this->assertHasReport('userlogin', 4);
- $this->assertHasReport('otherUser', 1);
- $this->assertHasReport('anotherUser', 2);
-
- $this->reports->deleteUserReportForSites('', array(1, 2, 3, 4));
-
- $this->assertHasReport('userlogin', 1);
- $this->assertHasReport('userlogin', 2);
- $this->assertHasReport('userlogin', 3);
- $this->assertHasReport('userlogin', 4);
- $this->assertHasReport('otherUser', 1);
- $this->assertHasReport('anotherUser', 2);
- }
-
- public function test_deleteUserReportForSites_shouldNotFailIfUserHasNoReports()
- {
- $this->reports->deleteUserReportForSites('unk', array());
-
- $this->assertHasReport('userlogin', 1);
- $this->assertHasReport('userlogin', 2);
- $this->assertHasReport('userlogin', 3);
- $this->assertHasReport('userlogin', 4);
- $this->assertHasReport('otherUser', 1);
- $this->assertHasReport('anotherUser', 2);
- }
-
- public function test_deleteUserReportForSites_shouldRemoveOnlyReportsForGivenSitesAndLogin()
- {
- $this->reports->deleteUserReportForSites('userLogin', array(1, 2));
-
- $this->assertHasNotReport('userlogin', 1);
- $this->assertHasNotReport('userlogin', 2);
-
- $this->assertHasReport('userlogin', 3);
- $this->assertHasReport('userlogin', 4);
- $this->assertHasReport('otherUser', 1);
- $this->assertHasReport('anotherUser', 2);
- }
-
- public function test_ScheduledReports_shouldRemoveOnlyReportsForGivenSitesAndLogin_IfEventIsTriggered()
- {
- Piwik::postEvent('UsersManager.removeSiteAccess', array('userLogin', array(1, 2)));
-
- $this->assertHasNotReport('userlogin', 1);
- $this->assertHasNotReport('userlogin', 2);
-
- $this->assertHasReport('userlogin', 3);
- $this->assertHasReport('userlogin', 4);
- $this->assertHasReport('otherUser', 1);
- $this->assertHasReport('anotherUser', 2);
- }
-
- public function test_deleteUserReport_shouldRemoveAllReportsOfASpecificUser()
- {
- $this->reports->deleteUserReport('userLogin');
-
- $this->assertHasNotReport('userlogin', 1);
- $this->assertHasNotReport('userlogin', 2);
- $this->assertHasNotReport('userlogin', 3);
- $this->assertHasNotReport('userlogin', 4);
-
- $this->assertHasReport('otherUser', 1);
- $this->assertHasReport('anotherUser', 2);
- }
-
- private function assertHasReport($login, $idSite)
- {
- $report = $this->getReport($login, $idSite);
-
- $this->assertNotEmpty($report, "Report for $login, $idSite should exist but does not");
- }
-
- private function assertHasNotReport($login, $idSite)
- {
- try {
- $this->getReport($login, $idSite);
- $this->fail("Report for $login, $idSite should not exist but does");
- } catch (\Exception $e) {
- $this->assertContains("Requested report couldn't be found", $e->getMessage());
- }
- }
-
- private function getReport($login, $idSite)
- {
- $this->setIdentity($login);
-
- return API::getInstance()->getReports($idSite, 'day', $this->reportIds[$login . '_' . $idSite]);
- }
-
- private function addReport($login, $idSite)
- {
- $this->setIdentity($login);
-
- $reportType = 'email';
- $reportFormat = 'pdf';
- $reports = array();
- $parameters = array(ScheduledReports::DISPLAY_FORMAT_PARAMETER => ScheduledReports::DISPLAY_FORMAT_TABLES_ONLY);
-
- $reportId = API::getInstance()->addReport($idSite, 'description', 'day', 3, $reportType, $reportFormat, $reports, $parameters);
- $this->reportIds[$login . '_' . $idSite] = $reportId;
- }
-
- private function setIdentity($login)
- {
- $pseudoMockAccess = new \FakeAccess();
- $pseudoMockAccess::$identity = $login;
- $pseudoMockAccess::$superUser = true;
- Access::setSingletonInstance($pseudoMockAccess);
- }
-
-}
diff --git a/plugins/SegmentEditor/tests/Integration/SegmentEditorTest.php b/plugins/SegmentEditor/tests/Integration/SegmentEditorTest.php
new file mode 100644
index 0000000000..e5d863e92c
--- /dev/null
+++ b/plugins/SegmentEditor/tests/Integration/SegmentEditorTest.php
@@ -0,0 +1,210 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+namespace Piwik\Plugins\SegmentEditor\tests\Integration;
+
+use Piwik\Access;
+use Piwik\Date;
+use Piwik\Piwik;
+use Piwik\Plugins\SegmentEditor\API;
+use Piwik\Plugins\SegmentEditor\Model;
+use Piwik\Plugins\SitesManager\API as APISitesManager;
+use Piwik\Tests\Impl\IntegrationTestCase;
+use FakeAccess;
+use Exception;
+
+/**
+ * Class Plugins_SegmentEditorTest
+ *
+ * @group Plugins
+ */
+class SegmentEditorTest extends IntegrationTestCase
+{
+ public function setUp()
+ {
+ parent::setUp();
+
+ \Piwik\Plugin\Manager::getInstance()->loadPlugin('SegmentEditor');
+ \Piwik\Plugin\Manager::getInstance()->installLoadedPlugins();
+
+ // setup the access layer
+ $pseudoMockAccess = new FakeAccess;
+ FakeAccess::setIdSitesView(array(1, 2));
+ FakeAccess::setIdSitesAdmin(array(3, 4));
+
+ //finally we set the user as a Super User by default
+ FakeAccess::$superUser = true;
+ FakeAccess::$superUserLogin = 'superusertest';
+ Access::setSingletonInstance($pseudoMockAccess);
+
+ APISitesManager::getInstance()->addSite('test', 'http://example.org');
+ }
+
+ /**
+ * @group Plugins
+ */
+ public function testAddInvalidSegment_ShouldThrow()
+ {
+ try {
+ API::getInstance()->add('name', 'test==test2');
+ $this->fail("Exception not raised.");
+ } catch (Exception $expected) {
+ }
+ try {
+ API::getInstance()->add('name', 'test');
+ $this->fail("Exception not raised.");
+ } catch (Exception $expected) {
+ }
+ }
+
+ /**
+ * @group Plugins
+ */
+ public function test_AddAndGet_SimpleSegment()
+ {
+ $name = 'name';
+ $definition = 'searches>1,visitIp!=127.0.0.1';
+ $idSegment = API::getInstance()->add($name, $definition);
+ $this->assertEquals($idSegment, 1);
+ $segment = API::getInstance()->get($idSegment);
+ unset($segment['ts_created']);
+ $expected = array(
+ 'idsegment' => 1,
+ 'name' => $name,
+ 'definition' => $definition,
+ 'login' => 'superUserLogin',
+ 'enable_all_users' => '0',
+ 'enable_only_idsite' => '0',
+ 'auto_archive' => '0',
+ 'ts_last_edit' => null,
+ 'deleted' => '0',
+ );
+
+ $this->assertEquals($segment, $expected);
+ }
+
+ /**
+ * @group Plugins
+ */
+ public function test_AddAndGet_AnotherSegment()
+ {
+ $name = 'name';
+ $definition = 'searches>1,visitIp!=127.0.0.1';
+ $idSegment = API::getInstance()->add($name, $definition, $idSite = 1, $autoArchive = 1, $enabledAllUsers = 1);
+ $this->assertEquals($idSegment, 1);
+
+ // Testing get()
+ $segment = API::getInstance()->get($idSegment);
+ $expected = array(
+ 'idsegment' => '1',
+ 'name' => $name,
+ 'definition' => $definition,
+ 'login' => 'superUserLogin',
+ 'enable_all_users' => '1',
+ 'enable_only_idsite' => '1',
+ 'auto_archive' => '1',
+ 'ts_last_edit' => null,
+ 'deleted' => '0',
+ );
+ unset($segment['ts_created']);
+ $this->assertEquals($segment, $expected);
+
+ // There is a segment to process for this particular site
+ $model = new Model();
+ $segments = $model->getSegmentsToAutoArchive($idSite);
+ unset($segments[0]['ts_created']);
+ $this->assertEquals($segments, array($expected));
+
+ // There is no segment to process for a non existing site
+ try {
+ $model->getSegmentsToAutoArchive(33);
+ $this->fail();
+ } catch(Exception $e) {
+ // expected
+ }
+
+ // There is no segment to process across all sites
+ $segments = $model->getSegmentsToAutoArchive($idSite = false);
+ $this->assertEquals($segments, array());
+ }
+
+ /**
+ * @group Plugins
+ */
+ public function test_UpdateSegment()
+ {
+ $name = 'name"';
+ $definition = 'searches>1,visitIp!=127.0.0.1';
+ $nameSegment1 = 'hello';
+ $idSegment1 = API::getInstance()->add($nameSegment1, 'searches==0', $idSite = 1, $autoArchive = 1, $enabledAllUsers = 1);
+ $idSegment2 = API::getInstance()->add($name, $definition, $idSite = 1, $autoArchive = 1, $enabledAllUsers = 1);
+
+ $updatedSegment = array(
+ 'idsegment' => $idSegment2,
+ 'name' => 'NEW name',
+ 'definition' => 'searches==0',
+ 'enable_only_idsite' => '0',
+ 'enable_all_users' => '0',
+ 'auto_archive' => '0',
+ 'ts_last_edit' => Date::now()->getDatetime(),
+ 'ts_created' => Date::now()->getDatetime(),
+ 'login' => Piwik::getCurrentUserLogin(),
+ 'deleted' => '0',
+ );
+ API::getInstance()->update($idSegment2,
+ $updatedSegment['name'],
+ $updatedSegment['definition'],
+ $updatedSegment['enable_only_idsite'],
+ $updatedSegment['auto_archive'],
+ $updatedSegment['enable_all_users']
+ );
+
+ $newSegment = API::getInstance()->get($idSegment2);
+
+ // avoid test failures for when ts_created/ts_last_edit are different by between 1/2 secs
+ $this->removeSecondsFromSegmentInfo($updatedSegment);
+ $this->removeSecondsFromSegmentInfo($newSegment);
+
+ $this->assertEquals($newSegment, $updatedSegment);
+
+ // Check the other segmenet was not updated
+ $newSegment = API::getInstance()->get($idSegment1);
+ $this->assertEquals($newSegment['name'], $nameSegment1);
+ }
+
+ /**
+ * @group Plugins
+ */
+ public function test_deleteSegment()
+ {
+ $idSegment1 = API::getInstance()->add('name 1', 'searches==0', $idSite = 1, $autoArchive = 1, $enabledAllUsers = 1);
+ $idSegment2 = API::getInstance()->add('name 2', 'searches>1,visitIp!=127.0.0.1', $idSite = 1, $autoArchive = 1, $enabledAllUsers = 1);
+
+ $deleted = API::getInstance()->delete($idSegment2);
+ $this->assertTrue($deleted);
+ try {
+ API::getInstance()->get($idSegment2);
+ $this->fail("getting deleted segment should have failed");
+ } catch(Exception $e) {
+ // expected
+ }
+
+ // and this should work
+ API::getInstance()->get($idSegment1);
+ }
+
+ private function removeSecondsFromSegmentInfo(&$segmentInfo)
+ {
+ $timestampProperties = array('ts_last_edit', 'ts_created');
+ foreach ($timestampProperties as $propertyName) {
+ if (isset($segmentInfo[$propertyName])) {
+ $segmentInfo[$propertyName] = substr($segmentInfo[$propertyName], 0, strlen($segmentInfo[$propertyName] - 2));
+ }
+ }
+ }
+}
diff --git a/plugins/SitesManager/tests/Integration/SiteUrlsTest.php b/plugins/SitesManager/tests/Integration/SiteUrlsTest.php
new file mode 100644
index 0000000000..8cc7cc5b14
--- /dev/null
+++ b/plugins/SitesManager/tests/Integration/SiteUrlsTest.php
@@ -0,0 +1,146 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+namespace Piwik\Plugins\SitesManager\tests\Integration;
+use Piwik\CacheFile;
+use Piwik\Plugins\SitesManager\API;
+use Piwik\Plugins\SitesManager\SiteUrls;
+use Piwik\Tests\Impl\IntegrationTestCase;
+
+/**
+ * @group SitesManager
+ * @group SiteUrlsTest
+ * @group Plugins
+ */
+class SiteUrlsTest extends IntegrationTestCase
+{
+ /**
+ * @var SiteUrls
+ */
+ private $siteUrls;
+
+ /**
+ * @var API
+ */
+ private $api;
+
+ public function setUp()
+ {
+ parent::setUp();
+
+ $this->siteUrls = new SiteUrls();
+ $this->api = API::getInstance();
+
+ SiteUrls::clearSitesCache();
+ }
+
+ public function testGetAllSiteUrls_shouldReturnAnEmptyArray_IfThereAreNoSites()
+ {
+ $this->assertSiteUrls(array());
+ }
+
+ public function testGetAllSiteUrls_shouldReturnUrlsForEachSiteId()
+ {
+ $this->addSite('http://www.example.com'); // only one main URL
+ $this->assertSiteUrls(array(1 => array('http://www.example.com')));
+
+ $this->addSite('http://www.example.com', 'http://www.piwik.org'); // main URL and alias URL
+ $this->assertSiteUrls(array(1 => array('http://www.example.com'), 2 => array('http://www.example.com', 'http://www.piwik.org')));
+
+ $this->api->addSiteAliasUrls(2, 'http://piwik.org');
+ $this->assertSiteUrls(array(1 => array('http://www.example.com'), 2 => array('http://www.example.com', 'http://piwik.org', 'http://www.piwik.org')));
+
+ $this->api->setSiteAliasUrls(2, array());
+ $this->assertSiteUrls(array(1 => array('http://www.example.com'), 2 => array('http://www.example.com')));
+ }
+
+ public function testGetAllCachedSiteUrls_shouldReturnAnEmptyArray_IfThereAreNoSites()
+ {
+ $this->assertCachedSiteUrls(array());
+ }
+
+ public function testGetAllCachedSiteUrls_ShouldReturnCorrectResultEvenIfItIsCachedAsWeClearTheCacheOnAnyChange()
+ {
+ $this->addSite('http://www.example.com'); // only one main URL
+ $this->assertCachedSiteUrls(array(1 => array('http://www.example.com')));
+
+ $this->addSite('http://www.example.com', 'http://www.piwik.org'); // main URL and alias URL
+ $this->assertCachedSiteUrls(array(1 => array('http://www.example.com'), 2 => array('http://www.example.com', 'http://www.piwik.org')));
+
+ $this->api->addSiteAliasUrls(2, 'http://piwik.org');
+ $this->assertCachedSiteUrls(array(1 => array('http://www.example.com'), 2 => array('http://www.example.com', 'http://piwik.org', 'http://www.piwik.org')));
+
+ $this->api->setSiteAliasUrls(2, array());
+ $this->assertCachedSiteUrls(array(1 => array('http://www.example.com'), 2 => array('http://www.example.com')));
+
+ $this->api->updateSite(1, 'siteName3', array('http://updated.example.com', 'http://2.example.com'));
+ $this->assertCachedSiteUrls(array(1 => array('http://updated.example.com', 'http://2.example.com'), 2 => array('http://www.example.com')));
+ }
+
+ public function testGetAllCachedSiteUrls_ShouldWriteACacheFile()
+ {
+ // make sure cache is empty
+ $this->assertValueInCache(false);
+
+ $this->addSite('http://www.example.com');
+ $this->siteUrls->getAllCachedSiteUrls();
+
+ // make sure we have a cached result
+ $this->assertValueInCache(array(1 => array('http://www.example.com')));
+ }
+
+ public function test_clearSitesCache_ShouldActuallyDeleteACache()
+ {
+ $this->addSite('http://www.example.com');
+ $this->siteUrls->getAllCachedSiteUrls();
+
+ // make sure we have a cached result
+ $this->assertValueInCache(array(1 => array('http://www.example.com')));
+
+ SiteUrls::clearSitesCache();
+
+ // make sure is empty now
+ $this->assertValueInCache(false);
+ }
+
+ public function testGetAllCachedSiteUrls_ShouldReadFromTheCacheFile()
+ {
+ $urlsToFake = array(1 => 'Whatever');
+ $cache = new CacheFile('tracker', 600);
+ $cache->set('allSiteUrlsPerSite', $urlsToFake);
+
+ $actual = $this->siteUrls->getAllCachedSiteUrls();
+
+ $this->assertEquals($urlsToFake, $actual);
+ }
+
+ private function assertSiteUrls($expectedUrls)
+ {
+ $urls = $this->siteUrls->getAllSiteUrls();
+ $this->assertEquals($expectedUrls, $urls);
+ }
+
+ private function assertCachedSiteUrls($expectedUrls)
+ {
+ $urls = $this->siteUrls->getAllCachedSiteUrls();
+ $this->assertEquals($expectedUrls, $urls);
+ }
+
+ private function addSite($urls)
+ {
+ $this->api->addSite('siteName', func_get_args());
+ }
+
+ private function assertValueInCache($value)
+ {
+ $cache = new CacheFile('tracker', 600);
+ $siteUrls = $cache->get('allSiteUrlsPerSite');
+
+ $this->assertEquals($value, $siteUrls);
+ }
+}
diff --git a/plugins/SitesManager/tests/Integration/SitesManagerTest.php b/plugins/SitesManager/tests/Integration/SitesManagerTest.php
new file mode 100644
index 0000000000..2d2ac466ef
--- /dev/null
+++ b/plugins/SitesManager/tests/Integration/SitesManagerTest.php
@@ -0,0 +1,1000 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+namespace Piwik\Plugins\SitesManager\tests\Integration;
+
+use Piwik\Access;
+use Piwik\Plugins\SitesManager\API;
+use Piwik\Plugins\UsersManager\API as APIUsersManager;
+use Piwik\Site;
+use Piwik\Tests\Impl\IntegrationTestCase;
+use FakeAccess;
+use Exception;
+use PHPUnit_Framework_Constraint_IsType;
+
+/**
+ * Class Plugins_SitesManagerTest
+ *
+ * @group Plugins
+ */
+class SitesManagerTest extends IntegrationTestCase
+{
+ public function setUp()
+ {
+ parent::setUp();
+
+ // setup the access layer
+ $pseudoMockAccess = new FakeAccess;
+ FakeAccess::$superUser = true;
+ Access::setSingletonInstance($pseudoMockAccess);
+ }
+
+ /**
+ * empty name -> exception
+ *
+ * @group Plugins
+ */
+ public function testAddSiteEmptyName()
+ {
+ try {
+ API::getInstance()->addSite("", array("http://piwik.net"));
+ } catch (Exception $e) {
+ return;
+ }
+ $this->fail('Expected exception not raised');
+ }
+
+ /**
+ * DataProvider for testAddSiteWrongUrls
+ */
+ public function getInvalidUrlData()
+ {
+ return array(
+ array(array()), // no urls
+ array(array("")),
+ array(""),
+ array("httpww://piwik.net"),
+ array("httpww://piwik.net/gqg~#"),
+ );
+ }
+
+ /**
+ * wrong urls -> exception
+ *
+ * @dataProvider getInvalidUrlData
+ * @group Plugins
+ */
+ public function testAddSiteWrongUrls($url)
+ {
+ try {
+ API::getInstance()->addSite("name", $url);
+ } catch (Exception $e) {
+ return;
+ }
+ $this->fail('Expected exception not raised');
+ }
+
+ /**
+ * Test with valid IPs
+ *
+ * @group Plugins
+ */
+ public function testAddSiteExcludedIpsAndtimezoneAndCurrencyAndExcludedQueryParametersValid()
+ {
+ $ips = '1.2.3.4,1.1.1.*,1.2.*.*,1.*.*.*';
+ $timezone = 'Europe/Paris';
+ $currency = 'EUR';
+ $excludedQueryParameters = 'p1,P2, P33333';
+ $expectedExcludedQueryParameters = 'p1,P2,P33333';
+ $excludedUserAgents = " p1,P2, \nP3333 ";
+ $expectedExcludedUserAgents = "p1,P2,P3333";
+ $expectedWebsiteType = 'mobile-\'app';
+ $keepUrlFragment = 1;
+ $idsite = API::getInstance()->addSite("name", "http://piwik.net/", $ecommerce = 1,
+ $siteSearch = 1, $searchKeywordParameters = 'search,param', $searchCategoryParameters = 'cat,category',
+ $ips, $excludedQueryParameters, $timezone, $currency, $group = null, $startDate = null, $excludedUserAgents,
+ $keepUrlFragment, $expectedWebsiteType);
+ $siteInfo = API::getInstance()->getSiteFromId($idsite);
+ $this->assertEquals($ips, $siteInfo['excluded_ips']);
+ $this->assertEquals($timezone, $siteInfo['timezone']);
+ $this->assertEquals($currency, $siteInfo['currency']);
+ $this->assertEquals($ecommerce, $siteInfo['ecommerce']);
+ $this->assertTrue(Site::isEcommerceEnabledFor($idsite));
+ $this->assertEquals($siteSearch, $siteInfo['sitesearch']);
+ $this->assertTrue(Site::isSiteSearchEnabledFor($idsite));
+ $this->assertEquals($expectedWebsiteType, $siteInfo['type']);
+ $this->assertEquals($expectedWebsiteType, Site::getTypeFor($idsite));
+
+ $this->assertEquals($searchKeywordParameters, $siteInfo['sitesearch_keyword_parameters']);
+ $this->assertEquals($searchCategoryParameters, $siteInfo['sitesearch_category_parameters']);
+ $this->assertEquals($expectedExcludedQueryParameters, $siteInfo['excluded_parameters']);
+ $this->assertEquals($expectedExcludedUserAgents, $siteInfo['excluded_user_agents']);
+ }
+
+ /**
+ * dataProvider for testAddSiteExcludedIpsNotValid
+ */
+ public function getInvalidIPsData()
+ {
+ return array(
+ array('35817587341'),
+ array('ieagieha'),
+ array('1.2.3'),
+ array('*.1.1.1'),
+ array('*.*.1.1'),
+ array('*.*.*.1'),
+ array('1.1.1.1.1'),
+ );
+ }
+
+ /**
+ * Test with invalid IPs
+ *
+ * @dataProvider getInvalidIPsData
+ * @group Plugins
+ */
+ public function testAddSiteExcludedIpsNotValid($ip)
+ {
+ try {
+ API::getInstance()->addSite("name", "http://piwik.net/", $ecommerce = 0,
+ $siteSearch = 1, $searchKeywordParameters = null, $searchCategoryParameters = null, $ip);
+ } catch (Exception $e) {
+ return;
+ }
+ $this->fail('Expected exception not raised');
+ }
+
+ /**
+ * one url -> one main_url and nothing inserted as alias urls
+ *
+ * @group Plugins
+ */
+ public function testAddSiteOneUrl()
+ {
+ $url = "http://piwik.net/";
+ $urlOK = "http://piwik.net";
+ $idsite = API::getInstance()->addSite("name", $url);
+ $this->assertInternalType(PHPUnit_Framework_Constraint_IsType::TYPE_INT, $idsite);
+
+ $siteInfo = API::getInstance()->getSiteFromId($idsite);
+ $this->assertEquals($urlOK, $siteInfo['main_url']);
+ $this->assertEquals(date('Y-m-d'), date('Y-m-d', strtotime($siteInfo['ts_created'])));
+
+ $siteUrls = API::getInstance()->getSiteUrlsFromId($idsite);
+ $this->assertEquals(1, count($siteUrls));
+ }
+
+ /**
+ * several urls -> one main_url and others as alias urls
+ *
+ * @group Plugins
+ */
+ public function testAddSiteSeveralUrls()
+ {
+ $urls = array("http://piwik.net/", "http://piwik.com", "https://piwik.net/test/");
+ $urlsOK = array("http://piwik.net", "http://piwik.com", "https://piwik.net/test");
+ $idsite = API::getInstance()->addSite("super website", $urls);
+ $this->assertInternalType(PHPUnit_Framework_Constraint_IsType::TYPE_INT, $idsite);
+
+ $siteInfo = API::getInstance()->getSiteFromId($idsite);
+ $this->assertEquals($urlsOK[0], $siteInfo['main_url']);
+
+ $siteUrls = API::getInstance()->getSiteUrlsFromId($idsite);
+ $this->assertEquals($urlsOK, $siteUrls);
+ }
+
+ /**
+ * strange name
+ *
+ * @group Plugins
+ */
+ public function testAddSiteStrangeName()
+ {
+ $name = "supertest(); ~@@()''!£\$'%%^'!£ போ";
+ $idsite = API::getInstance()->addSite($name, "http://piwik.net");
+ $this->assertInternalType(PHPUnit_Framework_Constraint_IsType::TYPE_INT, $idsite);
+
+ $siteInfo = API::getInstance()->getSiteFromId($idsite);
+ $this->assertEquals($name, $siteInfo['name']);
+
+ }
+
+ /**
+ * adds a site
+ * use by several other unit tests
+ */
+ protected function _addSite()
+ {
+ $name = "website ";
+ $idsite = API::getInstance()->addSite($name, array("http://piwik.net", "http://piwik.com/test/"));
+ $this->assertInternalType(PHPUnit_Framework_Constraint_IsType::TYPE_INT, $idsite);
+
+ $siteInfo = API::getInstance()->getSiteFromId($idsite);
+ $this->assertEquals($name, $siteInfo['name']);
+ $this->assertEquals("http://piwik.net", $siteInfo['main_url']);
+
+ $siteUrls = API::getInstance()->getSiteUrlsFromId($idsite);
+ $this->assertEquals(array("http://piwik.net", "http://piwik.com/test"), $siteUrls);
+
+ return $idsite;
+ }
+
+ /**
+ * no duplicate -> all the urls are saved
+ *
+ * @group Plugins
+ */
+ public function testAddSiteUrlsnoDuplicate()
+ {
+ $idsite = $this->_addSite();
+
+ $siteUrlsBefore = API::getInstance()->getSiteUrlsFromId($idsite);
+
+ $toAdd = array("http://piwik1.net",
+ "http://piwik2.net",
+ "http://piwik3.net/test/",
+ "http://localhost/test",
+ "http://localho5.st/test",
+ "http://l42578gqege.f4",
+ "http://super.com/test/test/atqata675675/te"
+ );
+ $toAddValid = array("http://piwik1.net",
+ "http://piwik2.net",
+ "http://piwik3.net/test",
+ "http://localhost/test",
+ "http://localho5.st/test",
+ "http://l42578gqege.f4",
+ "http://super.com/test/test/atqata675675/te");
+
+ $insertedUrls = API::getInstance()->addSiteAliasUrls($idsite, $toAdd);
+ $this->assertEquals(count($toAdd), $insertedUrls);
+
+ $siteUrlsAfter = API::getInstance()->getSiteUrlsFromId($idsite);
+
+ $shouldHave = array_merge($siteUrlsBefore, $toAddValid);
+ sort($shouldHave);
+
+ sort($siteUrlsAfter);
+
+ $this->assertEquals($shouldHave, $siteUrlsAfter);
+ }
+
+ /**
+ * duplicate -> don't save the already existing URLs
+ *
+ * @group Plugins
+ */
+ public function testAddSiteUrlsDuplicate()
+ {
+ $idsite = $this->_addSite();
+
+ $siteUrlsBefore = API::getInstance()->getSiteUrlsFromId($idsite);
+
+ $toAdd = array_merge($siteUrlsBefore, array("http://piwik1.net", "http://piwik2.net"));
+
+ $insertedUrls = API::getInstance()->addSiteAliasUrls($idsite, $toAdd);
+ $this->assertEquals(count($toAdd) - count($siteUrlsBefore), $insertedUrls);
+
+ $siteUrlsAfter = API::getInstance()->getSiteUrlsFromId($idsite);
+
+ $shouldHave = $toAdd;
+ sort($shouldHave);
+
+ sort($siteUrlsAfter);
+
+ $this->assertEquals($shouldHave, $siteUrlsAfter);
+ }
+
+ /**
+ * case empty array => nothing happens
+ *
+ * @group Plugins
+ */
+ public function testAddSiteUrlsNoUrlsToAdd1()
+ {
+ $idsite = $this->_addSite();
+
+ $siteUrlsBefore = API::getInstance()->getSiteUrlsFromId($idsite);
+
+ $toAdd = array();
+
+ $insertedUrls = API::getInstance()->addSiteAliasUrls($idsite, $toAdd);
+ $this->assertEquals(count($toAdd), $insertedUrls);
+
+ $siteUrlsAfter = API::getInstance()->getSiteUrlsFromId($idsite);
+
+ $shouldHave = $siteUrlsBefore;
+ sort($shouldHave);
+
+ sort($siteUrlsAfter);
+
+ $this->assertEquals($shouldHave, $siteUrlsAfter);
+ }
+
+ /**
+ * case array only duplicate => nothing happens
+ *
+ * @group Plugins
+ */
+ public function testAddSiteUrlsNoUrlsToAdd2()
+ {
+ $idsite = $this->_addSite();
+
+ $siteUrlsBefore = API::getInstance()->getSiteUrlsFromId($idsite);
+
+ $toAdd = $siteUrlsBefore;
+
+ $insertedUrls = API::getInstance()->addSiteAliasUrls($idsite, $toAdd);
+ $this->assertEquals(0, $insertedUrls);
+
+ $siteUrlsAfter = API::getInstance()->getSiteUrlsFromId($idsite);
+
+ $shouldHave = $siteUrlsBefore;
+ sort($shouldHave);
+
+ sort($siteUrlsAfter);
+
+ $this->assertEquals($shouldHave, $siteUrlsAfter);
+ }
+
+ /**
+ * wrong format urls => exception
+ *
+ * @group Plugins
+ */
+ public function testAddSiteUrlsWrongUrlsFormat3()
+ {
+ try {
+ $idsite = $this->_addSite();
+ $toAdd = array("http:mpigeq");
+ API::getInstance()->addSiteAliasUrls($idsite, $toAdd);
+ } catch (Exception $e) {
+ return;
+ }
+ $this->fail('Expected exception not raised');
+ }
+
+ /**
+ * wrong idsite => no exception because simply no access to this resource
+ *
+ * @group Plugins
+ */
+ public function testAddSiteUrlsWrongIdSite1()
+ {
+ try {
+ $toAdd = array("http://pigeq.com/test");
+ API::getInstance()->addSiteAliasUrls(-1, $toAdd);
+ } catch (Exception $e) {
+ return;
+ }
+ $this->fail('Expected exception not raised');
+ }
+
+ /**
+ * wrong idsite => exception
+ *
+ * @group Plugins
+ */
+ public function testAddSiteUrlsWrongIdSite2()
+ {
+ try {
+ $toAdd = array("http://pigeq.com/test");
+ API::getInstance()->addSiteAliasUrls(155, $toAdd);
+ } catch (Exception $e) {
+ return;
+ }
+ $this->fail('Expected exception not raised');
+ }
+
+ /**
+ * no Id -> empty array
+ *
+ * @group Plugins
+ */
+ public function testGetAllSitesIdNoId()
+ {
+ $ids = API::getInstance()->getAllSitesId();
+ $this->assertEquals(array(), $ids);
+ }
+
+ /**
+ * several Id -> normal array
+ *
+ * @group Plugins
+ */
+ public function testGetAllSitesIdSeveralId()
+ {
+ $name = "tetq";
+ $idsites = array(
+ API::getInstance()->addSite($name, array("http://piwik.net", "http://piwik.com/test/")),
+ API::getInstance()->addSite($name, array("http://piwik.net", "http://piwik.com/test/")),
+ API::getInstance()->addSite($name, array("http://piwik.net", "http://piwik.com/test/")),
+ API::getInstance()->addSite($name, array("http://piwik.net", "http://piwik.com/test/")),
+ API::getInstance()->addSite($name, array("http://piwik.net", "http://piwik.com/test/")),
+ );
+
+ $ids = API::getInstance()->getAllSitesId();
+ $this->assertEquals($idsites, $ids);
+ }
+
+ /**
+ * wrong id => exception
+ *
+ * @group Plugins
+ */
+ public function testGetSiteFromIdWrongId1()
+ {
+ try {
+ API::getInstance()->getSiteFromId(0);
+ } catch (Exception $e) {
+ return;
+ }
+ $this->fail('Expected exception not raised');
+ }
+
+ /**
+ * wrong id => exception
+ *
+ * @group Plugins
+ */
+ public function testGetSiteFromIdWrongId2()
+ {
+ try {
+ API::getInstance()->getSiteFromId("x1");
+ } catch (Exception $e) {
+ return;
+ }
+ $this->fail('Expected exception not raised');
+ }
+
+ /**
+ * wrong id : no access => exception
+ *
+ * @group Plugins
+ */
+ public function testGetSiteFromIdWrongId3()
+ {
+ $idsite = API::getInstance()->addSite("site", array("http://piwik.net", "http://piwik.com/test/"));
+ $this->assertEquals(1, $idsite);
+
+ // set noaccess to site 1
+ FakeAccess::setIdSitesView(array(2));
+ FakeAccess::setIdSitesAdmin(array());
+
+ try {
+ API::getInstance()->getSiteFromId(1);
+ } catch (Exception $e) {
+ return;
+ }
+ $this->fail('Expected exception not raised');
+ }
+
+ /**
+ * normal case
+ *
+ * @group Plugins
+ */
+ public function testGetSiteFromIdNormalId()
+ {
+ $name = "website ''";
+ $idsite = API::getInstance()->addSite($name, array("http://piwik.net", "http://piwik.com/test/"));
+ $this->assertInternalType(PHPUnit_Framework_Constraint_IsType::TYPE_INT, $idsite);
+
+ $siteInfo = API::getInstance()->getSiteFromId($idsite);
+ $this->assertEquals($name, $siteInfo['name']);
+ $this->assertEquals("http://piwik.net", $siteInfo['main_url']);
+ }
+
+ /**
+ * there is no admin site available -> array()
+ *
+ * @group Plugins
+ */
+ public function testGetSitesWithAdminAccessNoResult()
+ {
+ FakeAccess::setIdSitesAdmin(array());
+
+ $sites = API::getInstance()->getSitesWithAdminAccess();
+ $this->assertEquals(array(), $sites);
+ }
+
+ /**
+ * normal case, admin and view and noaccess website => return only admin
+ *
+ * @group Plugins
+ */
+ public function testGetSitesWithAdminAccess()
+ {
+ API::getInstance()->addSite("site1", array("http://piwik.net", "http://piwik.com/test/"));
+ API::getInstance()->addSite("site2", array("http://piwik.com/test/"));
+ API::getInstance()->addSite("site3", array("http://piwik.org"));
+
+ $resultWanted = array(
+ 0 => array("idsite" => 1, "name" => "site1", "main_url" => "http://piwik.net", "ecommerce" => 0, "excluded_ips" => "", 'sitesearch' => 1, 'sitesearch_keyword_parameters' => '', 'sitesearch_category_parameters' => '', 'excluded_parameters' => '', 'excluded_user_agents' => '', 'timezone' => 'UTC', 'currency' => 'USD', 'group' => '', 'keep_url_fragment' => 0, 'type' => 'website'),
+ 1 => array("idsite" => 3, "name" => "site3", "main_url" => "http://piwik.org", "ecommerce" => 0, "excluded_ips" => "", 'sitesearch' => 1, 'sitesearch_keyword_parameters' => '', 'sitesearch_category_parameters' => '', 'excluded_parameters' => '', 'excluded_user_agents' => '', 'timezone' => 'UTC', 'currency' => 'USD', 'group' => '', 'keep_url_fragment' => 0, 'type' => 'website'),
+ );
+
+ FakeAccess::setIdSitesAdmin(array(1, 3));
+
+ $sites = API::getInstance()->getSitesWithAdminAccess();
+
+ // we dont test the ts_created
+ unset($sites[0]['ts_created']);
+ unset($sites[1]['ts_created']);
+ $this->assertEquals($resultWanted, $sites);
+ }
+
+ /**
+ * there is no admin site available -> array()
+ *
+ * @group Plugins
+ */
+ public function testGetSitesWithViewAccessNoResult()
+ {
+ FakeAccess::setIdSitesView(array());
+ FakeAccess::setIdSitesAdmin(array());
+
+ $sites = API::getInstance()->getSitesWithViewAccess();
+ $this->assertEquals(array(), $sites);
+ }
+
+ /**
+ * normal case, admin and view and noaccess website => return only admin
+ *
+ * @group Plugins
+ */
+ public function testGetSitesWithViewAccess()
+ {
+ API::getInstance()->addSite("site1", array("http://piwik.net", "http://piwik.com/test/"));
+ API::getInstance()->addSite("site2", array("http://piwik.com/test/"));
+ API::getInstance()->addSite("site3", array("http://piwik.org"));
+
+ $resultWanted = array(
+ 0 => array("idsite" => 1, "name" => "site1", "main_url" => "http://piwik.net", "ecommerce" => 0, 'sitesearch' => 1, 'sitesearch_keyword_parameters' => '', 'sitesearch_category_parameters' => '', "excluded_ips" => "", 'excluded_parameters' => '', 'excluded_user_agents' => '', 'timezone' => 'UTC', 'currency' => 'USD', 'group' => '', 'keep_url_fragment' => 0, 'type' => 'website'),
+ 1 => array("idsite" => 3, "name" => "site3", "main_url" => "http://piwik.org", "ecommerce" => 0, 'sitesearch' => 1, 'sitesearch_keyword_parameters' => '', 'sitesearch_category_parameters' => '', "excluded_ips" => "", 'excluded_parameters' => '', 'excluded_user_agents' => '', 'timezone' => 'UTC', 'currency' => 'USD', 'group' => '', 'keep_url_fragment' => 0, 'type' => 'website'),
+ );
+
+ FakeAccess::setIdSitesView(array(1, 3));
+ FakeAccess::setIdSitesAdmin(array());
+
+ $sites = API::getInstance()->getSitesWithViewAccess();
+ // we dont test the ts_created
+ unset($sites[0]['ts_created']);
+ unset($sites[1]['ts_created']);
+ $this->assertEquals($resultWanted, $sites);
+ }
+
+ /**
+ * there is no admin site available -> array()
+ *
+ * @group Plugins
+ */
+ public function testGetSitesWithAtLeastViewAccessNoResult()
+ {
+ FakeAccess::setIdSitesView(array());
+ FakeAccess::setIdSitesAdmin(array());
+
+ $sites = API::getInstance()->getSitesWithAtLeastViewAccess();
+ $this->assertEquals(array(), $sites);
+ }
+
+ /**
+ * normal case, admin and view and noaccess website => return only admin
+ *
+ * @group Plugins
+ */
+ public function testGetSitesWithAtLeastViewAccess()
+ {
+ API::getInstance()->addSite("site1", array("http://piwik.net", "http://piwik.com/test/"), $ecommerce = 1);
+ API::getInstance()->addSite("site2", array("http://piwik.com/test/"));
+ API::getInstance()->addSite("site3", array("http://piwik.org"));
+
+ $resultWanted = array(
+ 0 => array("idsite" => 1, "name" => "site1", "main_url" => "http://piwik.net", "ecommerce" => 1, "excluded_ips" => "", 'sitesearch' => 1, 'sitesearch_keyword_parameters' => '', 'sitesearch_category_parameters' => '', 'excluded_parameters' => '', 'excluded_user_agents' => '', 'timezone' => 'UTC', 'currency' => 'USD', 'group' => '', 'keep_url_fragment' => 0, 'type' => 'website'),
+ 1 => array("idsite" => 3, "name" => "site3", "main_url" => "http://piwik.org", "ecommerce" => 0, "excluded_ips" => "", 'sitesearch' => 1, 'sitesearch_keyword_parameters' => '', 'sitesearch_category_parameters' => '', 'excluded_parameters' => '', 'excluded_user_agents' => '', 'timezone' => 'UTC', 'currency' => 'USD', 'group' => '', 'keep_url_fragment' => 0, 'type' => 'website'),
+ );
+
+ FakeAccess::setIdSitesView(array(1, 3));
+ FakeAccess::setIdSitesAdmin(array());
+
+ $sites = API::getInstance()->getSitesWithAtLeastViewAccess();
+ // we dont test the ts_created
+ unset($sites[0]['ts_created']);
+ unset($sites[1]['ts_created']);
+ $this->assertEquals($resultWanted, $sites);
+ }
+
+ /**
+ * no urls for this site => array()
+ *
+ * @group Plugins
+ */
+ public function testGetSiteUrlsFromIdNoUrls()
+ {
+ $idsite = API::getInstance()->addSite("site1", array("http://piwik.net"));
+
+ $urls = API::getInstance()->getSiteUrlsFromId($idsite);
+ $this->assertEquals(array("http://piwik.net"), $urls);
+ }
+
+ /**
+ * normal case
+ *
+ * @group Plugins
+ */
+ public function testGetSiteUrlsFromIdManyUrls()
+ {
+ $site = array("http://piwik.net",
+ "http://piwik.org",
+ "http://piwik.org",
+ "http://piwik.com");
+ sort($site);
+
+ $idsite = API::getInstance()->addSite("site1", $site);
+
+ $siteWanted = array("http://piwik.net",
+ "http://piwik.org",
+ "http://piwik.com");
+ sort($siteWanted);
+ $urls = API::getInstance()->getSiteUrlsFromId($idsite);
+
+ $this->assertEquals($siteWanted, $urls);
+ }
+
+ /**
+ * wrongId => exception
+ *
+ * @group Plugins
+ */
+ public function testGetSiteUrlsFromIdWrongId()
+ {
+ try {
+ FakeAccess::setIdSitesView(array(3));
+ FakeAccess::setIdSitesAdmin(array());
+ API::getInstance()->getSiteUrlsFromId(1);
+ } catch (Exception $e) {
+ return;
+ }
+ $this->fail('Expected exception not raised');
+ }
+
+ /**
+ * one url => no change to alias urls
+ *
+ * @group Plugins
+ */
+ public function testUpdateSiteOneUrl()
+ {
+ $urls = array("http://piwiknew.com",
+ "http://piwiknew.net",
+ "http://piwiknew.org",
+ "http://piwiknew.fr");
+ $idsite = API::getInstance()->addSite("site1", $urls);
+
+ $newMainUrl = "http://main.url";
+
+ // Also test that the group was set to empty, and is searchable
+ $websites = API::getInstance()->getSitesFromGroup('');
+ $this->assertEquals(1, count($websites));
+
+ // the Update doesn't change the group field
+ API::getInstance()->updateSite($idsite, "test toto@{}", $newMainUrl);
+ $websites = API::getInstance()->getSitesFromGroup('');
+ $this->assertEquals(1, count($websites));
+
+ // Updating the group to something
+ $group = 'something';
+ API::getInstance()->updateSite($idsite, "test toto@{}", $newMainUrl, $ecommerce = 0, $ss = true, $ss_kwd = null, $ss_cat = '', $ips = null, $parametersExclude = null, $timezone = null, $currency = null, $group);
+ $websites = API::getInstance()->getSitesFromGroup($group);
+ $this->assertEquals(1, count($websites));
+ $this->assertEquals(date('Y-m-d'), date('Y-m-d', strtotime($websites[0]['ts_created'])));
+
+ // Updating the group to nothing
+ $group = '';
+ $type = 'mobileAppTest';
+ API::getInstance()->updateSite($idsite, "test toto@{}", $newMainUrl, $ecommerce = 0, $ss = false, $ss_kwd = '', $ss_cat = null, $ips = null, $parametersExclude = null, $timezone = null, $currency = null, $group, $startDate = '2010-01-01', $excludedUserAgent = null, $keepUrlFragment = 1, $type);
+ $websites = API::getInstance()->getSitesFromGroup($group);
+ $this->assertEquals(1, count($websites));
+ $this->assertEquals('2010-01-01', date('Y-m-d', strtotime($websites[0]['ts_created'])));
+
+ // Test setting the website type
+ $this->assertEquals($type, Site::getTypeFor($idsite));
+
+ // Check Alias URLs contain only main url
+ $allUrls = API::getInstance()->getSiteUrlsFromId($idsite);
+ $this->assertEquals($newMainUrl, $allUrls[0]);
+ $aliasUrls = array_slice($allUrls, 1);
+ $this->assertEquals(array(), $aliasUrls);
+
+ }
+
+ /**
+ * strange name and NO URL => name ok, main_url not updated
+ *
+ * @group Plugins
+ */
+ public function testUpdateSiteStrangeNameNoUrl()
+ {
+ $idsite = API::getInstance()->addSite("site1", "http://main.url");
+ $newName = "test toto@{'786'}";
+
+ API::getInstance()->updateSite($idsite, $newName);
+
+ $site = API::getInstance()->getSiteFromId($idsite);
+
+ $this->assertEquals($newName, $site['name']);
+ // url didn't change because parameter url NULL in updateSite
+ $this->assertEquals("http://main.url", $site['main_url']);
+ }
+
+ /**
+ * several urls => both main and alias are updated
+ * also test the update of group field
+ *
+ * @group Plugins
+ */
+ public function testUpdateSiteSeveralUrlsAndGroup()
+ {
+ $urls = array("http://piwiknew.com",
+ "http://piwiknew.net",
+ "http://piwiknew.org",
+ "http://piwiknew.fr");
+
+ $group = 'GROUP Before';
+ $idsite = API::getInstance()->addSite("site1", $urls, $ecommerce = 1,
+ $siteSearch = 1, $searchKeywordParameters = null, $searchCategoryParameters = null,
+ $excludedIps = null, $excludedQueryParameters = null, $timezone = null, $currency = null, $group, $startDate = '2011-01-01');
+
+ $websites = API::getInstance()->getSitesFromGroup($group);
+ $this->assertEquals(1, count($websites));
+
+ $newurls = array("http://piwiknew2.com",
+ "http://piwiknew2.net",
+ "http://piwiknew2.org",
+ "http://piwiknew2.fr");
+
+ $groupAfter = ' GROUP After';
+ API::getInstance()->updateSite($idsite, "test toto@{}", $newurls, $ecommerce = 0,
+ $siteSearch = 1, $searchKeywordParameters = null, $searchCategoryParameters = null,
+ $excludedIps = null, $excludedQueryParameters = null, $timezone = null, $currency = null, $groupAfter);
+
+ // no result for the group before update
+ $websites = API::getInstance()->getSitesFromGroup($group);
+ $this->assertEquals(0, count($websites));
+
+ // Testing that the group was updated properly (and testing that the group value is trimmed before inserted/searched)
+ $websites = API::getInstance()->getSitesFromGroup($groupAfter . ' ');
+ $this->assertEquals(1, count($websites));
+ $this->assertEquals('2011-01-01', date('Y-m-d', strtotime($websites[0]['ts_created'])));
+
+ // Test fetch website groups
+ $expectedGroups = array(trim($groupAfter));
+ $fetched = API::getInstance()->getSitesGroups();
+ $this->assertEquals($expectedGroups, $fetched);
+
+ $allUrls = API::getInstance()->getSiteUrlsFromId($idsite);
+ sort($allUrls);
+ sort($newurls);
+ $this->assertEquals($newurls, $allUrls);
+ }
+
+ /**
+ * @group Plugins
+ */
+ public function testGetSitesGroups()
+ {
+ $groups = array('group1', ' group1 ', '', 'group2');
+ $expectedGroups = array('group1', '', 'group2');
+ foreach ($groups as $group) {
+ API::getInstance()->addSite("test toto@{}", 'http://example.org', $ecommerce = 1, $siteSearch = null, $searchKeywordParameters = null, $searchCategoryParameters = null, $excludedIps = null, $excludedQueryParameters = null, $timezone = null, $currency = null, $group);
+ }
+
+ $this->assertEquals($expectedGroups, API::getInstance()->getSitesGroups());
+ }
+
+ public function getInvalidTimezoneData()
+ {
+ return array(
+ array('UTC+15'),
+ array('Paris'),
+ );
+ }
+
+ /**
+ *
+ * @dataProvider getInvalidTimezoneData
+ * @group Plugins
+ */
+ public function testAddSitesInvalidTimezone($timezone)
+ {
+ try {
+ API::getInstance()->addSite("site1", array('http://example.org'), $ecommerce = 0,
+ $siteSearch = 1, $searchKeywordParameters = null, $searchCategoryParameters = null, $ip = '', $params = '', $timezone);
+ } catch (Exception $e) {
+ return;
+ }
+ $this->fail('Expected exception not raised');
+ }
+
+ /**
+ * @group Plugins
+ */
+ public function testAddSitesInvalidCurrency()
+ {
+ try {
+ $invalidCurrency = '€';
+ API::getInstance()->addSite("site1", array('http://example.org'), $ecommerce = 0,
+ $siteSearch = 1, $searchKeywordParameters = null, $searchCategoryParameters = null, '', 'UTC', $invalidCurrency);
+ } catch (Exception $e) {
+ return;
+ }
+ $this->fail('Expected exception not raised');
+ }
+
+ /**
+ * @group Plugins
+ */
+ public function testSetDefaultTimezoneAndCurrencyAndExcludedQueryParametersAndExcludedIps()
+ {
+ // test that they return default values
+ $defaultTimezone = API::getInstance()->getDefaultTimezone();
+ $this->assertEquals('UTC', $defaultTimezone);
+ $defaultCurrency = API::getInstance()->getDefaultCurrency();
+ $this->assertEquals('USD', $defaultCurrency);
+ $excludedIps = API::getInstance()->getExcludedIpsGlobal();
+ $this->assertEquals('', $excludedIps);
+ $excludedQueryParameters = API::getInstance()->getExcludedQueryParametersGlobal();
+ $this->assertEquals('', $excludedQueryParameters);
+
+ // test that when not specified, defaults are set as expected
+ $idsite = API::getInstance()->addSite("site1", array('http://example.org'));
+ $site = new Site($idsite);
+ $this->assertEquals('UTC', $site->getTimezone());
+ $this->assertEquals('USD', $site->getCurrency());
+ $this->assertEquals('', $site->getExcludedQueryParameters());
+ $this->assertEquals('', $site->getExcludedIps());
+ $this->assertEquals(false, $site->isEcommerceEnabled());
+
+ // set the global timezone and get it
+ $newDefaultTimezone = 'UTC+5.5';
+ API::getInstance()->setDefaultTimezone($newDefaultTimezone);
+ $defaultTimezone = API::getInstance()->getDefaultTimezone();
+ $this->assertEquals($newDefaultTimezone, $defaultTimezone);
+
+ // set the default currency and get it
+ $newDefaultCurrency = 'EUR';
+ API::getInstance()->setDefaultCurrency($newDefaultCurrency);
+ $defaultCurrency = API::getInstance()->getDefaultCurrency();
+ $this->assertEquals($newDefaultCurrency, $defaultCurrency);
+
+ // set the global IPs to exclude and get it
+ $newGlobalExcludedIps = '1.1.1.*,1.1.*.*,150.1.1.1';
+ API::getInstance()->setGlobalExcludedIps($newGlobalExcludedIps);
+ $globalExcludedIps = API::getInstance()->getExcludedIpsGlobal();
+ $this->assertEquals($newGlobalExcludedIps, $globalExcludedIps);
+
+ // set the global URL query params to exclude and get it
+ $newGlobalExcludedQueryParameters = 'PHPSESSID,blabla, TesT';
+ // removed the space
+ $expectedGlobalExcludedQueryParameters = 'PHPSESSID,blabla,TesT';
+ API::getInstance()->setGlobalExcludedQueryParameters($newGlobalExcludedQueryParameters);
+ $globalExcludedQueryParameters = API::getInstance()->getExcludedQueryParametersGlobal();
+ $this->assertEquals($expectedGlobalExcludedQueryParameters, $globalExcludedQueryParameters);
+
+ // create a website and check that default currency and default timezone are set
+ // however, excluded IPs and excluded query Params are not returned
+ $idsite = API::getInstance()->addSite("site1", array('http://example.org'), $ecommerce = 0,
+ $siteSearch = 0, $searchKeywordParameters = 'test1,test2', $searchCategoryParameters = 'test2,test1',
+ '', '', $newDefaultTimezone);
+ $site = new Site($idsite);
+ $this->assertEquals($newDefaultTimezone, $site->getTimezone());
+ $this->assertEquals(date('Y-m-d'), $site->getCreationDate()->toString());
+ $this->assertEquals($newDefaultCurrency, $site->getCurrency());
+ $this->assertEquals('', $site->getExcludedIps());
+ $this->assertEquals('', $site->getExcludedQueryParameters());
+ $this->assertEquals('test1,test2', $site->getSearchKeywordParameters());
+ $this->assertEquals('test2,test1', $site->getSearchCategoryParameters());
+ $this->assertFalse($site->isSiteSearchEnabled());
+ $this->assertFalse(Site::isSiteSearchEnabledFor($idsite));
+ $this->assertFalse($site->isEcommerceEnabled());
+ $this->assertFalse(Site::isEcommerceEnabledFor($idsite));
+ }
+
+ /**
+ * @group Plugins
+ */
+ public function testGetSitesIdFromSiteUrlSuperUser()
+ {
+ API::getInstance()->addSite("site1", array("http://piwik.net", "http://piwik.com"));
+ API::getInstance()->addSite("site2", array("http://piwik.com", "http://piwik.net"));
+ API::getInstance()->addSite("site3", array("http://piwik.com", "http://piwik.org"));
+
+ $idsites = API::getInstance()->getSitesIdFromSiteUrl('http://piwik.org');
+ $this->assertTrue(count($idsites) == 1);
+
+ $idsites = API::getInstance()->getSitesIdFromSiteUrl('http://www.piwik.org');
+ $this->assertTrue(count($idsites) == 1);
+
+ $idsites = API::getInstance()->getSitesIdFromSiteUrl('http://piwik.net');
+ $this->assertTrue(count($idsites) == 2);
+
+ $idsites = API::getInstance()->getSitesIdFromSiteUrl('http://piwik.com');
+ $this->assertTrue(count($idsites) == 3);
+ }
+
+ /**
+ * @group Plugins
+ */
+ public function testGetSitesIdFromSiteUrlUser()
+ {
+ API::getInstance()->addSite("site1", array("http://www.piwik.net", "http://piwik.com"));
+ API::getInstance()->addSite("site2", array("http://piwik.com", "http://piwik.net"));
+ API::getInstance()->addSite("site3", array("http://piwik.com", "http://piwik.org"));
+
+ $saveAccess = Access::getInstance();
+
+ APIUsersManager::getInstance()->addUser("user1", "geqgegagae", "tegst@tesgt.com", "alias");
+ APIUsersManager::getInstance()->setUserAccess("user1", "view", array(1));
+
+ APIUsersManager::getInstance()->addUser("user2", "geqgegagae", "tegst2@tesgt.com", "alias");
+ APIUsersManager::getInstance()->setUserAccess("user2", "view", array(1));
+ APIUsersManager::getInstance()->setUserAccess("user2", "admin", array(3));
+
+ APIUsersManager::getInstance()->addUser("user3", "geqgegagae", "tegst3@tesgt.com", "alias");
+ APIUsersManager::getInstance()->setUserAccess("user3", "view", array(1, 2));
+ APIUsersManager::getInstance()->setUserAccess("user3", "admin", array(3));
+
+ $pseudoMockAccess = new FakeAccess;
+ FakeAccess::$superUser = false;
+ FakeAccess::$identity = 'user1';
+ FakeAccess::setIdSitesView(array(1));
+ FakeAccess::setIdSitesAdmin(array());
+ Access::setSingletonInstance($pseudoMockAccess);
+ $idsites = API::getInstance()->getSitesIdFromSiteUrl('http://piwik.com');
+ $this->assertEquals(1, count($idsites));
+
+ // testing URL normalization
+ $idsites = API::getInstance()->getSitesIdFromSiteUrl('http://www.piwik.com');
+ $this->assertEquals(1, count($idsites));
+ $idsites = API::getInstance()->getSitesIdFromSiteUrl('http://piwik.net');
+ $this->assertEquals(1, count($idsites));
+
+ $pseudoMockAccess = new FakeAccess;
+ FakeAccess::$superUser = false;
+ FakeAccess::$identity = 'user2';
+ FakeAccess::setIdSitesView(array(1));
+ FakeAccess::setIdSitesAdmin(array(3));
+ Access::setSingletonInstance($pseudoMockAccess);
+ $idsites = API::getInstance()->getSitesIdFromSiteUrl('http://piwik.com');
+ $this->assertEquals(2, count($idsites));
+
+ $pseudoMockAccess = new FakeAccess;
+ FakeAccess::$superUser = false;
+ FakeAccess::$identity = 'user3';
+ FakeAccess::setIdSitesView(array(1, 2));
+ FakeAccess::setIdSitesAdmin(array(3));
+ Access::setSingletonInstance($pseudoMockAccess);
+ $idsites = API::getInstance()->getSitesIdFromSiteUrl('http://piwik.com');
+ $this->assertEquals(3, count($idsites));
+
+ Access::setSingletonInstance($saveAccess);
+ }
+
+ /**
+ * @group Plugins
+ */
+ public function testGetSitesFromTimezones()
+ {
+ API::getInstance()->addSite("site3", array("http://piwik.org"), null, $siteSearch = 1, $searchKeywordParameters = null, $searchCategoryParameters = null, null, null, 'UTC');
+ $idsite2 = API::getInstance()->addSite("site3", array("http://piwik.org"), null, $siteSearch = 1, $searchKeywordParameters = null, $searchCategoryParameters = null, null, null, 'Pacific/Auckland');
+ $idsite3 = API::getInstance()->addSite("site3", array("http://piwik.org"), null, $siteSearch = 1, $searchKeywordParameters = null, $searchCategoryParameters = null, null, null, 'Pacific/Auckland');
+ $idsite4 = API::getInstance()->addSite("site3", array("http://piwik.org"), null, $siteSearch = 1, $searchKeywordParameters = null, $searchCategoryParameters = null, null, null, 'UTC+10');
+ $result = API::getInstance()->getSitesIdFromTimezones(array('UTC+10', 'Pacific/Auckland'));
+ $this->assertEquals(array($idsite2, $idsite3, $idsite4), $result);
+ }
+}
diff --git a/plugins/SitesManager/tests/SiteUrlsTest.php b/plugins/SitesManager/tests/SiteUrlsTest.php
deleted file mode 100644
index e459efb0a6..0000000000
--- a/plugins/SitesManager/tests/SiteUrlsTest.php
+++ /dev/null
@@ -1,145 +0,0 @@
-<?php
-/**
- * Piwik - free/libre analytics platform
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- */
-
-namespace Piwik\Plugins\SitesManager\tests;
-use Piwik\CacheFile;
-use Piwik\Plugins\SitesManager\API;
-use Piwik\Plugins\SitesManager\SiteUrls;
-
-/**
- * @group SitesManager
- * @group SiteUrlsTest
- * @group Database
- */
-class SiteUrlsTest extends \DatabaseTestCase
-{
- /**
- * @var SiteUrls
- */
- private $siteUrls;
-
- /**
- * @var API
- */
- private $api;
-
- public function setUp()
- {
- parent::setUp();
-
- $this->siteUrls = new SiteUrls();
- $this->api = API::getInstance();
-
- SiteUrls::clearSitesCache();
- }
-
- public function testGetAllSiteUrls_shouldReturnAnEmptyArray_IfThereAreNoSites()
- {
- $this->assertSiteUrls(array());
- }
-
- public function testGetAllSiteUrls_shouldReturnUrlsForEachSiteId()
- {
- $this->addSite('http://www.example.com'); // only one main URL
- $this->assertSiteUrls(array(1 => array('http://www.example.com')));
-
- $this->addSite('http://www.example.com', 'http://www.piwik.org'); // main URL and alias URL
- $this->assertSiteUrls(array(1 => array('http://www.example.com'), 2 => array('http://www.example.com', 'http://www.piwik.org')));
-
- $this->api->addSiteAliasUrls(2, 'http://piwik.org');
- $this->assertSiteUrls(array(1 => array('http://www.example.com'), 2 => array('http://www.example.com', 'http://piwik.org', 'http://www.piwik.org')));
-
- $this->api->setSiteAliasUrls(2, array());
- $this->assertSiteUrls(array(1 => array('http://www.example.com'), 2 => array('http://www.example.com')));
- }
-
- public function testGetAllCachedSiteUrls_shouldReturnAnEmptyArray_IfThereAreNoSites()
- {
- $this->assertCachedSiteUrls(array());
- }
-
- public function testGetAllCachedSiteUrls_ShouldReturnCorrectResultEvenIfItIsCachedAsWeClearTheCacheOnAnyChange()
- {
- $this->addSite('http://www.example.com'); // only one main URL
- $this->assertCachedSiteUrls(array(1 => array('http://www.example.com')));
-
- $this->addSite('http://www.example.com', 'http://www.piwik.org'); // main URL and alias URL
- $this->assertCachedSiteUrls(array(1 => array('http://www.example.com'), 2 => array('http://www.example.com', 'http://www.piwik.org')));
-
- $this->api->addSiteAliasUrls(2, 'http://piwik.org');
- $this->assertCachedSiteUrls(array(1 => array('http://www.example.com'), 2 => array('http://www.example.com', 'http://piwik.org', 'http://www.piwik.org')));
-
- $this->api->setSiteAliasUrls(2, array());
- $this->assertCachedSiteUrls(array(1 => array('http://www.example.com'), 2 => array('http://www.example.com')));
-
- $this->api->updateSite(1, 'siteName3', array('http://updated.example.com', 'http://2.example.com'));
- $this->assertCachedSiteUrls(array(1 => array('http://updated.example.com', 'http://2.example.com'), 2 => array('http://www.example.com')));
- }
-
- public function testGetAllCachedSiteUrls_ShouldWriteACacheFile()
- {
- // make sure cache is empty
- $this->assertValueInCache(false);
-
- $this->addSite('http://www.example.com');
- $this->siteUrls->getAllCachedSiteUrls();
-
- // make sure we have a cached result
- $this->assertValueInCache(array(1 => array('http://www.example.com')));
- }
-
- public function test_clearSitesCache_ShouldActuallyDeleteACache()
- {
- $this->addSite('http://www.example.com');
- $this->siteUrls->getAllCachedSiteUrls();
-
- // make sure we have a cached result
- $this->assertValueInCache(array(1 => array('http://www.example.com')));
-
- SiteUrls::clearSitesCache();
-
- // make sure is empty now
- $this->assertValueInCache(false);
- }
-
- public function testGetAllCachedSiteUrls_ShouldReadFromTheCacheFile()
- {
- $urlsToFake = array(1 => 'Whatever');
- $cache = new CacheFile('tracker', 600);
- $cache->set('allSiteUrlsPerSite', $urlsToFake);
-
- $actual = $this->siteUrls->getAllCachedSiteUrls();
-
- $this->assertEquals($urlsToFake, $actual);
- }
-
- private function assertSiteUrls($expectedUrls)
- {
- $urls = $this->siteUrls->getAllSiteUrls();
- $this->assertEquals($expectedUrls, $urls);
- }
-
- private function assertCachedSiteUrls($expectedUrls)
- {
- $urls = $this->siteUrls->getAllCachedSiteUrls();
- $this->assertEquals($expectedUrls, $urls);
- }
-
- private function addSite($urls)
- {
- $this->api->addSite('siteName', func_get_args());
- }
-
- private function assertValueInCache($value)
- {
- $cache = new CacheFile('tracker', 600);
- $siteUrls = $cache->get('allSiteUrlsPerSite');
-
- $this->assertEquals($value, $siteUrls);
- }
-}
diff --git a/plugins/UserCountry/LocationProvider/GeoIp/Php.php b/plugins/UserCountry/LocationProvider/GeoIp/Php.php
index 1bbf781d4f..2a3fda9dee 100755
--- a/plugins/UserCountry/LocationProvider/GeoIp/Php.php
+++ b/plugins/UserCountry/LocationProvider/GeoIp/Php.php
@@ -135,7 +135,7 @@ class Php extends GeoIp
}
// NOTE: ISP & ORG require commercial dbs to test. this code has been tested manually,
- // but not by integration tests.
+ // but not by system tests.
$ispGeoIp = $this->getGeoIpInstance($key = 'isp');
if ($ispGeoIp) {
$isp = geoip_org_by_addr($ispGeoIp, $ip);
diff --git a/plugins/UserCountry/tests/Unit/UserCountryTest.php b/plugins/UserCountry/tests/Unit/UserCountryTest.php
new file mode 100644
index 0000000000..540be65d70
--- /dev/null
+++ b/plugins/UserCountry/tests/Unit/UserCountryTest.php
@@ -0,0 +1,185 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+namespace Piwik\Plugins\UserCountry\tests\Unit;
+
+use Piwik\Plugins\UserCountry\GeoIPAutoUpdater;
+use Piwik\Plugins\UserCountry\LocationProvider\GeoIp;
+use Piwik\Plugins\UserCountry;
+use Piwik\Plugins\UserCountry\LocationProvider;
+use Exception;
+
+require_once PIWIK_INCLUDE_PATH . '/plugins/UserCountry/UserCountry.php';
+require_once PIWIK_INCLUDE_PATH . '/plugins/UserCountry/functions.php';
+require_once PIWIK_INCLUDE_PATH . '/core/DataFiles/Countries.php';
+
+class UserCountryTest extends \PHPUnit_Framework_Testcase
+{
+ /**
+ * @group Plugins
+ */
+ public function testGetFlagFromCode()
+ {
+ $flag = \Piwik\Plugins\UserCountry\getFlagFromCode("us");
+ $this->assertEquals(basename($flag), "us.png");
+ }
+
+ /**
+ * @group Plugins
+ */
+ public function testGetFlagFromInvalidCode()
+ {
+ $flag = \Piwik\Plugins\UserCountry\getFlagFromCode("foo");
+ $this->assertEquals(basename($flag), "xx.png");
+ }
+
+ /**
+ * @group Plugins
+ */
+ public function testFlagsAndContinents()
+ {
+ require PIWIK_PATH_TEST_TO_ROOT . '/core/DataFiles/Countries.php';
+
+ $continents = $GLOBALS['Piwik_ContinentList'];
+ $countries = array_merge($GLOBALS['Piwik_CountryList'], $GLOBALS['Piwik_CountryList_Extras']);
+
+ // Get list of existing flag icons
+ $flags = scandir(PIWIK_PATH_TEST_TO_ROOT . '/plugins/UserCountry/images/flags/');
+
+ // Get list of countries
+ foreach ($countries as $country => $continent) {
+ // test continent
+ $this->assertContains($continent, $continents);
+
+ // test flag
+ $this->assertContains($country . '.png', $flags);
+ }
+
+ foreach ($flags as $filename) {
+ if ($filename == '.' || $filename == '..') {
+ continue;
+ }
+
+ $country = substr($filename, 0, strpos($filename, '.png'));
+
+ // test country
+ $this->assertArrayHasKey($country, $countries, $filename);
+ }
+ }
+
+ /**
+ * Test that redundant checks work.
+ *
+ * @group Plugins
+ */
+ public function testGeoIpUpdaterRedundantChecks()
+ {
+ GeoIp::$geoIPDatabaseDir = 'tests/lib/geoip-files';
+ LocationProvider::$providers = null;
+
+ // create empty ISP & Org files
+ $this->createEmptyISPOrgFiles();
+
+ // run redundant checks
+ $updater = new Piwik_UserCountry_GeoIPAutoUpdater_publictest();
+ $updater->performRedundantDbChecks();
+
+ // check that files are renamed correctly
+ $this->checkBrokenGeoIPState();
+
+ // create empty files again & run checks again
+ $this->createEmptyISPOrgFiles();
+ $updater->performRedundantDbChecks();
+
+ // check that w/ broken files already there, redundant checks still work correctly
+ $this->checkBrokenGeoIPState();
+ }
+
+ /**
+ * @group Plugins
+ *
+ * @dataProvider getInvalidGeoIpUrlsToTest
+ */
+ public function testGeoIpDownloadInvalidUrl($url)
+ {
+ $updater = new Piwik_UserCountry_GeoIPAutoUpdater_publictest();
+ try {
+ $updater->downloadFile('loc', $url);
+ $this->fail("Downloading invalid url succeeded!");
+ } catch (Exception $ex) {
+ $this->assertEquals("UserCountry_UnsupportedArchiveType", $ex->getMessage());
+ }
+ }
+
+ public function getInvalidGeoIpUrlsToTest()
+ {
+ return array(array("http://localhost/tests/resources/geoip.tar"),
+ array("http://localhost/tests/resources/geoip.tar.bz2"),
+ array("http://localhost/tests/resources/geoip.dat"));
+ }
+
+ public function setUp()
+ {
+ // empty
+ }
+
+ public function tearDown()
+ {
+ $geoIpDirPath = PIWIK_INCLUDE_PATH . '/tests/lib/geoip-files';
+ $filesToRemove = array('GeoIPISP.dat.broken', 'GeoIPOrg.dat.broken', 'GeoIPISP.dat', 'GeoIPOrg.dat');
+
+ foreach ($filesToRemove as $name) {
+ $path = $geoIpDirPath . '/' . $name;
+ if (file_exists($path)) {
+ unlink($path);
+ }
+ }
+ }
+
+ private function createEmptyISPOrgFiles()
+ {
+ $geoIpDir = PIWIK_INCLUDE_PATH . '/tests/lib/geoip-files';
+
+ $fd = fopen($geoIpDir . '/GeoIPISP.dat', 'w');
+ fclose($fd);
+
+ $fd = fopen($geoIpDir . '/GeoIPOrg.dat', 'w');
+ fclose($fd);
+ }
+
+ private function checkBrokenGeoIPState()
+ {
+ $geoIpDir = PIWIK_INCLUDE_PATH . '/tests/lib/geoip-files';
+
+ $this->assertFalse(file_exists($geoIpDir . '/GeoIPCity.dat.broken'));
+
+ $this->assertFalse(file_exists($geoIpDir . '/GeoIPISP.dat'));
+ $this->assertTrue(file_exists($geoIpDir . '/GeoIPISP.dat.broken'));
+
+ $this->assertFalse(file_exists($geoIpDir . '/GeoIPOrg.dat'));
+ $this->assertTrue(file_exists($geoIpDir . '/GeoIPOrg.dat.broken'));
+ }
+}
+
+class Piwik_UserCountry_GeoIPAutoUpdater_publictest extends GeoIPAutoUpdater
+{
+ public function __construct()
+ {
+ // empty
+ }
+
+ public function performRedundantDbChecks()
+ {
+ parent::performRedundantDbChecks();
+ }
+
+ public function downloadFile($type, $url)
+ {
+ parent::downloadFile($type, $url);
+ }
+}
diff --git a/plugins/UserSettings/.gitignore b/plugins/UserSettings/.gitignore
new file mode 100644
index 0000000000..c8c9480010
--- /dev/null
+++ b/plugins/UserSettings/.gitignore
@@ -0,0 +1 @@
+tests/System/processed/*xml \ No newline at end of file
diff --git a/plugins/UserSettings/tests/Fixtures/LanguageFixture.php b/plugins/UserSettings/tests/Fixtures/LanguageFixture.php
index 227ea016ea..6cbd9d8343 100644
--- a/plugins/UserSettings/tests/Fixtures/LanguageFixture.php
+++ b/plugins/UserSettings/tests/Fixtures/LanguageFixture.php
@@ -10,7 +10,7 @@
namespace Piwik\Plugins\UserSettings\tests\Fixtures;
-use Piwik\Tests\Fixture;
+use Piwik\Tests\Impl\Fixture;
use Piwik\Date;
use Piwik\Common;
diff --git a/plugins/UserSettings/tests/GetLanguageIntegrationTest.php b/plugins/UserSettings/tests/GetLanguageIntegrationTest.php
deleted file mode 100644
index 9dac446e6c..0000000000
--- a/plugins/UserSettings/tests/GetLanguageIntegrationTest.php
+++ /dev/null
@@ -1,75 +0,0 @@
-<?php
-/**
- * Piwik - free/libre analytics platform
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- *
- */
-namespace Piwik\Plugins\UserSettings\tests;
-
-
-use Piwik\Plugins\UserSettings\tests\Fixtures\LanguageFixture;
-use Piwik\Tests\IntegrationTestCase;
-
-/**
- * Class GetLanguageIntegrationTest
- * @package Piwik\Plugins\UserSettings\tests
- * @group GetLanguageIntegrationTest
- * @group Plugins
- * @group UserSettings
- */
-class GetLanguageIntegrationTest extends IntegrationTestCase {
-
- public static $fixture = null;
-
- public static function getOutputPrefix()
- {
- return '';
- }
-
- /**
- * @param $api
- * @param $params
- * @dataProvider getApiForTesting
- * @group GetLanguageIntegrationTest
- */
- public function testApi($api, $params)
- {
- $this->runApiTests($api, $params);
- }
-
- /**
- * @return array
- */
- public function getApiForTesting()
- {
-
- $apiToCall = array(
- "UserSettings.getLanguage",
- "UserSettings.getLanguageCode"
- );
-
- $apiToTest = array();
-
- $apiToTest[] = array(
- $apiToCall,
- array(
- 'idSite' => self::$fixture->idSite,
- 'date' => self::$fixture->dateTime,
- 'periods' => array('day')
- )
- );
-
- return $apiToTest;
- }
-
-
- public static function getPathToTestDirectory()
- {
- return dirname(__FILE__);
- }
-
-}
-
-GetLanguageIntegrationTest::$fixture = new LanguageFixture(); \ No newline at end of file
diff --git a/plugins/UserSettings/tests/System/GetLanguageSystemTest.php b/plugins/UserSettings/tests/System/GetLanguageSystemTest.php
new file mode 100644
index 0000000000..70db55616b
--- /dev/null
+++ b/plugins/UserSettings/tests/System/GetLanguageSystemTest.php
@@ -0,0 +1,74 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\UserSettings\tests\System;
+
+
+use Piwik\Plugins\UserSettings\tests\Fixtures\LanguageFixture;
+use Piwik\Tests\Impl\SystemTestCase;
+
+/**
+ * Class GetLanguageSystemTest
+ * @package Piwik\Plugins\UserSettings\tests
+ * @group GetLanguageSystemTest
+ * @group Plugins
+ * @group UserSettings
+ */
+class GetLanguageSystemTest extends SystemTestCase {
+
+ public static $fixture = null;
+
+ public static function getOutputPrefix()
+ {
+ return '';
+ }
+
+ /**
+ * @param $api
+ * @param $params
+ * @dataProvider getApiForTesting
+ * @group GetLanguageSystemTest
+ */
+ public function testApi($api, $params)
+ {
+ $this->runApiTests($api, $params);
+ }
+
+ /**
+ * @return array
+ */
+ public function getApiForTesting()
+ {
+ $apiToCall = array(
+ "UserSettings.getLanguage",
+ "UserSettings.getLanguageCode"
+ );
+
+ $apiToTest = array();
+
+ $apiToTest[] = array(
+ $apiToCall,
+ array(
+ 'idSite' => self::$fixture->idSite,
+ 'date' => self::$fixture->dateTime,
+ 'periods' => array('day')
+ )
+ );
+
+ return $apiToTest;
+ }
+
+
+ public static function getPathToTestDirectory()
+ {
+ return dirname(__FILE__);
+ }
+
+}
+
+GetLanguageSystemTest::$fixture = new LanguageFixture(); \ No newline at end of file
diff --git a/plugins/UserSettings/tests/expected/test___UserSettings.getLanguageCode_day.xml b/plugins/UserSettings/tests/System/expected/test___UserSettings.getLanguageCode_day.xml
index 689e3d7d37..689e3d7d37 100644
--- a/plugins/UserSettings/tests/expected/test___UserSettings.getLanguageCode_day.xml
+++ b/plugins/UserSettings/tests/System/expected/test___UserSettings.getLanguageCode_day.xml
diff --git a/plugins/UserSettings/tests/expected/test___UserSettings.getLanguage_day.xml b/plugins/UserSettings/tests/System/expected/test___UserSettings.getLanguage_day.xml
index 6bb328c660..6bb328c660 100644
--- a/plugins/UserSettings/tests/expected/test___UserSettings.getLanguage_day.xml
+++ b/plugins/UserSettings/tests/System/expected/test___UserSettings.getLanguage_day.xml
diff --git a/plugins/UserSettings/tests/processed/.gitkeep b/plugins/UserSettings/tests/System/processed/.gitkeep
index e69de29bb2..e69de29bb2 100644
--- a/plugins/UserSettings/tests/processed/.gitkeep
+++ b/plugins/UserSettings/tests/System/processed/.gitkeep
diff --git a/plugins/UserSettings/tests/Unit/UserSettingsTest.php b/plugins/UserSettings/tests/Unit/UserSettingsTest.php
new file mode 100644
index 0000000000..408420ed6f
--- /dev/null
+++ b/plugins/UserSettings/tests/Unit/UserSettingsTest.php
@@ -0,0 +1,1036 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+namespace Piwik\Plugins\UserSettings\tests\Unit;
+
+use UserAgentParser;
+
+require_once PIWIK_INCLUDE_PATH . '/plugins/UserSettings/UserSettings.php';
+require_once PIWIK_INCLUDE_PATH . '/plugins/UserSettings/functions.php';
+
+class UserSettingsTest extends \PHPUnit_Framework_TestCase
+{
+ // User agent strings and expected parser results
+ public function getUserAgents()
+ {
+ return array(
+ // array('User Agent String', array(
+ // array( browser_id, name, short_name, version, major_number, minor_number, family ),
+ // array( os_id, name, short_name ))),
+
+ // Special: URL encoded IE8
+ array('Mozilla/4.0+(compatible;+MSIE+8.0;+Windows+NT+6.1;+WOW64;+Trident/4.0;+GTB7.4;+SLCC2;+.NET+CLR+2.0.50727;+.NET+CLR+3.5.30729;+.NET+CLR+3.0.30729;+Media+Center+PC+6.0;+.NET4.0C;+.NET4.0E;+MS-RTC+LM+8;+InfoPath.2)', array(
+ array('IE', 'Internet Explorer', 'IE', '8.0', '8', '0', 'ie'),
+ array('WI7', 'Windows 7', 'Win 7'))),
+
+ // ABrowse
+ array('Mozilla/5.0 (compatible; U; ABrowse 0.6; Syllable) AppleWebKit/420+ (KHTML, like Gecko)', array(
+ array('AB', 'ABrowse', 'ABrowse', '0.6', '0', '6', 'webkit'),
+ array('SYL', 'Syllable', 'Syllable'))),
+ array('Mozilla/5.0 (compatible; ABrowse 0.4; Syllable)', array(
+ array('AB', 'ABrowse', 'ABrowse', '0.4', '0', '4', 'webkit'),
+ array('SYL', 'Syllable', 'Syllable'))),
+
+ // Acoo Browser (treat as IE)
+ array('Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; GTB6; Acoo Browser; .NET CLR 1.1.4322; .NET CLR 2.0.50727)', array(
+ array('IE', 'Internet Explorer', 'IE', '8.0', '8', '0', 'ie'),
+ array('WXP', 'Windows XP', 'Win XP'))),
+ array('Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Acoo Browser; .NET CLR 2.0.50727; .NET CLR 1.1.4322)', array(
+ array('IE', 'Internet Explorer', 'IE', '7.0', '7', '0', 'ie'),
+ array('WXP', 'Windows XP', 'Win XP'))),
+ array('Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Acoo Browser; .NET CLR 1.1.4322; .NET CLR 2.0.50727)', array(
+ array('IE', 'Internet Explorer', 'IE', '6.0', '6', '0', 'ie'),
+ array('WXP', 'Windows XP', 'Win XP'))),
+
+ // Amaya
+ array('amaya/9.52 libwww/5.4.0', array(
+ array('AM', 'Amaya', 'Amaya', '9.52', '9', '52', 'unknown'),
+ false)),
+
+ // AmigaVoyager
+ array('AmigaVoyager/3.2 (AmigaOS/MC680x0)', array(
+ array('AV', 'AmigaVoyager', 'AmigaVoyager', '3.2', '3', '2', 'unknown'),
+ array('AMI', 'AmigaOS', 'AmigaOS'))),
+ array('AmigaVoyager/2.95 (compatible; MC680x0; AmigaOS; SV1)', array(
+ array('AV', 'AmigaVoyager', 'AmigaVoyager', '2.95', '2', '95', 'unknown'),
+ array('AMI', 'AmigaOS', 'AmigaOS'))),
+ array('AmigaVoyager/2.95 (compatible; MC680x0; AmigaOS)', array(
+ array('AV', 'AmigaVoyager', 'AmigaVoyager', '2.95', '2', '95', 'unknown'),
+ array('AMI', 'AmigaOS', 'AmigaOS'))),
+
+ // Android
+ array('Mozilla/5.0 (Linux; U; Android 1.1; en-us; dream) AppleWebKit/525.10+ (KHTML, like Gecko) Version/3.0.4 Mobile Safari/523.12.2', array(
+ array('SF', 'Safari', 'Safari', '3.0', '3', '0', 'webkit'),
+ array('AND', 'Android', 'Android'))),
+ array('Mozilla/5.0 (Linux; U; Android 2.2.1; en-us; Nexus One Build/FRG83) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1', array(
+ array('SF', 'Safari', 'Safari', '4.0', '4', '0', 'webkit'),
+ array('AND', 'Android', 'Android'))),
+ array('Mozilla/5.0 (Linux; U; Android 2.2.1; en-us; device Build/FRG83) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Safari/533.1', array(
+ array('SF', 'Safari', 'Safari', '4.0', '4', '0', 'webkit'),
+ array('AND', 'Android', 'Android'))),
+ array('Mozilla/5.0 (Linux; U; Android 4.0.1; en-us; Galaxy Nexus Build/ITL41D) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30', array(
+ array('SF', 'Safari', 'Safari', '4.0', '4', '0', 'webkit'),
+ array('AND', 'Android', 'Android'))),
+
+ // Android - Mobile Chrome
+ /*
+ array('rray('Mozilla/5.0 (Linux; U; Android 4.1; en-us) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.16 Safari/534.24', array(
+ array('CH', 'Chrome', 'Chrome', '11.0', '11', '0', 'webkit'),
+ array('AND', 'Android', 'Android'))),
+ */
+ array('Mozilla/5.0 (Linux; U; Android 4.0.1; en-us; Galaxy Nexus Build/ITL41F) AppleWebKit/535.7 (KHTML, like Gecko) CrMo/16.0.912.75 Mobile Safari/535.7', array(
+ array('CH', 'Chrome', 'Chrome', '16.0', '16', '0', 'webkit'),
+ array('AND', 'Android', 'Android'))),
+
+ // AOL / America Online Browser (treat as IE)
+ array('Mozilla/4.0 (compatible; MSIE 7.0; AOL 9.5; AOLBuild 4337.43; Windows NT 5.1; .NET CLR 1.1.4322)', array(
+ array('IE', 'Internet Explorer', 'IE', '7.0', '7', '0', 'ie'),
+ array('WXP', 'Windows XP', 'Win XP'))),
+ array('Mozilla/4.0 (compatible; MSIE 7.0; AOL 9.1; AOLBuild 4334.5009; Windows NT 5.1; GTB5; .NET CLR 1.1.4322)', array(
+ array('IE', 'Internet Explorer', 'IE', '7.0', '7', '0', 'ie'),
+ array('WXP', 'Windows XP', 'Win XP'))),
+ array('Mozilla/4.0 (compatible; MSIE 7.0; AOL 9.0; Windows NT 5.1; InfoPath.1)', array(
+ array('IE', 'Internet Explorer', 'IE', '7.0', '7', '0', 'ie'),
+ array('WXP', 'Windows XP', 'Win XP'))),
+ array('Mozilla/4.0 (compatible; MSIE 6.0; AOL 8.0; Windows NT 5.1; SV1)', array(
+ array('IE', 'Internet Explorer', 'IE', '6.0', '6', '0', 'ie'),
+ array('WXP', 'Windows XP', 'Win XP'))),
+ array('Mozilla/4.0 (compatible; MSIE 7.0; AOL 7.0; Windows NT 5.1)', array(
+ array('IE', 'Internet Explorer', 'IE', '7.0', '7', '0', 'ie'),
+ array('WXP', 'Windows XP', 'Win XP'))),
+ array('Mozilla/4.0 (compatible; MSIE 5.5; AOL 6.0; Windows 98; Win 9x 4.90)', array(
+ array('IE', 'Internet Explorer', 'IE', '5.5', '5', '5', 'ie'),
+ array('WME', 'Windows Me', 'Win Me'))),
+ array('Mozilla/4.0 (compatible; MSIE 5.5; AOL 5.0; Windows NT 5.0)', array(
+ array('IE', 'Internet Explorer', 'IE', '5.5', '5', '5', 'ie'),
+ array('W2K', 'Windows 2000', 'Win 2000'))),
+ array('Mozilla/4.0 (compatible; MSIE 4.01; AOL 4.0; Windows 95)', array(
+ array('IE', 'Internet Explorer', 'IE', '4.01', '4', '01', 'ie'),
+ array('W95', 'Windows 95', 'Win 95'))),
+ array('Mozilla/4.0 (compatible; MSIE 7.0; America Online Browser 1.1; Windows NT 5.1; (R1 1.5); .NET CLR 2.0.50727; InfoPath.1)', array(
+ array('IE', 'Internet Explorer', 'IE', '7.0', '7', '0', 'ie'),
+ array('WXP', 'Windows XP', 'Win XP'))),
+ array('Mozilla/4.0 (compatible; MSIE 6.0; America Online Browser 1.1; Windows 98)', array(
+ array('IE', 'Internet Explorer', 'IE', '6.0', '6', '0', 'ie'),
+ array('W98', 'Windows 98', 'Win 98'))),
+
+ // Arora
+ array('Mozilla/5.0 (X11; U; Linux; de-DE) AppleWebKit/527+ (KHTML, like Gecko, Safari/419.3) Arora/0.8.0', array(
+ array('AR', 'Arora', 'Arora', '0.8', '0', '8', 'webkit'),
+ array('LIN', 'Linux', 'Linux'))),
+ array('Mozilla/5.0 (X11; U; Linux; en-US) AppleWebKit/527+ (KHTML, like Gecko, Safari/419.3) Arora/0.6', array(
+ array('AR', 'Arora', 'Arora', '0.6', '0', '6', 'webkit'),
+ array('LIN', 'Linux', 'Linux'))),
+ array('Mozilla/5.0 (Windows; U; Windows NT 5.2; pt-BR) AppleWebKit/527+ (KHTML, like Gecko, Safari/419.3) Arora/0.4 (Change: )', array(
+ array('AR', 'Arora', 'Arora', '0.4', '0', '4', 'webkit'),
+ array('WS3', 'Windows Server 2003 / XP x64', 'Win S2003'))),
+ array('Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN) AppleWebKit/523.15 (KHTML, like Gecko, Safari/419.3) Arora/0.3 (Change: 287 c9dfb30)', array(
+ array('AR', 'Arora', 'Arora', '0.3', '0', '3', 'webkit'),
+ array('WXP', 'Windows XP', 'Win XP'))),
+ array('Mozilla/5.0 (X11; U; Linux; en-US) AppleWebKit/523.15 (KHTML, like Gecko, Safari/419.3) Arora/0.2 (Change: 189 35c14e0)', array(
+ array('AR', 'Arora', 'Arora', '0.2', '0', '2', 'webkit'),
+ array('LIN', 'Linux', 'Linux'))),
+
+ // Avant (treat as IE)
+ array('Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Avant Browser; .NET CLR 2.0.50727; MAXTHON 2.0)', array(
+ array('IE', 'Internet Explorer', 'IE', '7.0', '7', '0', 'ie'),
+ array('WXP', 'Windows XP', 'Win XP'))),
+ array('Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; Avant Browser; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0)', array(
+ array('IE', 'Internet Explorer', 'IE', '8.0', '8', '0', 'ie'),
+ array('WI7', 'Windows 7', 'Win 7'))),
+
+ // AWeb
+ array('Amiga-AWeb/3.5.07 beta', array(
+ array('AW', 'Amiga AWeb', 'AWeb', '3.5', '3', '5', 'unknown'),
+ array('AMI', 'AmigaOS', 'AmigaOS'))),
+ array('Mozilla/6.0; (Spoofed by Amiga-AWeb/3.5.07 beta)', array(
+ array('AW', 'Amiga AWeb', 'AWeb', '3.5', '3', '5', 'unknown'),
+ array('AMI', 'AmigaOS', 'AmigaOS'))),
+ array('MSIE/6.0; (Spoofed by Amiga-AWeb/3.4APL)', array(
+ array('AW', 'Amiga AWeb', 'AWeb', '3.4', '3', '4', 'unknown'),
+ array('AMI', 'AmigaOS', 'AmigaOS'))),
+
+ // Beonex
+ array('Mozilla/5.0 (Windows; U; WinNT; en; rv:1.0.2) Gecko/20030311 Beonex/0.8.2-stable', array(
+ array('BE', 'Beonex', 'Beonex', '0.8', '0', '8', 'unknown'),
+ array('WNT', 'Windows NT', 'Win NT'))),
+ array('Mozilla/5.0 (Windows; U; WinNT; en; Preview) Gecko/20020603 Beonex/0.8-stable', array(
+ array('BE', 'Beonex', 'Beonex', '0.8', '0', '8', 'unknown'),
+ array('WNT', 'Windows NT', 'Win NT'))),
+
+ // BlackBerry
+ array('BlackBerry8700/4.1.0 Profile/MIDP-2.0 Configuration/CLDC-1.1', array(
+ array('BB', 'BlackBerry', 'BlackBerry', '4.1', '4', '1', 'webkit'),
+ array('BLB', 'BlackBerry', 'BlackBerry'))),
+
+ array('Mozilla/5.0 (BlackBerry; U; BlackBerry 9800; en) AppleWebKit/534.1+ (KHTML, Like Gecko) Version/6.0.0.141 Mobile Safari/534.1+', array(
+ array('BB', 'BlackBerry', 'BlackBerry', '6.0', '6', '0', 'webkit'),
+ array('BLB', 'BlackBerry', 'BlackBerry'))),
+
+ array('Mozilla/5.0 (PlayBook; U; RIM Tablet OS 1.0.0; en-US) AppleWebKit/534.11+ (KHTML, like Gecko) Version/0.0.1 Safari/534.11+', array(
+ array('BP', 'PlayBook', 'PlayBook', '0.0', '0', '0', 'webkit'),
+ array('QNX', 'QNX', 'QNX'))),
+
+ // BrowseX
+ array('Mozilla/4.61 [en] (X11; U; ) - BrowseX (2.0.0 Windows)', array(
+ array('BX', 'BrowseX', 'BrowseX', '2.0', '2', '0', 'unknown'),
+ false)),
+
+ // Camino (formerly known as Chimera; not to be confused with another browser also named Chimera)
+ array('Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en; rv:1.9.0.8pre) Gecko/2009022800 Camino/2.0b3pre', array(
+ array('CA', 'Camino', 'Camino', '2.0', '2', '0', 'gecko'),
+ array('MAC', 'Mac OS', 'Mac OS'))),
+ array('Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en; rv:1.9.0.10pre) Gecko/2009041800 Camino/2.0b3pre (like Firefox/3.0.10pre)', array(
+ array('CA', 'Camino', 'Camino', '2.0', '2', '0', 'gecko'),
+ array('MAC', 'Mac OS', 'Mac OS'))),
+ array('Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en; rv:1.8.1.4pre) Gecko/20070511 Camino/1.6pre', array(
+ array('CA', 'Camino', 'Camino', '1.6', '1', '6', 'gecko'),
+ array('MAC', 'Mac OS', 'Mac OS'))),
+ array('Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en; rv:1.8.1.6) Gecko/20070809 Firefox/2.0.0.6 Camino/1.5.1', array(
+ array('CA', 'Camino', 'Camino', '1.5', '1', '5', 'gecko'),
+ array('MAC', 'Mac OS', 'Mac OS'))),
+ array('Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.0.1) Gecko/20030306 Camino/0.7', array(
+ array('CA', 'Camino', 'Camino', '0.7', '0', '7', 'gecko'),
+ array('MAC', 'Mac OS', 'Mac OS'))),
+ array('Mozilla/5.0 (Macintosh; U; PPC Mac OS X; pl-PL; rv:1.0.1) Gecko/20021111 Chimera/0.6', array(
+ array('CA', 'Camino', 'Camino', '0.6', '0', '6', 'gecko'),
+ array('MAC', 'Mac OS', 'Mac OS'))),
+
+ // Cheshire
+ array('Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/418.8 (KHTML, like Gecko, Safari) Cheshire/1.0.UNOFFICIAL', array(
+ array('CS', 'Cheshire', 'Cheshire', '1.0', '1', '0', 'webkit'),
+ array('MAC', 'Mac OS', 'Mac OS'))),
+ array('Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/419 (KHTML, like Gecko, Safari/419.3) Cheshire/1.0.ALPHA', array(
+ array('CS', 'Cheshire', 'Cheshire', '1.0', '1', '0', 'webkit'),
+ array('MAC', 'Mac OS', 'Mac OS'))),
+ array('Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/418.9 (KHTML, like Safari) Cheshire/1.0.ALPHA', array(
+ array('CS', 'Cheshire', 'Cheshire', '1.0', '1', '0', 'webkit'),
+ array('MAC', 'Mac OS', 'Mac OS'))),
+
+ // Chrome / Chromium
+ array('Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US) AppleWebKit/532.9 (KHTML, like Gecko) Chrome/5.0.310.0 Safari/532.9', array(
+ array('CH', 'Chrome', 'Chrome', '5.0', '5', '0', 'webkit'),
+ array('WS3', 'Windows Server 2003 / XP x64', 'Win S2003'))),
+ array('Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.19 (KHTML, like Gecko) Chrome/1.0.154.48 Safari/525.19', array(
+ array('CH', 'Chrome', 'Chrome', '1.0', '1', '0', 'webkit'),
+ array('WXP', 'Windows XP', 'Win XP'))),
+ array('Mozilla/5.0 (Linux; U; en-US) AppleWebKit/525.13 (KHTML, like Gecko) Chrome/0.2.149.27 Safari/525.13', array(
+ array('CH', 'Chrome', 'Chrome', '0.2', '0', '2', 'webkit'),
+ array('LIN', 'Linux', 'Linux'))),
+ array('Mozilla/5.0 (Windows NT 6.0; WOW64) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.16 Safari/534.24', array(
+ array('CH', 'Chrome', 'Chrome', '11.0', '11', '0', 'webkit'),
+ array('WVI', 'Windows Vista', 'Win Vista'))),
+ array('Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.16 Safari/534.24', array(
+ array('CH', 'Chrome', 'Chrome', '11.0', '11', '0', 'webkit'),
+ array('LIN', 'Linux', 'Linux'))),
+
+ // Chrome Frame
+ array('Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; chromeframe/11.0.660.0)', array(
+ array('CF', 'Chrome Frame', 'Chrome Frame', '11.0', '11', '0', 'webkit'),
+ array('WXP', 'Windows XP', 'Win XP'))),
+ array('Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) chromeframe/11.0.660.0', array(
+ array('CF', 'Chrome Frame', 'Chrome Frame', '11.0', '11', '0', 'webkit'),
+ array('WXP', 'Windows XP', 'Win XP'))),
+ array('Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; chromeframe/11.0.660.0) AppleWebKit/534.18 (KHTML, like Gecko) Chrome/11.0.660.0 Safari/534.18', array(
+ array('CF', 'Chrome Frame', 'Chrome Frame', '11.0', '11', '0', 'webkit'),
+ array('WXP', 'Windows XP', 'Win XP'))),
+ array('Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/534.18 (KHTML, like Gecko) Chrome/11.0.660.0 Safari/534.18', array(
+ array('CH', 'Chrome', 'Chrome', '11.0', '11', '0', 'webkit'),
+ array('WXP', 'Windows XP', 'Win XP'))),
+
+ // ChromePlus (treat as Chrome)
+ array('Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.2 (KHTML, like Gecko) ChromePlus/4.0.222.3 Chrome/4.0.222.3 Safari/532.2', array(
+ array('CH', 'Chrome', 'Chrome', '4.0', '4', '0', 'webkit'),
+ array('WXP', 'Windows XP', 'Win XP'))),
+ array('Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.28.3 (KHTML, like Gecko) Version/3.2.3 ChromePlus/4.0.222.3 Chrome/4.0.222.3 Safari/525.28.3', array(
+ array('CH', 'Chrome', 'Chrome', '3.2', '3', '2', 'webkit'),
+ array('WXP', 'Windows XP', 'Win XP'))),
+
+ // CometBird
+ array('Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.5) Gecko/2009011615 Firefox/3.0.5 CometBird/3.0.5', array(
+ array('CO', 'CometBird', 'CometBird', '3.0', '3', '0', 'gecko'),
+ array('WXP', 'Windows XP', 'Win XP'))),
+
+ // Crazy Browser (treat as IE)
+ array('Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; InfoPath.2; .NET CLR 2.0.50727; .NET CLR 1.1.4322; Crazy Browser 3.0.0 Beta2)', array(
+ array('IE', 'Internet Explorer', 'IE', '7.0', '7', '0', 'ie'),
+ array('WXP', 'Windows XP', 'Win XP'))),
+ array('Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Avant Browser; .NET CLR 2.0.50727; .NET CLR 3.0.04506.590; .NET CLR 3.5.20706; Crazy Browser 2.0.1)', array(
+ array('IE', 'Internet Explorer', 'IE', '7.0', '7', '0', 'ie'),
+ array('WXP', 'Windows XP', 'Win XP'))),
+
+ // Dillo
+ array('Dillo/2.0', array(
+ array('DI', 'Dillo', 'Dillo', '2.0', '2', '0', 'unknown'),
+ false)),
+ array('Dillo/0.6.4', array(
+ array('DI', 'Dillo', 'Dillo', '0.6', '0', '6', 'unknown'),
+ false)),
+
+ // Dolfin (or Dolphin, depending on which Samsung documentation you read); and yes, it's "bada" (lower-case)
+ array('Mozilla/5.0 (SAMSUNG; SAMSUNG-GT-S5250/S5250AIJI3; U; Bada/1.0; it-it) AppleWebKit/533.1 (KHTML, like Gecko) Dolfin/2.0 Mobile WQVGA SMM-MMS/1.2.0 NexPlayer/3.0 profile/MIDP-2.1 configuration/CLDC-1.1 OPN-B', array(
+ array('DF', 'Dolfin', 'Dolfin', '2.0', '2', '0', 'webkit'),
+ array('SBA', 'bada', 'bada'))),
+ array('Mozilla/5.0 (SAMSUNG; SAMSUNG-GT-S8530/S8530XXJKA; U; Bada/1.2; en-us) AppleWebKit/533.1 (KHTML, like Gecko) Dolfin/2.2 Mobile WVGA SMM-MMS/1.2.0 OPN-B', array(
+ array('DF', 'Dolfin', 'Dolfin', '2.2', '2', '2', 'webkit'),
+ array('SBA', 'bada', 'bada'))),
+
+ // ELinks
+ array('ELinks/0.12~pre2.dfsg0-1ubuntu1-lite (textmode; Debian; Linux 2.6.32-4-jolicloud i686; 143x37-2)', array(
+ array('EL', 'ELinks', 'ELinks', '0.12', '0', '12', 'unknown'),
+ array('LIN', 'Linux', 'Linux'))),
+ array('ELinks/0.12pre5.GIT (textmode; CYGWIN_NT-6.1 1.7.1(0.218/5/3) i686; 80x24-2)', array(
+ array('EL', 'ELinks', 'ELinks', '0.12', '0', '12', 'unknown'),
+ array('WI7', 'Windows 7', 'Win 7'))),
+ array('ELinks (0.4.3; NetBSD 3.0.2_PATCH sparc64; 141x19)', array(
+ array('EL', 'ELinks', 'ELinks', '0.4', '0', '4', 'unknown'),
+ array('NBS', 'NetBSD', 'NetBSD'))),
+
+ // Epiphany
+ array('Mozilla/5.0 (X11; U; Linux i686; en-us) AppleWebKit/531.2+ (KHTML, like Gecko) Safari/531.2+ Epiphany/2.29.5', array(
+ array('EP', 'Epiphany', 'Epiphany', '2.29', '2', '29', 'webkit'),
+ array('LIN', 'Linux', 'Linux'))),
+ array('Mozilla/5.0 (X11; U; Linux i686; en; rv:1.9.0.11) Gecko/20080528 Epiphany/2.22 Firefox/3.0', array(
+ // technically, this should be 'gecko' but UserAgentParser only supports one browserType (family) per browser
+ array('EP', 'Epiphany', 'Epiphany', '2.22', '2', '22', 'webkit'),
+ array('LIN', 'Linux', 'Linux'))),
+
+ // Fennec
+ array('Mozilla/5.0 (Android; Linux armv7l; rv:2.0.1) Gecko/20100101 Firefox/4.0.1 Fennec/2.0.1', array(
+ array('FE', 'Fennec', 'Fennec', '2.0', '2', '0', 'gecko'),
+ array('AND', 'Android', 'Android'))),
+ array('Mozilla/5.0 (Maemo; Linux armv7l; rv2.0.1) Gecko/20100101 Firefox/4.0.1 Fennec/2.0.1', array(
+ array('FE', 'Fennec', 'Fennec', '2.0', '2', '0', 'gecko'),
+ array('MAE', 'Maemo', 'Maemo'))),
+ array('Mozilla/5.0 (X11; Linux i686; rv2.0.1) Gecko/20100101 Firefox/4.0.1 Fennec/2.0.1', array(
+ array('FE', 'Fennec', 'Fennec', '2.0', '2', '0', 'gecko'),
+ array('LIN', 'Linux', 'Linux'))),
+ array('Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2a1pre) Gecko/20090626 Fennec/1.0b2', array(
+ array('FE', 'Fennec', 'Fennec', '1.0', '1', '0', 'gecko'),
+ array('MAC', 'Mac OS', 'Mac OS'))),
+ array('Mozilla/5.0 (X11; U; Linux armv6l; en-US; rv:1.9.1b1pre) Gecko/20081005220218 Gecko/2008052201 Fennec/0.9pre', array(
+ array('FE', 'Fennec', 'Fennec', '0.9', '0', '9', 'gecko'),
+ array('LIN', 'Linux', 'Linux'))),
+ array('Mozilla/5.0 (X11; U; Linux armv6l; en-US; rv:1.9.1a1pre) Gecko/2008071707 Fennec/0.5', array(
+ array('FE', 'Fennec', 'Fennec', '0.5', '0', '5', 'gecko'),
+ array('LIN', 'Linux', 'Linux'))),
+
+ // Firefox (formerly Firebird, formerly Phoenix; and rebranded versions)
+ array('Mozilla/5.0 (X11; Linux i686; rv:5.0a2) Gecko/20110413 Firefox/5.0a2', array(
+ array('FF', 'Firefox', 'Firefox', '5.0', '5', '0', 'gecko'),
+ array('LIN', 'Linux', 'Linux'))),
+ array('Mozilla/5.0 (Windows NT 6.1; rv:2.0.1) Gecko/20100101 Firefox/4.0.1', array(
+ array('FF', 'Firefox', 'Firefox', '4.0', '4', '0', 'gecko'),
+ array('WI7', 'Windows 7', 'Win 7'))),
+ array('Mozilla/5.0 (X11; U; Linux i686; en-US; rv:2.0a1pre) Gecko/2008060602 Minefield/4.0a1pre', array(
+ array('FF', 'Firefox', 'Firefox', '4.0', '4', '0', 'gecko'),
+ array('LIN', 'Linux', 'Linux'))),
+ array('Mozilla/5.0 (X11; U; Linux i686; en-US; rv:2.0a1pre) Gecko/2008060602 Minefield/4.0a1p', array(
+ array('FF', 'Firefox', 'Firefox', '4.0', '4', '0', 'gecko'),
+ array('LIN', 'Linux', 'Linux'))),
+ array('Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2a2pre) Gecko/20090826 Namoroka/3.6a2pre', array(
+ array('FF', 'Firefox', 'Firefox', '3.6', '3', '6', 'gecko'),
+ array('WVI', 'Windows Vista', 'Win Vista'))),
+ array('Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2) Gecko/20100119 Namoroka/3.6', array(
+ array('FF', 'Firefox', 'Firefox', '3.6', '3', '6', 'gecko'),
+ array('WI7', 'Windows 7', 'Win 7'))),
+ array('Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1b4pre) Gecko/20090420 Shiretoko/3.5b4pre (.NET CLR 3.5.30729)', array(
+ array('FF', 'Firefox', 'Firefox', '3.5', '3', '5', 'gecko'),
+ array('WI7', 'Windows 7', 'Win 7'))),
+ array('Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.2) Gecko/20090803 Ubuntu/9.04 (jaunty) Shiretoko/3.5.2', array(
+ array('FF', 'Firefox', 'Firefox', '3.5', '3', '5', 'gecko'),
+ array('LIN', 'Linux', 'Linux'))),
+ array('Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.6) Gecko/2009011913 Firefox/3.0.6', array(
+ array('FF', 'Firefox', 'Firefox', '3.0', '3', '0', 'gecko'),
+ array('WXP', 'Windows XP', 'Win XP'))),
+ array('Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9a7) Gecko/2007080210 GranParadiso/3.0a7', array(
+ array('FF', 'Firefox', 'Firefox', '3.0', '3', '0', 'gecko'),
+ array('WVI', 'Windows Vista', 'Win Vista'))),
+ array('Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.1) Gecko/2008072716 IceCat/3.0.1-g1', array(
+ array('FF', 'Firefox', 'Firefox', '3.0', '3', '0', 'gecko'),
+ array('LIN', 'Linux', 'Linux'))),
+ array('Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.1) Gecko/2008071420 Iceweasel/3.0.1 (Debian-3.0.1-1)', array(
+ array('FF', 'Firefox', 'Firefox', '3.0', '3', '0', 'gecko'),
+ array('LIN', 'Linux', 'Linux'))),
+ array('Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1b2) Gecko/20060821 BonEcho/2.0b2', array(
+ array('FF', 'Firefox', 'Firefox', '2.0', '2', '0', 'gecko'),
+ array('LIN', 'Linux', 'Linux'))),
+ array('Mozilla/5.0 (X11; U; Darwin Power Macintosh; en-US; rv:1.8.0.12) Gecko/20070803 Firefox/1.5.0.12 Fink Community Edition', array(
+ array('FF', 'Firefox', 'Firefox', '1.5', '1', '5', 'gecko'),
+ array('MAC', 'Mac OS', 'Mac OS'))),
+ array('Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6b) Gecko/20031212 Firebird/0.7+', array(
+ array('FB', 'Firebird', 'Firebird', '0.7', '0', '7', 'gecko'),
+ array('WXP', 'Windows XP', 'Win XP'))),
+ array('Mozilla/5.0 (Windows; U; Win98; de-DE; rv:1.4b) Gecko/20030516 Mozilla Firebird/0.6', array(
+ array('FB', 'Firebird', 'Firebird', '0.6', '0', '6', 'gecko'),
+ array('W98', 'Windows 98', 'Win 98'))),
+ array('Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.3a) Gecko/20021207 Phoenix/0.5', array(
+ array('PX', 'Phoenix', 'Phoenix', '0.5', '0', '5', 'gecko'),
+ array('WNT', 'Windows NT', 'Win NT'))),
+ array('Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.2b) Gecko/20020923 Phoenix/0.1', array(
+ array('PX', 'Phoenix', 'Phoenix', '0.1', '0', '1', 'gecko'),
+ array('WXP', 'Windows XP', 'Win XP'))),
+ array('Mozilla/5.0 (Nintendo DS v4; U; M3 Adapter CF + PassMe2; en-US; rv:1.8.0.6 ) Gecko/20060728 Firefox/1.5.0.6 (firefox.gba.ds)', array(
+ array('FF', 'Firefox', 'Firefox', '1.5', '1', '5', 'gecko'),
+ array('NDS', 'Nintendo DS', 'DS'))),
+ array('Mozilla/5.0 (Android; Mobile; rv:15.0) Gecko/15.0 Firefox/15.0a1', array(
+ array('FF', 'Firefox', 'Firefox', '15.0', '15', '0', 'gecko'),
+ array('AND', 'Android', 'Android'))),
+
+ // Flock
+ array('Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/532.5 (KHTML, like Gecko) Flock/3.0.0.3737 Chrome/4.1.249.1071 Safari/532.5', array(
+ array('FL', 'Flock', 'Flock', '3.0', '3', '0', 'webkit'),
+ array('WI7', 'Windows 7', 'Win 7'))),
+ // pre-3.0 is actually gecko
+ array('Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7 Flock/2.5.6 (.NET CLR 3.5.30729)', array(
+ array('FL', 'Flock', 'Flock', '2.5', '2', '5', 'webkit'),
+ array('WXP', 'Windows XP', 'Win XP'))),
+ array('Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.7) Gecko/20091221 AppleWebKit/531.21.8 KHTML/4.3.5 (like Gecko) Firefox/3.5.7 Flock/2.5.6 (.NET CLR 3.5.30729)', array(
+ array('FL', 'Flock', 'Flock', '2.5', '2', '5', 'webkit'),
+ array('WXP', 'Windows XP', 'Win XP'))),
+ array('Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.7) Gecko/20091221 AppleWebKit/531.21.8 (KHTML, like Gecko) Firefox/3.5.7 Flock/2.5.6 (.NET CLR 3.5.30729)', array(
+ array('FL', 'Flock', 'Flock', '2.5', '2', '5', 'webkit'),
+ array('WXP', 'Windows XP', 'Win XP'))),
+ array('Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.9) Gecko/20071106 Firefox/2.0.0.9 Flock/1.0.1', array(
+ array('FL', 'Flock', 'Flock', '1.0', '1', '0', 'webkit'),
+ array('MAC', 'Mac OS', 'Mac OS'))),
+ array('Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8.1.8) Gecko/20071101 Firefox/2.0.0.8 Flock/1.0', array(
+ array('FL', 'Flock', 'Flock', '1.0', '1', '0', 'webkit'),
+ array('MAC', 'Mac OS', 'Mac OS'))),
+ array('Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8b5) Gecko/20051021 Flock/0.4 Firefox/1.0+', array(
+ array('FL', 'Flock', 'Flock', '0.4', '0', '4', 'webkit'),
+ array('MAC', 'Mac OS', 'Mac OS'))),
+
+ // Fluid
+ array('Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_1; nl-nl) AppleWebKit/532.3+ (KHTML, like Gecko) Fluid/0.9.6 Safari/532.3+', array(
+ array('FD', 'Fluid', 'Fluid', '0.9', '0', '9', 'webkit'),
+ array('MAC', 'Mac OS', 'Mac OS'))),
+ array('Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.13 (KHTML, like Gecko) Fluid/0.9.4 Safari/525.13', array(
+ array('FD', 'Fluid', 'Fluid', '0.9', '0', '9', 'webkit'),
+ array('WXP', 'Windows XP', 'Win XP'))),
+
+ // Galeon
+ array('Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.8) Gecko/20090327 Galeon/2.0.7', array(
+ array('GA', 'Galeon', 'Galeon', '2.0', '2', '0', 'gecko'),
+ array('LIN', 'Linux', 'Linux'))),
+ array('Mozilla/5.0 (X11; U; OpenBSD i386; en-US; rv:1.8.1.19) Gecko/20090701 Galeon/2.0.7', array(
+ array('GA', 'Galeon', 'Galeon', '2.0', '2', '0', 'gecko'),
+ array('OBS', 'OpenBSD', 'OpenBSD'))),
+ array('Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.19) Gecko/20081216 Galeon/2.0.4 Firefox/2.0.0.19', array(
+ array('GA', 'Galeon', 'Galeon', '2.0', '2', '0', 'gecko'),
+ array('LIN', 'Linux', 'Linux'))),
+ array('Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.13pre) Gecko/20080207 Galeon/2.0.1 (Ubuntu package 2.0.1-1ubuntu2) Firefox/1.5.0.13pre', array(
+ array('GA', 'Galeon', 'Galeon', '2.0', '2', '0', 'gecko'),
+ array('LIN', 'Linux', 'Linux'))),
+ array('Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.6) Gecko/20040406 Galeon/1.3.15', array(
+ array('GA', 'Galeon', 'Galeon', '1.3', '1', '3', 'gecko'),
+ array('BSD', 'FreeBSD', 'FreeBSD'))),
+ array('Mozilla/5.0 Galeon/1.2.9 (X11; Linux i686; U;) Gecko/20021213 Debian/1.2.9-0.bunk', array(
+ array('GA', 'Galeon', 'Galeon', '1.2', '1', '2', 'gecko'),
+ array('LIN', 'Linux', 'Linux'))),
+ array('Mozilla/5.0 Galeon/1.0.3 (X11; Linux i686; U;) Gecko/0', array(
+ array('GA', 'Galeon', 'Galeon', '1.0', '1', '0', 'gecko'),
+ array('LIN', 'Linux', 'Linux'))),
+
+ // Google Earth embedded browser
+ array('Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/532.4 (KHTML, like Gecko) Google Earth/5.2.1.1329 Safari/532.4', array(
+ array('GE', 'Google Earth', 'Google Earth', '5.2', '5', '2', 'webkit'),
+ array('WI7', 'Windows 7', 'Win 7'))),
+
+ // GreenBrowser (treat as IE)
+ array('Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.0.04506; Media Center PC 5.0; .NET CLR 3.5.21022; GreenBrowser)', array(
+ array('IE', 'Internet Explorer', 'IE', '6.0', '6', '0', 'ie'),
+ array('WXP', 'Windows XP', 'Win XP'))),
+ array('Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.5.30729; InfoPath.2; .NET CLR 3.0.30729; GreenBrowser)', array(
+ array('IE', 'Internet Explorer', 'IE', '8.0', '8', '0', 'ie'),
+ array('WVI', 'Windows Vista', 'Win Vista'))),
+
+ // Hana
+ array('Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/418.9 (KHTML, like Gecko) Hana/1.1', array(
+ array('HA', 'Hana', 'Hana', '1.1', '1', '1', 'webkit'),
+ array('MAC', 'Mac OS', 'Mac OS'))),
+ array('Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/417.9 (KHTML, like Gecko) Hana/1.0', array(
+ array('HA', 'Hana', 'Hana', '1.0', '1', '0', 'webkit'),
+ array('MAC', 'Mac OS', 'Mac OS'))),
+
+ // HotJava
+ array('HotJava/1.1.2 FCS', array(
+ array('HJ', 'HotJava', 'HotJava', '1.1', '1', '1', 'unknown'),
+ false)),
+ array('HotJava/1.0.1/JRE1.1.x', array(
+ array('HJ', 'HotJava', 'HotJava', '1.0', '1', '0', 'unknown'),
+ false)),
+
+ // iBrowse
+ array('Mozilla/5.0 (compatible; IBrowse 3.0; AmigaOS4.0)', array(
+ array('IB', 'IBrowse', 'IBrowse', '3.0', '3', '0', 'unknown'),
+ array('AMI', 'AmigaOS', 'AmigaOS'))),
+ array('Mozilla/4.0 (compatible; IBrowse 2.3; AmigaOS4.0)', array(
+ array('IB', 'IBrowse', 'IBrowse', '2.3', '2', '3', 'unknown'),
+ array('AMI', 'AmigaOS', 'AmigaOS'))),
+ array('IBrowse/2.4 (AmigaOS 3.9; 68K)', array(
+ array('IB', 'IBrowse', 'IBrowse', '2.4', '2', '4', 'unknown'),
+ array('AMI', 'AmigaOS', 'AmigaOS'))),
+ array('IBrowse/2.3 (AmigaOS V51)', array(
+ array('IB', 'IBrowse', 'IBrowse', '2.3', '2', '3', 'unknown'),
+ array('AMI', 'AmigaOS', 'AmigaOS'))),
+ array('IBrowse/2.3 (AmigaOS 4.0)', array(
+ array('IB', 'IBrowse', 'IBrowse', '2.3', '2', '3', 'unknown'),
+ array('AMI', 'AmigaOS', 'AmigaOS'))),
+
+ // iCab
+ array('iCab/4.5 (Macintosh; U; PPC Mac OS X)', array(
+ array('IC', 'iCab', 'iCab', '4.5', '4', '5', 'unknown'),
+ array('MAC', 'Mac OS', 'Mac OS'))),
+ array('iCab/4.5 (Macintosh; U; Mac OS X Leopard 10.5.7)', array(
+ array('IC', 'iCab', 'iCab', '4.5', '4', '5', 'unknown'),
+ array('MAC', 'Mac OS', 'Mac OS'))),
+ array('Mozilla/5.0 (compatible; iCab 3.0.5; Macintosh; U; PPC Mac OS)', array(
+ array('IC', 'iCab', 'iCab', '3.0', '3', '0', 'unknown'),
+ array('MAC', 'Mac OS', 'Mac OS'))),
+ array('Mozilla/5.0 (compatible; iCab 3.0.5; Macintosh; U; PPC Mac OS X)', array(
+ array('IC', 'iCab', 'iCab', '3.0', '3', '0', 'unknown'),
+ array('MAC', 'Mac OS', 'Mac OS'))),
+ array('Mozilla/5.0 (Macintosh; U; PPC Mac OS; en) iCab 3', array(
+ array('IC', 'iCab', 'iCab', '3.0', '3', '0', 'unknown'),
+ array('MAC', 'Mac OS', 'Mac OS'))),
+ array('Mozilla/4.5 (compatible; iCab 2.7.1; Macintosh; I; PPC)', array(
+ array('IC', 'iCab', 'iCab', '2.7', '2', '7', 'unknown'),
+ array('MAC', 'Mac OS', 'Mac OS'))),
+ array('iCab/2.9.8 (Macintosh; U; 68K)', array(
+ array('IC', 'iCab', 'iCab', '2.9', '2', '9', 'unknown'),
+ array('MAC', 'Mac OS', 'Mac OS'))),
+ array('Lynx/2.8 (compatible; iCab 2.9.8; Macintosh; U; 68K)', array(
+ array('IC', 'iCab', 'iCab', '2.9', '2', '9', 'unknown'),
+ array('MAC', 'Mac OS', 'Mac OS'))),
+ array('Mozilla/4/5 (compatible; iCab 2.9.8; Macintosh; U; 68K)', array(
+ array('IC', 'iCab', 'iCab', '2.9', '2', '9', 'unknown'),
+ array('MAC', 'Mac OS', 'Mac OS'))),
+ array('Mozilla/4.0 (compatible; MSIE 5.0; Mac_PowerPC)', array(
+ array('IE', 'Internet Explorer', 'IE', '5.0', '5', '0', 'ie'),
+ array('MAC', 'Mac OS', 'Mac OS'))),
+ array('Mozilla/4.76 (Macintosh; I; PPC)', array(
+ array('NS', 'Netscape', 'Netscape', '4.76', '4', '76', 'gecko'),
+ array('MAC', 'Mac OS', 'Mac OS'))),
+
+ // Internet Explorer
+ array('Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0; Xbox)', array(
+ array('IE', 'Internet Explorer', 'IE', '9.0', '9', '0', 'ie'),
+ array('XBX', 'Xbox', 'Xbox'))),
+ array('Mozilla/5.0 (compatible; MSIE 9.0; Windows Phone OS 7.5; Trident/5.0; IEMobile/9.0; Xbox)', array(
+ array('IE', 'Internet Explorer', 'IE', '9.0', '9', '0', 'ie'),
+ array('XBX', 'Xbox', 'Xbox'))),
+ array('Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Win64; x64; Trident/6.0)', array(
+ array('IE', 'Internet Explorer', 'IE', '10.0', '10', '0', 'ie'),
+ array('WI8', 'Windows 8', 'Win 8'))),
+ array('Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0)', array(
+ array('IE', 'Internet Explorer', 'IE', '10.0', '10', '0', 'ie'),
+ array('WI7', 'Windows 7', 'Win 7'))),
+ array('Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Trident/6.0)', array(
+ array('IE', 'Internet Explorer', 'IE', '10.0', '10', '0', 'ie'),
+ array('WI7', 'Windows 7', 'Win 7'))),
+ array('Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)', array(
+ array('IE', 'Internet Explorer', 'IE', '9.0', '9', '0', 'ie'),
+ array('WI7', 'Windows 7', 'Win 7'))),
+ array('Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; Trident/5.0)', array(
+ array('IE', 'Internet Explorer', 'IE', '9.0', '9', '0', 'ie'),
+ array('WVI', 'Windows Vista', 'Win Vista'))),
+ array('Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET CLR 3.0.04506; .NET CLR 3.5.21022; InfoPath.2; SLCC1; Zune 3.0)', array(
+ array('IE', 'Internet Explorer', 'IE', '8.0', '8', '0', 'ie'),
+ array('WI7', 'Windows 7', 'Win 7'))),
+ array('Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0)', array(
+ array('IE', 'Internet Explorer', 'IE', '8.0', '8', '0', 'ie'),
+ array('WVI', 'Windows Vista', 'Win Vista'))),
+ array('Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; Trident/4.0)', array(
+ array('IE', 'Internet Explorer', 'IE', '8.0', '8', '0', 'ie'),
+ array('WVI', 'Windows Vista', 'Win Vista'))),
+ array('Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0)', array(
+ array('IE', 'Internet Explorer', 'IE', '8.0', '8', '0', 'ie'),
+ array('WXP', 'Windows XP', 'Win XP'))),
+ array('Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648)', array(
+ array('IE', 'Internet Explorer', 'IE', '6.0', '6', '0', 'ie'),
+ array('WXP', 'Windows XP', 'Win XP'))),
+ array('Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)', array(
+ array('IE', 'Internet Explorer', 'IE', '6.0', '6', '0', 'ie'),
+ array('WS3', 'Windows Server 2003 / XP x64', 'Win S2003'))),
+ array('Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; WOW64; SV1; .NET CLR 2.0.50727)', array(
+ array('IE', 'Internet Explorer', 'IE', '6.0', '6', '0', 'ie'),
+ array('WS3', 'Windows Server 2003 / XP x64', 'Win S2003'))),
+ array('Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; Win64; x64; SV1; .NET CLR 2.0.50727)', array(
+ array('IE', 'Internet Explorer', 'IE', '6.0', '6', '0', 'ie'),
+ array('WS3', 'Windows Server 2003 / XP x64', 'Win S2003'))),
+
+ // IE Mobile
+ array('Mozilla/5.0 (compatible; MSIE 9.0; Windows Phone OS 7.5; Trident/5.0; IEMobile/9.0; SAMSUNG; SGH-i917)', array(
+ array('IE', 'Internet Explorer', 'IE', '9.0', '9', '0', 'ie'),
+ array('WPH', 'Windows Phone OS', 'WinPhone'))),
+ array('Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; XBLWP7; ZuneWP7)', array(
+ array('IE', 'Internet Explorer', 'IE', '7.0', '7', '0', 'ie'),
+ array('WPH', 'Windows Phone OS', 'WinPhone'))),
+ array('Mozilla/4.0 (compatible; MSIE 7.0; Windows Phone OS 7.0; Trident/3.1; IEMobile/7.0; DeviceManufacturer; DeviceModel)', array(
+ array('IE', 'Internet Explorer', 'IE', '7.0', '7', '0', 'ie'),
+ array('WPH', 'Windows Phone OS', 'WinPhone'))),
+ array('Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; IEMobile 7.11)', array(
+ array('IE', 'Internet Explorer', 'IE', '6.0', '6', '0', 'ie'),
+ array('WMO', 'Windows Mobile', 'WinMo'))),
+ array('Mozilla/4.0 (compatible; MSIE 4.01; Windows CE; PPC; 240x320)', array(
+ array('IE', 'Internet Explorer', 'IE', '4.01', '4', '01', 'ie'),
+ array('WCE', 'Windows CE', 'Win CE'))),
+
+ // Internet Explorer with misbehaving Google Tool Bar
+ array('Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; GTB6.5; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)', array(
+ array('IE', 'Internet Explorer', 'IE', '8.0', '8', '0', 'ie'),
+ array('WXP', 'Windows XP', 'Win XP'))),
+ array('Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; GTB0.0; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)', array(
+ array('IE', 'Internet Explorer', 'IE', '8.0', '8', '0', 'ie'),
+ array('WXP', 'Windows XP', 'Win XP'))),
+
+ // Iron
+ array('Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/531.0 (KHTML, like Gecko) Iron/3.0.189.0 Safari/531.0', array(
+ array('IR', 'Iron', 'Iron', '3.0', '3', '0', 'webkit'),
+ array('WI7', 'Windows 7', 'Win 7'))),
+
+ // K-Meleon
+ array('Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.21) Gecko/20090331 K-Meleon/1.5.3', array(
+ array('KM', 'K-Meleon', 'K-Meleon', '1.5', '1', '5', 'gecko'),
+ array('LIN', 'Linux', 'Linux'))),
+ array('Mozilla/5.0 (Darwin; FreeBSD 5.6; en-GB; rv:1.8.1.17pre) Gecko/20080716 K-Meleon/1.5.0', array(
+ array('KM', 'K-Meleon', 'K-Meleon', '1.5', '1', '5', 'gecko'),
+ array('MAC', 'Mac OS', 'Mac OS'))),
+ array('Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.2b) Gecko/20021016 K-Meleon 0.7', array(
+ array('KM', 'K-Meleon', 'K-Meleon', '0.7', '0', '7', 'gecko'),
+ array('WNT', 'Windows NT', 'Win NT'))),
+
+ // Kapiko
+ array('Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9.0.1) Gecko/20080722 Firefox/3.0.1 Kapiko/3.0', array(
+ array('KP', 'Kapiko', 'Kapiko', '3.0', '3', '0', 'gecko'),
+ array('WXP', 'Windows XP', 'Win XP'))),
+
+ // Kazehakase
+ array('Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.11) Gecko Kazehakase/0.5.4 Debian/0.5.4-2.1ubuntu3', array(
+ array('KZ', 'Kazehakase', 'Kazehakase', '0.5', '0', '5', 'gecko'),
+ array('LIN', 'Linux', 'Linux'))),
+ array('Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.13) Gecko/20080311 (Debian-1.8.1.13+nobinonly-0ubuntu1) Kazehakase/0.5.2', array(
+ array('KZ', 'Kazehakase', 'Kazehakase', '0.5', '0', '5', 'gecko'),
+ array('LIN', 'Linux', 'Linux'))),
+ array('Mozilla/5.0 (X11; Linux x86_64; U;) Gecko/20060207 Kazehakase/0.3.5 Debian/0.3.5-1', array(
+ array('KZ', 'Kazehakase', 'Kazehakase', '0.3', '0', '3', 'gecko'),
+ array('LIN', 'Linux', 'Linux'))),
+
+ // KKMAN (treat as IE)
+ array('Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; KKMAN3.2)', array(
+ array('IE', 'Internet Explorer', 'IE', '7.0', '7', '0', 'ie'),
+ array('WXP', 'Windows XP', 'Win XP'))),
+
+ // Konqueror
+ array('Mozilla/5.0 (compatible; Konqueror/4.0; Linux) KHTML/4.0.5 (like Gecko)', array(
+ array('KO', 'Konqueror', 'Konqueror', '4.0', '4', '0', 'khtml'),
+ array('LIN', 'Linux', 'Linux'))),
+ array('Mozilla/5.0 (compatible; Konqueror/4.0; Microsoft Windows) KHTML/4.0.80 (like Gecko)', array(
+ array('KO', 'Konqueror', 'Konqueror', '4.0', '4', '0', 'khtml'),
+ false)),
+ array('Mozilla/5.0 (compatible; Konqueror/3.5; GNU/kFreeBSD) KHTML/3.5.9 (like Gecko) (Debian)', array(
+ array('KO', 'Konqueror', 'Konqueror', '3.5', '3', '5', 'khtml'),
+ array('BSD', 'FreeBSD', 'FreeBSD'))),
+ array('Mozilla/5.0 (compatible; Konqueror/2.1.1; X11)', array(
+ array('KO', 'Konqueror', 'Konqueror', '2.1', '2', '1', 'khtml'),
+ false)),
+
+ // Links
+ array('Links', array(
+ false,
+ false)),
+ array('Links (2.1pre31; Linux 2.6.21-omap1 armv6l; x)', array(
+ array('LI', 'Links', 'Links', '2.1', '2', '1', 'unknown'),
+ array('LIN', 'Linux', 'Linux'))),
+ array('Links (0.99; OS/2 1 i386; 80x33)', array(
+ array('LI', 'Links', 'Links', '0.99', '0', '99', 'unknown'),
+ array('OS2', 'OS/2', 'OS/2'))),
+
+ // Lunascape (identity crisis)
+ array('Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1) Gecko/20090701 Firefox/3.5 Lunascape/5.1.2.3', array(
+ array('FF', 'Firefox', 'Firefox', '3.5', '3', '5', 'gecko'),
+ array('WVI', 'Windows Vista', 'Win Vista'))),
+ array('Mozilla/5.0 (Windows; U; ; cs-CZ) AppleWebKit/532+ (KHTML, like Gecko, Safari/532.0) Lunascape/5.1.2.3', array(
+ array('SF', 'Safari', 'Safari', '4.0', '4', '0', 'webkit'),
+ false)),
+ array('Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; InfoPath.1; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Lunascape 5.1.2.3)', array(
+ array('IE', 'Internet Explorer', 'IE', '6.0', '6', '0', 'ie'),
+ array('WXP', 'Windows XP', 'Win XP'))),
+
+ // Lynx
+ array('Lynx (textmode)', array(
+ false,
+ false)),
+ array('Lynx/2.8.7dev.9 libwww-FM/2.14', array(
+ array('LX', 'Lynx', 'Lynx', '2.8', '2', '8', 'unknown'),
+ false)),
+
+ // Maxathon (treat as IE)
+ array('Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; SV1; Maxthon; .NET CLR 1.1.4322)', array(
+ array('IE', 'Internet Explorer', 'IE', '7.0', '7', '0', 'ie'),
+ array('WXP', 'Windows XP', 'Win XP'))),
+
+ // Midori
+ array('Midori/0.1.9 (X11; Linux i686; U; fr-fr) WebKit/532+', array(
+ array('MI', 'Midori', 'Midori', '0.1', '0', '1', 'webkit'),
+ array('LIN', 'Linux', 'Linux'))),
+ array('Mozilla/5.0 (X11; U; Linux; pt-br) AppleWebKit/531+ (KHTML, like Gecko) Safari/531.2+ Midori/0.3', array(
+ array('MI', 'Midori', 'Midori', '0.3', '0', '3', 'webkit'),
+ array('LIN', 'Linux', 'Linux'))),
+
+ // Mozilla Suite
+ array('Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.7) Gecko/20070606', array(
+ array('MO', 'Mozilla', 'Mozilla', '1.7', '1', '7', 'gecko'),
+ array('SOS', 'SunOS', 'SunOS'))),
+ array('Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050927 Debian/1.7.8-1sarge3', array(
+ array('MO', 'Mozilla', 'Mozilla', '1.7', '1', '7', 'gecko'),
+ array('LIN', 'Linux', 'Linux'))),
+
+ // NCSA Mosaic
+ array('PATHWORKS Mosaic/1.0 libwww/2.15_Spyglass', array(
+ array('MC', 'NCSA Mosaic', 'Mosaic', '1.0', '1', '0', 'unknown'),
+ false)),
+ array('WinMosaic/Version 2.0 (ALPHA 2)', array(
+ array('MC', 'NCSA Mosaic', 'Mosaic', '2.0', '2', '0', 'unknown'),
+ false)),
+ array('VMS_Mosaic/3.8-1 (Motif;OpenVMS V7.3-2 DEC 3000 - M700) libwww/2.12_Mosaic', array(
+ array('MC', 'NCSA Mosaic', 'Mosaic', '3.8', '3', '8', 'unknown'),
+ array('VMS', 'OpenVMS', 'OpenVMS'))),
+ array('Mosaic from Digital/1.02_Win32', array(
+ array('MC', 'NCSA Mosaic', 'Mosaic', '1.02', '1', '02', 'unknown'),
+ array('W95', 'Windows 95', 'Win 95'))),
+ array('NCSA Mosaic/2.0.0b4 (Windows AXP)', array(
+ array('MC', 'NCSA Mosaic', 'Mosaic', '2.0', '2', '0', 'unknown'),
+ false)),
+ array('NCSA_Mosaic/2.7b5 (X11;Linux 2.6.7 i686) libwww/2.12 modified', array(
+ array('MC', 'NCSA Mosaic', 'Mosaic', '2.7', '2', '7', 'unknown'),
+ array('LIN', 'Linux', 'Linux'))),
+ array('mMosaic/3.6.6 (X11;SunOS 5.8 sun4m)', array(
+ array('MC', 'NCSA Mosaic', 'Mosaic', '3.6', '3', '6', 'unknown'),
+ array('SOS', 'SunOS', 'SunOS'))),
+
+ // Netscape Navigator (9.x)
+ array('Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.8pre) Gecko/20071015 Firefox/2.0.0.7 Navigator/9.0', array(
+ array('NS', 'Netscape', 'Netscape', '9.0', '9', '0', 'gecko'),
+ array('LIN', 'Linux', 'Linux'))),
+ array('Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20070321 Netscape/9.0', array(
+ array('NS', 'Netscape', 'Netscape', '9.0', '9', '0', 'gecko'),
+ array('LIN', 'Linux', 'Linux'))),
+
+ // Netscape (6.x - 8.x)
+ array('Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20070321 Netscape/8.1.3', array(
+ array('NS', 'Netscape', 'Netscape', '8.1', '8', '1', 'gecko'),
+ array('LIN', 'Linux', 'Linux'))),
+ array('Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.2) Gecko/20040804 Netscape/7.2 (ax)', array(
+ array('NS', 'Netscape', 'Netscape', '7.2', '7', '2', 'gecko'),
+ array('WXP', 'Windows XP', 'Win XP'))),
+ array('Mozilla/5.0 (X11; U; OSF1 alpha; en-US; rv:0.9.4.1) Gecko/20020517 Netscape6/6.2.3', array(
+ array('NS', 'Netscape', 'Netscape', '6.2', '6', '2', 'gecko'),
+ array('T64', 'Tru64', 'Tru64'))),
+ array('Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.2) Gecko/20010726 Netscape6/6.1', array(
+ array('NS', 'Netscape', 'Netscape', '6.1', '6', '1', 'gecko'),
+ array('LIN', 'Linux', 'Linux'))),
+
+ // Netscape Communicator (4.x)
+ array('Mozilla/4.76C-SGI [en] (X11; I; IRIX64 6.5 IP30)', array(
+ array('NS', 'Netscape', 'Netscape', '4.76', '4', '76', 'gecko'),
+ array('IRI', 'IRIX', 'IRIX'))),
+ array('Mozilla/4.72 [en] (X11; I; HP-UX B.11.00 9000/800)', array(
+ array('NS', 'Netscape', 'Netscape', '4.72', '4', '72', 'gecko'),
+ array('HPX', 'HP-UX', 'HP-UX'))),
+ array('Mozilla/4.41 (BEOS; U ;Nav)', array(
+ array('NS', 'Netscape', 'Netscape', '4.41', '4', '41', 'gecko'),
+ array('BEO', 'BeOS', 'BeOS'))),
+ array('Mozilla/4.0 (compatible; Windows NT 5.1; U; en)', array(
+ array('NS', 'Netscape', 'Netscape', '4.0', '4', '0', 'gecko'),
+ array('WXP', 'Windows XP', 'Win XP'))),
+
+ // Netscape Navigator (up to 3.x)
+ array('Mozilla/3.0 (X11; I; AIX 2)', array(
+ array('NS', 'Netscape', 'Netscape', '3.0', '3', '0', 'gecko'),
+ array('AIX', 'AIX', 'AIX'))),
+ array('Mozilla/2.02 [fr] (WinNT; I)', array(
+ array('NS', 'Netscape', 'Netscape', '2.02', '2', '02', 'gecko'),
+ array('WNT', 'Windows NT', 'Win NT'))),
+
+ // NetFront NX
+ array('Mozilla/5.0 (Nintendo WiiU) AppleWebKit/534.52 (KHTML, like Gecko) NX/2.1.0.8.21 NintendoBrowser/1.0.0.7494.US', array(
+ array('NF', 'NetFront', 'NetFront', '2.1', '2', '1', 'webkit'),
+ array('WIU', 'Nintendo Wii U', 'Wii U'))),
+ array('Mozilla/5.0 (Nintendo 3DS; U; ; en) Version/1.7498.US', array(
+ array('NF', 'NetFront', 'NetFront', '1.7498', '1', '7498', 'webkit'),
+ array('3DS', 'Nintendo 3DS', '3DS'))),
+ array('Mozilla/5.0 (Playstation Vita 1.61) AppleWebKit/531.22.8 (KHTML, like Gecko) Silk/3.2', array(
+ array('NF', 'NetFront', 'NetFront', '3.2', '3', '2', 'webkit'),
+ array('PSV', 'PlayStation Vita', 'PS Vita'))),
+
+ // Kindle
+ array('Mozilla/4.0 (compatible; Linux 2.6.10) NetFront/3.3 Kindle/1.0 (screen 600x800)', array(
+ array('NF', 'NetFront', 'NetFront', '3.3', '3', '3', 'webkit'),
+ array('LIN', 'Linux', 'Linux'))),
+ array('Mozilla/5.0 (Linux; U; Android 2.3.4; en-us; Kindle Fire Build/GINGERBREAD) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1', array(
+ array('SF', 'Safari', 'Safari', '4.0', '4', '0', 'webkit'),
+ array('AND', 'Android', 'Android'))),
+ array('Mozilla/5.0 (Linux; U; en-US) AppleWebKit/528.5+ (KHTML, like Gecko, Safari/528.5+) Version/4.0 Kindle/3.0 (screen 600×800; rotate)', array(
+ array('SF', 'Safari', 'Safari', '4.0', '4', '0', 'webkit'),
+ array('LIN', 'Linux', 'Linux'))),
+ array('Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-us; Silk/1.1.0-80) AppleWebKit/533.16 (KHTML, like Gecko) Version/5.0 Safari/533.16 Silk-Accelerated=true', array(
+ array('SF', 'Safari', 'Safari', '5.0', '5', '0', 'webkit'),
+ array('MAC', 'Mac OS', 'Mac OS'))),
+
+ // Omniweb
+ array('Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US) AppleWebKit/525.18 (KHTML, like Gecko, Safari/525.20) OmniWeb/v622.3.0.105198', array(
+ array('OW', 'OmniWeb', 'OmniWeb', '5.8', '5', '8', 'webkit'),
+ array('MAC', 'Mac OS', 'Mac OS'))),
+ array('Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/522+ (KHTML, like Gecko, Safari/522) OmniWeb/v613', array(
+ array('OW', 'OmniWeb', 'OmniWeb', '5.6', '5', '6', 'webkit'),
+ array('MAC', 'Mac OS', 'Mac OS'))),
+ array('Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/420+ (KHTML, like Gecko, Safari/420) OmniWeb/v607', array(
+ array('OW', 'OmniWeb', 'OmniWeb', '5.5', '5', '5', 'webkit'),
+ array('MAC', 'Mac OS', 'Mac OS'))),
+ array('Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/125.4 (KHTML, like Gecko, Safari) OmniWeb/v563.34', array(
+ array('OW', 'OmniWeb', 'OmniWeb', '5.1', '5', '1', 'webkit'),
+ array('MAC', 'Mac OS', 'Mac OS'))),
+ array('Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/85 (KHTML, like Gecko) OmniWeb/v558.36', array(
+ array('OW', 'OmniWeb', 'OmniWeb', '5.0', '5', '0', 'webkit'),
+ array('MAC', 'Mac OS', 'Mac OS'))),
+ array('Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/85 (KHTML, like Gecko) OmniWeb/v496', array(
+ array('OW', 'OmniWeb', 'OmniWeb', '4.5', '4', '5', 'webkit'),
+ array('MAC', 'Mac OS', 'Mac OS'))),
+
+ // Opera
+ array('Opera/9.63 (Windows NT 5.1; U; en) Presto/2.1.1', array(
+ array('OP', 'Opera', 'Opera', '9.63', '9', '63', 'opera'),
+ array('WXP', 'Windows XP', 'Win XP'))),
+ array('Opera/9.30 (Nintendo Wii; U; ; 2047-7; en)', array(
+ array('OP', 'Opera', 'Opera', '9.30', '9', '30', 'opera'),
+ array('WII', 'Nintendo Wii', 'Wii'))),
+ array('Opera/9.64 (Windows ME; U; en) Presto/2.1.1', array(
+ array('OP', 'Opera', 'Opera', '9.64', '9', '64', 'opera'),
+ array('WME', 'Windows Me', 'Win Me'))),
+ array('Opera/9.80 (Windows NT 5.1; U; en) Presto/2.2.15 Version/10.00', array(
+ array('OP', 'Opera', 'Opera', '10.00', '10', '0', 'opera'),
+ array('WXP', 'Windows XP', 'Win XP'))),
+ array('Mozilla/4.0 (compatible; MSIE 6.0; Nitro) Opera 8.50 [en Mozilla/4.0 (compatible; MSIE 6.0; Nitro) Opera 8.50 [ja]', array(
+ array('OP', 'Opera', 'Opera', '8.50', '8', '50', 'opera'),
+ array('NDS', 'Nintendo DS', 'DS'))),
+ array('Opera/9.00 (Nintendo DS U; ; 1309-9; de)', array(
+ array('OP', 'Opera', 'Opera', '9.00', '9', '00', 'opera'),
+ array('NDS', 'Nintendo DS', 'DS'))),
+ array('Opera/9.50 (Nintendo DSi; Opera/507; U; en-US) ', array(
+ array('OP', 'Opera', 'Opera', '9.50', '9', '50', 'opera'),
+ array('DSI', 'Nintendo DSi', 'DSi'))),
+
+ // PlayStation
+ array('Mozilla/5.0 (PLAYSTATION 3; 1.00)', array(
+ false,
+ array('PS3', 'PlayStation 3', 'PS3'))),
+
+ // PSP
+ array('PSP (PlayStation Portable); 2.00', array(
+ false,
+ array('PSP', 'PlayStation Portable', 'PSP'))),
+ array('Mozilla/4.0 (PSP (PlayStation Portable); 2.00)', array(
+ false,
+ array('PSP', 'PlayStation Portable', 'PSP'))),
+
+ // Rekonq 1.0+
+ array('Mozilla/5.0 (X11; Linux i686) AppleWebKit/534.34 (KHTML, like Gecko) rekonq/1.0 Safari/534.34', array(
+ array('RK', 'Rekonq', 'Rekonq', '1.0', '1', '0', 'webkit'),
+ array('LIN', 'Linux', 'Linux'))),
+
+ // Safari
+ array('Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.19 (KHTML, like Gecko) Version/3.1.2 Safari/525.21', array(
+ array('SF', 'Safari', 'Safari', '3.1', '3', '1', 'webkit'),
+ array('WXP', 'Windows XP', 'Win XP'))),
+ array('Mozilla/5.0 (iPhone; U; CPU iPhone OS 2_2 like Mac OS X; en-us) AppleWebKit/525.18.1 (KHTML, like Gecko) Version/3.1.1 Mobile/5G77 Safari/525.20', array(
+ array('SF', 'Safari', 'Safari', '3.1', '3', '1', 'webkit'),
+ array('IPH', 'iPhone', 'iPhone'))),
+ array('Mozilla/5.0 (iPod; U; CPU like Mac OS X; en) AppleWebKit/420.1 (KHTML, like Gecko) Version/3.0 Mobile/3A100a Safari/419.3', array(
+ array('SF', 'Safari', 'Safari', '3.0', '3', '0', 'webkit'),
+ array('IPD', 'iPod', 'iPod'))),
+ array('Mozilla/5.0 (iPod; U; CPU iPhone OS 2_2_1 like Mac OS X; en-us) AppleWebKit/525.18.1 (KHTML, like Gecko) Version/3.1.1 Mobile/5H11a Safari/525.20', array(
+ array('SF', 'Safari', 'Safari', '3.1', '3', '1', 'webkit'),
+ array('IPD', 'iPod', 'iPod'))),
+ array('Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_5; en-us) AppleWebKit/527.3+ (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1', array(
+ array('SF', 'Safari', 'Safari', '3.1', '3', '1', 'webkit'),
+ array('MAC', 'Mac OS', 'Mac OS'))),
+ array('Mozilla/5.0 (iPad; U; CPU iPhone OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B314 Safari/531.21.10', array(
+ array('SF', 'Safari', 'Safari', '4.0', '4', '0', 'webkit'),
+ array('IPA', 'iPad', 'iPad'))),
+ array('Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B367 Safari/531.21.10', array(
+ array('SF', 'Safari', 'Safari', '4.0', '4', '0', 'webkit'),
+ array('IPA', 'iPad', 'iPad'))),
+ array('Mozilla/5.0 (iPod; U; CPU iPhone OS 4_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A293 Safari/6531.22.7', array(
+ array('SF', 'Safari', 'Safari', '4.0', '4', '0', 'webkit'),
+ array('IPD', 'iPod', 'iPod'))),
+ array('Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A293 Safari/6531.22.7', array(
+ array('SF', 'Safari', 'Safari', '4.0', '4', '0', 'webkit'),
+ array('IPH', 'iPhone', 'iPhone'))),
+ array('Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/533.19.4 (KHTML, like Gecko) ', array(
+ array('SF', 'Safari', 'Safari', '5.0', '5', '0', 'webkit'),
+ array('WVI', 'Windows Vista', 'Win Vista'))),
+ array('Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/534.50 (KHTML, like Gecko) Version/5.1 Safari/534.50', array(
+ array('SF', 'Safari', 'Safari', '5.1', '5', '1', 'webkit'),
+ array('MAC', 'Mac OS', 'Mac OS'))),
+ array('Mozilla/5.0 (iPhone; CPU iPhone OS 6_1 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Mobile/10B141', array(
+ array('SF', 'Safari', 'Safari', '6.0', '6', '0', 'webkit'),
+ array('IPH', 'iPhone', 'iPhone'))),
+ array('Mozilla/5.0 (iPhone; CPU iPhone OS 6_1 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10B141 Safari/8536.25', array(
+ array('SF', 'Safari', 'Safari', '6.0', '6', '0', 'webkit'),
+ array('IPH', 'iPhone', 'iPhone'))),
+
+ // SeaMonkey (formerly Mozilla Suite and rebranded versions)
+ array('Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.8) Gecko/20071008 Iceape/1.1.5 (Ubuntu-1.1.5-1ubuntu0.7.10)', array(
+ array('SM', 'SeaMonkey', 'SeaMonkey', '1.1', '1', '1', 'gecko'),
+ array('LIN', 'Linux', 'Linux'))),
+ array('Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1b4pre) Gecko/20090405 SeaMonkey/2.0b1pre', array(
+ array('SM', 'SeaMonkey', 'SeaMonkey', '2.0', '2', '0', 'gecko'),
+ array('LIN', 'Linux', 'Linux'))),
+ array('Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9) Gecko', array(
+ // this pre-2.0 UA is missing the SeaMonkey/X.Y
+ array('SM', 'SeaMonkey', 'SeaMonkey', '1.9', '1', '9', 'gecko'),
+ array('WXP', 'Windows XP', 'Win XP'))),
+ array('Mozilla/5.0 (Windows; U; Windows NT 5.1; cs; rv:1.9) Gecko/2008052906', array(
+ // this pre-2.0 UA is missing the SeaMonkey/X.Y
+ array('SM', 'SeaMonkey', 'SeaMonkey', '1.9', '1', '9', 'gecko'),
+ array('WXP', 'Windows XP', 'Win XP'))),
+
+ // Palm webOS
+ array('Mozilla/5.0 (webOS/1.0; U; en-us) AppleWebKit/525.27.1 (KHTML, like Gecko) Version/1.0 Safari/525.27.1 Pre/1.0', array(
+ array('WO', 'Palm webOS', 'webOS', '1.0', '1', '0', 'webkit'),
+ array('WOS', 'Palm webOS', 'webOS'))),
+ array('Mozilla/5.0 (webOS/Palm webOS 1.2.9; U; en-US) AppleWebKit/525.27.1 (KHTML, like Gecko) Version/1.0 Safari/525.27.1 Pixi/1.0', array(
+ array('WO', 'Palm webOS', 'webOS', '1.0', '1', '0', 'webkit'),
+ array('WOS', 'Palm webOS', 'webOS'))),
+ array('Mozilla/5.0 [en] (PalmOS; U; WebPro/3.5; Palm-Zi72)', array(
+ array('WP', 'WebPro', 'WebPro', '3.5', '3', '5', 'unknown'),
+ array('POS', 'Palm OS', 'Palm OS'))),
+
+ // Palm WebPro
+ array('Mozilla/4.76 [en] (PalmOS; U; WebPro/3.0.1a; Palm-Cct1)', array(
+ array('WP', 'WebPro', 'WebPro', '3.0', '3', '0', 'unknown'),
+ array('POS', 'Palm OS', 'Palm OS'))),
+ array('Mozilla/4.76 [en] (PalmOS; U; WebPro/3.0; Palm-Arz1)', array(
+ array('WP', 'WebPro', 'WebPro', '3.0', '3', '0', 'unknown'),
+ array('POS', 'Palm OS', 'Palm OS'))),
+
+ // Shiira 1.x - treat as Safari since it uses the installed version of Safari's WebKit
+ array('Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/417.9 (KHTML, like Gecko, Safari) Shiira/1.1', array(
+ array('SF', 'Safari', 'Safari', '2.0', '2', '0', 'webkit'),
+ array('MAC', 'Mac OS', 'Mac OS'))),
+ array('Mozilla/5.0 (Macintosh; U; PPC Mac OS X; pl-pl) AppleWebKit/312.8 (KHTML, like Gecko) Shiira/1.2.1 Safari/125', array(
+ array('SF', 'Safari', 'Safari', '1.3', '1', '3', 'webkit'),
+ array('MAC', 'Mac OS', 'Mac OS'))),
+
+ // Shiira 2.x - ditto
+ array('Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_7; en-us) AppleWebKit/525.28.3 (KHTML, like Gecko) Shiira Safari/125', array(
+ array('SF', 'Safari', 'Safari', '3.2', '3', '2', 'webkit'),
+ array('MAC', 'Mac OS', 'Mac OS'))),
+
+ // SymbianOS
+ array('Nokia3650/1.0 SymbianOS/6.1 Series60/1.2 Profile/MIDP-1.0 Configuration/CLDC-1.0', array(
+ false,
+ array('SYM', 'SymbianOS', 'SymbianOS'))),
+ array('Mozilla/5.0 (SymbianOS/9.4; U; Series60/5.0 Nokia5800d-1b/20.2.014; Profile/MIDP-2.1 Configuration/CLDC-1.1 ) AppleWebKit/413 (KHTML, like Gecko) Safari/413', array(
+ array('SF', 'Safari', 'Safari', '2.0', '2', '0', 'webkit'),
+ array('SYM', 'SymbianOS', 'SymbianOS'))),
+ array('Opera/9.80 (S60; SymbOS; Opera Mobi/499; U; en-GB) Presto/2.4.18 Version/10.00', array(
+ array('OP', 'Opera', 'Opera', '10.00', '10', '00', 'opera'),
+ array('SYM', 'SymbianOS', 'SymbianOS'))),
+ array('SonyEricssonG700/R100 Mozilla/4.0 (compatible; MSIE 6.0; Symbian OS; 958) Opera 8.65 [ru]', array(
+ array('OP', 'Opera', 'Opera', '8.65', '8', '65', 'opera'),
+ array('SYM', 'SymbianOS', 'SymbianOS'))),
+
+ // Appcelerator Titanium
+ array('Appcelerator Titanium/1.8.0 (iPhone Simulator/4.3; iPhone OS; en_US;)', array(
+ array('TI', 'Titanium', 'Titanium', '1.8', '1', '8', 'webkit'),
+ array('IPH', 'iPhone', 'iPhone'))),
+
+ array('Appcelerator Titanium/1.8.0 (iPod touch/4.3.1; iPhone OS; de_DE;)', array(
+ array('TI', 'Titanium', 'Titanium', '1.8', '1', '8', 'webkit'),
+ array('IPD', 'iPod', 'iPod'))),
+
+ array('Appcelerator Titanium/1.8.0 (iPad/4.3.3; iPhone OS; de_DE;)', array(
+ array('TI', 'Titanium', 'Titanium', '1.8', '1', '8', 'webkit'),
+ array('IPA', 'iPad', 'iPad'))),
+
+ array('Dalvik/1.1.0 (Linux; U; Android 2.1; google_sdk Build/ERD79) Titanium/1.8.0', array(
+ array('TI', 'Titanium', 'Titanium', '1.8', '1', '8', 'webkit'),
+ array('AND', 'Android', 'Android'))),
+
+ array('Dalvik/1.4.0 (Linux; U; Android 2.3.3; GT-I9100 Build/GINGERBREAD) Titanium/1.8.0', array(
+ array('TI', 'Titanium', 'Titanium', '1.8', '1', '8', 'webkit'),
+ array('AND', 'Android', 'Android'))),
+
+ array('Mozilla/5.0 (X11; U; CrOS i686 9.10.0; en-US) AppleWebKit/532.5 (KHTML, like Gecko) Chrome/4.0.253.0 Safari/532.5', array(
+ array('CH', 'Chrome', 'Chrome', '4.0', '4', '0', 'webkit'),
+ array('LIN', 'Linux', 'Linux'))),
+
+ // Email Clients
+
+ // Thunderbird
+ array('Mozilla/5.0 (Windows NT 5.1; rv:14.0) Gecko/20120713 Thunderbird/14.0 Lightning/1.6', array(
+ array('TB', 'Thunderbird', 'Thunderbird', '14.0', '14', '0', 'gecko'),
+ array('WXP', 'Windows XP', 'Win XP'))),
+
+ array('Mozilla/5.0 (X11; Linux i686; rv:16.0) Gecko/20121011 Thunderbird/16.0.1', array(
+ array('TB', 'Thunderbird', 'Thunderbird', '16.0', '16', '0', 'gecko'),
+ array('LIN', 'Linux', 'Linux'))),
+
+ array('Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 Lightning/1.9', array(
+ array('TB', 'Thunderbird', 'Thunderbird', '17.0', '17', '0', 'gecko'),
+ array('WI7', 'Windows 7', 'Win 7'))),
+
+ array('Mozilla/5.0 (X11; Linux i686 on x86_64; rv:15.0) Gecko/20120907 Thunderbird/15.0.1', array(
+ array('TB', 'Thunderbird', 'Thunderbird', '15.0', '15', '0', 'gecko'),
+ array('LIN', 'Linux', 'Linux')))
+
+ );
+ }
+
+ /**
+ * Test getBrowser()
+ *
+ * @dataProvider getUserAgents
+ * @group Plugins
+ */
+ public function testGetBrowser($userAgent, $expected)
+ {
+ $res = UserAgentParser::getBrowser($userAgent);
+ $family = false;
+
+ if ($res === false)
+ $this->assertFalse($expected[0]);
+ else {
+ $family = \Piwik\Plugins\UserSettings\getBrowserFamily($res['id']);
+ $this->assertEquals($expected[0][0], $res['id']);
+ $this->assertEquals($expected[0][1], $res['name']);
+ $this->assertEquals($expected[0][2], $res['short_name']);
+ $this->assertEquals($expected[0][3], $res['version']);
+ $this->assertEquals($expected[0][4], $res['major_number']);
+ $this->assertEquals($expected[0][5], $res['minor_number']);
+ $this->assertEquals($expected[0][6], $family);
+ }
+ }
+
+ /**
+ * Test getOperatingSystem()
+ *
+ * @dataProvider getUserAgents
+ * @group Plugins
+ */
+ public function testGetOperatingSystem($userAgent, $expected)
+ {
+ $res = UserAgentParser::getOperatingSystem($userAgent);
+
+ $this->assertEquals($expected[1][0], $res['id']);
+ $this->assertEquals($expected[1][1], $res['name']);
+ $this->assertEquals($expected[1][2], $res['short_name']);
+ }
+}
diff --git a/plugins/UsersManager/tests/APITest.php b/plugins/UsersManager/tests/APITest.php
deleted file mode 100644
index 60a53af07f..0000000000
--- a/plugins/UsersManager/tests/APITest.php
+++ /dev/null
@@ -1,71 +0,0 @@
-<?php
-/**
- * Piwik - free/libre analytics platform
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- */
-
-namespace Piwik\Plugins\UsersManager\tests;
-use Piwik\Access;
-use FakeAccess;
-use Piwik\Piwik;
-use Piwik\Plugins\UsersManager\API;
-use Piwik\Tests\Fixture;
-
-/**
- * @group UsersManager
- * @group APITest
- * @group Database
- */
-class APITest extends \DatabaseTestCase
-{
- /**
- * @var API
- */
- private $api;
-
- public function setUp()
- {
- parent::setUp();
-
- $this->api = API::getInstance();
-
- $pseudoMockAccess = new FakeAccess();
- FakeAccess::$superUser = true;
- Access::setSingletonInstance($pseudoMockAccess);
-
- Fixture::createWebsite('2014-01-01 00:00:00');
- Fixture::createWebsite('2014-01-01 00:00:00');
- Fixture::createWebsite('2014-01-01 00:00:00');
- $this->api->addUser('userLogin', 'password', 'userlogin@password.de');
- }
-
- public function test_setUserAccess_ShouldTriggerRemoveSiteAccessEvent_IfAccessToAWebsiteIsRemoved()
- {
- $eventTriggered = false;
- $self = $this;
- Piwik::addAction('UsersManager.removeSiteAccess', function ($login, $idSites) use (&$eventTriggered, $self) {
- $eventTriggered = true;
- $self->assertEquals('userLogin', $login);
- $self->assertEquals(array(1, 2), $idSites);
- });
-
- $this->api->setUserAccess('userLogin', 'noaccess', array(1, 2));
-
- $this->assertTrue($eventTriggered, 'UsersManager.removeSiteAccess event was not triggered');
- }
-
- public function test_setUserAccess_ShouldNotTriggerRemoveSiteAccessEvent_IfAccessIsAdded()
- {
- $eventTriggered = false;
- Piwik::addAction('UsersManager.removeSiteAccess', function () use (&$eventTriggered) {
- $eventTriggered = true;
- });
-
- $this->api->setUserAccess('userLogin', 'admin', array(1, 2));
-
- $this->assertFalse($eventTriggered, 'UsersManager.removeSiteAccess event was triggered but should not');
- }
-
-}
diff --git a/plugins/UsersManager/tests/Integration/APITest.php b/plugins/UsersManager/tests/Integration/APITest.php
new file mode 100644
index 0000000000..e84cd5b750
--- /dev/null
+++ b/plugins/UsersManager/tests/Integration/APITest.php
@@ -0,0 +1,72 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+namespace Piwik\Plugins\UsersManager\tests;
+use Piwik\Access;
+use FakeAccess;
+use Piwik\Piwik;
+use Piwik\Plugins\UsersManager\API;
+use Piwik\Tests\Impl\Fixture;
+use Piwik\Tests\Impl\IntegrationTestCase;
+
+/**
+ * @group UsersManager
+ * @group APITest
+ * @group Plugins
+ */
+class APITest extends IntegrationTestCase
+{
+ /**
+ * @var API
+ */
+ private $api;
+
+ public function setUp()
+ {
+ parent::setUp();
+
+ $this->api = API::getInstance();
+
+ $pseudoMockAccess = new FakeAccess();
+ FakeAccess::$superUser = true;
+ Access::setSingletonInstance($pseudoMockAccess);
+
+ Fixture::createWebsite('2014-01-01 00:00:00');
+ Fixture::createWebsite('2014-01-01 00:00:00');
+ Fixture::createWebsite('2014-01-01 00:00:00');
+ $this->api->addUser('userLogin', 'password', 'userlogin@password.de');
+ }
+
+ public function test_setUserAccess_ShouldTriggerRemoveSiteAccessEvent_IfAccessToAWebsiteIsRemoved()
+ {
+ $eventTriggered = false;
+ $self = $this;
+ Piwik::addAction('UsersManager.removeSiteAccess', function ($login, $idSites) use (&$eventTriggered, $self) {
+ $eventTriggered = true;
+ $self->assertEquals('userLogin', $login);
+ $self->assertEquals(array(1, 2), $idSites);
+ });
+
+ $this->api->setUserAccess('userLogin', 'noaccess', array(1, 2));
+
+ $this->assertTrue($eventTriggered, 'UsersManager.removeSiteAccess event was not triggered');
+ }
+
+ public function test_setUserAccess_ShouldNotTriggerRemoveSiteAccessEvent_IfAccessIsAdded()
+ {
+ $eventTriggered = false;
+ Piwik::addAction('UsersManager.removeSiteAccess', function () use (&$eventTriggered) {
+ $eventTriggered = true;
+ });
+
+ $this->api->setUserAccess('userLogin', 'admin', array(1, 2));
+
+ $this->assertFalse($eventTriggered, 'UsersManager.removeSiteAccess event was triggered but should not');
+ }
+
+}
diff --git a/plugins/UsersManager/tests/Integration/UserPreferencesTest.php b/plugins/UsersManager/tests/Integration/UserPreferencesTest.php
new file mode 100644
index 0000000000..cd23e7baa3
--- /dev/null
+++ b/plugins/UsersManager/tests/Integration/UserPreferencesTest.php
@@ -0,0 +1,118 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+namespace Piwik\Plugins\UsersManager\tests;
+
+use Piwik\Piwik;
+use Piwik\Plugins\UsersManager\UserPreferences;
+use Piwik\Plugins\UsersManager\API as APIUsersManager;
+use FakeAccess;
+use Piwik\Access;
+use Piwik\Tests\Impl\Fixture;
+use Piwik\Tests\Impl\IntegrationTestCase;
+
+/**
+ * @group UsersManager
+ * @group UserPreferencesTest
+ * @group Plugins
+ * @group Plugins
+ */
+class UserPreferencesTest extends IntegrationTestCase
+{
+ /**
+ * @var UserPreferences
+ */
+ private $userPreferences;
+
+ public function setUp()
+ {
+ parent::setUp();
+
+ $this->userPreferences = new UserPreferences();
+
+ $this->setSuperUser();
+ }
+
+ public function test_getDefaultReport_ShouldReturnFalseByDefault()
+ {
+ $this->assertEquals(false, $this->userPreferences->getDefaultReport());
+ }
+
+ public function test_getDefaultReport_ShouldReturnTheRawValueIfNotNumeric()
+ {
+ $this->setDefaultReport('MultiSites');
+ $this->assertEquals('MultiSites', $this->userPreferences->getDefaultReport());
+ }
+
+ public function test_getDefaultReport_ShouldNotReturnSiteIdIfNoPermissionForSite()
+ {
+ $this->createSite();
+ $this->setDefaultReport(1);
+ $this->setAnonymous();
+ $this->assertEquals(false, $this->userPreferences->getDefaultReport());
+ }
+
+ public function test_getDefaultReport_ShouldReturnSiteIdIfPermissionForSite()
+ {
+ $this->createSite();
+ $this->setDefaultReport(1);
+ $this->assertEquals(1, $this->userPreferences->getDefaultReport());
+ }
+
+ public function test_getDefaultWebsiteId_ShouldReturnFalseByDefault()
+ {
+ $this->assertEquals(false, $this->userPreferences->getDefaultWebsiteId());
+ }
+
+ public function test_getDefaultWebsiteId_ShouldReturnASiteIfOneExistsAndHasAccess()
+ {
+ $this->createSite();
+ $this->assertEquals(1, $this->userPreferences->getDefaultWebsiteId());
+ }
+
+ public function test_getDefaultWebsiteId_ShouldReturnFalseIfASiteExistsButHasNoAccess()
+ {
+ $this->createSite();
+ $this->setAnonymous();
+ $this->assertEquals(false, $this->userPreferences->getDefaultWebsiteId());
+ }
+
+ public function test_getDefaultWebsiteId_ShouldReturnASiteEvenIfMultiSitesIsDefaultReport()
+ {
+ $this->setDefaultReport('MultiSites');
+ $this->createSite();
+ $this->assertEquals(1, $this->userPreferences->getDefaultWebsiteId());
+ }
+
+ private function setSuperUser()
+ {
+ $pseudoMockAccess = new FakeAccess();
+ FakeAccess::$superUser = true;
+ Access::setSingletonInstance($pseudoMockAccess);
+ }
+
+ private function setAnonymous()
+ {
+ $pseudoMockAccess = new FakeAccess();
+ FakeAccess::$superUser = false;
+ Access::setSingletonInstance($pseudoMockAccess);
+ }
+
+ private function createSite()
+ {
+ Fixture::createWebsite('2013-01-23 01:23:45');
+ }
+
+ private function setDefaultReport($defaultReport)
+ {
+ APIUsersManager::getInstance()->setUserPreference(Piwik::getCurrentUserLogin(),
+ APIUsersManager::PREFERENCE_DEFAULT_REPORT,
+ $defaultReport);
+ }
+
+}
diff --git a/plugins/UsersManager/tests/Integration/UsersManagerTest.php b/plugins/UsersManager/tests/Integration/UsersManagerTest.php
new file mode 100644
index 0000000000..e813c2ac1b
--- /dev/null
+++ b/plugins/UsersManager/tests/Integration/UsersManagerTest.php
@@ -0,0 +1,919 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+namespace Piwik\Plugins\UsersManager\tests\Integration;
+
+use Piwik\Access;
+use Piwik\Plugins\SitesManager\API as APISitesManager;
+use Piwik\Plugins\UsersManager\API;
+use Piwik\Plugins\UsersManager\Model;
+use Piwik\Translate;
+use Piwik\Tests\Impl\IntegrationTestCase;
+use FakeAccess;
+use Exception;
+
+
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ * @group UsersManagerTest
+ * @group UsersManager
+ * @group Plugins
+ */
+class UsersManagerTest extends IntegrationTestCase
+{
+ /**
+ * @var API
+ */
+ private $api;
+
+ /**
+ * @var Model
+ */
+ private $model;
+
+ public function setUp()
+ {
+ parent::setUp();
+
+ \Piwik\Plugin\Manager::getInstance()->loadPlugin('UsersManager');
+ \Piwik\Plugin\Manager::getInstance()->installLoadedPlugins();
+
+ // setup the access layer
+ $pseudoMockAccess = new FakeAccess;
+ FakeAccess::setIdSitesView(array(1, 2));
+ FakeAccess::setIdSitesAdmin(array(3, 4));
+
+ //finally we set the user as a Super User by default
+ FakeAccess::$superUser = true;
+ FakeAccess::$superUserLogin = 'superusertest';
+ Access::setSingletonInstance($pseudoMockAccess);
+
+ $this->api = API::getInstance();
+ $this->model = new Model();
+ }
+
+ private function _flatten($sitesAccess)
+ {
+ $result = array();
+
+ foreach ($sitesAccess as $siteAccess) {
+ $result[$siteAccess['site']] = $siteAccess['access'];
+ }
+
+ return $result;
+ }
+
+ private function _checkUserHasNotChanged($user, $newPassword, $newEmail = null, $newAlias = null)
+ {
+ if (is_null($newEmail)) {
+ $newEmail = $user['email'];
+ }
+ if (is_null($newAlias)) {
+ $newAlias = $user['alias'];
+ }
+ $userAfter = $this->api->getUser($user["login"]);
+ unset($userAfter['date_registered']);
+
+ // we now compute what the token auth should be, it should always be a hash of the login and the current password
+ // if the password has changed then the token_auth has changed!
+ $user['token_auth'] = $this->api->getTokenAuth($user["login"], md5($newPassword));
+ $user['password'] = md5($newPassword);
+ $user['email'] = $newEmail;
+ $user['alias'] = $newAlias;
+ $user['superuser_access'] = 0;
+ $this->assertEquals($user, $userAfter);
+ }
+
+ /**
+ * bad password => exception#
+ * @expectedException \Exception
+ * @expectedExceptionMessage UsersManager_ExceptionInvalidPassword
+ */
+ public function testUpdateUserBadpasswd()
+ {
+ $login = "login";
+ $user = array('login' => $login,
+ 'password' => "geqgeagae",
+ 'email' => "test@test.com",
+ 'alias' => "alias");
+
+ $this->api->addUser($user['login'], $user['password'], $user['email'], $user['alias']);
+
+ try {
+ $this->api->updateUser($login, "pas");
+ } catch (Exception $expected) {
+ $this->_checkUserHasNotChanged($user, $user['password']);
+ throw $expected;
+ }
+ }
+
+ /**
+ * Dataprovider
+ */
+ public function getAddUserInvalidLoginData()
+ {
+ return array(
+ array(12, "password", "email@email.com", "alias"), // wrong login / integer => exception
+ array("gegag'ggea'", "password", "email@email.com", "alias"), // wrong login / too short => exception
+ array("gegag11gge&", "password", "email@email.com", "alias"), // wrong login / too long => exception
+ array("geg'ag11gge@", "password", "email@email.com", "alias"), // wrong login / bad characters => exception
+ );
+ }
+
+ /**
+ * @dataProvider getAddUserInvalidLoginData
+ * @expectedException \Exception
+ * @expectedExceptionMessage UsersManager_ExceptionInvalidLogin
+ */
+ public function testAddUserWrongLogin($userLogin, $password, $email, $alias)
+ {
+ $this->api->addUser($userLogin, $password, $email, $alias);
+ }
+
+ /**
+ * @expectedException \Exception
+ * @expectedExceptionMessage UsersManager_ExceptionLoginExists
+ */
+ public function testAddUserExistingLogin()
+ {
+ $this->api->addUser("test", "password", "email@email.com", "alias");
+ $this->api->addUser("test", "password2", "em2ail@email.com", "al2ias");
+ }
+
+ /**
+ * Dataprovider for wrong password tests
+ */
+ public function getWrongPasswordTestData()
+ {
+ return array(
+ array("geggeqgeqag", "pas", "email@email.com", "alias"), // too short -> exception
+ array("ghqgeggg", "gegageqqqqqqqgeqgqeg84897897897897g122", "email@email.com", "alias"), // too long -> exception
+ array("geggeqgeqag", "", "email@email.com", "alias"), // empty -> exception
+ );
+ }
+
+ /**
+ * @dataProvider getWrongPasswordTestData
+ * @expectedException \Exception
+ * @expectedExceptionMessage UsersManager_ExceptionInvalidPassword
+ */
+ public function testAddUserWrongPassword($userLogin, $password, $email, $alias)
+ {
+ $this->api->addUser($userLogin, $password, $email, $alias);
+ }
+
+ /**
+ * Dataprovider for wrong email tests
+ */
+ public function getWrongEmailTestData()
+ {
+ return array(
+ array("geggeqgeqag", "geqgeagae", "ema'il@email.com", "alias"),
+ array("geggeqgeqag", "geqgeagae", "@email.com", "alias"),
+ array("geggeqgeqag", "geqgeagae", "email@.com", "alias"),
+ array("geggeqgeqag", "geqgeagae", "email@4.", "alias"),
+ array("geggeqgeqag", "geqgeagae", "", "alias"),
+ );
+ }
+
+ /**
+ * @dataProvider getWrongEmailTestData
+ * @expectedException \Exception
+ * @expectedExceptionMessage mail
+ */
+ public function testAddUserWrongEmail($userLogin, $password, $email, $alias)
+ {
+ $this->api->addUser($userLogin, $password, $email, $alias);
+ }
+
+ /**
+ * empty alias => use login
+ */
+ public function testAddUserEmptyAlias()
+ {
+ $login = "geggeqgeqag";
+ $this->api->addUser($login, "geqgeagae", "mgeagi@geq.com", "");
+ $user = $this->api->getUser($login);
+ $this->assertEquals($login, $user['alias']);
+ $this->assertEquals($login, $user['login']);
+ }
+
+ /**
+ * no alias => use login
+ */
+ public function testAddUserNoAliasSpecified()
+ {
+ $login = "geggeqg455eqag";
+ $this->api->addUser($login, "geqgeagae", "mgeagi@geq.com");
+ $user = $this->api->getUser($login);
+ $this->assertEquals($login, $user['alias']);
+ $this->assertEquals($login, $user['login']);
+ }
+
+ /**
+ * normal test case
+ */
+ public function testAddUser()
+ {
+ $login = "geggeq55eqag";
+ $password = "mypassword";
+ $email = "mgeag4544i@geq.com";
+ $alias = "her is my alias )(&|\" '£%*(&%+))";
+
+ $time = time();
+ $this->api->addUser($login, $password, $email, $alias);
+ $user = $this->api->getUser($login);
+
+ // check that the date registered is correct
+ $this->assertTrue($time <= strtotime($user['date_registered']) && strtotime($user['date_registered']) <= time(),
+ "the date_registered " . strtotime($user['date_registered']) . " is different from the time() " . time());
+ $this->assertTrue($user['date_registered'] <= time());
+
+ // check that token is 32 chars
+ $this->assertEquals(32, strlen($user['password']));
+
+ // that the password has been md5
+ $this->assertEquals(md5($login . md5($password)), $user['token_auth']);
+
+ // check that all fields are the same
+ $this->assertEquals($login, $user['login']);
+ $this->assertEquals(md5($password), $user['password']);
+ $this->assertEquals($email, $user['email']);
+ $this->assertEquals($alias, $user['alias']);
+ }
+
+ /**
+ * @expectedException \Exception
+ * @expectedExceptionMessage UsersManager_ExceptionDeleteDoesNotExist
+ */
+ public function testSeleteUserDoesntExist()
+ {
+ $this->api->addUser("geggeqgeqag", "geqgeagae", "test@test.com", "alias");
+ $this->api->deleteUser("geggeqggnew");
+ }
+
+ /**
+ * @expectedException \Exception
+ * @expectedExceptionMessage UsersManager_ExceptionDeleteDoesNotExist
+ */
+ public function testDeleteUserEmptyUser()
+ {
+ $this->api->deleteUser("");
+ }
+
+ /**
+ * @expectedException \Exception
+ * @expectedExceptionMessage UsersManager_ExceptionDeleteDoesNotExist
+ */
+ public function testDeleteUserNullUser()
+ {
+ $this->api->deleteUser(null);
+ }
+
+ /**
+ * @expectedException \Exception
+ * @expectedExceptionMessage UsersManager_ExceptionDeleteOnlyUserWithSuperUserAccess
+ */
+ public function testDeleteUser_ShouldFail_InCaseTheUserIsTheOnlyRemainingSuperUser()
+ {
+ //add user and set some rights
+ $this->api->addUser("regularuser", "geqgeagae1", "test1@test.com", "alias1");
+ $this->api->addUser("superuser", "geqgeagae2", "test2@test.com", "alias2");
+ $this->api->setSuperUserAccess('superuser', true);
+
+ // delete the user
+ $this->api->deleteUser("superuser");
+ }
+
+ /**
+ * normal case, user deleted
+ */
+ public function testDeleteUser()
+ {
+ $this->addSites(3);
+
+ //add user and set some rights
+ $this->api->addUser("geggeqgeqag", "geqgeagae", "test@test.com", "alias");
+ $this->api->setUserAccess("geggeqgeqag", "view", array(1, 2));
+ $this->api->setUserAccess("geggeqgeqag", "admin", array(1, 3));
+
+ // check rights are set
+ $this->assertNotEquals(array(), $this->api->getSitesAccessFromUser("geggeqgeqag"));
+
+ // delete the user
+ $this->api->deleteUser("geggeqgeqag");
+
+ // try to get it, it should raise an exception
+ try {
+ $this->api->getUser("geggeqgeqag");
+ $this->fail("Exception not raised.");
+ } catch (Exception $expected) {
+ $this->assertRegExp("(UsersManager_ExceptionUserDoesNotExist)", $expected->getMessage());
+ }
+
+ // add the same user
+ $this->api->addUser("geggeqgeqag", "geqgeagae", "test@test.com", "alias");
+
+ //checks access have been deleted
+ //to do so we recreate the same user login and check if the rights are still there
+ $this->assertEquals(array(), $this->api->getSitesAccessFromUser("geggeqgeqag"));
+ }
+
+ /**
+ * @expectedException \Exception
+ * @expectedExceptionMessage UsersManager_ExceptionUserDoesNotExist
+ */
+ public function testGetUserNoUser()
+ {
+ // try to get it, it should raise an exception
+ $this->api->getUser("geggeqgeqag");
+ }
+
+ /**
+ * normal case
+ */
+ public function test_GetUser()
+ {
+ $login = "geggeq55eqag";
+ $password = "mypassword";
+ $email = "mgeag4544i@geq.com";
+ $alias = "";
+
+ $this->api->addUser($login, $password, $email, $alias);
+ $user = $this->api->getUser($login);
+
+ // check that all fields are the same
+ $this->assertEquals($login, $user['login']);
+ $this->assertInternalType('string', $user['password']);
+ $this->assertInternalType('string', $user['date_registered']);
+ $this->assertEquals($email, $user['email']);
+
+ //alias shouldnt be empty even if no alias specified
+ $this->assertGreaterThan(0, strlen($user['alias']));
+ }
+
+ /**
+ * no user => empty array
+ */
+ public function testGetUsersNoUser()
+ {
+ $this->assertEquals($this->api->getUsers(), array());
+ }
+
+ /**
+ * normal case
+ * as well as selecting specific user names, comma separated
+ */
+ public function testGetUsers()
+ {
+ $this->api->addUser("gegg4564eqgeqag", "geqgegagae", "tegst@tesgt.com", "alias");
+ $this->api->addUser("geggeqge632ge56a4qag", "geqgegeagae", "tesggt@tesgt.com", "alias");
+ $this->api->addUser("geggeqgeqagqegg", "geqgeaggggae", "tesgggt@tesgt.com");
+
+ $users = $this->api->getUsers();
+ $users = $this->_removeNonTestableFieldsFromUsers($users);
+ $user1 = array('login' => "gegg4564eqgeqag", 'password' => md5("geqgegagae"), 'alias' => "alias", 'email' => "tegst@tesgt.com", 'superuser_access' => 0);
+ $user2 = array('login' => "geggeqge632ge56a4qag", 'password' => md5("geqgegeagae"), 'alias' => "alias", 'email' => "tesggt@tesgt.com", 'superuser_access' => 0);
+ $user3 = array('login' => "geggeqgeqagqegg", 'password' => md5("geqgeaggggae"), 'alias' => 'geggeqgeqagqegg', 'email' => "tesgggt@tesgt.com", 'superuser_access' => 0);
+ $expectedUsers = array($user1, $user2, $user3);
+ $this->assertEquals($expectedUsers, $users);
+ $this->assertEquals(array($user1), $this->_removeNonTestableFieldsFromUsers($this->api->getUsers('gegg4564eqgeqag')));
+ $this->assertEquals(array($user1, $user2), $this->_removeNonTestableFieldsFromUsers($this->api->getUsers('gegg4564eqgeqag,geggeqge632ge56a4qag')));
+ }
+
+ protected function _removeNonTestableFieldsFromUsers($users)
+ {
+ foreach ($users as &$user) {
+ unset($user['token_auth']);
+ unset($user['date_registered']);
+ }
+ return $users;
+ }
+
+ /**
+ * normal case
+ */
+ public function testGetUsersLogin()
+ {
+ $this->api->addUser('gegg4564eqgeqag', 'geqgegagae', 'tegst@tesgt.com', 'alias');
+ $this->api->addUser("geggeqge632ge56a4qag", "geqgegeagae", "tesggt@tesgt.com", "alias");
+ $this->api->addUser("geggeqgeqagqegg", "geqgeaggggae", "tesgggt@tesgt.com");
+
+ $logins = $this->api->getUsersLogin();
+
+ $this->assertEquals(array("gegg4564eqgeqag", "geggeqge632ge56a4qag", "geggeqgeqagqegg"), $logins);
+ }
+
+ /**
+ * @expectedException \Exception
+ * @expectedExceptionMessage UsersManager_ExceptionUserDoesNotExist
+ */
+ public function testSetUserAccessNoLogin()
+ {
+ $this->api->setUserAccess("nologin", "view", 1);
+ }
+
+ /**
+ * @expectedException \Exception
+ * @expectedExceptionMessage UsersManager_ExceptionAccessValues
+ */
+ public function testSetUserAccessWrongAccessSpecified()
+ {
+ $this->api->addUser("gegg4564eqgeqag", "geqgegagae", "tegst@tesgt.com", "alias");
+ $this->api->setUserAccess("gegg4564eqgeqag", "viewnotknown", 1);
+ }
+
+ /**
+ * @expectedException \Exception
+ * @expectedExceptionMessage UsersManager_ExceptionAccessValues
+ */
+ public function testSetUserAccess_ShouldFail_SuperUserAccessIsNotAllowed()
+ {
+ $this->api->addUser("gegg4564eqgeqag", "geqgegagae", "tegst@tesgt.com", "alias");
+ $this->api->setUserAccess("gegg4564eqgeqag", "superuser", 1);
+ }
+
+ /**
+ * @expectedException \Exception
+ * @expectedExceptionMessage UsersManager_ExceptionUserDoesNotExist
+ */
+ public function testSetUserAccess_ShouldFail_IfLoginIsConfigSuperUserLogin()
+ {
+ $this->api->setUserAccess('superusertest', 'view', 1);
+ }
+
+ /**
+ * @expectedException \Exception
+ * @expectedExceptionMessage UsersManager_ExceptionSuperUserAccess
+ */
+ public function testSetUserAccess_ShouldFail_IfLoginIsUserWithSuperUserAccess()
+ {
+ $this->api->addUser("gegg4564eqgeqag", "geqgegagae", "tegst@tesgt.com", "alias");
+ $this->api->setSuperUserAccess('gegg4564eqgeqag', true);
+
+ $this->api->setUserAccess('gegg4564eqgeqag', 'view', 1);
+ }
+
+ /**
+ * idsites = all => apply access to all websites with admin access
+ */
+ public function testSetUserAccessIdsitesIsAll()
+ {
+ $this->api->addUser("gegg4564eqgeqag", "geqgegagae", "tegst@tesgt.com", "alias");
+
+ FakeAccess::$superUser = false;
+
+ $this->api->setUserAccess("gegg4564eqgeqag", "view", "all");
+
+ FakeAccess::$superUser = true;
+ $access = $this->api->getSitesAccessFromUser("gegg4564eqgeqag");
+ $access = $this->_flatten($access);
+
+ FakeAccess::$superUser = false;
+ $this->assertEquals(array_keys($access), FakeAccess::getSitesIdWithAdminAccess());
+
+ // we want to test the case for which we have actually set some rights
+ // if this is not OK then change the setUp method and add some admin rights for some websites
+ $this->assertGreaterThan(0, count(array_keys($access)));
+ }
+
+ /**
+ * idsites = all AND user is superuser=> apply access to all websites
+ */
+ public function testSetUserAccessIdsitesIsAllSuperuser()
+ {
+ FakeAccess::$superUser = true;
+
+ $idSites = $this->addSites(5);
+
+ $this->api->addUser("gegg4564eqgeqag", "geqgegagae", "tegst@tesgt.com", "alias");
+ $this->api->setUserAccess("gegg4564eqgeqag", "view", "all");
+
+ $access = $this->api->getSitesAccessFromUser("gegg4564eqgeqag");
+ $access = $this->_flatten($access);
+ $this->assertEquals($idSites, array_keys($access));
+ }
+
+ /**
+ * @expectedException \Exception
+ */
+ public function testSetUserAccess_ShouldNotBeAbleToSetAnyAccess_IfIdSitesIsEmpty()
+ {
+ $this->api->addUser("gegg4564eqgeqag", "geqgegagae", "tegst@tesgt.com", "alias");
+
+ $this->api->setUserAccess("gegg4564eqgeqag", "view", array());
+ }
+
+ /**
+ * normal case, access set for only one site
+ */
+ public function testSetUserAccessIdsitesOneSite()
+ {
+ $this->api->addUser("gegg4564eqgeqag", "geqgegagae", "tegst@tesgt.com", "alias");
+ $idSites = $this->addSites(1);
+
+ $this->api->setUserAccess("gegg4564eqgeqag", "view", $idSites);
+
+ $access = $this->api->getSitesAccessFromUser("gegg4564eqgeqag");
+ $access = $this->_flatten($access);
+ $this->assertEquals($idSites, array_keys($access));
+ }
+
+ /**
+ * normal case, access set for multiple sites
+ */
+ public function testSetUserAccessIdsitesMultipleSites()
+ {
+ $this->api->addUser("gegg4564eqgeqag", "geqgegagae", "tegst@tesgt.com", "alias");
+ list($id1, $id2, $id3) = $this->addSites(3);
+
+ $this->api->setUserAccess("gegg4564eqgeqag", "view", array($id1, $id3));
+
+ $access = $this->api->getSitesAccessFromUser("gegg4564eqgeqag");
+ $access = $this->_flatten($access);
+ $this->assertEquals(array($id1, $id3), array_keys($access));
+ }
+
+ /**
+ * normal case, string idSites comma separated access set for multiple sites
+ */
+ public function testSetUserAccessWithIdSitesIsStringCommaSeparated()
+ {
+ $this->api->addUser("gegg4564eqgeqag", "geqgegagae", "tegst@tesgt.com", "alias");
+ list($id1, $id2, $id3) = $this->addSites(3);
+
+ $this->api->setUserAccess("gegg4564eqgeqag", "view", "1,3");
+
+ $access = $this->api->getSitesAccessFromUser("gegg4564eqgeqag");
+ $access = $this->_flatten($access);
+ $this->assertEquals(array($id1, $id3), array_keys($access));
+ }
+
+ /**
+ * normal case, set different acccess to different websites for one user
+ */
+ public function testSetUserAccessMultipleCallDistinctAccessSameUser()
+ {
+ $this->api->addUser("gegg4564eqgeqag", "geqgegagae", "tegst@tesgt.com", "alias");
+
+ list($id1, $id2) = $this->addSites(2);
+
+ $this->api->setUserAccess("gegg4564eqgeqag", "view", array($id1));
+ $this->api->setUserAccess("gegg4564eqgeqag", "admin", array($id2));
+
+ $access = $this->api->getSitesAccessFromUser("gegg4564eqgeqag");
+ $access = $this->_flatten($access);
+ $this->assertEquals(array($id1 => 'view', $id2 => 'admin'), $access);
+ }
+
+ /**
+ * normal case, set different access to different websites for multiple users
+ */
+ public function testSetUserAccessMultipleCallDistinctAccessMultipleUser()
+ {
+ $this->api->addUser("user1", "geqgegagae", "tegst@tesgt.com", "alias");
+ $this->api->addUser("user2", "geqgegagae", "tegst2@tesgt.com", "alias");
+
+ list($id1, $id2, $id3) = $this->addSites(3);
+
+ $this->api->setUserAccess("user1", "view", array($id1, $id2));
+ $this->api->setUserAccess("user2", "admin", array($id1));
+ $this->api->setUserAccess("user2", "view", array($id3, $id2));
+
+ $access1 = $this->api->getSitesAccessFromUser("user1");
+ $access1 = $this->_flatten($access1);
+ $access2 = $this->api->getSitesAccessFromUser("user2");
+ $access2 = $this->_flatten($access2);
+ $wanted1 = array($id1 => 'view', $id2 => 'view',);
+ $wanted2 = array($id1 => 'admin', $id2 => 'view', $id3 => 'view');
+
+ $this->assertEquals($wanted1, $access1);
+ $this->assertEquals($wanted2, $access2);
+
+ $access1 = $this->api->getUsersAccessFromSite($id1);
+ $access2 = $this->api->getUsersAccessFromSite($id2);
+ $access3 = $this->api->getUsersAccessFromSite($id3);
+ $wanted1 = array('user1' => 'view', 'user2' => 'admin',);
+ $wanted2 = array('user1' => 'view', 'user2' => 'view');
+ $wanted3 = array('user2' => 'view');
+
+ $this->assertEquals($wanted1, $access1);
+ $this->assertEquals($wanted2, $access2);
+ $this->assertEquals($wanted3, $access3);
+
+ $access1 = $this->api->getUsersSitesFromAccess('view');
+ $access2 = $this->api->getUsersSitesFromAccess('admin');
+ $wanted1 = array('user1' => array($id1, $id2), 'user2' => array($id2, $id3));
+ $wanted2 = array('user2' => array($id1));
+
+ $this->assertEquals($wanted1, $access1);
+ $this->assertEquals($wanted2, $access2);
+
+ // Test getUsersWithSiteAccess
+ $users = $this->api->getUsersWithSiteAccess($id1, $access = 'view');
+ $this->assertEquals(1, count($users));
+ $this->assertEquals('user1', $users[0]['login']);
+ $users = $this->api->getUsersWithSiteAccess($id2, $access = 'view');
+ $this->assertEquals(2, count($users));
+ $users = $this->api->getUsersWithSiteAccess($id1, $access = 'admin');
+ $this->assertEquals(1, count($users));
+ $this->assertEquals('user2', $users[0]['login']);
+ $users = $this->api->getUsersWithSiteAccess($id3, $access = 'admin');
+ $this->assertEquals(0, count($users));
+ }
+
+ /**
+ * we set access for one user for one site several times and check that it is updated
+ */
+ public function testSetUserAccessMultipleCallOverwriteSingleUserOneSite()
+ {
+ $this->api->addUser("user1", "geqgegagae", "tegst@tesgt.com", "alias");
+
+ list($id1, $id2) = $this->addSites(2);
+
+ $this->api->setUserAccess("user1", "view", array($id1, $id2));
+ $this->api->setUserAccess("user1", "admin", array($id1));
+
+ $access1 = $this->api->getSitesAccessFromUser("user1");
+ $access1 = $this->_flatten($access1);
+ $wanted1 = array($id1 => 'admin', $id2 => 'view',);
+
+ $this->assertEquals($wanted1, $access1);
+ }
+
+ /**
+ * @expectedException \Exception
+ * @expectedExceptionMessage checkUserHasSuperUserAccess Fake exception
+ */
+ public function testSetSuperUserAccess_ShouldFail_IfUserHasNotSuperUserPermission()
+ {
+ FakeAccess::setSuperUserAccess(false);
+ $this->api->setSuperUserAccess('nologin', false);
+ }
+
+ /**
+ * @expectedException \Exception
+ * @expectedExceptionMessage UsersManager_ExceptionUserDoesNotExist
+ */
+ public function testSetSuperUserAccess_ShouldFail_IfUserWithGivenLoginDoesNotExist()
+ {
+ $this->api->setSuperUserAccess('nologin', false);
+ }
+
+ /**
+ * @expectedException \Exception
+ * @expectedExceptionMessage UsersManager_ExceptionEditAnonymous
+ */
+ public function testSetSuperUserAccess_ShouldFail_IfUserIsAnonymous()
+ {
+ $this->api->setSuperUserAccess('anonymous', true);
+ }
+
+ /**
+ * @expectedException \Exception
+ * @expectedExceptionMessage UsersManager_ExceptionRemoveSuperUserAccessOnlySuperUser
+ */
+ public function testSetSuperUserAccess_ShouldFail_IfUserIsOnlyRemainingUserWithSuperUserAccess()
+ {
+ $this->api->addUser('login1', 'password1', 'test@example.com', false);
+ $this->api->setSuperUserAccess('login1', true);
+
+ $this->api->setSuperUserAccess('login1', false);
+ }
+
+ public function testSetSuperUserAccess_ShouldDeleteAllExistingAccessEntries()
+ {
+ list($id1, $id2) = $this->addSites(2);
+ $this->api->addUser('login1', 'password1', 'test@example.com', false);
+ $this->api->setUserAccess('login1', 'view', array($id1));
+ $this->api->setUserAccess('login1', 'admin', array($id2));
+
+ // verify user has access before setting Super User access
+ $access = $this->_flatten($this->api->getSitesAccessFromUser('login1'));
+ $this->assertEquals(array($id1 => 'view', $id2 => 'admin'), $access);
+
+ $this->api->setSuperUserAccess('login1', true);
+
+ // verify no longer any access
+ $this->assertEquals(array(), $this->model->getSitesAccessFromUser('login1'));
+ }
+
+ public function testSetSuperUserAccess_ShouldAddAndRemoveSuperUserAccessOnlyForGivenLogin()
+ {
+ $this->api->addUser('login1', 'password1', 'test1@example.com', false);
+ $this->api->addUser('login2', 'password2', 'test2@example.com', false);
+ $this->api->addUser('login3', 'password3', 'test3@example.com', false);
+
+ $this->api->setSuperUserAccess('login2', true);
+
+ // test add Super User access
+ $users = $this->api->getUsers();
+
+ $this->assertEquals(0, $users[0]['superuser_access']);
+ $this->assertEquals(1, $users[1]['superuser_access']);
+ $this->assertEquals('login2', $users[1]['login']);
+ $this->assertEquals(0, $users[2]['superuser_access']);
+
+ // should also accept string '1' to add Super User access
+ $this->api->setSuperUserAccess('login1', '1');
+ // test remove Super User access
+ $this->api->setSuperUserAccess('login2', false);
+
+ $users = $this->api->getUsers();
+ $this->assertEquals(1, $users[0]['superuser_access']);
+ $this->assertEquals('login1', $users[0]['login']);
+ $this->assertEquals(0, $users[1]['superuser_access']);
+ $this->assertEquals(0, $users[2]['superuser_access']);
+
+ $this->api->setSuperUserAccess('login3', true);
+ // should also accept string '0' to remove Super User access
+ $this->api->setSuperUserAccess('login1', '0');
+
+ $users = $this->api->getUsers();
+ $this->assertEquals(0, $users[0]['superuser_access']);
+ $this->assertEquals(0, $users[1]['superuser_access']);
+ $this->assertEquals('login3', $users[2]['login']);
+ $this->assertEquals(1, $users[2]['superuser_access']);
+ }
+
+ /**
+ * @expectedException \Exception
+ * @expectedExceptionMessage UsersManager_ExceptionUserDoesNotExist
+ */
+ public function testGetSitesAccessFromUserWrongUser()
+ {
+ $this->api->getSitesAccessFromUser("user1");
+ }
+
+ /**
+ * @expectedException \Exception
+ */
+ public function testGetUsersAccessFromSiteWrongIdSite()
+ {
+ $this->api->getUsersAccessFromSite(1);
+ }
+
+ /**
+ * @expectedException \Exception
+ * @expectedExceptionMessage UsersManager_ExceptionAccessValues
+ */
+ public function testGetUsersSitesFromAccessWrongSite()
+ {
+ $this->api->getUsersSitesFromAccess('unknown');
+ }
+
+ /**
+ * @expectedException \Exception
+ * @expectedExceptionMessage UsersManager_ExceptionUserDoesNotExist
+ */
+ public function testUpdateUserNonExistingLogin()
+ {
+ $this->api->updateUser("lolgin", "password");
+ }
+
+ /**
+ * no email no alias => keep old ones
+ */
+ public function testUpdateUserNoEmailNoAlias()
+ {
+ $login = "login";
+ $user = array('login' => $login,
+ 'password' => "geqgeagae",
+ 'email' => "test@test.com",
+ 'alias' => "alias");
+
+ $this->api->addUser($user['login'], $user['password'], $user['email'], $user['alias']);
+ $this->api->updateUser($login, "passowordOK");
+
+ $this->_checkUserHasNotChanged($user, "passowordOK");
+ }
+
+ /**
+ * no email => keep old ones
+ */
+ public function testUpdateUserNoEmail()
+ {
+ $login = "login";
+ $user = array('login' => $login,
+ 'password' => "geqgeagae",
+ 'email' => "test@test.com",
+ 'alias' => "alias");
+
+ $this->api->addUser($user['login'], $user['password'], $user['email'], $user['alias']);
+ $this->api->updateUser($login, "passowordOK", null, "newalias");
+
+ $this->_checkUserHasNotChanged($user, "passowordOK", null, "newalias");
+ }
+
+ /**
+ * no alias => keep old ones
+ */
+ public function testUpdateUserNoAlias()
+ {
+ $login = "login";
+ $user = array('login' => $login,
+ 'password' => "geqgeagae",
+ 'email' => "test@test.com",
+ 'alias' => "alias");
+
+ $this->api->addUser($user['login'], $user['password'], $user['email'], $user['alias']);
+ $this->api->updateUser($login, "passowordOK", "email@geaga.com");
+
+ $this->_checkUserHasNotChanged($user, "passowordOK", "email@geaga.com");
+ }
+
+ /**
+ * check to modify as the user
+ * @expectedException \Exception
+ * @expectedExceptionMessage UsersManager_ExceptionLoginExists
+ */
+ public function testAddUserIAmTheUser()
+ {
+ FakeAccess::$identity = 'login';
+ $this->testUpdateUserNoEmailNoAlias();
+ }
+
+ /**
+ * check to modify as being another user => exception
+ *
+ * @expectedException \Exception
+ */
+ public function testUpdateUserIAmNotTheUser()
+ {
+ FakeAccess::$identity = 'login2';
+ FakeAccess::$superUser = false;
+ $this->testUpdateUserNoEmailNoAlias();
+ }
+
+ /**
+ * normal case, reused in other tests
+ */
+ public function testUpdateUser()
+ {
+ $login = "login";
+ $user = array('login' => $login,
+ 'password' => "geqgeagae",
+ 'email' => "test@test.com",
+ 'alias' => "alias");
+
+ $this->api->addUser($user['login'], $user['password'], $user['email'], $user['alias']);
+ $this->api->updateUser($login, "passowordOK", "email@geaga.com", "NEW ALIAS");
+
+ $this->_checkUserHasNotChanged($user, "passowordOK", "email@geaga.com", "NEW ALIAS");
+ }
+
+ /**
+ * @expectedException \Exception
+ */
+ public function testGetUserByEmailInvalidMail()
+ {
+ $this->api->getUserByEmail('email@test.com');
+ }
+
+ public function testGetUserByEmail()
+ {
+ $user = array('login' => "login",
+ 'password' => "geqgeagae",
+ 'email' => "test@test.com",
+ 'alias' => "alias");
+
+ $this->api->addUser($user['login'], $user['password'], $user['email'], $user['alias']);
+
+ $userByMail = $this->api->getUserByEmail($user['email']);
+
+ $this->assertEquals($user['login'], $userByMail['login']);
+ $this->assertEquals($user['email'], $userByMail['email']);
+ $this->assertEquals($user['alias'], $userByMail['alias']);
+ }
+
+ public function testGetUserPreferenceDefault()
+ {
+ $this->addSites(1);
+ $defaultReportPref = API::PREFERENCE_DEFAULT_REPORT;
+ $defaultReportDatePref = API::PREFERENCE_DEFAULT_REPORT_DATE;
+
+ $this->assertEquals(1, $this->api->getUserPreference('someUser', $defaultReportPref));
+ $this->assertEquals('yesterday', $this->api->getUserPreference('someUser', $defaultReportDatePref));
+ }
+
+ private function addSites($numberOfSites)
+ {
+ $idSites = array();
+
+ for ($index = 0; $index < $numberOfSites; $index++) {
+ $name = "test" . ($index + 1);
+ $idSites[] = APISitesManager::getInstance()->addSite($name, array("http://piwik.net", "http://piwik.com/test/"));
+ }
+
+ return $idSites;
+ }
+}
diff --git a/plugins/UsersManager/tests/UserPreferencesTest.php b/plugins/UsersManager/tests/UserPreferencesTest.php
deleted file mode 100644
index 7f27529b02..0000000000
--- a/plugins/UsersManager/tests/UserPreferencesTest.php
+++ /dev/null
@@ -1,116 +0,0 @@
-<?php
-/**
- * Piwik - free/libre analytics platform
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- */
-
-namespace Piwik\Plugins\UsersManager\tests;
-use Piwik\Piwik;
-use Piwik\Plugins\UsersManager\UserPreferences;
-use Piwik\Plugins\UsersManager\API as APIUsersManager;
-use FakeAccess;
-use Piwik\Access;
-use Piwik\Tests\Fixture;
-
-/**
- * @group UsersManager
- * @group UserPreferencesTest
- * @group Database
- * @group Plugins
- */
-class UserPreferencesTest extends \DatabaseTestCase
-{
- /**
- * @var UserPreferences
- */
- private $userPreferences;
-
- public function setUp()
- {
- parent::setUp();
-
- $this->userPreferences = new UserPreferences();
-
- $this->setSuperUser();
- }
-
- public function test_getDefaultReport_ShouldReturnFalseByDefault()
- {
- $this->assertEquals(false, $this->userPreferences->getDefaultReport());
- }
-
- public function test_getDefaultReport_ShouldReturnTheRawValueIfNotNumeric()
- {
- $this->setDefaultReport('MultiSites');
- $this->assertEquals('MultiSites', $this->userPreferences->getDefaultReport());
- }
-
- public function test_getDefaultReport_ShouldNotReturnSiteIdIfNoPermissionForSite()
- {
- $this->createSite();
- $this->setDefaultReport(1);
- $this->setAnonymous();
- $this->assertEquals(false, $this->userPreferences->getDefaultReport());
- }
-
- public function test_getDefaultReport_ShouldReturnSiteIdIfPermissionForSite()
- {
- $this->createSite();
- $this->setDefaultReport(1);
- $this->assertEquals(1, $this->userPreferences->getDefaultReport());
- }
-
- public function test_getDefaultWebsiteId_ShouldReturnFalseByDefault()
- {
- $this->assertEquals(false, $this->userPreferences->getDefaultWebsiteId());
- }
-
- public function test_getDefaultWebsiteId_ShouldReturnASiteIfOneExistsAndHasAccess()
- {
- $this->createSite();
- $this->assertEquals(1, $this->userPreferences->getDefaultWebsiteId());
- }
-
- public function test_getDefaultWebsiteId_ShouldReturnFalseIfASiteExistsButHasNoAccess()
- {
- $this->createSite();
- $this->setAnonymous();
- $this->assertEquals(false, $this->userPreferences->getDefaultWebsiteId());
- }
-
- public function test_getDefaultWebsiteId_ShouldReturnASiteEvenIfMultiSitesIsDefaultReport()
- {
- $this->setDefaultReport('MultiSites');
- $this->createSite();
- $this->assertEquals(1, $this->userPreferences->getDefaultWebsiteId());
- }
-
- private function setSuperUser()
- {
- $pseudoMockAccess = new FakeAccess();
- FakeAccess::$superUser = true;
- Access::setSingletonInstance($pseudoMockAccess);
- }
-
- private function setAnonymous()
- {
- $pseudoMockAccess = new FakeAccess();
- FakeAccess::$superUser = false;
- Access::setSingletonInstance($pseudoMockAccess);
- }
-
- private function createSite()
- {
- Fixture::createWebsite('2013-01-23 01:23:45');
- }
-
- private function setDefaultReport($defaultReport)
- {
- APIUsersManager::getInstance()->setUserPreference(Piwik::getCurrentUserLogin(),
- APIUsersManager::PREFERENCE_DEFAULT_REPORT,
- $defaultReport);
- }
-
-}
diff --git a/plugins/VisitorGenerator b/plugins/VisitorGenerator
-Subproject aea836e8702778a52a22c3453061c8066fd34cd
+Subproject c12768d036739865c79e7108f60cc5ec0aa607e
diff --git a/tests/PHPUnit/BenchmarkTestCase.php b/tests/PHPUnit/BenchmarkTestCase.php
index 28e6128c48..40f5309527 100755
--- a/tests/PHPUnit/BenchmarkTestCase.php
+++ b/tests/PHPUnit/BenchmarkTestCase.php
@@ -8,9 +8,9 @@
use Piwik\Config;
use Piwik\Db;
use Piwik\Plugins\Goals\API;
-use Piwik\Tests\Fixture;
+use Piwik\Tests\Impl\Fixture;
-require_once PIWIK_INCLUDE_PATH . '/tests/PHPUnit/IntegrationTestCase.php';
+require_once PIWIK_INCLUDE_PATH . '/tests/PHPUnit/Impl/SystemTestCase.php';
require_once PIWIK_INCLUDE_PATH . '/tests/LocalTracker.php';
// require fixtures
@@ -21,7 +21,7 @@ foreach (glob(PIWIK_INCLUDE_PATH . '/tests/PHPUnit/Benchmarks/Fixtures/*.php') a
/**
* Base class for benchmarks.
*/
-abstract class BenchmarkTestCase extends \Piwik\Tests\IntegrationTestCase
+abstract class BenchmarkTestCase extends \Piwik\Tests\Impl\SystemTestCase
{
protected static $fixture;
diff --git a/tests/PHPUnit/Benchmarks/Fixtures/ManyThousandSitesOneVisitEach.php b/tests/PHPUnit/Benchmarks/Fixtures/ManyThousandSitesOneVisitEach.php
index 38e89928bd..4fbbef1bb9 100644
--- a/tests/PHPUnit/Benchmarks/Fixtures/ManyThousandSitesOneVisitEach.php
+++ b/tests/PHPUnit/Benchmarks/Fixtures/ManyThousandSitesOneVisitEach.php
@@ -7,7 +7,7 @@
*/
use Piwik\Date;
use Piwik\Plugins\Goals\API;
-use Piwik\Tests\Fixture;
+use Piwik\Tests\Impl\Fixture;
/**
* Reusable fixture. Adds 20,000 sites and tracks one pageview for each on one day.
diff --git a/tests/PHPUnit/Benchmarks/Fixtures/OneSiteThousandsOfDistinctUrlsOverMonth.php b/tests/PHPUnit/Benchmarks/Fixtures/OneSiteThousandsOfDistinctUrlsOverMonth.php
index 554b18a694..2a997554a3 100644
--- a/tests/PHPUnit/Benchmarks/Fixtures/OneSiteThousandsOfDistinctUrlsOverMonth.php
+++ b/tests/PHPUnit/Benchmarks/Fixtures/OneSiteThousandsOfDistinctUrlsOverMonth.php
@@ -7,7 +7,7 @@
*/
use Piwik\Date;
use Piwik\Plugins\Goals\API;
-use Piwik\Tests\Fixture;
+use Piwik\Tests\Impl\Fixture;
/**
* Adds one site and 1000 actions for every day of one month (January). Each
diff --git a/tests/PHPUnit/Benchmarks/Fixtures/OneSiteTwelveThousandVisitsOneYear.php b/tests/PHPUnit/Benchmarks/Fixtures/OneSiteTwelveThousandVisitsOneYear.php
index 9b12e79e9f..aed08bb332 100755
--- a/tests/PHPUnit/Benchmarks/Fixtures/OneSiteTwelveThousandVisitsOneYear.php
+++ b/tests/PHPUnit/Benchmarks/Fixtures/OneSiteTwelveThousandVisitsOneYear.php
@@ -7,7 +7,7 @@
*/
use Piwik\Date;
use Piwik\Plugins\Goals\API;
-use Piwik\Tests\Fixture;
+use Piwik\Tests\Impl\Fixture;
/**
* Reusable fixture. Tracks twelve thousand page views over a year for one site.
diff --git a/tests/PHPUnit/Benchmarks/Fixtures/ThousandSitesTwelveVisitsEachOneDay.php b/tests/PHPUnit/Benchmarks/Fixtures/ThousandSitesTwelveVisitsEachOneDay.php
index fad6fc311f..79dba76fe7 100755
--- a/tests/PHPUnit/Benchmarks/Fixtures/ThousandSitesTwelveVisitsEachOneDay.php
+++ b/tests/PHPUnit/Benchmarks/Fixtures/ThousandSitesTwelveVisitsEachOneDay.php
@@ -7,7 +7,7 @@
*/
use Piwik\Date;
use Piwik\Plugins\Goals\API as APIGoals;
-use Piwik\Tests\Fixture;
+use Piwik\Tests\Impl\Fixture;
/**
* Reusable fixture. Tracks twelve thousand page views for 1000 sites on one day.
diff --git a/tests/PHPUnit/ConsoleCommandTestCase.php b/tests/PHPUnit/ConsoleCommandTestCase.php
index 504d37da95..72b231f41f 100644
--- a/tests/PHPUnit/ConsoleCommandTestCase.php
+++ b/tests/PHPUnit/ConsoleCommandTestCase.php
@@ -10,10 +10,11 @@ namespace Piwik\Tests;
use Piwik\Config;
use Piwik\Console;
+use Piwik\Tests\Impl\SystemTestCase;
use Symfony\Component\Console\Tester\ApplicationTester;
/**
- * Base class for test cases that test Piwik console commands. Derives from IntegrationTestCase
+ * Base class for test cases that test Piwik console commands. Derives from SystemTestCase
* so the entire Piwik environment is set up.
*
* This will create an ApplicationTester instance (provided by Symfony) which should be used to
@@ -33,7 +34,7 @@ use Symfony\Component\Console\Tester\ApplicationTester;
* // other checks
* }
*/
-class ConsoleCommandTestCase extends IntegrationTestCase
+class ConsoleCommandTestCase extends SystemTestCase
{
protected $applicationTester = null;
diff --git a/tests/PHPUnit/Core/AssetManager/UIAssetMinifierTest.php b/tests/PHPUnit/Core/AssetManager/UIAssetMinifierTest.php
deleted file mode 100644
index df62e5c86b..0000000000
--- a/tests/PHPUnit/Core/AssetManager/UIAssetMinifierTest.php
+++ /dev/null
@@ -1,55 +0,0 @@
-<?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\AssetManager\UIAsset\OnDiskUIAsset;
-use Piwik\AssetManager\UIAssetMinifier;
-
-class UIAssetMinifierTest extends PHPUnit_Framework_TestCase
-{
-
- /**
- * @var UIAssetMinifier
- */
- private $assetMinifier;
-
- public function setUp()
- {
- $this->assetMinifier = UIAssetMinifier::getInstance();
- }
-
- public function provider_isMinifiedJs()
- {
- return array(
- array('libs/jquery/jquery.js', true),
- array('libs/jquery/jquery-ui.js', true),
- array('libs/jquery/jquery.browser.js', true),
- array('libs/jqplot/jqplot-custom.min.js', true),
- array('plugins/TreemapVisualization/libs/Jit/jit-2.0.1-yc.js', true),
- array('plugins/TreemapVisualization/javascripts/treemapViz.js', false),
- array('plugins/UserCountryMap/javascripts/vendor/raphael.min.js', true),
- array('plugins/UserCountryMap/javascripts/vendor/jquery.qtip.min.js', true),
- array('plugins/UserCountryMap/javascripts/vendor/kartograph.min.js', true),
- array('plugins/UserCountryMap/javascripts/vendor/jquery.qtip.min.js', true),
- );
- }
-
- /**
- * @group Core
- * @dataProvider provider_isMinifiedJs
- */
- public function test_isMinifiedJs($scriptFileName, $isMinified)
- {
- $scriptFile = new OnDiskUIAsset(PIWIK_USER_PATH, $scriptFileName);
-
- $this->assertEquals(
- $isMinified,
- $this->assetMinifier->isMinifiedJs($scriptFile->getContent())
- );
- }
-}
diff --git a/tests/PHPUnit/Core/AssetManager/stylesheets/CssWithURLs.css b/tests/PHPUnit/Core/AssetManager/stylesheets/CssWithURLs.css
deleted file mode 100644
index 75c919da98..0000000000
--- a/tests/PHPUnit/Core/AssetManager/stylesheets/CssWithURLs.css
+++ /dev/null
@@ -1,12 +0,0 @@
-h1 {
- color: orange;
- text-align: center;
- /* url relative to root: must not be rewritten*/
- background: url(tests/PHPUnit/Core/AssetManager/stylesheets/images/test-image.png);
-}
-
-p {
- font-size: 20px;
- /* url relative to file: must be rewritten*/
- background: url(images/test-image.png);
-} \ No newline at end of file
diff --git a/tests/PHPUnit/Core/AssetManager/stylesheets/ExpectedMergeResult.css b/tests/PHPUnit/Core/AssetManager/stylesheets/ExpectedMergeResult.css
deleted file mode 100644
index 3b86a91e52..0000000000
--- a/tests/PHPUnit/Core/AssetManager/stylesheets/ExpectedMergeResult.css
+++ /dev/null
@@ -1,30 +0,0 @@
-/* compile_me_once={{{CACHE-BUSTER-JS}}} */
-/* Piwik CSS file is compiled with Less. You may be interested in writing a custom Theme for Piwik! */
-#page #header {
- color: white;
-}
-#footer {
- color: red;
-}
-.box {
- color: #fe33ac;
- border-color: #fdcdea;
-}
-.box div {
- -webkit-box-shadow: 0 0 5px rgba(0,0,0,0.3);
- -moz-box-shadow: 0 0 5px rgba(0,0,0,0.3);
- box-shadow: 0 0 5px rgba(0,0,0,0.3);
-}
-h1 {
- color: orange;
- text-align: center;
- background: url(tests/PHPUnit/Core/AssetManager/stylesheets/images/test-image.png);
-}
-p {
- font-size: 20px;
- background: url(tests/PHPUnit/Core/AssetManager/stylesheets/images/test-image.png);
-}
-body {
- background-color: #b0c4de;
-}
-/* customization via event */ \ No newline at end of file
diff --git a/tests/PHPUnit/Core/AssetManagerTest.php b/tests/PHPUnit/Core/AssetManagerTest.php
deleted file mode 100644
index 85fc6d9764..0000000000
--- a/tests/PHPUnit/Core/AssetManagerTest.php
+++ /dev/null
@@ -1,721 +0,0 @@
-<?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\AssetManager\UIAsset\OnDiskUIAsset;
-use Piwik\AssetManager\UIAsset;
-use Piwik\AssetManager;
-use Piwik\AssetManager\UIAssetFetcher\StaticUIAssetFetcher;
-use Piwik\Config;
-use Piwik\Plugin;
-use Piwik\Plugin\Manager;
-use Piwik\EventDispatcher;
-
-require_once PIWIK_INCLUDE_PATH . "/tests/PHPUnit/Core/AssetManager/UIAssetCacheBusterMock.php";
-require_once PIWIK_INCLUDE_PATH . "/tests/PHPUnit/Core/AssetManager/PluginManagerMock.php";
-require_once PIWIK_INCLUDE_PATH . "/tests/PHPUnit/Core/AssetManager/PluginMock.php";
-require_once PIWIK_INCLUDE_PATH . "/tests/PHPUnit/Core/AssetManager/ThemeMock.php";
-
-/**
- * @group AssetManagerTest
- */
-class AssetManagerTest extends PHPUnit_Framework_TestCase
-{
- // todo Theme->rewriteAssetPathIfOverridesFound is not tested
-
- const ASSET_MANAGER_TEST_DIR = 'tests/PHPUnit/Core/AssetManager/';
-
- const FIRST_CACHE_BUSTER_JS = 'first-cache-buster-js';
- const SECOND_CACHE_BUSTER_JS = 'second-cache-buster-js';
- const FIRST_CACHE_BUSTER_SS = 'first-cache-buster-stylesheet';
- const SECOND_CACHE_BUSTER_SS = 'second-cache-buster-stylesheet';
-
- const CORE_PLUGIN_NAME = 'MockCorePlugin';
- const CORE_PLUGIN_WITHOUT_ASSETS_NAME = 'MockCoreWithoutAssetPlugin';
- const NON_CORE_PLUGIN_NAME = 'MockNonCorePlugin';
- const CORE_THEME_PLUGIN_NAME = 'CoreThemePlugin';
- const NON_CORE_THEME_PLUGIN_NAME = 'NonCoreThemePlugin';
-
- /**
- * @var AssetManager
- */
- private $assetManager;
-
- /**
- * @var UIAsset
- */
- private $mergedAsset;
-
- /**
- * @var UIAssetCacheBusterMock
- */
- private $cacheBuster;
-
- /**
- * @var PluginManagerMock
- */
- private $pluginManager;
-
- public function setUp()
- {
- $this->activateMergedAssets();
-
- $this->setUpCacheBuster();
-
- $this->setUpAssetManager();
-
- $this->setUpPluginManager();
-
- $this->setUpTheme();
-
- $this->setUpPlugins();
- }
-
- public function tearDown()
- {
- $this->assetManager->removeMergedAssets();
- Manager::unsetInstance();
- }
-
- private function activateMergedAssets()
- {
- $this->setUpConfig('merged-assets-enabled.ini.php');
- }
-
- private function disableMergedAssets()
- {
- $this->setUpConfig('merged-assets-disabled.ini.php');
- }
-
- /**
- * @param string $filename
- */
- private function setUpConfig($filename)
- {
- $userFile = PIWIK_INCLUDE_PATH . '/' . self::ASSET_MANAGER_TEST_DIR . 'configs/' . $filename;
- $globalFile = PIWIK_INCLUDE_PATH . '/' . self::ASSET_MANAGER_TEST_DIR . 'configs/plugins.ini.php';
-
- $config = Config::getInstance();
- $config->setTestEnvironment($userFile, $globalFile);
- $config->init();
- }
-
- private function setUpCacheBuster()
- {
- $this->cacheBuster = UIAssetCacheBusterMock::getInstance();
- }
-
- private function setUpAssetManager()
- {
- $this->assetManager = AssetManager::getInstance();
-
- $this->assetManager->removeMergedAssets();
-
- $this->assetManager->setCacheBuster($this->cacheBuster);
- }
-
- private function setUpPluginManager()
- {
- $this->pluginManager = PluginManagerMock::getInstance();
- Manager::setSingletonInstance($this->pluginManager);
-
- EventDispatcher::unsetInstance(); // EventDispatcher stores a reference to Plugin Manager
- }
-
- private function setUpPlugins()
- {
- $this->pluginManager->setPlugins(
- array(
- $this->getCoreTheme()->getPlugin(),
- $this->getNonCoreTheme()->getPlugin(),
- $this->getCorePlugin(),
- $this->getCorePluginWithoutUIAssets(),
- $this->getNonCorePlugin()
- )
- );
-
- $this->pluginManager->setLoadedTheme($this->getNonCoreTheme());
- }
-
- private function setUpCorePluginOnly()
- {
- $this->pluginManager->setPlugins(
- array(
- $this->getCorePlugin(),
- )
- );
- }
-
- /**
- * @return Plugin
- */
- private function getCorePlugin()
- {
- $corePlugin = new PluginMock(self::CORE_PLUGIN_NAME);
-
- $corePlugin->setJsFiles(
- array(
- self::ASSET_MANAGER_TEST_DIR . 'scripts/SimpleObject.js',
- self::ASSET_MANAGER_TEST_DIR . 'scripts/SimpleArray.js',
- )
- );
-
- $corePlugin->setStylesheetFiles($this->getCorePluginStylesheetFiles());
- $corePlugin->setJsCustomization('// customization via event');
- $corePlugin->setCssCustomization('/* customization via event */');
-
- return $corePlugin;
- }
-
- /**
- * @return Plugin
- */
- private function getCorePluginWithoutUIAssets()
- {
- return new PluginMock(self::CORE_PLUGIN_WITHOUT_ASSETS_NAME);
- }
-
- /**
- * @return Plugin
- */
- private function getNonCorePlugin()
- {
- $nonCorePlugin = new PluginMock(self::NON_CORE_PLUGIN_NAME);
- $nonCorePlugin->setJsFiles(array(self::ASSET_MANAGER_TEST_DIR . 'scripts/SimpleAlert.js'));
-
- return $nonCorePlugin;
- }
-
- private function setUpTheme()
- {
- $this->assetManager->setTheme($this->getCoreTheme());
- }
-
- /**
- * @return ThemeMock
- */
- private function getCoreTheme()
- {
- return $this->createTheme(self::CORE_THEME_PLUGIN_NAME);
- }
-
- /**
- * @return ThemeMock
- */
- private function getNonCoreTheme()
- {
- return $this->createTheme(self::NON_CORE_THEME_PLUGIN_NAME);
- }
-
- /**
- * @param string $themeName
- * @return ThemeMock
- */
- private function createTheme($themeName)
- {
- $coreThemePlugin = new PluginMock($themeName);
-
- $coreThemePlugin->setIsTheme(true);
-
- $coreTheme = new ThemeMock($coreThemePlugin);
-
- $coreTheme->setStylesheet($this->getCoreThemeStylesheet());
- $coreTheme->setJsFiles(array(self::ASSET_MANAGER_TEST_DIR . 'scripts/SimpleComments.js'));
-
- return $coreTheme;
- }
-
- /**
- * @return string[]
- */
- public function getCorePluginStylesheetFiles()
- {
- return array(
- self::ASSET_MANAGER_TEST_DIR . 'stylesheets/SimpleLess.less',
- self::ASSET_MANAGER_TEST_DIR . 'stylesheets/CssWithURLs.css',
- );
- }
-
- private function clearDateCache()
- {
- clearstatcache();
- }
-
- /**
- * @return int
- */
- private function waitAndGetModificationDate()
- {
- $this->clearDateCache();
-
- sleep(1.5);
-
- $modificationDate = $this->mergedAsset->getModificationDate();
-
- return $modificationDate;
- }
-
- /**
- * @param string $cacheBuster
- */
- private function setJSCacheBuster($cacheBuster)
- {
- $this->cacheBuster->setPiwikVersionBasedCacheBuster($cacheBuster);
- }
-
- /**
- * @param string $cacheBuster
- */
- private function setStylesheetCacheBuster($cacheBuster)
- {
- $this->cacheBuster->setMd5BasedCacheBuster($cacheBuster);
- }
-
- private function triggerGetMergedCoreJavaScript()
- {
- $this->mergedAsset = $this->assetManager->getMergedCoreJavaScript();
- }
-
- private function triggerGetMergedNonCoreJavaScript()
- {
- $this->mergedAsset = $this->assetManager->getMergedNonCoreJavaScript();
- }
-
- private function triggerGetMergedStylesheet()
- {
- $this->mergedAsset = $this->assetManager->getMergedStylesheet();
- }
-
- private function validateMergedCoreJs()
- {
- $expectedContent = $this->getExpectedMergedCoreJs();
-
- $this->validateExpectedContent($expectedContent);
- }
-
- private function validateMergedNonCoreJs()
- {
- $expectedContent = $this->getExpectedMergedNonCoreJs();
-
- $this->validateExpectedContent($expectedContent);
- }
-
- private function validateMergedStylesheet()
- {
- $expectedContent = $this->getExpectedMergedStylesheet();
-
- $this->validateExpectedContent($expectedContent);
- }
-
- /**
- * @param string $expectedContent
- */
- private function validateExpectedContent($expectedContent)
- {
- $this->assertEquals($expectedContent, $this->mergedAsset->getContent());
- }
-
- /**
- * @return string
- */
- private function getExpectedMergedCoreJs()
- {
- return $this->getExpectedMergedJs('ExpectedMergeResultCore.js');
- }
-
- /**
- * @return string
- */
- private function getExpectedMergedNonCoreJs()
- {
- return $this->getExpectedMergedJs('ExpectedMergeResultNonCore.js');
- }
-
- /**
- * @param string $filename
- * @return string
- */
- private function getExpectedMergedJs($filename)
- {
- $expectedMergeResult = new OnDiskUIAsset(PIWIK_USER_PATH, self::ASSET_MANAGER_TEST_DIR .'scripts/' . $filename);
-
- $expectedContent = $expectedMergeResult->getContent();
-
- return $this->adjustExpectedJsContent($expectedContent);
- }
-
- /**
- * @param string $expectedJsContent
- * @return string
- */
- private function adjustExpectedJsContent($expectedJsContent)
- {
- $expectedJsContent = str_replace("\n", "\r\n", $expectedJsContent);
-
- $expectedJsContent = $this->specifyCacheBusterInExpectedContent($expectedJsContent, $this->cacheBuster->piwikVersionBasedCacheBuster());
-
- return $expectedJsContent;
- }
-
- /**
- * @return string
- */
- private function getExpectedMergedStylesheet()
- {
- $expectedMergeResult = new OnDiskUIAsset(PIWIK_USER_PATH, self::ASSET_MANAGER_TEST_DIR .'stylesheets/ExpectedMergeResult.css');
-
- $expectedContent = $expectedMergeResult->getContent();
-
- $expectedContent = $this->specifyCacheBusterInExpectedContent($expectedContent, $this->cacheBuster->md5BasedCacheBuster(''));
-
- return $expectedContent;
- }
-
- /**
- * @return string
- */
- private function getCoreThemeStylesheet()
- {
- return self::ASSET_MANAGER_TEST_DIR . 'stylesheets/SimpleBody.css';
- }
-
- /**
- * @param string $content
- * @param string $cacheBuster
- * @return string
- */
- private function specifyCacheBusterInExpectedContent($content, $cacheBuster)
- {
- return str_replace('{{{CACHE-BUSTER-JS}}}', $cacheBuster, $content);
- }
-
- /**
- * @param int $previousDate
- */
- private function validateDateDidNotChange($previousDate)
- {
- $this->clearDateCache();
-
- $this->assertEquals($previousDate, $this->mergedAsset->getModificationDate());
- }
-
- /**
- * @param int $previousDate
- */
- private function validateDateIsMoreRecent($previousDate)
- {
- $this->clearDateCache();
-
- $this->assertTrue($previousDate < $this->mergedAsset->getModificationDate());
- }
-
- /**
- * @return string
- */
- private function getJsTranslationScript()
- {
- return
- '<script type="text/javascript">' . PHP_EOL .
- 'var translations = [];' . PHP_EOL .
- 'if (typeof(piwik_translations) == \'undefined\') { var piwik_translations = new Object; }for(var i in translations) { piwik_translations[i] = translations[i];} ' . PHP_EOL .
- '</script>';
- }
-
- /**
- * @return UIAsset[]
- */
- private function generateAllMergedAssets()
- {
- $this->triggerGetMergedStylesheet();
- $stylesheetAsset = $this->mergedAsset;
-
- $this->triggerGetMergedCoreJavaScript();
- $coreJsAsset = $this->mergedAsset;
-
- $this->triggerGetMergedNonCoreJavaScript();
- $nonCoreJsAsset = $this->mergedAsset;
-
- $this->assertTrue($stylesheetAsset->exists());
- $this->assertTrue($coreJsAsset->exists());
- $this->assertTrue($nonCoreJsAsset->exists());
-
- return array($stylesheetAsset, $coreJsAsset, $nonCoreJsAsset);
- }
-
- /**
- * @group Core
- */
- public function test_getMergedCoreJavaScript_NotGenerated()
- {
- $this->setJSCacheBuster(self::FIRST_CACHE_BUSTER_JS);
-
- $this->triggerGetMergedCoreJavaScript();
-
- $this->validateMergedCoreJs();
- }
-
- /**
- * @group Core
- */
- public function test_getMergedNonCoreJavaScript_NotGenerated()
- {
- $this->setJSCacheBuster(self::FIRST_CACHE_BUSTER_JS);
-
- $this->triggerGetMergedNonCoreJavaScript();
-
- $this->validateMergedNonCoreJs();
- }
-
- /**
- * @group Core
- */
- public function test_getMergedNonCoreJavaScript_NotGenerated_NoNonCorePlugin()
- {
- $this->setUpCorePluginOnly();
-
- $this->setJSCacheBuster(self::FIRST_CACHE_BUSTER_JS);
-
- $this->triggerGetMergedNonCoreJavaScript();
-
- $expectedContent = $this->adjustExpectedJsContent('/* Piwik Javascript - cb={{{CACHE-BUSTER-JS}}}*/' . PHP_EOL);
-
- $this->validateExpectedContent($expectedContent);
- }
-
- /**
- * @group Core
- */
- public function test_getMergedCoreJavaScript_AlreadyGenerated_MergedAssetsDisabled_UpToDate()
- {
- $this->disableMergedAssets();
-
- $this->setJSCacheBuster(self::FIRST_CACHE_BUSTER_JS);
-
- $this->triggerGetMergedCoreJavaScript();
-
- $modDateBeforeSecondRequest = $this->waitAndGetModificationDate();
-
- $this->triggerGetMergedCoreJavaScript();
-
- $this->validateDateDidNotChange($modDateBeforeSecondRequest);
- }
-
- /**
- * @group Core
- */
- public function test_getMergedCoreJavaScript_AlreadyGenerated_MergedAssetsDeactivated_Stale()
- {
- $this->disableMergedAssets();
-
- $this->setJSCacheBuster(self::FIRST_CACHE_BUSTER_JS);
-
- $this->triggerGetMergedCoreJavaScript();
-
- $modDateBeforeSecondRequest = $this->waitAndGetModificationDate();
-
- $this->setJSCacheBuster(self::SECOND_CACHE_BUSTER_JS);
-
- $this->triggerGetMergedCoreJavaScript();
-
- $this->validateDateIsMoreRecent($modDateBeforeSecondRequest);
-
- $this->validateMergedCoreJs();
- }
-
- /**
- * @group Core
- */
- public function test_getMergedStylesheet_NotGenerated()
- {
- $this->setStylesheetCacheBuster(self::FIRST_CACHE_BUSTER_SS);
-
- $this->triggerGetMergedStylesheet();
-
- $this->validateMergedStylesheet();
- }
-
- /**
- * We always regenerate if cache buster changes
- * @group Core
- */
- public function test_getMergedStylesheet_Generated_MergedAssetsEnabled_Stale()
- {
- $this->activateMergedAssets();
-
- $this->setStylesheetCacheBuster(self::FIRST_CACHE_BUSTER_SS);
-
- $this->triggerGetMergedStylesheet();
-
- $modDateBeforeSecondRequest = $this->waitAndGetModificationDate();
-
- $this->setStylesheetCacheBuster(self::SECOND_CACHE_BUSTER_SS);
-
- $this->triggerGetMergedStylesheet();
-
- $this->validateDateIsMoreRecent($modDateBeforeSecondRequest);
-
- $this->validateMergedStylesheet();
- }
-
- /**
- * We always regenerate if cache buster changes
- * @group Core
- */
- public function test_getMergedStylesheet_Generated_MergedAssetsDisabled_Stale()
- {
- $this->disableMergedAssets();
-
- $this->setStylesheetCacheBuster(self::FIRST_CACHE_BUSTER_SS);
-
- $this->triggerGetMergedStylesheet();
-
- $modDateBeforeSecondRequest = $this->waitAndGetModificationDate();
-
- $this->setStylesheetCacheBuster(self::SECOND_CACHE_BUSTER_SS);
-
- $this->triggerGetMergedStylesheet();
-
- $this->validateDateIsMoreRecent($modDateBeforeSecondRequest);
-
- $this->validateMergedStylesheet();
- }
-
- /**
- * @group Core
- */
- public function test_getMergedStylesheet_Generated_MergedAssetsDisabled_UpToDate()
- {
- $this->disableMergedAssets();
-
- $this->setStylesheetCacheBuster(self::FIRST_CACHE_BUSTER_SS);
-
- $this->triggerGetMergedStylesheet();
-
- $modDateBeforeSecondRequest = $this->waitAndGetModificationDate();
-
- $this->triggerGetMergedStylesheet();
-
- $this->validateDateDidNotChange($modDateBeforeSecondRequest);
- }
-
- /**
- * @group Core
- */
- public function test_getCssInclusionDirective()
- {
- $expectedCssInclusionDirective = '<link rel="stylesheet" type="text/css" href="index.php?module=Proxy&action=getCss" />' . PHP_EOL;
-
- $this->assertEquals($expectedCssInclusionDirective, $this->assetManager->getCssInclusionDirective());
- }
-
- /**
- * @group Core
- */
- public function test_getJsInclusionDirective_MergedAssetsDisabled()
- {
- $this->disableMergedAssets();
-
- $expectedJsInclusionDirective =
- $this->getJsTranslationScript() .
- '<script type="text/javascript" src="tests/PHPUnit/Core/AssetManager/scripts/SimpleObject.js"></script>' . PHP_EOL .
- '<script type="text/javascript" src="tests/PHPUnit/Core/AssetManager/scripts/SimpleArray.js"></script>' . PHP_EOL .
- '<script type="text/javascript" src="tests/PHPUnit/Core/AssetManager/scripts/SimpleComments.js"></script>' . PHP_EOL .
- '<script type="text/javascript" src="tests/PHPUnit/Core/AssetManager/scripts/SimpleAlert.js"></script>' . PHP_EOL;
-
- $this->assertEquals($expectedJsInclusionDirective, $this->assetManager->getJsInclusionDirective());
- }
-
- /**
- * @group Core
- */
- public function test_getJsInclusionDirective_MergedAssetsEnabled()
- {
- $expectedJsInclusionDirective =
- $this->getJsTranslationScript() .
- '<script type="text/javascript" src="index.php?module=Proxy&action=getCoreJs"></script>' . PHP_EOL .
- '<script type="text/javascript" src="index.php?module=Proxy&action=getNonCoreJs"></script>' . PHP_EOL;
-
- $this->assertEquals($expectedJsInclusionDirective, $this->assetManager->getJsInclusionDirective());
- }
-
- /**
- * @group Core
- */
- public function test_getCompiledBaseCss()
- {
- $this->setStylesheetCacheBuster(self::FIRST_CACHE_BUSTER_SS);
-
- $staticStylesheetList = array_merge($this->getCorePluginStylesheetFiles(), array($this->getCoreThemeStylesheet()));
-
- $minimalAssetFetcher = new StaticUIAssetFetcher(
- array_reverse($staticStylesheetList),
- $staticStylesheetList,
- $this->getCoreTheme()
- );
-
- $this->assetManager->setMinimalStylesheetFetcher($minimalAssetFetcher);
-
- $this->mergedAsset = $this->assetManager->getCompiledBaseCss();
-
- $this->validateMergedStylesheet();
- }
-
- /**
- * @group Core
- */
- public function test_removeMergedAssets()
- {
- list($stylesheetAsset, $coreJsAsset, $nonCoreJsAsset) = $this->generateAllMergedAssets();
-
- $this->assetManager->removeMergedAssets();
-
- $this->assertFalse($stylesheetAsset->exists());
- $this->assertFalse($coreJsAsset->exists());
- $this->assertFalse($nonCoreJsAsset->exists());
- }
-
- /**
- * @group Core
- */
- public function test_removeMergedAssets_PluginNameSpecified_PluginWithoutAssets()
- {
- list($stylesheetAsset, $coreJsAsset, $nonCoreJsAsset) = $this->generateAllMergedAssets();
-
- $this->assetManager->removeMergedAssets(self::CORE_PLUGIN_WITHOUT_ASSETS_NAME);
-
- $this->assertFalse($stylesheetAsset->exists());
- $this->assertTrue($coreJsAsset->exists());
- $this->assertTrue($nonCoreJsAsset->exists());
- }
-
- /**
- * @group Core
- */
- public function test_removeMergedAssets_PluginNameSpecified_CorePlugin()
- {
- list($stylesheetAsset, $coreJsAsset, $nonCoreJsAsset) = $this->generateAllMergedAssets();
-
- $this->assetManager->removeMergedAssets(self::CORE_PLUGIN_NAME);
-
- $this->assertFalse($stylesheetAsset->exists());
- $this->assertFalse($coreJsAsset->exists());
- $this->assertTrue($nonCoreJsAsset->exists());
- }
-
- /**
- * @group Core
- */
- public function test_removeMergedAssets_PluginNameSpecified_NonCoreThemeWithAssets()
- {
- list($stylesheetAsset, $coreJsAsset, $nonCoreJsAsset) = $this->generateAllMergedAssets();
-
- $this->assetManager->removeMergedAssets(self::NON_CORE_THEME_PLUGIN_NAME);
-
- $this->assertFalse($stylesheetAsset->exists());
- $this->assertTrue($coreJsAsset->exists());
- $this->assertFalse($nonCoreJsAsset->exists());
- }
-} \ No newline at end of file
diff --git a/tests/PHPUnit/Core/DeprecatedMethodsTest.php b/tests/PHPUnit/Core/DeprecatedMethodsTest.php
deleted file mode 100644
index 6bbcc64110..0000000000
--- a/tests/PHPUnit/Core/DeprecatedMethodsTest.php
+++ /dev/null
@@ -1,72 +0,0 @@
-<?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\AssetManager;
-use Piwik\AssetManager\UIAsset;
-use Piwik\Plugin;
-
-/**
- * @group Core
- */
-class DeprecatedMethodsTest extends PHPUnit_Framework_TestCase
-{
-
- public function test_version2_0_4()
- {
- $validTill = '2014-10-20';
- $this->assertDeprecatedMethodIsRemoved('\Piwik\Period', 'factory', $validTill);
-
- $validTill = '2014-10-20';
- $this->assertDeprecatedMethodIsRemoved('\Piwik\Config', 'getConfigSuperUserForBackwardCompatibility', $validTill);
- $this->assertDeprecatedMethodIsRemoved('\Piwik\Menu\MenuAdmin', 'addEntry', $validTill);
- $this->assertDeprecatedMethodIsRemoved('\Piwik\Menu\MenuAdmin', 'removeEntry', $validTill);
- $this->assertDeprecatedMethodIsRemoved('\Piwik\Menu\MenuTop', 'addEntry', $validTill);
- $this->assertDeprecatedMethodIsRemoved('\Piwik\Menu\MenuTop', 'removeEntry', $validTill);
-
- $validTill = '2014-10-20';
- $this->assertDeprecatedMethodIsRemoved('\Piwik\SettingsPiwik', 'rewriteTmpPathWithHostname', $validTill);
-
- $this->assertDeprecatedMethodIsRemovedInPiwik3('\Piwik\Menu\MenuAbstract', 'add');
- }
-
- private function assertDeprecatedMethodIsRemoved($className, $method, $removalDate)
- {
- $now = \Piwik\Date::now();
- $removalDate = \Piwik\Date::factory($removalDate);
-
- $class = new ReflectionClass($className);
- $methodExists = $class->hasMethod($method);
-
- if (!$now->isLater($removalDate)) {
-
- $errorMessage = $className . '::' . $method . ' should still exists until ' . $removalDate . ' although it is deprecated.';
- $this->assertTrue($methodExists, $errorMessage);
- return;
- }
-
- $errorMessage = $className . '::' . $method . ' should be removed as the method is deprecated but it is not.';
- $this->assertFalse($methodExists, $errorMessage);
- }
-
- private function assertDeprecatedMethodIsRemovedInPiwik3($className, $method)
- {
- $version = \Piwik\Version::VERSION;
-
- $class = new ReflectionClass($className);
- $methodExists = $class->hasMethod($method);
-
- if (-1 === version_compare($version, '3.0.0')) {
-
- $errorMessage = $className . '::' . $method . ' should still exists until 3.0 although it is deprecated.';
- $this->assertTrue($methodExists, $errorMessage);
- return;
- }
-
- $errorMessage = $className . '::' . $method . ' should be removed as the method is deprecated but it is not.';
- $this->assertFalse($methodExists, $errorMessage);
- }
-} \ No newline at end of file
diff --git a/tests/PHPUnit/Core/HttpTest.php b/tests/PHPUnit/Core/HttpTest.php
deleted file mode 100644
index af2711c530..0000000000
--- a/tests/PHPUnit/Core/HttpTest.php
+++ /dev/null
@@ -1,123 +0,0 @@
-<?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\Http;
-use Piwik\Tests\Fixture;
-
-/**
- * @group HttpTest
- */
-class HttpTest extends PHPUnit_Framework_TestCase
-{
- /**
- * Dataprovider for testFetchRemoteFile
- */
- public function getMethodsToTest()
- {
- return array(
- 'curl' => array('curl'),
- 'fopen' => array('fopen'),
- 'socket' => array('socket'),
- );
- }
-
- /**
- * @group Core
- *
- * @dataProvider getMethodsToTest
- */
- public function testFetchRemoteFile($method)
- {
- $this->assertNotNull(Http::getTransportMethod());
- $result = Http::sendHttpRequestBy($method, Fixture::getRootUrl() . 'piwik.js', 30);
- $this->assertTrue(strpos($result, 'Piwik') !== false);
- }
-
- /**
- * @group Core
- */
- public function testFetchApiLatestVersion()
- {
- $destinationPath = PIWIK_USER_PATH . '/tmp/latest/LATEST';
- Http::fetchRemoteFile(Fixture::getRootUrl(), $destinationPath, 3);
- $this->assertFileExists($destinationPath);
- $this->assertGreaterThan(0, filesize($destinationPath));
- }
-
- /**
- * @group Core
- */
- public function testFetchLatestZip()
- {
- $destinationPath = PIWIK_USER_PATH . '/tmp/latest/latest.zip';
- Http::fetchRemoteFile(Fixture::getRootUrl() . 'tests/PHPUnit/Core/Http/fixture.zip', $destinationPath, 3, 30);
- $this->assertFileExists($destinationPath);
- $this->assertGreaterThan(0, filesize($destinationPath));
- }
-
- /**
- * @group Core
- * @dataProvider getMethodsToTest
- */
- public function testCustomByteRange($method)
- {
- $result = Http::sendHttpRequestBy(
- $method,
- Fixture::getRootUrl() . '/piwik.js',
- 30,
- $userAgent = null,
- $destinationPath = null,
- $file = null,
- $followDepth = 0,
- $acceptLanguage = false,
- $acceptInvalidSslCertificate = false,
- $byteRange = array(10, 20),
- $getExtendedInfo = true
- );
-
- if ($method != 'fopen') {
- $this->assertEquals(206, $result['status']);
- $this->assertTrue(isset($result['headers']['Content-Range']));
- $this->assertEquals('bytes 10-20/', substr($result['headers']['Content-Range'], 0, 12));
- $this->assertEquals('application/x-javascript', $result['headers']['Content-Type']);
- }
- }
-
- /**
- * @group Core
- *
- * @dataProvider getMethodsToTest
- */
- public function testHEADOperation($method)
- {
- if ($method == 'fopen') {
- return; // not supported w/ this method
- }
-
- $result = Http::sendHttpRequestBy(
- $method,
- Fixture::getRootUrl() . 'tests/PHPUnit/Core/Http/fixture.zip',
- 30,
- $userAgent = null,
- $destinationPath = null,
- $file = null,
- $followDepth = 0,
- $acceptLanguage = false,
- $acceptInvalidSslCertificate = false,
- $byteRange = false,
- $getExtendedInfo = true,
- $httpMethod = 'HEAD'
- );
-
- $this->assertEquals('', $result['data']);
- $this->assertEquals(200, $result['status']);
-
- $this->assertTrue(isset($result['headers']['Content-Length']), "Content-Length header not set!");
- $this->assertTrue(is_numeric($result['headers']['Content-Length']), "Content-Length header not numeric!");
- $this->assertEquals('application/zip', $result['headers']['Content-Type']);
- }
-}
diff --git a/tests/PHPUnit/Core/ReleaseCheckListTest.php b/tests/PHPUnit/Core/ReleaseCheckListTest.php
deleted file mode 100644
index ba70ff9410..0000000000
--- a/tests/PHPUnit/Core/ReleaseCheckListTest.php
+++ /dev/null
@@ -1,391 +0,0 @@
-<?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\Filesystem;
-use Piwik\Plugin\Manager;
-use Piwik\SettingsServer;
-
-/**
- * @group ReleaseCheckListTest
- */
-class ReleaseCheckListTest extends PHPUnit_Framework_TestCase
-{
- public function setUp()
- {
- $this->globalConfig = _parse_ini_file(PIWIK_PATH_TEST_TO_ROOT . '/config/global.ini.php', true);
-
- parent::setUp();
- }
-
- /**
- * @group Core
- */
- public function test_icoFilesIconsShouldBeInPngFormat()
- {
- $files = Filesystem::globr(PIWIK_INCLUDE_PATH . '/plugins', '*.ico');
- $this->checkFilesAreInPngFormat($files);
- $files = Filesystem::globr(PIWIK_INCLUDE_PATH . '/core', '*.ico');
- $this->checkFilesAreInPngFormat($files);
- }
-
- /**
- * @group Core
- */
- public function test_pngFilesIconsShouldBeInPngFormat()
- {
- $files = Filesystem::globr(PIWIK_INCLUDE_PATH . '/plugins', '*.png');
- $this->checkFilesAreInPngFormat($files);
- $files = Filesystem::globr(PIWIK_INCLUDE_PATH . '/core', '*.png');
- $this->checkFilesAreInPngFormat($files);
- }
-
- /**
- * @group Core
- */
- public function test_gifFilesIconsShouldBeInGifFormat()
- {
- $files = Filesystem::globr(PIWIK_INCLUDE_PATH . '/plugins', '*.gif');
- $this->checkFilesAreInGifFormat($files);
- $files = Filesystem::globr(PIWIK_INCLUDE_PATH . '/core', '*.gif');
- $this->checkFilesAreInGifFormat($files);
- }
-
- /**
- * @group Core
- */
- public function test_jpgImagesShouldBeInJpgFormat()
- {
- $files = Filesystem::globr(PIWIK_INCLUDE_PATH . '/plugins', '*.jpg');
- $this->checkFilesAreInJpgFormat($files);
- $files = Filesystem::globr(PIWIK_INCLUDE_PATH . '/core', '*.jpg');
- $this->checkFilesAreInJpgFormat($files);
- $files = Filesystem::globr(PIWIK_INCLUDE_PATH . '/plugins', '*.jpeg');
- $this->checkFilesAreInJpgFormat($files);
- $files = Filesystem::globr(PIWIK_INCLUDE_PATH . '/core', '*.jpeg');
- $this->checkFilesAreInJpgFormat($files);
- }
-
- /**
- * @group Core
- */
- public function testCheckThatConfigurationValuesAreProductionValues()
- {
- $this->_checkEqual(array('Debug' => 'always_archive_data_day'), '0');
- $this->_checkEqual(array('Debug' => 'always_archive_data_period'), '0');
- $this->_checkEqual(array('Debug' => 'enable_sql_profiler'), '0');
- $this->_checkEqual(array('General' => 'time_before_today_archive_considered_outdated'), '150');
- $this->_checkEqual(array('General' => 'enable_browser_archiving_triggering'), '1');
- $this->_checkEqual(array('General' => 'default_language'), 'en');
- $this->_checkEqual(array('Tracker' => 'record_statistics'), '1');
- $this->_checkEqual(array('Tracker' => 'visit_standard_length'), '1800');
- $this->_checkEqual(array('Tracker' => 'trust_visitors_cookies'), '0');
- // logging messages are disabled
- $this->_checkEqual(array('log' => 'log_level'), 'WARN');
- $this->_checkEqual(array('log' => 'log_writers'), array('screen'));
- $this->_checkEqual(array('log' => 'logger_api_call'), null);
-
- require_once PIWIK_INCLUDE_PATH . "/core/TaskScheduler.php";
- $this->assertFalse(DEBUG_FORCE_SCHEDULED_TASKS);
-
- // Check the index.php has "backtrace disabled"
- $content = file_get_contents(PIWIK_INCLUDE_PATH . "/index.php");
- $expected = "define('PIWIK_PRINT_ERROR_BACKTRACE', false);";
- $this->assertTrue( false !== strpos($content, $expected), 'index.php should contain: ' . $expected);
- }
-
- private function _checkEqual($key, $valueExpected)
- {
- $section = key($key);
- $optionName = current($key);
- $value = null;
- if (isset($this->globalConfig[$section][$optionName])) {
- $value = $this->globalConfig[$section][$optionName];
- }
- $this->assertEquals($valueExpected, $value, "$section -> $optionName was '" . var_export($value, true) . "', expected '" . var_export($valueExpected, true) . "'");
- }
-
- /**
- * @group Core
- */
- public function testTemplatesDontContainDebug()
- {
- $patternFailIfFound = 'dump(';
- $files = Filesystem::globr(PIWIK_INCLUDE_PATH . '/plugins', '*.twig');
- foreach ($files as $file) {
- if ($file == PIWIK_INCLUDE_PATH . '/plugins/CoreConsole/templates/travis.yml.twig') {
- continue;
- }
-
- $content = file_get_contents($file);
- $this->assertFalse(strpos($content, $patternFailIfFound), 'found in ' . $file);
- }
- }
-
- /**
- * @group Core
- */
- public function testCheckThatGivenPluginsAreDisabledByDefault()
- {
- $pluginsShouldBeDisabled = array(
- 'DBStats'
- );
- foreach ($pluginsShouldBeDisabled as $pluginName) {
- if (in_array($pluginName, $this->globalConfig['Plugins']['Plugins'])) {
- throw new Exception("Plugin $pluginName is enabled by default but shouldn't.");
- }
- }
-
- }
-
- /**
- * test that the profiler is disabled (mandatory on a production server)
- * @group Core
- */
- public function testProfilingDisabledInProduction()
- {
- require_once 'Tracker/Db.php';
- $this->assertTrue(\Piwik\Tracker\Db::isProfilingEnabled() === false, 'SQL profiler should be disabled in production! See Db::$profiling');
- }
-
- /**
- * @group Core
- */
- public function testPiwikTrackerDebugIsOff()
- {
- $this->assertTrue(!isset($GLOBALS['PIWIK_TRACKER_DEBUG']));
- $this->assertEquals(0, $this->globalConfig['Tracker']['debug']);
- }
-
- /**
- * This tests that all PHP files start with <?php
- * This would help detect errors such as a php file starting with spaces
- * @group Core
- */
- public function test_phpFilesStartWithRightCharacter()
- {
- $files = Filesystem::globr(PIWIK_INCLUDE_PATH, '*.php');
-
- foreach($files as $file) {
- $handle = fopen($file, "r");
- $expectedStart = "<?php";
-
- $isIniFile = strpos($file, ".ini.php") !== false || strpos($file, ".ini.travis.php") !== false;
- if($isIniFile) {
- $expectedStart = "; <?php exit;";
- }
-
- $skipStartFileTest = $this->isSkipPhpFileStartWithPhpBlock($file, $isIniFile);
-
- if($skipStartFileTest) {
- continue;
- }
-
- $start = fgets($handle, strlen($expectedStart) + 1 );
- $this->assertEquals($start, $expectedStart, "File $file does not start with $expectedStart");
- }
- }
-
- /**
- * @group Core
- */
- public function test_directoriesShouldBeChmod755()
- {
- $pluginsPath = realpath(PIWIK_INCLUDE_PATH . '/plugins/');
-
- $objects = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($pluginsPath), RecursiveIteratorIterator::SELF_FIRST);
- $paths = array();
- foreach($objects as $name => $object){
- if (is_dir($name)
- && strpos($name, "/.") === false) {
- $paths[] = $name;
- }
- }
-
- $this->assertGreaterThan(50, count($paths), 'test at latest 50 directories, got ' . count($paths));
-
- // to prevent errors with un-readable assets,
- // we ensure all directories in plugins/* are added to git with CHMOD 755
- foreach($paths as $pathToTest) {
-
- $chmod = substr(decoct(fileperms($pathToTest)), -3);
- $valid = array('777', '775', '755');
- $command = "find $pluginsPath -type d -exec chmod 755 {} +";
- $this->assertTrue(in_array($chmod, $valid),
- "Some directories within plugins/ are not chmod 755 \n\nGot: $chmod for : $pathToTest \n\n".
- "Run this command to set all directories to 755: \n$command\n");;
- }
- }
-
- /**
- * Check that directories in plugins/ folder are specifically either enabled or disabled.
- *
- * This fails when a new folder is added to plugins/* and forgot to enable or mark as disabled in Manager.php.
- *
- * @group Core
- */
- public function test_DirectoriesInPluginsFolder_areKnown()
- {
- $pluginsBundledWithPiwik = \Piwik\Config::getInstance()->getFromGlobalConfig('Plugins');
- $pluginsBundledWithPiwik = $pluginsBundledWithPiwik['Plugins'];
- $magicPlugins = 42;
- $this->assertTrue(count($pluginsBundledWithPiwik) > $magicPlugins);
-
- $plugins = _glob(\Piwik\Plugin\Manager::getPluginsDirectory() . '*', GLOB_ONLYDIR);
- $count = 1;
- foreach($plugins as $pluginPath) {
- $pluginName = basename($pluginPath);
-
- $addedToGit = $this->isPathAddedToGit($pluginPath);
-
- if(!$addedToGit) {
- // if not added to git, then it is not part of the release checklist.
- continue;
- }
- $manager = \Piwik\Plugin\Manager::getInstance();
- $isGitSubmodule = $manager->isPluginOfficialAndNotBundledWithCore($pluginName);
- $disabled = in_array($pluginName, $manager->getCorePluginsDisabledByDefault()) || $isGitSubmodule;
-
- $enabled = in_array($pluginName, $pluginsBundledWithPiwik);
-
- $this->assertTrue( $enabled + $disabled === 1,
- "Plugin $pluginName should be either enabled (in global.ini.php) or disabled (in Piwik\\Plugin\\Manager).
- It is currently (enabled=".(int)$enabled. ", disabled=" . (int)$disabled . ")"
- );
- $count++;
- }
- $this->assertTrue($count > $magicPlugins);
- }
-
- /**
- * @group Core
- */
- public function testEndOfLines()
- {
- foreach (Filesystem::globr(PIWIK_DOCUMENT_ROOT, '*') as $file) {
- // skip files in these folders
- if (strpos($file, '/.git/') !== false ||
- strpos($file, '/documentation/') !== false ||
- strpos($file, '/tests/') !== false ||
- strpos($file, '/lang/') !== false ||
- strpos($file, 'yuicompressor') !== false ||
- strpos($file, '/tmp/') !== false
- ) {
- continue;
- }
-
- // skip files with these file extensions
- if (preg_match('/\.(bmp|fdf|gif|deb|deflate|exe|gz|ico|jar|jpg|p12|pdf|png|rar|swf|vsd|z|zip|ttf|so|dat|eps|phar|pyc)$/', $file)) {
- continue;
- }
-
- if (!is_dir($file)) {
- $contents = file_get_contents($file);
-
- // expect CRLF
- if (preg_match('/\.(bat|ps1)$/', $file)) {
- $contents = str_replace("\r\n", '', $contents);
- $this->assertTrue(strpos($contents, "\n") === false, 'Incorrect line endings in ' . $file);
- } else {
- // expect native
- $hasWindowsEOL = strpos($contents, "\r\n");
-
- // overwrite translations files with incorrect line endings
- $this->assertTrue($hasWindowsEOL === false, 'Incorrect line endings \r\n found in ' . $file);
- }
- }
- }
- }
-
- /**
- * @group Core
- */
- public function testPiwikJavaScript()
- {
- // check source against Snort rule 8443
- // @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');
-
- $this->assertTrue(preg_match($pattern, $contents) == 0);
-
- $contents = file_get_contents(PIWIK_DOCUMENT_ROOT . '/piwik.js');
- $this->assertTrue(preg_match($pattern, $contents) == 0);
- }
-
- /**
- * @param $files
- */
- private function checkFilesAreInPngFormat($files)
- {
- $this->checkFilesAreInFormat($files, "png");
- }
- private function checkFilesAreInJpgFormat($files)
- {
- $this->checkFilesAreInFormat($files, "jpeg");
- }
-
- private function checkFilesAreInGifFormat($files)
- {
- $this->checkFilesAreInFormat($files, "gif");
- }
-
- /**
- * @param $files
- * @param $format
- */
- private function checkFilesAreInFormat($files, $format)
- {
- $errors = array();
- foreach ($files as $file) {
- $function = "imagecreatefrom" . $format;
- if (!function_exists($function)) {
- throw new \Exception("Unexpected error: $function function does not exist!");
- }
-
- $handle = @$function($file);
- if (empty($handle)) {
- $errors[] = $file;
- }
- }
-
- if (!empty($errors)) {
- $icons = var_export($errors, true);
- $icons = "gimp " . implode(" ", $errors);
- $this->fail("$format format failed for following icons $icons \n");
- }
- }
-
- /**
- * @param $file
- * @param $isIniFile
- * @return bool
- */
- protected function isSkipPhpFileStartWithPhpBlock($file, $isIniFile)
- {
- $isIniFileInTests = strpos($file, "/tests/") !== false;
- $isTestResultFile = strpos($file, "/Integration/expected") !== false
- || strpos($file, "/Integration/processed") !== false
- || strpos($file, "tests/resources/Updater/") !== false
- || strpos($file, "Twig/Tests/") !== false
- || strpos($file, "/vendor/") !== false;
- $isLib = strpos($file, "lib/xhprof") !== false || strpos($file, "phpunit/phpunit") !== false;
-
- return ($isIniFile && $isIniFileInTests) || $isTestResultFile || $isLib;
- }
-
- /**
- * @param $pluginPath
- * @return bool
- */
- protected function isPathAddedToGit($pluginPath)
- {
- $gitOutput = shell_exec('git ls-files ' . $pluginPath . ' --error-unmatch 2>&1');
- $addedToGit = (strlen($gitOutput) > 0) && strpos($gitOutput, 'error: pathspec') === false;
- return $addedToGit;
- }
-
-}
diff --git a/tests/PHPUnit/Core/ServeStaticFileTest.php b/tests/PHPUnit/Core/ServeStaticFileTest.php
deleted file mode 100644
index 588c1b8c25..0000000000
--- a/tests/PHPUnit/Core/ServeStaticFileTest.php
+++ /dev/null
@@ -1,589 +0,0 @@
-<?php
-/**
- * This php file is used to unit test Piwik::serverStaticFile()
- * Unit tests for this method should normally be located in /tests/core/Piwik.test.php
- * To make a comprehensive test suit for Piwik::serverStaticFile() (ie. being able to test combinations of request
- * headers, being able to test response headers and so on) we need to simulate static file requests in a controlled
- * environment
- * The php code which simulates requests using Piwik::serverStaticFile() is provided in the same file (ie. this one)
- * as the unit testing code for Piwik::serverStaticFile()
- * This decision has a structural impact on the usual unit test file structure
- * serverStaticFile.test.php has been created to avoid making too many modifications to /tests/core/Piwik.test.php
- */
-
-// This is Piwik logo, the static file used in this test suit
-
-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");
-
-// Defines http request parameters
-define("FILE_MODE_REQUEST_VAR", "fileMode");
-define("SRV_MODE_REQUEST_VAR", "serverMode");
-define("ZLIB_OUTPUT_REQUEST_VAR", "zlibOutput");
-
-/**
- * These constants define the mode in which this php file is used :
- * - for unit testing Piwik::serverStaticFile() or
- * - as a static file server
- */
-define("STATIC_SERVER_MODE", "staticServerMode");
-define("UNIT_TEST_MODE", "unitTestMode");
-
-// These constants define which action will be performed by the static server.
-define("NULL_FILE_SRV_MODE", "nullFile");
-define("GHOST_FILE_SRV_MODE", "ghostFile");
-define("TEST_FILE_SRV_MODE", "testFile");
-define("PARTIAL_TEST_FILE_SRV_MODE", "partialTestFile");
-define("WHOLE_TEST_FILE_WITH_RANGE_SRV_MODE", "wholeTestFileWithRange");
-
-define("PARTIAL_BYTE_START", 1204);
-define("PARTIAL_BYTE_END", 14724);
-
-// If the static file server has not been requested, the standard unit test case class is defined
-class Test_Piwik_ServeStaticFile extends PHPUnit_Framework_TestCase
-{
- public function tearDown()
- {
- parent::tearDown();
- chmod(TEST_FILE_LOCATION, 0644);
- }
-
- /**
- * Test that php compression isn't enabled ... otherwise, lots of tests will fail
- *
- * @group Core
- */
- public function test_phpOutputCompression()
- {
- $this->assertFalse(ProxyHttp::isPhpOutputCompressed());
- }
-
- /**
- * Checks that "HTTP/1.0 404 Not Found" is returned when Piwik::serverStaticFile is called with a null file
- *
- * @group Core
- */
- public function test_nullFile()
- {
- $curlHandle = curl_init();
- curl_setopt($curlHandle, CURLOPT_URL, $this->getNullFileSrvModeUrl());
- curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, true);
- curl_exec($curlHandle);
- $responseInfo = curl_getinfo($curlHandle);
- curl_close($curlHandle);
-
- $this->assertEquals($responseInfo["http_code"], 404);
- }
-
- /**
- * Checks that "HTTP/1.0 404 Not Found" is returned when Piwik::serverStaticFile is called with a non existing file
- *
- *
- * @group Core
- */
- public function test_ghostFile()
- {
- $curlHandle = curl_init();
- curl_setopt($curlHandle, CURLOPT_URL, $this->getGhostFileSrvModeUrl());
- curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, true);
- curl_exec($curlHandle);
- $responseInfo = curl_getinfo($curlHandle);
- curl_close($curlHandle);
-
- $this->assertEquals($responseInfo["http_code"], 404);
- }
-
- /**
- * Checks that "HTTP/1.0 505 Internal server error" is returned when Piwik::serverStaticFile is called with a
- * non-readable file
- *
- * @group Core
- */
- public function test_nonReadableFile()
- {
- /**
- * This test would fail on a windows environment because it is not possible to remove reading rights on a
- * windows file using PHP.
- */
- if (SettingsServer::isWindows()) {
- return;
- }
-
- // Setting mode so the testing file is non-readable
- chmod(TEST_FILE_LOCATION, 0200);
-
- $curlHandle = curl_init();
- curl_setopt($curlHandle, CURLOPT_URL, $url = $this->getTestFileSrvModeUrl());
- curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, true);
- curl_exec($curlHandle);
- $responseInfo = curl_getinfo($curlHandle);
- curl_close($curlHandle);
-
- // Restoring file mode
- chmod(TEST_FILE_LOCATION, 0644);
-
- $this->assertEquals($responseInfo["http_code"], 505);
- }
-
- /**
- * Context :
- * - First access to test file
- * - zlib.output_compression = 0
- * - no compression
- * Expected :
- * - file is send back without compression
- * - cache control headers are correctly set
- *
- * @group Core
- */
- public function test_firstAccessNoCompression()
- {
- $curlHandle = curl_init();
- curl_setopt($curlHandle, CURLOPT_URL, $this->getTestFileSrvModeUrl());
- curl_setopt($curlHandle, CURLOPT_HEADER, true);
- curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, true);
- $fullResponse = curl_exec($curlHandle);
- $responseInfo = curl_getinfo($curlHandle);
- curl_close($curlHandle);
-
- // Tests returned code equals 200
- $this->assertEquals(200, $responseInfo["http_code"]);
-
- // Tests content type
- $this->assertContains(TEST_FILE_CONTENT_TYPE, $responseInfo["content_type"]);
-
- // Tests no compression has been applied
- $this->assertNull($this->getContentEncodingValue($fullResponse));
-
- // Tests returned size
- $this->assertEquals(filesize(TEST_FILE_LOCATION), $responseInfo["size_download"]);
-
- // Tests if returned modified date is correctly set
- $this->assertEquals(gmdate('D, d M Y H:i:s', filemtime(TEST_FILE_LOCATION)) . ' GMT',
- $this->getLastModifiedValue($fullResponse));
-
- // Tests if cache control headers are correctly set
- $this->assertEquals("public, must-revalidate", $this->getCacheControlValue($fullResponse));
- $pragma = $this->getPragma($fullResponse);
- $this->assertTrue($pragma == null || $pragma == 'Pragma:');
- $expires = $this->getExpires($fullResponse);
- $this->assertTrue(strtotime($expires) > time() + 99 * 86400);
- }
-
- /**
- * Context :
- * - Second access to test file
- * - If-Modified-Since set to test file modification date
- * Expected :
- * - "HTTP/1.1 304 Not Modified" sent back to client
- *
- * @group Core
- */
- public function test_secondAccessNoCompression()
- {
- $curlHandle = curl_init();
- curl_setopt($curlHandle, CURLOPT_URL, $this->getTestFileSrvModeUrl());
- curl_setopt($curlHandle, CURLOPT_TIMECONDITION, 1);
- curl_setopt($curlHandle, CURLOPT_TIMEVALUE, filemtime(TEST_FILE_LOCATION));
- curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, true);
- curl_exec($curlHandle);
- $responseInfo = curl_getinfo($curlHandle);
- curl_close($curlHandle);
-
- $this->assertEquals($responseInfo["http_code"], 304);
- }
-
- /**
- * Context :
- * - Second access to test file
- * - If-Modified-Since set to test file modification date minus 1 second
- * Expected :
- * - http return code 200 sent back to client
- *
- * @group Core
- */
- public function test_secondAccessNoCompressionExpiredFile()
- {
- $curlHandle = curl_init();
- curl_setopt($curlHandle, CURLOPT_URL, $this->getTestFileSrvModeUrl());
- curl_setopt($curlHandle, CURLOPT_TIMECONDITION, 1);
- curl_setopt($curlHandle, CURLOPT_TIMEVALUE, filemtime(TEST_FILE_LOCATION) - 1);
- curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, true);
- curl_exec($curlHandle);
- $responseInfo = curl_getinfo($curlHandle);
- curl_close($curlHandle);
-
- $this->assertEquals($responseInfo["http_code"], 200);
- }
-
- /**
- * Context :
- * - First access to file
- * - zlib output compression is on
- * Expected :
- * - the response has to be readable, it tests the proxy doesn't compress the file when compression
- * is enabled in php.
- *
- * @group Core
- */
- public function test_responseReadableWithPhpCompression()
- {
- $curlHandle = curl_init();
- curl_setopt($curlHandle, CURLOPT_URL, $this->setZlibOutputRequest(($this->getTestFileSrvModeUrl())));
-
- // The "" parameter sets all compatible content encodings
- curl_setopt($curlHandle, CURLOPT_ENCODING, "");
- curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, true);
- $fullResponse = curl_exec($curlHandle);
- curl_close($curlHandle);
-
- // Tests response content, it has to be equal to the test file. If not equal, double compression occurred
- $this->assertEquals($fullResponse, file_get_contents(TEST_FILE_LOCATION));
- }
-
- /**
- * Context :
- * - First access to file
- * - Content-Encoding: deflate
- * Expected :
- * - the response has to be readable
- * - the compression method used must be gzdeflate and not gzcompression to be IE compatible
- *
- * @group Core
- */
- public function test_deflateCompression()
- {
- $this->removeCompressedFiles();
-
- $curlHandle = curl_init();
- curl_setopt($curlHandle, CURLOPT_URL, $this->getTestFileSrvModeUrl());
- curl_setopt($curlHandle, CURLOPT_ENCODING, "deflate");
- curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, true);
- $fullResponse = curl_exec($curlHandle);
- curl_close($curlHandle);
-
- // Tests response content, it has to be equal to the test file
- $this->assertEquals($fullResponse, file_get_contents(TEST_FILE_LOCATION));
-
- // Tests deflate compression has been used
- $deflateFileLocation = $this->getCompressedFileLocation() . ".deflate";
- $this->assertTrue(file_exists($deflateFileLocation));
-
- // Tests gzdeflate has been used for IE compatibility
- $this->assertEquals(gzinflate(file_get_contents($deflateFileLocation)), file_get_contents(TEST_FILE_LOCATION));
-
- $this->removeCompressedFiles();
- }
-
- /**
- * Context :
- * - First access to file
- * - Content-Encoding: gzip
- * Expected :
- * - the response has to be readable
- * - the compression method used is gzip
- *
- * @group Core
- */
- public function test_gzipCompression()
- {
- $this->removeCompressedFiles();
-
- $curlHandle = curl_init();
- curl_setopt($curlHandle, CURLOPT_URL, $this->getTestFileSrvModeUrl());
- curl_setopt($curlHandle, CURLOPT_ENCODING, "gzip");
- curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, true);
- $fullResponse = curl_exec($curlHandle);
- curl_close($curlHandle);
-
- // Tests response content, it has to be equal to the test file
- $this->assertEquals($fullResponse, file_get_contents(TEST_FILE_LOCATION));
-
- // Tests gzip compression has been used
- $gzipFileLocation = $this->getCompressedFileLocation() . ".gz";
- $this->assertTrue(file_exists($gzipFileLocation));
-
- $this->removeCompressedFiles();
- }
-
- /**
- * Context :
- * - First access to file
- * - Content-Encoding: deflate
- * - Repeat twice
- * Expected :
- * - the compressed file cache mechanism works file, ie. the .deflate file is not generated twice
- *
- * @group Core
- */
- public function test_compressionCache()
- {
- $this->removeCompressedFiles();
- $deflateFileLocation = $this->getCompressedFileLocation() . ".deflate";
-
- $curlHandle = curl_init();
- curl_setopt($curlHandle, CURLOPT_URL, $this->getTestFileSrvModeUrl());
- curl_setopt($curlHandle, CURLOPT_ENCODING, "deflate");
- curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, true);
- curl_exec($curlHandle);
- curl_close($curlHandle);
-
- $firstAccessModificationTime = filemtime($deflateFileLocation);
-
- // Requests made to the static file have to be executed at different times for the test to be valid.
- sleep(1);
-
- $curlHandle = curl_init();
- curl_setopt($curlHandle, CURLOPT_URL, $this->getTestFileSrvModeUrl());
- curl_setopt($curlHandle, CURLOPT_ENCODING, "deflate");
- curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, true);
- curl_exec($curlHandle);
- curl_close($curlHandle);
-
- // Tests the .deflate file has not been generated twice
- clearstatcache();
- $this->assertEquals($firstAccessModificationTime, filemtime($deflateFileLocation));
-
- $this->removeCompressedFiles();
- }
-
- /**
- * Context :
- * - First access to file
- * - Content-Encoding: deflate
- * - Repeat twice, in between: update the modification date of the test file
- * Expected :
- * - the test file has been updated, the cached compressed file should be regenerated
- *
- * @group Core
- */
- public function test_compressionCacheInvalidation()
- {
- $this->removeCompressedFiles();
- $deflateFileLocation = $this->getCompressedFileLocation() . ".deflate";
-
- $curlHandle = curl_init();
- curl_setopt($curlHandle, CURLOPT_URL, $this->getTestFileSrvModeUrl());
- curl_setopt($curlHandle, CURLOPT_ENCODING, "deflate");
- curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, true);
- curl_exec($curlHandle);
- curl_close($curlHandle);
-
- $firstAccessModificationTime = filemtime($deflateFileLocation);
-
- // Requests made to the static file have to be executed at different times for the test to be valid.
- sleep(1);
-
- // We update the test file modification date
- touch(TEST_FILE_LOCATION);
-
- $curlHandle = curl_init();
- curl_setopt($curlHandle, CURLOPT_URL, $this->getTestFileSrvModeUrl());
- curl_setopt($curlHandle, CURLOPT_ENCODING, "deflate");
- curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, true);
- curl_exec($curlHandle);
- curl_close($curlHandle);
-
- clearstatcache();
- $this->assertNotEquals($firstAccessModificationTime, filemtime($deflateFileLocation));
-
- $this->removeCompressedFiles();
- }
-
- /**
- * @group Core
- */
- public function test_partialFileServeNoCompression()
- {
- $this->removeCompressedFiles();
-
- $curlHandle = curl_init();
- curl_setopt($curlHandle, CURLOPT_URL, $this->getPartialTestFileSrvModeUrl());
- curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, true);
- $partialResponse = curl_exec($curlHandle);
- $responseInfo = curl_getinfo($curlHandle);
- curl_close($curlHandle);
-
- clearstatcache();
-
- // check no compressed files created
- $this->assertFalse(file_exists($this->getCompressedFileLocation() . ".deflate"));
- $this->assertFalse(file_exists($this->getCompressedFileLocation() . ".gz"));
-
- // check $partialResponse
- $this->assertEquals(PARTIAL_BYTE_END - PARTIAL_BYTE_START, $responseInfo["size_download"]);
-
- $expectedPartialContents = substr(file_get_contents(TEST_FILE_LOCATION), PARTIAL_BYTE_START,
- PARTIAL_BYTE_END - PARTIAL_BYTE_START);
- $this->assertEquals($expectedPartialContents, $partialResponse);
- }
-
- /**
- * @group Core
- * @group TestToExec
- */
- public function test_partialFileServeWithCompression()
- {
- $this->removeCompressedFiles();
-
- $curlHandle = curl_init();
- curl_setopt($curlHandle, CURLOPT_URL, $this->getPartialTestFileSrvModeUrl());
- curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($curlHandle, CURLOPT_ENCODING, "deflate");
- $partialResponse = curl_exec($curlHandle);
- curl_getinfo($curlHandle);
- curl_close($curlHandle);
-
- clearstatcache();
-
- // check the correct compressed file is created
- $this->assertTrue(file_exists($this->getCompressedFileLocation() . '.' . PARTIAL_BYTE_START . '.' . PARTIAL_BYTE_END . ".deflate"));
- $this->assertFalse(file_exists($this->getCompressedFileLocation() . ".gz"));
-
- // check $partialResponse
- $expectedPartialContents = substr(file_get_contents(TEST_FILE_LOCATION), PARTIAL_BYTE_START,
- PARTIAL_BYTE_END - PARTIAL_BYTE_START);
- $this->assertEquals($expectedPartialContents, $partialResponse);
-
- $this->removeCompressedFiles();
- }
-
- /**
- * @group Core
- */
- public function test_wholeFileServeWithByteRange()
- {
- $this->removeCompressedFiles();
-
- $curlHandle = curl_init();
- curl_setopt($curlHandle, CURLOPT_URL, $this->getWholeTestFileWithRangeSrvModeUrl());
- curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($curlHandle, CURLOPT_ENCODING, "deflate");
- $fullResponse = curl_exec($curlHandle);
- curl_getinfo($curlHandle);
- curl_close($curlHandle);
-
- clearstatcache();
-
- // check the correct compressed file is created
- $this->assertTrue(file_exists($this->getCompressedFileLocation() . ".deflate"));
- $this->assertFalse(file_exists($this->getCompressedFileLocation() . ".gz"));
-
- // check $fullResponse
- $this->assertEquals(file_get_contents(TEST_FILE_LOCATION), $fullResponse);
-
- $this->removeCompressedFiles();
- }
-
- /**
- * Helper methods
- */
- private function getStaticSrvUrl()
- {
- $url = Fixture::getRootUrl();
- $url .= '/tests/resources/';
-
- return $url . "staticFileServer.php?" . FILE_MODE_REQUEST_VAR . "=" . STATIC_SERVER_MODE .
- "&" . SRV_MODE_REQUEST_VAR . "=";
- }
-
- private function getNullFileSrvModeUrl()
- {
- return $this->getStaticSrvUrl() . NULL_FILE_SRV_MODE;
- }
-
- private function getGhostFileSrvModeUrl()
- {
- return $this->getStaticSrvUrl() . GHOST_FILE_SRV_MODE;
- }
-
- private function getTestFileSrvModeUrl()
- {
- return $this->getStaticSrvUrl() . TEST_FILE_SRV_MODE;
- }
-
- private function getPartialTestFileSrvModeUrl()
- {
- return $this->getStaticSrvUrl() . PARTIAL_TEST_FILE_SRV_MODE;
- }
-
- private function getWholeTestFileWithRangeSrvModeUrl()
- {
- return $this->getStaticSrvUrl() . WHOLE_TEST_FILE_WITH_RANGE_SRV_MODE;
- }
-
- private function setZlibOutputRequest($url)
- {
- return $url . "&" . ZLIB_OUTPUT_REQUEST_VAR . "=1";
- }
-
- private function getContentEncodingValue($fullResponse)
- {
- preg_match_all('/Content-Encoding:[\s*]([[:print:]]*)/', $fullResponse, $matches);
-
- if (isset($matches[1][0])) {
- return $matches[1][0];
- }
-
- return null;
- }
-
- private function getCacheControlValue($fullResponse)
- {
- preg_match_all('/Cache-Control:[\s*]([[:print:]]*)/', $fullResponse, $matches);
-
- if (isset($matches[1][0])) {
- return $matches[1][0];
- }
-
- return null;
- }
-
- private function getPragma($fullResponse)
- {
- preg_match_all('/(Pragma:[[:print:]]*)/', $fullResponse, $matches);
-
- if (isset($matches[1][0])) {
- return trim($matches[1][0]);
- }
-
- return null;
- }
-
- private function getExpires($fullResponse)
- {
- preg_match_all('/Expires: ([[:print:]]*)/', $fullResponse, $matches);
-
- if (isset($matches[1][0])) {
- return trim($matches[1][0]);
- }
-
- return null;
- }
-
- private function getLastModifiedValue($fullResponse)
- {
- preg_match_all('/Last-Modified:[\s*]([[:print:]]*)/', $fullResponse, $matches);
-
- if (isset($matches[1][0])) {
- return $matches[1][0];
- }
-
- return null;
- }
-
- private function getCompressedFileLocation()
- {
- return \Piwik\AssetManager::getInstance()->getAssetDirectory() . '/' . basename(TEST_FILE_LOCATION);
- }
-
- private function removeCompressedFiles()
- {
- @unlink($this->getCompressedFileLocation() . ".deflate");
- @unlink($this->getCompressedFileLocation() . ".gz");
- }
-}
diff --git a/tests/PHPUnit/DatabaseTestCase.php b/tests/PHPUnit/DatabaseTestCase.php
index 715571eba4..d1d0e06cdc 100644..100755
--- a/tests/PHPUnit/DatabaseTestCase.php
+++ b/tests/PHPUnit/DatabaseTestCase.php
@@ -5,92 +5,17 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
-use Piwik\Config;
-use Piwik\Db;
-use Piwik\Tests\Fixture;
-use Piwik\Tests\IntegrationTestCase;
/**
- * Tests extending DatabaseTestCase are much slower to run: the setUp will
- * create all Piwik tables in a freshly empty test database.
- *
- * This allows each test method to start from a clean DB and setup initial state to
- * then test it.
- *
+ * @deprecated since 2.8.0 use \Piwik\Tests\Impl\IntegrationTestCase instead
*/
-class DatabaseTestCase extends IntegrationTestCase
+class DatabaseTestCase extends \Piwik\Tests\Impl\IntegrationTestCase
{
- /**
- * @var Fixture
- */
- public static $fixture;
- public static $tableData;
- /**
- * Implementation details:
- *
- * To increase speed of tests, database setup is done once in setUpBeforeClass.
- * Afterwards, the content of the tables is stored in a static class variable,
- * self::$tableData. Before each individual test, the database tables are
- * truncated and the data in self::$tableData is restored.
- *
- * If your test modifies table columns, you will need to recreate the database
- * completely. This can be accomplished by:
- *
- * public function setUp()
- * {
- * self::$fixture->performSetUp();
- * }
- *
- * public function tearDown()
- * {
- * parent::tearDown();
- * self::$fixture->performTearDown();
- * }
- */
public static function setUpBeforeClass()
{
- static::configureFixture(static::$fixture);
- parent::setUpBeforeClass();
-
- self::$tableData = self::getDbTablesWithData();
- }
-
- public static function tearDownAfterClass()
- {
- self::$tableData = array();
- }
-
- /**
- * Setup the database and create the base tables for all tests
- */
- public function setUp()
- {
- parent::setUp();
+ \Piwik\Log::debug('\DatabaseTestCase is deprecated since 2.8.0 extend \Piwik\Tests\Impl\IntegrationTestCase instead');
- Config::getInstance()->setTestEnvironment();
-
- if (!empty(self::$tableData)) {
- self::restoreDbTables(self::$tableData);
- }
- }
-
- /**
- * Resets all caches and drops the database
- */
- public function tearDown()
- {
- self::$fixture->clearInMemoryCaches();
-
- parent::tearDown();
- }
-
- protected static function configureFixture($fixture)
- {
- $fixture->loadTranslations = false;
- $fixture->createSuperUser = false;
- $fixture->configureComponents = false;
+ parent::setUpBeforeClass();
}
}
-
-DatabaseTestCase::$fixture = new Fixture(); \ No newline at end of file
diff --git a/tests/PHPUnit/FakeAccess.php b/tests/PHPUnit/FakeAccess.php
index be97babff0..3a7ab32e69 100644
--- a/tests/PHPUnit/FakeAccess.php
+++ b/tests/PHPUnit/FakeAccess.php
@@ -26,21 +26,21 @@ class FakeAccess
public function __construct()
{
- self::$superUser = false;
+ self::$superUser = false;
self::$idSitesAdmin = array();
- self::$idSitesView = array();
- self::$identity = 'superUserLogin';
+ self::$idSitesView = array();
+ self::$identity = 'superUserLogin';
}
public static function setIdSitesAdmin($ids)
{
- self::$superUser = false;
+ self::$superUser = false;
self::$idSitesAdmin = $ids;
}
public static function setIdSitesView($ids)
{
- self::$superUser = false;
+ self::$superUser = false;
self::$idSitesView = $ids;
}
@@ -74,6 +74,7 @@ class FakeAccess
}
$idSites = Site::getIdSitesFromIdSitesString($idSites);
+
foreach ($idSites as $idsite) {
if (!in_array($idsite, $websitesAccess)) {
throw new Exception("checkUserHasAdminAccess Fake exception // string not to be tested");
@@ -142,6 +143,7 @@ class FakeAccess
if (self::$superUser) {
return API::getInstance()->getAllSitesId();
}
+
return self::$idSitesAdmin;
}
@@ -150,6 +152,7 @@ class FakeAccess
if (self::$superUser) {
return API::getInstance()->getAllSitesId();
}
+
return self::$idSitesView;
}
@@ -158,15 +161,18 @@ class FakeAccess
if (self::$superUser) {
return API::getInstance()->getAllSitesId();
}
+
return array_merge(self::$idSitesView, self::$idSitesAdmin);
}
public function getRawSitesWithSomeViewAccess($login)
{
$result = array();
+
foreach (array_merge(self::$idSitesView, self::$idSitesAdmin) as $idSite) {
$result[] = array('idsite' => $idSite);
}
+
return $result;
}
} \ No newline at end of file
diff --git a/tests/PHPUnit/Fixture.php b/tests/PHPUnit/Fixture.php
index cc72b8498d..ad13e7eb3c 100644
--- a/tests/PHPUnit/Fixture.php
+++ b/tests/PHPUnit/Fixture.php
@@ -6,856 +6,26 @@
* @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;
-use Piwik\DataAccess\ArchiveTableCreator;
-use Piwik\DataTable\Manager as DataTableManager;
-use Piwik\Date;
-use Piwik\Db;
-use Piwik\DbHelper;
use Piwik\Log;
-use Piwik\Option;
-use Piwik\Piwik;
-use Piwik\Plugins\LanguagesManager\API as APILanguageManager;
-use Piwik\Plugins\MobileMessaging\MobileMessaging;
-use Piwik\Plugins\ScheduledReports\API as APIScheduledReports;
-use Piwik\Plugins\ScheduledReports\ScheduledReports;
-use Piwik\Plugins\SitesManager\API as APISitesManager;
-use Piwik\Plugins\UserCountry\LocationProvider;
-use Piwik\Plugins\UsersManager\API as APIUsersManager;
-use Piwik\Plugins\UsersManager\UsersManager;
-use Piwik\ReportRenderer;
-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;
-use Exception;
/**
- * Base type for all integration test fixtures. Integration test fixtures
- * add visit and related data to the database before a test is run. Different
- * tests can use the same fixtures.
- *
- * This class defines a set of helper methods for fixture types. The helper
- * methods are public, but ideally they should only be used by fixture types.
- *
- * NOTE: YOU SHOULD NOT CREATE A NEW FIXTURE UNLESS THERE IS NO WAY TO MODIFY
- * AN EXISTING FIXTURE TO HANDLE YOUR USE CASE.
- *
- * Related TODO: we should try and reduce the amount of existing fixtures by
- * merging some together.
+ * @deprecated since 2.8.0 use \Piwik\Tests\Impl\Fixture instead
*/
-class Fixture extends PHPUnit_Framework_Assert
+class Fixture extends \Piwik\Tests\Impl\Fixture
{
- const IMAGES_GENERATED_ONLY_FOR_OS = 'linux';
- const IMAGES_GENERATED_FOR_PHP = '5.5';
- const IMAGES_GENERATED_FOR_GD = '2.1.1';
- const DEFAULT_SITE_NAME = 'Piwik test';
-
- const ADMIN_USER_LOGIN = 'superUserLogin';
- const ADMIN_USER_PASSWORD = 'superUserPass';
-
- public $dbName = false;
- public $createConfig = true;
- public $dropDatabaseInSetUp = true;
- public $dropDatabaseInTearDown = true;
- public $loadTranslations = true;
- public $createSuperUser = true;
- public $removeExistingSuperUser = true;
- public $overwriteExisting = true;
- public $configureComponents = true;
- public $persistFixtureData = false;
- public $resetPersistedFixture = false;
- public $printToScreen = false;
-
- public $testCaseClass = false;
- public $extraPluginsToLoad = array();
-
- public $testEnvironment = null;
-
- /**
- * @return string
- */
- protected static function getPythonBinary()
- {
- if(\Piwik\SettingsServer::isWindows()) {
- return "C:\Python27\python.exe";
- }
- if(IntegrationTestCase::isTravisCI()) {
- return 'python2.6';
- }
- return 'python';
- }
/** Adds data to Piwik. Creates sites, tracks visits, imports log files, etc. */
public function setUp()
{
- // empty
- }
-
- /** Does any clean up. Most of the time there will be no need to clean up. */
- public function tearDown()
- {
- // empty
- }
-
- public function getDbName()
- {
- if ($this->dbName !== false) {
- return $this->dbName;
- }
-
- if ($this->persistFixtureData) {
- return str_replace("\\", "_", get_class($this));
- }
-
- return Config::getInstance()->database_tests['dbname'];
- }
-
- public function performSetUp($setupEnvironmentOnly = false)
- {
- try {
- if ($this->createConfig) {
- Config::getInstance()->setTestEnvironment();
- }
-
- $this->dbName = $this->getDbName();
-
- if ($this->persistFixtureData) {
- $this->dropDatabaseInSetUp = false;
- $this->dropDatabaseInTearDown = false;
- $this->overwriteExisting = false;
- $this->removeExistingSuperUser = false;
-
- Config::getInstance()->database_tests['dbname'] = Config::getInstance()->database['dbname'] = $this->dbName;
-
- $this->getTestEnvironment()->dbName = $this->dbName;
- }
-
- if ($this->dbName === false) { // must be after test config is created
- $this->dbName = Config::getInstance()->database['dbname'];
- }
-
- static::connectWithoutDatabase();
-
- if ($this->dropDatabaseInSetUp
- || $this->resetPersistedFixture
- ) {
- $this->dropDatabase();
- }
-
- DbHelper::createDatabase($this->dbName);
- DbHelper::disconnectDatabase();
-
- // reconnect once we're sure the database exists
- Config::getInstance()->database['dbname'] = $this->dbName;
- Db::createDatabaseObject();
-
- Db::get()->query("SET wait_timeout=28800;");
-
- DbHelper::createTables();
-
- \Piwik\Plugin\Manager::getInstance()->unloadPlugins();
-
- } catch (Exception $e) {
- static::fail("TEST INITIALIZATION FAILED: " . $e->getMessage() . "\n" . $e->getTraceAsString());
- }
-
- include "DataFiles/SearchEngines.php";
- include "DataFiles/Socials.php";
- include "DataFiles/Languages.php";
- include "DataFiles/Countries.php";
- include "DataFiles/Currencies.php";
- include "DataFiles/LanguageToCountry.php";
- include "DataFiles/Providers.php";
-
- if (!$this->isFixtureSetUp()) {
- DbHelper::truncateAllTables();
- }
-
- static::createAccessInstance();
-
- // We need to be SU to create websites for tests
- Access::getInstance()->setSuperUserAccess();
-
- Cache::deleteTrackerCache();
-
- static::loadAllPlugins($this->getTestEnvironment(), $this->testCaseClass, $this->extraPluginsToLoad);
-
- self::updateDatabase();
-
- self::installAndActivatePlugins();
-
- $_GET = $_REQUEST = array();
- $_SERVER['HTTP_REFERER'] = '';
-
- // Make sure translations are loaded to check messages in English
- if ($this->loadTranslations) {
- Translate::reloadLanguage('en');
- APILanguageManager::getInstance()->setLanguageForUser('superUserLogin', 'en');
- }
-
- FakeAccess::$superUserLogin = 'superUserLogin';
-
- \Piwik\SettingsPiwik::$cachedKnownSegmentsToArchive = null;
- \Piwik\CacheFile::$invalidateOpCacheBeforeRead = true;
-
- if ($this->configureComponents) {
- \Piwik\Plugins\PrivacyManager\IPAnonymizer::deactivate();
- \Piwik\Plugins\PrivacyManager\DoNotTrackHeaderChecker::deactivate();
- }
-
- if ($this->createSuperUser) {
- self::createSuperUser($this->removeExistingSuperUser);
- }
-
- if ($setupEnvironmentOnly) {
- return;
- }
-
- $this->getTestEnvironment()->save();
- $this->getTestEnvironment()->executeSetupTestEnvHook();
- Piwik_TestingEnvironment::addSendMailHook();
-
- if ($this->overwriteExisting
- || !$this->isFixtureSetUp()
- ) {
- $this->setUp();
+ Log::warning('Piwik\Tests\Fixture is deprecated, use \Piwik\Tests\Impl\Fixture instead');
- $this->markFixtureSetUp();
- $this->log("Database {$this->dbName} marked as successfully set up.");
- } else {
- $this->log("Using existing database {$this->dbName}.");
- }
- }
-
- public function getTestEnvironment()
- {
- if ($this->testEnvironment === null) {
- $this->testEnvironment = new Piwik_TestingEnvironment();
- $this->testEnvironment->delete();
-
- if (getenv('PIWIK_USE_XHPROF') == 1) {
- $this->testEnvironment->useXhprof = true;
- }
- }
- return $this->testEnvironment;
- }
-
- public function isFixtureSetUp()
- {
- $optionName = get_class($this) . '.setUpFlag';
- return Option::get($optionName) !== false;
- }
-
- public function markFixtureSetUp()
- {
- $optionName = get_class($this) . '.setUpFlag';
- Option::set($optionName, 1);
- }
-
- public function performTearDown()
- {
- // Note: avoid run SQL in the *tearDown() metohds because it randomly fails on Travis CI
- // with error Error while sending QUERY packet. PID=XX
- $this->tearDown();
-
- self::unloadAllPlugins();
-
- if ($this->dropDatabaseInTearDown) {
- $this->dropDatabase();
- }
-
- $this->clearInMemoryCaches();
- }
-
- public function clearInMemoryCaches()
- {
- DataTableManager::getInstance()->deleteAll();
- Option::clearCache();
- Site::clearCache();
- Cache::deleteTrackerCache();
- Config::getInstance()->clear();
- ArchiveTableCreator::clear();
- \Piwik\Plugins\ScheduledReports\API::$cache = array();
- \Piwik\Registry::unsetInstance();
- \Piwik\EventDispatcher::getInstance()->clearAllObservers();
-
- $_GET = $_REQUEST = array();
- Translate::unloadEnglishTranslation();
-
- Config::unsetInstance();
-
- \Piwik\Config::getInstance()->Plugins; // make sure Plugins exists in a config object for next tests that use Plugin\Manager
- // since Plugin\Manager uses getFromGlobalConfig which doesn't init the config object
- }
-
- public static function loadAllPlugins($testEnvironment = null, $testCaseClass = false, $extraPluginsToLoad = array())
- {
- if (empty($testEnvironment)) {
- $testEnvironment = new Piwik_TestingEnvironment();
- }
-
- DbHelper::createTables();
- $pluginsManager = \Piwik\Plugin\Manager::getInstance();
-
- $plugins = $testEnvironment->getCoreAndSupportedPlugins();
-
- // make sure the plugin that executed this method is included in the plugins to load
- $extraPlugins = array_merge($extraPluginsToLoad, array(
- \Piwik\Plugin::getPluginNameFromBacktrace(debug_backtrace()),
- \Piwik\Plugin::getPluginNameFromNamespace($testCaseClass),
- \Piwik\Plugin::getPluginNameFromNamespace(get_called_class())
- ));
- foreach ($extraPlugins as $pluginName) {
- if (empty($pluginName)) {
- continue;
- }
-
- if (in_array($pluginName, $plugins)) {
- continue;
- }
-
- $plugins[] = $pluginName;
- if ($testEnvironment) {
- $testEnvironment->pluginsToLoad = array_merge($testEnvironment->pluginsToLoad ?: array(), array($pluginName));
- }
- }
-
- Log::debug("Plugins to load during tests: " . implode(', ', $plugins));
-
- $pluginsManager->loadPlugins($plugins);
- }
-
- public static function installAndActivatePlugins()
- {
- $pluginsManager = \Piwik\Plugin\Manager::getInstance();
-
- // Install plugins
- $messages = $pluginsManager->installLoadedPlugins();
- if(!empty($messages)) {
- Log::info("Plugin loading messages: %s", implode(" --- ", $messages));
- }
-
- // Activate them
- foreach($pluginsManager->getLoadedPlugins() as $plugin) {
- $name = $plugin->getPluginName();
- if (!$pluginsManager->isPluginActivated($name)) {
- $pluginsManager->activatePlugin($name);
- }
- }
- }
-
- public static function unloadAllPlugins()
- {
- try {
- $manager = \Piwik\Plugin\Manager::getInstance();
- $plugins = $manager->getLoadedPlugins();
- foreach ($plugins as $plugin) {
- $plugin->uninstall();
- }
- \Piwik\Plugin\Manager::getInstance()->unloadPlugins();
- } catch (Exception $e) {
- }
- }
-
- /**
- * Creates a website, then sets its creation date to a day earlier than specified dateTime
- * Useful to create a website now, but force data to be archived back in the past.
- *
- * @param string $dateTime eg '2010-01-01 12:34:56'
- * @param int $ecommerce
- * @param string $siteName
- *
- * @param bool|string $siteUrl
- * @param int $siteSearch
- * @param null|string $searchKeywordParameters
- * @param null|string $searchCategoryParameters
- * @return int idSite of website created
- */
- public static function createWebsite($dateTime, $ecommerce = 0, $siteName = false, $siteUrl = false,
- $siteSearch = 1, $searchKeywordParameters = null,
- $searchCategoryParameters = null, $timezone = null)
- {
- if($siteName === false) {
- $siteName = self::DEFAULT_SITE_NAME;
- }
- $idSite = APISitesManager::getInstance()->addSite(
- $siteName,
- $siteUrl === false ? "http://piwik.net/" : $siteUrl,
- $ecommerce,
- $siteSearch, $searchKeywordParameters, $searchCategoryParameters,
- $ips = null,
- $excludedQueryParameters = null,
- $timezone,
- $currency = null
- );
-
- // Manually set the website creation date to a day earlier than the earliest day we record stats for
- Db::get()->update(Common::prefixTable("site"),
- array('ts_created' => Date::factory($dateTime)->subDay(1)->getDatetime()),
- "idsite = $idSite"
- );
-
- // Clear the memory Website cache
- Site::clearCache();
-
- return $idSite;
- }
-
- /**
- * Returns URL to Piwik root.
- *
- * @return string
- */
- public static function getRootUrl()
- {
- $piwikUrl = Url::getCurrentUrlWithoutFileName();
-
- $pathBeforeRoot = 'tests';
- // Running from a plugin
- if (strpos($piwikUrl, 'plugins/') !== false) {
- $pathBeforeRoot = 'plugins';
- }
-
- $testsInPath = strpos($piwikUrl, $pathBeforeRoot . '/');
- if ($testsInPath !== false) {
- $piwikUrl = substr($piwikUrl, 0, $testsInPath);
- }
-
- // in case force_ssl=1, or assume_secure_protocol=1, is set in tests
- // we don't want to require Travis CI or devs to setup HTTPS on their local machine
- $piwikUrl = str_replace("https://", "http://", $piwikUrl);
-
- return $piwikUrl;
- }
-
- /**
- * Returns URL to the proxy script, used to ensure piwik.php
- * uses the test environment, and allows variable overwriting
- *
- * @return string
- */
- public static function getTrackerUrl()
- {
- return self::getRootUrl() . 'tests/PHPUnit/proxy/piwik.php';
- }
-
- /**
- * Returns a PiwikTracker object that you can then use to track pages or goals.
- *
- * @param int $idSite
- * @param string $dateTime
- * @param boolean $defaultInit If set to true, the tracker object will have default IP, user agent, time, resolution, etc.
- * @param bool $useLocal
- *
- * @return PiwikTracker
- */
- public static function getTracker($idSite, $dateTime, $defaultInit = true, $useLocal = false)
- {
- if ($useLocal) {
- require_once PIWIK_INCLUDE_PATH . '/tests/LocalTracker.php';
- $t = new Piwik_LocalTracker($idSite, self::getTrackerUrl());
- } else {
- $t = new PiwikTracker($idSite, self::getTrackerUrl());
- }
- $t->setForceVisitDateTime($dateTime);
-
- if ($defaultInit) {
- $t->setTokenAuth(self::getTokenAuth());
- $t->setIp('156.5.3.2');
-
- // Optional tracking
- $t->setUserAgent("Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.2.6) Gecko/20100625 Firefox/3.6.6 (.NET CLR 3.5.30729)");
- $t->setBrowserLanguage('fr');
- $t->setLocalTime('12:34:06');
- $t->setResolution(1024, 768);
- $t->setBrowserHasCookies(true);
- $t->setPlugins($flash = true, $java = true, $director = false);
- }
- return $t;
- }
-
- /**
- * Checks that the response is a GIF image as expected.
- * Will fail the test if the response is not the expected GIF
- *
- * @param $response
- */
- public static function checkResponse($response)
- {
- $trans_gif_64 = "R0lGODlhAQABAIAAAAAAAAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==";
- $expectedResponse = base64_decode($trans_gif_64);
-
- $url = "\n =========================== \n URL was: " . PiwikTracker::$DEBUG_LAST_REQUESTED_URL;
- self::assertEquals($expectedResponse, $response, "Expected GIF beacon, got: <br/>\n"
- . var_export($response, true)
- . "\n If you are stuck, you can enable [Tracker] debug=1; in config.ini.php to get more debug info."
- . base64_encode($response)
- . $url
- );
- }
-
- /**
- * Checks that the response from bulk tracking is a valid JSON
- * string. Will fail the test if JSON status is not success.
- *
- * @param $response
- */
- public static function checkBulkTrackingResponse($response) {
- $data = json_decode($response, true);
- if (!is_array($data) || empty($response)) {
- throw new Exception("Bulk tracking response (".$response.") is not an array: " . var_export($data, true) . "\n");
- }
- if(!isset($data['status'])) {
- throw new Exception("Returned data didn't have a status: " . var_export($data,true));
- }
-
- self::assertArrayHasKey('status', $data);
- self::assertEquals('success', $data['status'], "expected success, got: " . var_export($data, true));
- }
-
- public static function makeLocation($city, $region, $country, $lat = null, $long = null, $isp = null)
- {
- return array(LocationProvider::CITY_NAME_KEY => $city,
- LocationProvider::REGION_CODE_KEY => $region,
- LocationProvider::COUNTRY_CODE_KEY => $country,
- LocationProvider::LATITUDE_KEY => $lat,
- LocationProvider::LONGITUDE_KEY => $long,
- LocationProvider::ISP_KEY => $isp);
- }
-
- /**
- * Returns the Super User token auth that can be used in tests. Can be used to
- * do bulk tracking.
- *
- * @return string
- */
- public static function getTokenAuth()
- {
- return APIUsersManager::getInstance()->getTokenAuth(
- self::ADMIN_USER_LOGIN,
- UsersManager::getPasswordHash(self::ADMIN_USER_PASSWORD)
- );
- }
-
- public static function createSuperUser($removeExisting = true)
- {
- $login = self::ADMIN_USER_LOGIN;
- $password = UsersManager::getPasswordHash(self::ADMIN_USER_PASSWORD);
- $token = self::getTokenAuth();
-
- $model = new \Piwik\Plugins\UsersManager\Model();
- if ($removeExisting) {
- $model->deleteUserOnly($login);
- }
-
- $user = $model->getUser($login);
-
- if (empty($user)) {
- $model->addUser($login, $password, 'hello@example.org', $login, $token, Date::now()->getDatetime());
- } else {
- $model->updateUser($login, $password, 'hello@example.org', $login, $token);
- }
-
- if (empty($user['superuser_access'])) {
- $model->setSuperUserAccess($login, true);
- }
-
- return $model->getUserByTokenAuth($token);
- }
-
- /**
- * Create three MAIL and two MOBILE scheduled reports
- *
- * Reports sent by mail can contain PNG graphs when the user specifies it.
- * Depending on the system under test, generated images differ slightly.
- * Because of this discrepancy, PNG graphs are only tested if the system under test
- * has the characteristics described in 'canImagesBeIncludedInScheduledReports'.
- * See tests/README.md for more detail.
- *
- * @see canImagesBeIncludedInScheduledReports
- * @param int $idSite id of website created
- */
- public static function setUpScheduledReports($idSite)
- {
- // fake access is needed so API methods can call Piwik::getCurrentUserLogin(), e.g: 'ScheduledReports.addReport'
- $pseudoMockAccess = new FakeAccess;
- FakeAccess::$superUser = true;
- Access::setSingletonInstance($pseudoMockAccess);
-
- // retrieve available reports
- $availableReportMetadata = APIScheduledReports::getReportMetadata($idSite, ScheduledReports::EMAIL_TYPE);
-
- $availableReportIds = array();
- foreach ($availableReportMetadata as $reportMetadata) {
- $availableReportIds[] = $reportMetadata['uniqueId'];
- }
-
- //@review should we also test evolution graphs?
- // set-up mail report
- APIScheduledReports::getInstance()->addReport(
- $idSite,
- 'Mail Test report',
- 'day', // overridden in getApiForTestingScheduledReports()
- 0,
- ScheduledReports::EMAIL_TYPE,
- ReportRenderer::HTML_FORMAT, // overridden in getApiForTestingScheduledReports()
- $availableReportIds,
- array(ScheduledReports::DISPLAY_FORMAT_PARAMETER => ScheduledReports::DISPLAY_FORMAT_TABLES_ONLY)
- );
-
- // set-up sms report for one website
- APIScheduledReports::getInstance()->addReport(
- $idSite,
- 'SMS Test report, one website',
- 'day', // overridden in getApiForTestingScheduledReports()
- 0,
- MobileMessaging::MOBILE_TYPE,
- MobileMessaging::SMS_FORMAT,
- array("MultiSites_getOne"),
- array("phoneNumbers" => array())
- );
-
- // set-up sms report for all websites
- APIScheduledReports::getInstance()->addReport(
- $idSite,
- 'SMS Test report, all websites',
- 'day', // overridden in getApiForTestingScheduledReports()
- 0,
- MobileMessaging::MOBILE_TYPE,
- MobileMessaging::SMS_FORMAT,
- array("MultiSites_getAll"),
- array("phoneNumbers" => array())
- );
-
- if (self::canImagesBeIncludedInScheduledReports()) {
- // set-up mail report with images
- APIScheduledReports::getInstance()->addReport(
- $idSite,
- 'Mail Test report',
- 'day', // overridden in getApiForTestingScheduledReports()
- 0,
- ScheduledReports::EMAIL_TYPE,
- ReportRenderer::HTML_FORMAT, // overridden in getApiForTestingScheduledReports()
- $availableReportIds,
- array(ScheduledReports::DISPLAY_FORMAT_PARAMETER => ScheduledReports::DISPLAY_FORMAT_TABLES_AND_GRAPHS)
- );
-
- // set-up mail report with one row evolution based png graph
- APIScheduledReports::getInstance()->addReport(
- $idSite,
- 'Mail Test report',
- 'day',
- 0,
- ScheduledReports::EMAIL_TYPE,
- ReportRenderer::HTML_FORMAT,
- array('Actions_getPageTitles'),
- array(
- ScheduledReports::DISPLAY_FORMAT_PARAMETER => ScheduledReports::DISPLAY_FORMAT_GRAPHS_ONLY,
- ScheduledReports::EVOLUTION_GRAPH_PARAMETER => 'true',
- )
- );
- }
- }
-
- /**
- * Return true if system under test has Piwik core team's most common configuration
- */
- public static function canImagesBeIncludedInScheduledReports()
- {
- $gdInfo = gd_info();
- return
- stristr(php_uname(), self::IMAGES_GENERATED_ONLY_FOR_OS) &&
- strpos( phpversion(), self::IMAGES_GENERATED_FOR_PHP) !== false &&
- strpos( $gdInfo['GD Version'], self::IMAGES_GENERATED_FOR_GD) !== false;
- }
-
- public static $geoIpDbUrl = 'http://piwik-team.s3.amazonaws.com/GeoIP.dat.gz';
- public static $geoLiteCityDbUrl = 'http://piwik-team.s3.amazonaws.com/GeoLiteCity.dat.gz';
-
- public static function downloadGeoIpDbs()
- {
- $geoIpOutputDir = PIWIK_INCLUDE_PATH . '/tests/lib/geoip-files';
- self::downloadAndUnzip(self::$geoIpDbUrl, $geoIpOutputDir, 'GeoIP.dat');
- self::downloadAndUnzip(self::$geoLiteCityDbUrl, $geoIpOutputDir, 'GeoIPCity.dat');
- }
-
- public static function downloadAndUnzip($url, $outputDir, $filename)
- {
- $bufferSize = 1024 * 1024;
-
- if (!is_dir($outputDir)) {
- mkdir($outputDir);
- }
-
- $deflatedOut = $outputDir . '/' . $filename;
- $outfileName = $deflatedOut . '.gz';
-
- if (file_exists($deflatedOut)) {
- return;
- }
-
- $dump = fopen($url, 'rb');
- $outfile = fopen($outfileName, 'wb');
- while (!feof($dump)) {
- fwrite($outfile, fread($dump, $bufferSize), $bufferSize);
- }
- fclose($dump);
- fclose($outfile);
-
- // unzip the dump
- exec("gunzip -c \"" . $outfileName . "\" > \"$deflatedOut\"", $output, $return);
- if ($return !== 0) {
- Log::info("gunzip failed with file that has following contents:");
- Log::info(file_get_contents($outfile));
-
- throw new Exception("gunzip failed($return): " . implode("\n", $output));
- }
- }
-
- protected static function executeLogImporter($logFile, $options)
- {
- $python = self::getPythonBinary();
-
- // create the command
- $cmd = $python
- . ' "' . PIWIK_INCLUDE_PATH . '/misc/log-analytics/import_logs.py" ' # script loc
- . '-ddd ' // debug
- . '--url="' . self::getRootUrl() . 'tests/PHPUnit/proxy/" ' # proxy so that piwik uses test config files
- ;
-
- foreach ($options as $name => $value) {
- $cmd .= $name;
- if ($value !== false) {
- $cmd .= '="' . $value . '"';
- }
- $cmd .= ' ';
- }
-
- $cmd .= '"' . $logFile . '" 2>&1';
-
- // run the command
- exec($cmd, $output, $result);
- if ($result !== 0) {
- throw new Exception("log importer failed: " . implode("\n", $output) . "\n\ncommand used: $cmd");
- }
-
- return $output;
- }
-
- public static function siteCreated($idSite)
- {
- return Db::fetchOne("SELECT COUNT(*) FROM " . Common::prefixTable('site') . " WHERE idsite = ?", array($idSite)) != 0;
- }
-
- public static function goalExists($idSite, $idGoal)
- {
- return Db::fetchOne("SELECT COUNT(*) FROM " . Common::prefixTable('goal') . " WHERE idgoal = ? AND idsite = ?", array($idGoal, $idSite)) != 0;
- }
-
- /**
- * Connects to MySQL w/o specifying a database.
- */
- public static function connectWithoutDatabase()
- {
- $dbConfig = Config::getInstance()->database;
- $oldDbName = $dbConfig['dbname'];
- $dbConfig['dbname'] = null;
-
- Db::createDatabaseObject($dbConfig);
-
- $dbConfig['dbname'] = $oldDbName;
- }
-
- /**
- * Sets up access instance.
- */
- public static function createAccessInstance()
- {
- Access::setSingletonInstance(null);
- Access::getInstance();
- Piwik::postEvent('Request.initAuthenticationObject');
- }
-
- public function dropDatabase($dbName = null)
- {
- $dbName = $dbName ?: $this->dbName ?: Config::getInstance()->database_tests['dbname'];
-
- $this->log("Dropping database '$dbName'...");
-
- $config = _parse_ini_file(PIWIK_INCLUDE_PATH . '/config/config.ini.php', true);
- $originalDbName = $config['database']['dbname'];
- if ($dbName == $originalDbName
- && $dbName != 'piwik_tests'
- ) { // santity check
- throw new \Exception("Trying to drop original database '$originalDbName'. Something's wrong w/ the tests.");
- }
-
- DbHelper::dropDatabase($dbName);
- }
-
- public function log($message)
- {
- if ($this->printToScreen) {
- echo $message . "\n";
- }
- }
-
- // NOTE: since API_Request does sanitization, API methods do not. when calling them, we must
- // sometimes do sanitization ourselves.
- public static function makeXssContent($type, $sanitize = false)
- {
- $result = "<script>$('body').html('$type XSS!');</script>";
- if ($sanitize) {
- $result = Common::sanitizeInputValue($result);
- }
- return $result;
- }
-
- public static function updateDatabase($force = false)
- {
- Cache::deleteTrackerCache();
- Option::clearCache();
-
- 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;
+ parent::setUp();
}
}
-// needed by tests that use stored segments w/ the proxy index.php
-class OverrideLogin extends Access
+/**
+ * @deprecated since 2.8.0 use \Piwik\Tests\Impl\OverrideLogin instead
+ */
+class OverrideLogin extends \Piwik\Tests\Impl\OverrideLogin
{
- public function getLogin()
- {
- return 'superUserLogin';
- }
} \ No newline at end of file
diff --git a/tests/PHPUnit/Fixtures/FewVisitsWithSetVisitorIdAndUserId.php b/tests/PHPUnit/Fixtures/FewVisitsWithSetVisitorIdAndUserId.php
index f039505460..01156c1d0a 100644
--- a/tests/PHPUnit/Fixtures/FewVisitsWithSetVisitorIdAndUserId.php
+++ b/tests/PHPUnit/Fixtures/FewVisitsWithSetVisitorIdAndUserId.php
@@ -10,7 +10,7 @@ namespace Piwik\Tests\Fixtures;
use Piwik\Date;
use Piwik\Plugins\Goals\API;
use Piwik\Tracker\Visit;
-use Piwik\Tests\Fixture;
+use Piwik\Tests\Impl\Fixture;
use PiwikTracker;
use Exception;
diff --git a/tests/PHPUnit/Fixtures/InvalidVisits.php b/tests/PHPUnit/Fixtures/InvalidVisits.php
index adf068d5d3..4c16226406 100644
--- a/tests/PHPUnit/Fixtures/InvalidVisits.php
+++ b/tests/PHPUnit/Fixtures/InvalidVisits.php
@@ -9,7 +9,7 @@ namespace Piwik\Tests\Fixtures;
use Piwik\Http;
use Piwik\Plugins\SitesManager\API;
-use Piwik\Tests\Fixture;
+use Piwik\Tests\Impl\Fixture;
use Exception;
/**
diff --git a/tests/PHPUnit/Fixtures/ManySitesImportedLogs.php b/tests/PHPUnit/Fixtures/ManySitesImportedLogs.php
index 2ddc236f0c..38a6479de7 100644
--- a/tests/PHPUnit/Fixtures/ManySitesImportedLogs.php
+++ b/tests/PHPUnit/Fixtures/ManySitesImportedLogs.php
@@ -12,7 +12,7 @@ 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\Impl\Fixture;
use Piwik\Tests\OverrideLogin;
/**
diff --git a/tests/PHPUnit/Fixtures/ManySitesImportedLogsWithXssAttempts.php b/tests/PHPUnit/Fixtures/ManySitesImportedLogsWithXssAttempts.php
index 70f2d07ca5..6c4cf69526 100644
--- a/tests/PHPUnit/Fixtures/ManySitesImportedLogsWithXssAttempts.php
+++ b/tests/PHPUnit/Fixtures/ManySitesImportedLogsWithXssAttempts.php
@@ -11,7 +11,7 @@ use Piwik\Date;
use Piwik\Db;
use Piwik\Plugins\Annotations\API as APIAnnotations;
use Piwik\Plugins\Goals\API as APIGoals;
-use Piwik\Tests\Fixture;
+use Piwik\Tests\Impl\Fixture;
require_once PIWIK_INCLUDE_PATH . '/tests/PHPUnit/Fixtures/ManySitesImportedLogs.php';
diff --git a/tests/PHPUnit/Fixtures/ManyVisitsWithGeoIP.php b/tests/PHPUnit/Fixtures/ManyVisitsWithGeoIP.php
index 2d7620f4fe..f8783f8b7d 100644
--- a/tests/PHPUnit/Fixtures/ManyVisitsWithGeoIP.php
+++ b/tests/PHPUnit/Fixtures/ManyVisitsWithGeoIP.php
@@ -11,7 +11,7 @@ use Piwik\Date;
use Piwik\Plugins\Goals\API;
use Piwik\Plugins\UserCountry\LocationProvider\GeoIp;
use Piwik\Plugins\UserCountry\LocationProvider;
-use Piwik\Tests\Fixture;
+use Piwik\Tests\Impl\Fixture;
use Exception;
require_once PIWIK_INCLUDE_PATH . '/tests/PHPUnit/MockLocationProvider.php';
diff --git a/tests/PHPUnit/Fixtures/ManyVisitsWithMockLocationProvider.php b/tests/PHPUnit/Fixtures/ManyVisitsWithMockLocationProvider.php
index aee0adbba9..cf3434632c 100644
--- a/tests/PHPUnit/Fixtures/ManyVisitsWithMockLocationProvider.php
+++ b/tests/PHPUnit/Fixtures/ManyVisitsWithMockLocationProvider.php
@@ -9,7 +9,7 @@ namespace Piwik\Tests\Fixtures;
use Piwik\Date;
use Piwik\Plugins\UserCountry\LocationProvider;
-use Piwik\Tests\Fixture;
+use Piwik\Tests\Impl\Fixture;
require_once PIWIK_INCLUDE_PATH . '/tests/PHPUnit/MockLocationProvider.php';
diff --git a/tests/PHPUnit/Fixtures/ManyVisitsWithSubDirReferrersAndCustomVars.php b/tests/PHPUnit/Fixtures/ManyVisitsWithSubDirReferrersAndCustomVars.php
index 88f673831c..8250174878 100644
--- a/tests/PHPUnit/Fixtures/ManyVisitsWithSubDirReferrersAndCustomVars.php
+++ b/tests/PHPUnit/Fixtures/ManyVisitsWithSubDirReferrersAndCustomVars.php
@@ -8,7 +8,7 @@
namespace Piwik\Tests\Fixtures;
use Piwik\Date;
-use Piwik\Tests\Fixture;
+use Piwik\Tests\Impl\Fixture;
/**
* Adds one site and tracks 13 visits all with custom variables and referrer URLs
diff --git a/tests/PHPUnit/Fixtures/OmniFixture.php b/tests/PHPUnit/Fixtures/OmniFixture.php
index a826e13e36..176764f3c2 100644
--- a/tests/PHPUnit/Fixtures/OmniFixture.php
+++ b/tests/PHPUnit/Fixtures/OmniFixture.php
@@ -12,7 +12,7 @@ use Piwik\Access;
use Piwik\Option;
use ReflectionClass;
use Piwik\Plugins\VisitsSummary\API as VisitsSummaryAPI;
-use Piwik\Tests\Fixture;
+use Piwik\Tests\Impl\Fixture;
use Piwik\Tests\OverrideLogin;
/**
diff --git a/tests/PHPUnit/Fixtures/OneVisitSeveralPageViews.php b/tests/PHPUnit/Fixtures/OneVisitSeveralPageViews.php
index c4ed1564a0..899df68e7a 100644
--- a/tests/PHPUnit/Fixtures/OneVisitSeveralPageViews.php
+++ b/tests/PHPUnit/Fixtures/OneVisitSeveralPageViews.php
@@ -8,7 +8,7 @@
namespace Piwik\Tests\Fixtures;
use Piwik\Date;
-use Piwik\Tests\Fixture;
+use Piwik\Tests\Impl\Fixture;
/**
* Adds one site and tracks one visit with several pageviews.
@@ -40,7 +40,7 @@ class OneVisitSeveralPageViews extends Fixture
{
$dateTime = $this->dateTime;
$idSite = $this->idSite;
- $t = self::getTracker($idSite, $dateTime, $defaultInit = true, $useThirdPartyCookie = 1);
+ $t = self::getTracker($idSite, $dateTime, $defaultInit = true);
$t->setUrlReferrer('http://www.google.com.vn/url?sa=t&rct=j&q=%3C%3E%26%5C%22the%20pdo%20extension%20is%20required%20for%20this%20adapter%20but%20the%20extension%20is%20not%20loaded&source=web&cd=4&ved=0FjAD&url=http%3A%2F%2Fforum.piwik.org%2Fread.php%3F2%2C1011&ei=y-HHAQ&usg=AFQjCN2-nt5_GgDeg&cad=rja');
$t->setUrl('http://example.org/%C3%A9%C3%A9%C3%A9%22%27...%20%3Cthis%20is%20cool%3E!');
diff --git a/tests/PHPUnit/Fixtures/OneVisitWithAbnormalPageviewUrls.php b/tests/PHPUnit/Fixtures/OneVisitWithAbnormalPageviewUrls.php
index ba1f56d207..22999000ee 100644
--- a/tests/PHPUnit/Fixtures/OneVisitWithAbnormalPageviewUrls.php
+++ b/tests/PHPUnit/Fixtures/OneVisitWithAbnormalPageviewUrls.php
@@ -8,7 +8,7 @@
namespace Piwik\Tests\Fixtures;
use Piwik\Date;
-use Piwik\Tests\Fixture;
+use Piwik\Tests\Impl\Fixture;
/**
* Adds one site and tracks one visit w/ pageview URLs that are not normalized.
diff --git a/tests/PHPUnit/Fixtures/OneVisitorTwoVisits.php b/tests/PHPUnit/Fixtures/OneVisitorTwoVisits.php
index 50f576b33f..f8f4202c51 100644
--- a/tests/PHPUnit/Fixtures/OneVisitorTwoVisits.php
+++ b/tests/PHPUnit/Fixtures/OneVisitorTwoVisits.php
@@ -10,7 +10,7 @@ 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;
+use Piwik\Tests\Impl\Fixture;
/**
* This fixture adds one website and tracks two visits by one visitor.
diff --git a/tests/PHPUnit/Fixtures/SomeVisitsAllConversions.php b/tests/PHPUnit/Fixtures/SomeVisitsAllConversions.php
index 663b3e748a..b8645c9208 100644
--- a/tests/PHPUnit/Fixtures/SomeVisitsAllConversions.php
+++ b/tests/PHPUnit/Fixtures/SomeVisitsAllConversions.php
@@ -9,7 +9,7 @@ namespace Piwik\Tests\Fixtures;
use Piwik\Date;
use Piwik\Plugins\Goals\API;
-use Piwik\Tests\Fixture;
+use Piwik\Tests\Impl\Fixture;
/**
* Adds one site and tracks a couple conversions.
diff --git a/tests/PHPUnit/Fixtures/SomeVisitsCustomVariablesCampaignsNotHeuristics.php b/tests/PHPUnit/Fixtures/SomeVisitsCustomVariablesCampaignsNotHeuristics.php
index adc6b2e3e0..1985b9090c 100644
--- a/tests/PHPUnit/Fixtures/SomeVisitsCustomVariablesCampaignsNotHeuristics.php
+++ b/tests/PHPUnit/Fixtures/SomeVisitsCustomVariablesCampaignsNotHeuristics.php
@@ -9,7 +9,7 @@ namespace Piwik\Tests\Fixtures;
use Piwik\Date;
use Piwik\Plugins\Goals\API;
-use Piwik\Tests\Fixture;
+use Piwik\Tests\Impl\Fixture;
use PiwikTracker;
/**
diff --git a/tests/PHPUnit/Fixtures/SomeVisitsManyPageviewsWithTransitions.php b/tests/PHPUnit/Fixtures/SomeVisitsManyPageviewsWithTransitions.php
index 52845bc0b8..309f5713da 100644
--- a/tests/PHPUnit/Fixtures/SomeVisitsManyPageviewsWithTransitions.php
+++ b/tests/PHPUnit/Fixtures/SomeVisitsManyPageviewsWithTransitions.php
@@ -8,7 +8,7 @@
namespace Piwik\Tests\Fixtures;
use Piwik\Date;
-use Piwik\Tests\Fixture;
+use Piwik\Tests\Impl\Fixture;
/**
* Adds one site and tracks a couple visits with many pageviews. The
diff --git a/tests/PHPUnit/Fixtures/SomeVisitsWithLongUrls.php b/tests/PHPUnit/Fixtures/SomeVisitsWithLongUrls.php
index 6d5e2556b3..7104a9db40 100644
--- a/tests/PHPUnit/Fixtures/SomeVisitsWithLongUrls.php
+++ b/tests/PHPUnit/Fixtures/SomeVisitsWithLongUrls.php
@@ -8,7 +8,7 @@
namespace Piwik\Tests\Fixtures;
use Piwik\Date;
-use Piwik\Tests\Fixture;
+use Piwik\Tests\Impl\Fixture;
/**
* Adds one site and tracks 7 visits w/ some long-ish urls (as page urls and
@@ -44,7 +44,7 @@ class SomeVisitsWithLongUrls extends Fixture
$idSite = $this->idSite;
// Visit 1: keyword and few URLs
- $t = self::getTracker($idSite, $dateTime, $defaultInit = true, $useThirdPartyCookie = 1);
+ $t = self::getTracker($idSite, $dateTime, $defaultInit = true);
$t->setUrlReferrer('http://bing.com/search?q=Hello world');
// Generate a few page views that will be truncated
diff --git a/tests/PHPUnit/Fixtures/SomeVisitsWithNonUnicodePageTitles.php b/tests/PHPUnit/Fixtures/SomeVisitsWithNonUnicodePageTitles.php
index 08b4962a6f..6b173301f2 100644
--- a/tests/PHPUnit/Fixtures/SomeVisitsWithNonUnicodePageTitles.php
+++ b/tests/PHPUnit/Fixtures/SomeVisitsWithNonUnicodePageTitles.php
@@ -9,7 +9,7 @@ namespace Piwik\Tests\Fixtures;
use Piwik\Date;
use Piwik\Plugins\SitesManager\API;
-use Piwik\Tests\Fixture;
+use Piwik\Tests\Impl\Fixture;
/**
* Adds one website and some visits with non unicode page titles.
diff --git a/tests/PHPUnit/Fixtures/SqlDump.php b/tests/PHPUnit/Fixtures/SqlDump.php
index 06c094de03..3547266669 100644
--- a/tests/PHPUnit/Fixtures/SqlDump.php
+++ b/tests/PHPUnit/Fixtures/SqlDump.php
@@ -11,8 +11,7 @@ use Piwik\Access;
use Piwik\ArchiveProcessor\Rules;
use Piwik\Config;
use Piwik\Db;
-use Piwik\Piwik;
-use Piwik\Tests\Fixture;
+use Piwik\Tests\Impl\Fixture;
use Exception;
/**
diff --git a/tests/PHPUnit/Fixtures/ThreeGoalsOnePageview.php b/tests/PHPUnit/Fixtures/ThreeGoalsOnePageview.php
index ac7abb6a4f..fcb72a3487 100644
--- a/tests/PHPUnit/Fixtures/ThreeGoalsOnePageview.php
+++ b/tests/PHPUnit/Fixtures/ThreeGoalsOnePageview.php
@@ -9,7 +9,7 @@ namespace Piwik\Tests\Fixtures;
use Piwik\Date;
use Piwik\Plugins\Goals\API;
-use Piwik\Tests\Fixture;
+use Piwik\Tests\Impl\Fixture;
/**
* Fixture that adds one site with three goals and tracks one pageview & one manual
diff --git a/tests/PHPUnit/Fixtures/ThreeSitesWithManyVisitsWithSiteSearch.php b/tests/PHPUnit/Fixtures/ThreeSitesWithManyVisitsWithSiteSearch.php
index 1c12adc3f3..1b6086ddde 100644
--- a/tests/PHPUnit/Fixtures/ThreeSitesWithManyVisitsWithSiteSearch.php
+++ b/tests/PHPUnit/Fixtures/ThreeSitesWithManyVisitsWithSiteSearch.php
@@ -9,7 +9,7 @@ namespace Piwik\Tests\Fixtures;
use Piwik\Date;
use Piwik\Plugins\SitesManager\API;
-use Piwik\Tests\Fixture;
+use Piwik\Tests\Impl\Fixture;
/**
* Adds three websites with different site search configurations and adds
diff --git a/tests/PHPUnit/Fixtures/ThreeSitesWithSharedVisitors.php b/tests/PHPUnit/Fixtures/ThreeSitesWithSharedVisitors.php
index 267e848fde..79f04d69f7 100644
--- a/tests/PHPUnit/Fixtures/ThreeSitesWithSharedVisitors.php
+++ b/tests/PHPUnit/Fixtures/ThreeSitesWithSharedVisitors.php
@@ -10,7 +10,7 @@ namespace Piwik\Tests\Fixtures;
use Piwik\Common;
use Piwik\Date;
use Piwik\Db;
-use Piwik\Tests\Fixture;
+use Piwik\Tests\Impl\Fixture;
/**
* Adds three sites and tracks some visits w/ visitors that visit each site.
diff --git a/tests/PHPUnit/Fixtures/TwoSitesEcommerceOrderWithItems.php b/tests/PHPUnit/Fixtures/TwoSitesEcommerceOrderWithItems.php
index 938fe28c86..a2b00b32d6 100644
--- a/tests/PHPUnit/Fixtures/TwoSitesEcommerceOrderWithItems.php
+++ b/tests/PHPUnit/Fixtures/TwoSitesEcommerceOrderWithItems.php
@@ -9,7 +9,7 @@ namespace Piwik\Tests\Fixtures;
use Piwik\Date;
use Piwik\Plugins\Goals\API;
-use Piwik\Tests\Fixture;
+use Piwik\Tests\Impl\Fixture;
/**
* Adds two sites and tracks some visits with ecommerce orders.
diff --git a/tests/PHPUnit/Fixtures/TwoSitesManyVisitsOverSeveralDaysWithSearchEngineReferrers.php b/tests/PHPUnit/Fixtures/TwoSitesManyVisitsOverSeveralDaysWithSearchEngineReferrers.php
index 3ff7b56fa4..8b154fd31f 100644
--- a/tests/PHPUnit/Fixtures/TwoSitesManyVisitsOverSeveralDaysWithSearchEngineReferrers.php
+++ b/tests/PHPUnit/Fixtures/TwoSitesManyVisitsOverSeveralDaysWithSearchEngineReferrers.php
@@ -9,7 +9,7 @@ namespace Piwik\Tests\Fixtures;
use Piwik\Date;
use Piwik\Plugins\Goals\API;
-use Piwik\Tests\Fixture;
+use Piwik\Tests\Impl\Fixture;
/**
* Adds one website and tracks visits on different days over a month
diff --git a/tests/PHPUnit/Fixtures/TwoSitesTwoVisitorsDifferentDays.php b/tests/PHPUnit/Fixtures/TwoSitesTwoVisitorsDifferentDays.php
index 6e913930fd..8c3ab81f71 100644
--- a/tests/PHPUnit/Fixtures/TwoSitesTwoVisitorsDifferentDays.php
+++ b/tests/PHPUnit/Fixtures/TwoSitesTwoVisitorsDifferentDays.php
@@ -10,7 +10,7 @@ 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;
+use Piwik\Tests\Impl\Fixture;
/**
* Adds two websites and tracks visits from two visitors on different days.
diff --git a/tests/PHPUnit/Fixtures/TwoSitesVisitsInPast.php b/tests/PHPUnit/Fixtures/TwoSitesVisitsInPast.php
index 0d47c97815..7d8f967d99 100644
--- a/tests/PHPUnit/Fixtures/TwoSitesVisitsInPast.php
+++ b/tests/PHPUnit/Fixtures/TwoSitesVisitsInPast.php
@@ -8,7 +8,7 @@
namespace Piwik\Tests\Fixtures;
use Piwik\Date;
-use Piwik\Tests\Fixture;
+use Piwik\Tests\Impl\Fixture;
/**
* Adds two sites and tracks several visits all in the past.
diff --git a/tests/PHPUnit/Fixtures/TwoSitesWithAnnotations.php b/tests/PHPUnit/Fixtures/TwoSitesWithAnnotations.php
index 370c5a864e..9cd6938d27 100644
--- a/tests/PHPUnit/Fixtures/TwoSitesWithAnnotations.php
+++ b/tests/PHPUnit/Fixtures/TwoSitesWithAnnotations.php
@@ -10,7 +10,7 @@ namespace Piwik\Tests\Fixtures;
use Piwik\Access;
use Piwik\Date;
use Piwik\Plugins\Annotations\API;
-use Piwik\Tests\Fixture;
+use Piwik\Tests\Impl\Fixture;
use FakeAccess;
/**
diff --git a/tests/PHPUnit/Fixtures/TwoVisitsNoKeywordWithBot.php b/tests/PHPUnit/Fixtures/TwoVisitsNoKeywordWithBot.php
index fcbb864bfb..d2a66893fd 100644
--- a/tests/PHPUnit/Fixtures/TwoVisitsNoKeywordWithBot.php
+++ b/tests/PHPUnit/Fixtures/TwoVisitsNoKeywordWithBot.php
@@ -9,7 +9,7 @@ namespace Piwik\Tests\Fixtures;
use Piwik\Date;
use Piwik\Plugins\Goals\API;
-use Piwik\Tests\Fixture;
+use Piwik\Tests\Impl\Fixture;
/**
* Adds one site and tracks two visits. One visit is a bot and one has no keyword
@@ -43,7 +43,7 @@ class TwoVisitsNoKeywordWithBot extends Fixture
// tests run in UTC, the Tracker in UTC
$dateTime = $this->dateTime;
$idSite = $this->idSite;
- $t = self::getTracker($idSite, $dateTime, $defaultInit = true, $useThirdPartyCookie = 1);
+ $t = self::getTracker($idSite, $dateTime, $defaultInit = true);
// Also testing to record this as a bot while specifically allowing bots
$t->setUserAgent('Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)');
diff --git a/tests/PHPUnit/Fixtures/TwoVisitsWithCustomEvents.php b/tests/PHPUnit/Fixtures/TwoVisitsWithCustomEvents.php
index b2777b408f..043fa4aaca 100644
--- a/tests/PHPUnit/Fixtures/TwoVisitsWithCustomEvents.php
+++ b/tests/PHPUnit/Fixtures/TwoVisitsWithCustomEvents.php
@@ -9,7 +9,7 @@ namespace Piwik\Tests\Fixtures;
use Piwik\Date;
use Piwik\Plugins\Goals\API as APIGoals;
-use Piwik\Tests\Fixture;
+use Piwik\Tests\Impl\Fixture;
use PiwikTracker;
/**
diff --git a/tests/PHPUnit/Fixtures/TwoVisitsWithCustomVariables.php b/tests/PHPUnit/Fixtures/TwoVisitsWithCustomVariables.php
index 5ed8c06b85..a472add11b 100644
--- a/tests/PHPUnit/Fixtures/TwoVisitsWithCustomVariables.php
+++ b/tests/PHPUnit/Fixtures/TwoVisitsWithCustomVariables.php
@@ -9,7 +9,7 @@ namespace Piwik\Tests\Fixtures;
use Piwik\Date;
use Piwik\Plugins\Goals\API;
-use Piwik\Tests\Fixture;
+use Piwik\Tests\Impl\Fixture;
/**
* Adds one site with two goals and tracks two visits with custom variables.
diff --git a/tests/PHPUnit/Fixtures/VisitOverSeveralDaysImportedLogs.php b/tests/PHPUnit/Fixtures/VisitOverSeveralDaysImportedLogs.php
index 98cc3b50aa..216d49f377 100644
--- a/tests/PHPUnit/Fixtures/VisitOverSeveralDaysImportedLogs.php
+++ b/tests/PHPUnit/Fixtures/VisitOverSeveralDaysImportedLogs.php
@@ -7,7 +7,7 @@
*/
namespace Piwik\Tests\Fixtures;
-use Piwik\Tests\Fixture;
+use Piwik\Tests\Impl\Fixture;
/**
* Import a same visitor, over three different days, in reverse chronological order
diff --git a/tests/PHPUnit/Fixtures/VisitsInDifferentTimezones.php b/tests/PHPUnit/Fixtures/VisitsInDifferentTimezones.php
index 19c7fcc062..0a1dce05fd 100644
--- a/tests/PHPUnit/Fixtures/VisitsInDifferentTimezones.php
+++ b/tests/PHPUnit/Fixtures/VisitsInDifferentTimezones.php
@@ -8,7 +8,7 @@
namespace Piwik\Tests\Fixtures;
use Piwik\Date;
-use Piwik\Tests\Fixture;
+use Piwik\Tests\Impl\Fixture;
/**
* Adds one site with a non UTC timezone and tracks a couple visits near the end of the day.
diff --git a/tests/PHPUnit/Fixtures/VisitsOverSeveralDays.php b/tests/PHPUnit/Fixtures/VisitsOverSeveralDays.php
index caf67e00aa..923a7dcb3b 100644
--- a/tests/PHPUnit/Fixtures/VisitsOverSeveralDays.php
+++ b/tests/PHPUnit/Fixtures/VisitsOverSeveralDays.php
@@ -8,7 +8,7 @@
namespace Piwik\Tests\Fixtures;
use Piwik\Date;
-use Piwik\Tests\Fixture;
+use Piwik\Tests\Impl\Fixture;
/**
* Adds one website and tracks several visits from one visitor on
diff --git a/tests/PHPUnit/Fixtures/VisitsTwoWebsitesWithAdditionalVisits.php b/tests/PHPUnit/Fixtures/VisitsTwoWebsitesWithAdditionalVisits.php
index 01963cb8ee..321af65330 100644
--- a/tests/PHPUnit/Fixtures/VisitsTwoWebsitesWithAdditionalVisits.php
+++ b/tests/PHPUnit/Fixtures/VisitsTwoWebsitesWithAdditionalVisits.php
@@ -8,7 +8,7 @@
namespace Piwik\Tests\Fixtures;
use Piwik\Date;
-use Piwik\Tests\Fixture;
+use Piwik\Tests\Impl\Fixture;
/**
* Adds two sites and tracks several visits with possibility to add new visits to the same days
diff --git a/tests/PHPUnit/Impl/ApiTestConfig.php b/tests/PHPUnit/Impl/ApiTestConfig.php
index a2dfab24d4..5458f88db6 100644
--- a/tests/PHPUnit/Impl/ApiTestConfig.php
+++ b/tests/PHPUnit/Impl/ApiTestConfig.php
@@ -20,7 +20,7 @@ use \Exception;
* processed before comparison.
*
* Instances of this class are not created directly. Instead, an array mapping config
- * property names w/ values is passed to IntegrationTestCase::runApiTests. For example,
+ * property names w/ values is passed to SystemTestCase::runApiTests. For example,
*
* $this->runApiTests("UserCountry", array(
* 'idSite' => 1,
@@ -135,7 +135,7 @@ class ApiTestConfig
public $fileExtension = false;
/**
- * An array of API methods that shouldn't be called. If `'all'` is specified in IntegrationTestCase::runApiTests,
+ * An array of API methods that shouldn't be called. If `'all'` is specified in SystemTestCase::runApiTests,
* the methods in this property will be ignored when calling all API methods.
*
* @var string[]|false eg, `array("Actions", "Referrers.getWebsites", ...)`
@@ -159,7 +159,7 @@ class ApiTestConfig
/**
* If supplied, tests will compare API responses with files using a different file prefix.
* Normally, the test name is used as the test prefix, so this will usually be set to the
- * name of the integration test. Either that or the value in the test's getOutputPrefix
+ * name of the system test. Either that or the value in the test's getOutputPrefix
* method.
*
* @param string|bool eg, `'OneVisitorTwoVisitsTest'`
@@ -205,7 +205,7 @@ class ApiTestConfig
}
if (!property_exists($this, $key)) {
- throw new Exception("Invalid API test property '$key'! Check your Integration tests.");
+ throw new Exception("Invalid API test property '$key'! Check your System tests.");
}
$this->$key = $value;
diff --git a/tests/PHPUnit/Impl/Fixture.php b/tests/PHPUnit/Impl/Fixture.php
new file mode 100644
index 0000000000..bfb212107f
--- /dev/null
+++ b/tests/PHPUnit/Impl/Fixture.php
@@ -0,0 +1,861 @@
+<?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\Impl;
+
+use Piwik\Access;
+use Piwik\Common;
+use Piwik\Config;
+use Piwik\DataAccess\ArchiveTableCreator;
+use Piwik\DataTable\Manager as DataTableManager;
+use Piwik\Date;
+use Piwik\Db;
+use Piwik\DbHelper;
+use Piwik\Log;
+use Piwik\Option;
+use Piwik\Piwik;
+use Piwik\Plugins\LanguagesManager\API as APILanguageManager;
+use Piwik\Plugins\MobileMessaging\MobileMessaging;
+use Piwik\Plugins\ScheduledReports\API as APIScheduledReports;
+use Piwik\Plugins\ScheduledReports\ScheduledReports;
+use Piwik\Plugins\SitesManager\API as APISitesManager;
+use Piwik\Plugins\UserCountry\LocationProvider;
+use Piwik\Plugins\UsersManager\API as APIUsersManager;
+use Piwik\Plugins\UsersManager\UsersManager;
+use Piwik\ReportRenderer;
+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;
+use Exception;
+
+/**
+ * Base type for all system test fixtures. System test fixtures
+ * add visit and related data to the database before a test is run. Different
+ * tests can use the same fixtures.
+ *
+ * This class defines a set of helper methods for fixture types. The helper
+ * methods are public, but ideally they should only be used by fixture types.
+ *
+ * NOTE: YOU SHOULD NOT CREATE A NEW FIXTURE UNLESS THERE IS NO WAY TO MODIFY
+ * AN EXISTING FIXTURE TO HANDLE YOUR USE CASE.
+ *
+ * Related TODO: we should try and reduce the amount of existing fixtures by
+ * merging some together.
+ */
+class Fixture extends PHPUnit_Framework_Assert
+{
+ const IMAGES_GENERATED_ONLY_FOR_OS = 'linux';
+ const IMAGES_GENERATED_FOR_PHP = '5.5';
+ const IMAGES_GENERATED_FOR_GD = '2.1.1';
+ const DEFAULT_SITE_NAME = 'Piwik test';
+
+ const ADMIN_USER_LOGIN = 'superUserLogin';
+ const ADMIN_USER_PASSWORD = 'superUserPass';
+
+ public $dbName = false;
+ public $createConfig = true;
+ public $dropDatabaseInSetUp = true;
+ public $dropDatabaseInTearDown = true;
+ public $loadTranslations = true;
+ public $createSuperUser = true;
+ public $removeExistingSuperUser = true;
+ public $overwriteExisting = true;
+ public $configureComponents = true;
+ public $persistFixtureData = false;
+ public $resetPersistedFixture = false;
+ public $printToScreen = false;
+
+ public $testCaseClass = false;
+ public $extraPluginsToLoad = array();
+
+ public $testEnvironment = null;
+
+ /**
+ * @return string
+ */
+ protected static function getPythonBinary()
+ {
+ if(\Piwik\SettingsServer::isWindows()) {
+ return "C:\Python27\python.exe";
+ }
+ if(SystemTestCase::isTravisCI()) {
+ return 'python2.6';
+ }
+ return 'python';
+ }
+
+ /** Adds data to Piwik. Creates sites, tracks visits, imports log files, etc. */
+ public function setUp()
+ {
+ // empty
+ }
+
+ /** Does any clean up. Most of the time there will be no need to clean up. */
+ public function tearDown()
+ {
+ // empty
+ }
+
+ public function getDbName()
+ {
+ if ($this->dbName !== false) {
+ return $this->dbName;
+ }
+
+ if ($this->persistFixtureData) {
+ return str_replace("\\", "_", get_class($this));
+ }
+
+ return Config::getInstance()->database_tests['dbname'];
+ }
+
+ public function performSetUp($setupEnvironmentOnly = false)
+ {
+ try {
+ if ($this->createConfig) {
+ Config::getInstance()->setTestEnvironment();
+ }
+
+ $this->dbName = $this->getDbName();
+
+ if ($this->persistFixtureData) {
+ $this->dropDatabaseInSetUp = false;
+ $this->dropDatabaseInTearDown = false;
+ $this->overwriteExisting = false;
+ $this->removeExistingSuperUser = false;
+
+ Config::getInstance()->database_tests['dbname'] = Config::getInstance()->database['dbname'] = $this->dbName;
+
+ $this->getTestEnvironment()->dbName = $this->dbName;
+ }
+
+ if ($this->dbName === false) { // must be after test config is created
+ $this->dbName = Config::getInstance()->database['dbname'];
+ }
+
+ static::connectWithoutDatabase();
+
+ if ($this->dropDatabaseInSetUp
+ || $this->resetPersistedFixture
+ ) {
+ $this->dropDatabase();
+ }
+
+ DbHelper::createDatabase($this->dbName);
+ DbHelper::disconnectDatabase();
+
+ // reconnect once we're sure the database exists
+ Config::getInstance()->database['dbname'] = $this->dbName;
+ Db::createDatabaseObject();
+
+ Db::get()->query("SET wait_timeout=28800;");
+
+ DbHelper::createTables();
+
+ \Piwik\Plugin\Manager::getInstance()->unloadPlugins();
+
+ } catch (Exception $e) {
+ static::fail("TEST INITIALIZATION FAILED: " . $e->getMessage() . "\n" . $e->getTraceAsString());
+ }
+
+ include "DataFiles/SearchEngines.php";
+ include "DataFiles/Socials.php";
+ include "DataFiles/Languages.php";
+ include "DataFiles/Countries.php";
+ include "DataFiles/Currencies.php";
+ include "DataFiles/LanguageToCountry.php";
+ include "DataFiles/Providers.php";
+
+ if (!$this->isFixtureSetUp()) {
+ DbHelper::truncateAllTables();
+ }
+
+ static::createAccessInstance();
+
+ // We need to be SU to create websites for tests
+ Access::getInstance()->setSuperUserAccess();
+
+ Cache::deleteTrackerCache();
+
+ static::loadAllPlugins($this->getTestEnvironment(), $this->testCaseClass, $this->extraPluginsToLoad);
+
+ self::updateDatabase();
+
+ self::installAndActivatePlugins();
+
+ $_GET = $_REQUEST = array();
+ $_SERVER['HTTP_REFERER'] = '';
+
+ // Make sure translations are loaded to check messages in English
+ if ($this->loadTranslations) {
+ Translate::reloadLanguage('en');
+ APILanguageManager::getInstance()->setLanguageForUser('superUserLogin', 'en');
+ }
+
+ FakeAccess::$superUserLogin = 'superUserLogin';
+
+ \Piwik\SettingsPiwik::$cachedKnownSegmentsToArchive = null;
+ \Piwik\CacheFile::$invalidateOpCacheBeforeRead = true;
+
+ if ($this->configureComponents) {
+ \Piwik\Plugins\PrivacyManager\IPAnonymizer::deactivate();
+ \Piwik\Plugins\PrivacyManager\DoNotTrackHeaderChecker::deactivate();
+ }
+
+ if ($this->createSuperUser) {
+ self::createSuperUser($this->removeExistingSuperUser);
+ }
+
+ if ($setupEnvironmentOnly) {
+ return;
+ }
+
+ $this->getTestEnvironment()->save();
+ $this->getTestEnvironment()->executeSetupTestEnvHook();
+ Piwik_TestingEnvironment::addSendMailHook();
+
+ if ($this->overwriteExisting
+ || !$this->isFixtureSetUp()
+ ) {
+ $this->setUp();
+
+ $this->markFixtureSetUp();
+ $this->log("Database {$this->dbName} marked as successfully set up.");
+ } else {
+ $this->log("Using existing database {$this->dbName}.");
+ }
+ }
+
+ public function getTestEnvironment()
+ {
+ if ($this->testEnvironment === null) {
+ $this->testEnvironment = new Piwik_TestingEnvironment();
+ $this->testEnvironment->delete();
+
+ if (getenv('PIWIK_USE_XHPROF') == 1) {
+ $this->testEnvironment->useXhprof = true;
+ }
+ }
+ return $this->testEnvironment;
+ }
+
+ public function isFixtureSetUp()
+ {
+ $optionName = get_class($this) . '.setUpFlag';
+ return Option::get($optionName) !== false;
+ }
+
+ public function markFixtureSetUp()
+ {
+ $optionName = get_class($this) . '.setUpFlag';
+ Option::set($optionName, 1);
+ }
+
+ public function performTearDown()
+ {
+ // Note: avoid run SQL in the *tearDown() metohds because it randomly fails on Travis CI
+ // with error Error while sending QUERY packet. PID=XX
+ $this->tearDown();
+
+ self::unloadAllPlugins();
+
+ if ($this->dropDatabaseInTearDown) {
+ $this->dropDatabase();
+ }
+
+ $this->clearInMemoryCaches();
+ }
+
+ public function clearInMemoryCaches()
+ {
+ DataTableManager::getInstance()->deleteAll();
+ Option::clearCache();
+ Site::clearCache();
+ Cache::deleteTrackerCache();
+ Config::getInstance()->clear();
+ ArchiveTableCreator::clear();
+ \Piwik\Plugins\ScheduledReports\API::$cache = array();
+ \Piwik\Registry::unsetInstance();
+ \Piwik\EventDispatcher::getInstance()->clearAllObservers();
+
+ $_GET = $_REQUEST = array();
+ Translate::unloadEnglishTranslation();
+
+ Config::unsetInstance();
+
+ \Piwik\Config::getInstance()->Plugins; // make sure Plugins exists in a config object for next tests that use Plugin\Manager
+ // since Plugin\Manager uses getFromGlobalConfig which doesn't init the config object
+ }
+
+ public static function loadAllPlugins($testEnvironment = null, $testCaseClass = false, $extraPluginsToLoad = array())
+ {
+ if (empty($testEnvironment)) {
+ $testEnvironment = new Piwik_TestingEnvironment();
+ }
+
+ DbHelper::createTables();
+ $pluginsManager = \Piwik\Plugin\Manager::getInstance();
+
+ $plugins = $testEnvironment->getCoreAndSupportedPlugins();
+
+ // make sure the plugin that executed this method is included in the plugins to load
+ $extraPlugins = array_merge($extraPluginsToLoad, array(
+ \Piwik\Plugin::getPluginNameFromBacktrace(debug_backtrace()),
+ \Piwik\Plugin::getPluginNameFromNamespace($testCaseClass),
+ \Piwik\Plugin::getPluginNameFromNamespace(get_called_class())
+ ));
+ foreach ($extraPlugins as $pluginName) {
+ if (empty($pluginName)) {
+ continue;
+ }
+
+ if (in_array($pluginName, $plugins)) {
+ continue;
+ }
+
+ $plugins[] = $pluginName;
+ if ($testEnvironment) {
+ $testEnvironment->pluginsToLoad = array_merge($testEnvironment->pluginsToLoad ?: array(), array($pluginName));
+ }
+ }
+
+ Log::debug("Plugins to load during tests: " . implode(', ', $plugins));
+
+ $pluginsManager->loadPlugins($plugins);
+ }
+
+ public static function installAndActivatePlugins()
+ {
+ $pluginsManager = \Piwik\Plugin\Manager::getInstance();
+
+ // Install plugins
+ $messages = $pluginsManager->installLoadedPlugins();
+ if(!empty($messages)) {
+ Log::info("Plugin loading messages: %s", implode(" --- ", $messages));
+ }
+
+ // Activate them
+ foreach($pluginsManager->getLoadedPlugins() as $plugin) {
+ $name = $plugin->getPluginName();
+ if (!$pluginsManager->isPluginActivated($name)) {
+ $pluginsManager->activatePlugin($name);
+ }
+ }
+ }
+
+ public static function unloadAllPlugins()
+ {
+ try {
+ $manager = \Piwik\Plugin\Manager::getInstance();
+ $plugins = $manager->getLoadedPlugins();
+ foreach ($plugins as $plugin) {
+ $plugin->uninstall();
+ }
+ \Piwik\Plugin\Manager::getInstance()->unloadPlugins();
+ } catch (Exception $e) {
+ }
+ }
+
+ /**
+ * Creates a website, then sets its creation date to a day earlier than specified dateTime
+ * Useful to create a website now, but force data to be archived back in the past.
+ *
+ * @param string $dateTime eg '2010-01-01 12:34:56'
+ * @param int $ecommerce
+ * @param string $siteName
+ *
+ * @param bool|string $siteUrl
+ * @param int $siteSearch
+ * @param null|string $searchKeywordParameters
+ * @param null|string $searchCategoryParameters
+ * @return int idSite of website created
+ */
+ public static function createWebsite($dateTime, $ecommerce = 0, $siteName = false, $siteUrl = false,
+ $siteSearch = 1, $searchKeywordParameters = null,
+ $searchCategoryParameters = null, $timezone = null)
+ {
+ if($siteName === false) {
+ $siteName = self::DEFAULT_SITE_NAME;
+ }
+ $idSite = APISitesManager::getInstance()->addSite(
+ $siteName,
+ $siteUrl === false ? "http://piwik.net/" : $siteUrl,
+ $ecommerce,
+ $siteSearch, $searchKeywordParameters, $searchCategoryParameters,
+ $ips = null,
+ $excludedQueryParameters = null,
+ $timezone,
+ $currency = null
+ );
+
+ // Manually set the website creation date to a day earlier than the earliest day we record stats for
+ Db::get()->update(Common::prefixTable("site"),
+ array('ts_created' => Date::factory($dateTime)->subDay(1)->getDatetime()),
+ "idsite = $idSite"
+ );
+
+ // Clear the memory Website cache
+ Site::clearCache();
+
+ return $idSite;
+ }
+
+ /**
+ * Returns URL to Piwik root.
+ *
+ * @return string
+ */
+ public static function getRootUrl()
+ {
+ $piwikUrl = Url::getCurrentUrlWithoutFileName();
+
+ $pathBeforeRoot = 'tests';
+ // Running from a plugin
+ if (strpos($piwikUrl, 'plugins/') !== false) {
+ $pathBeforeRoot = 'plugins';
+ }
+
+ $testsInPath = strpos($piwikUrl, $pathBeforeRoot . '/');
+ if ($testsInPath !== false) {
+ $piwikUrl = substr($piwikUrl, 0, $testsInPath);
+ }
+
+ // in case force_ssl=1, or assume_secure_protocol=1, is set in tests
+ // we don't want to require Travis CI or devs to setup HTTPS on their local machine
+ $piwikUrl = str_replace("https://", "http://", $piwikUrl);
+
+ return $piwikUrl;
+ }
+
+ /**
+ * Returns URL to the proxy script, used to ensure piwik.php
+ * uses the test environment, and allows variable overwriting
+ *
+ * @return string
+ */
+ public static function getTrackerUrl()
+ {
+ return self::getRootUrl() . 'tests/PHPUnit/proxy/piwik.php';
+ }
+
+ /**
+ * Returns a PiwikTracker object that you can then use to track pages or goals.
+ *
+ * @param int $idSite
+ * @param string $dateTime
+ * @param boolean $defaultInit If set to true, the tracker object will have default IP, user agent, time, resolution, etc.
+ * @param bool $useLocal
+ *
+ * @return PiwikTracker
+ */
+ public static function getTracker($idSite, $dateTime, $defaultInit = true, $useLocal = false)
+ {
+ if ($useLocal) {
+ require_once PIWIK_INCLUDE_PATH . '/tests/LocalTracker.php';
+ $t = new Piwik_LocalTracker($idSite, self::getTrackerUrl());
+ } else {
+ $t = new PiwikTracker($idSite, self::getTrackerUrl());
+ }
+ $t->setForceVisitDateTime($dateTime);
+
+ if ($defaultInit) {
+ $t->setTokenAuth(self::getTokenAuth());
+ $t->setIp('156.5.3.2');
+
+ // Optional tracking
+ $t->setUserAgent("Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.2.6) Gecko/20100625 Firefox/3.6.6 (.NET CLR 3.5.30729)");
+ $t->setBrowserLanguage('fr');
+ $t->setLocalTime('12:34:06');
+ $t->setResolution(1024, 768);
+ $t->setBrowserHasCookies(true);
+ $t->setPlugins($flash = true, $java = true, $director = false);
+ }
+ return $t;
+ }
+
+ /**
+ * Checks that the response is a GIF image as expected.
+ * Will fail the test if the response is not the expected GIF
+ *
+ * @param $response
+ */
+ public static function checkResponse($response)
+ {
+ $trans_gif_64 = "R0lGODlhAQABAIAAAAAAAAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==";
+ $expectedResponse = base64_decode($trans_gif_64);
+
+ $url = "\n =========================== \n URL was: " . PiwikTracker::$DEBUG_LAST_REQUESTED_URL;
+ self::assertEquals($expectedResponse, $response, "Expected GIF beacon, got: <br/>\n"
+ . var_export($response, true)
+ . "\n If you are stuck, you can enable [Tracker] debug=1; in config.ini.php to get more debug info."
+ . base64_encode($response)
+ . $url
+ );
+ }
+
+ /**
+ * Checks that the response from bulk tracking is a valid JSON
+ * string. Will fail the test if JSON status is not success.
+ *
+ * @param $response
+ */
+ public static function checkBulkTrackingResponse($response) {
+ $data = json_decode($response, true);
+ if (!is_array($data) || empty($response)) {
+ throw new Exception("Bulk tracking response (".$response.") is not an array: " . var_export($data, true) . "\n");
+ }
+ if(!isset($data['status'])) {
+ throw new Exception("Returned data didn't have a status: " . var_export($data,true));
+ }
+
+ self::assertArrayHasKey('status', $data);
+ self::assertEquals('success', $data['status'], "expected success, got: " . var_export($data, true));
+ }
+
+ public static function makeLocation($city, $region, $country, $lat = null, $long = null, $isp = null)
+ {
+ return array(LocationProvider::CITY_NAME_KEY => $city,
+ LocationProvider::REGION_CODE_KEY => $region,
+ LocationProvider::COUNTRY_CODE_KEY => $country,
+ LocationProvider::LATITUDE_KEY => $lat,
+ LocationProvider::LONGITUDE_KEY => $long,
+ LocationProvider::ISP_KEY => $isp);
+ }
+
+ /**
+ * Returns the Super User token auth that can be used in tests. Can be used to
+ * do bulk tracking.
+ *
+ * @return string
+ */
+ public static function getTokenAuth()
+ {
+ return APIUsersManager::getInstance()->getTokenAuth(
+ self::ADMIN_USER_LOGIN,
+ UsersManager::getPasswordHash(self::ADMIN_USER_PASSWORD)
+ );
+ }
+
+ public static function createSuperUser($removeExisting = true)
+ {
+ $login = self::ADMIN_USER_LOGIN;
+ $password = UsersManager::getPasswordHash(self::ADMIN_USER_PASSWORD);
+ $token = self::getTokenAuth();
+
+ $model = new \Piwik\Plugins\UsersManager\Model();
+ if ($removeExisting) {
+ $model->deleteUserOnly($login);
+ }
+
+ $user = $model->getUser($login);
+
+ if (empty($user)) {
+ $model->addUser($login, $password, 'hello@example.org', $login, $token, Date::now()->getDatetime());
+ } else {
+ $model->updateUser($login, $password, 'hello@example.org', $login, $token);
+ }
+
+ if (empty($user['superuser_access'])) {
+ $model->setSuperUserAccess($login, true);
+ }
+
+ return $model->getUserByTokenAuth($token);
+ }
+
+ /**
+ * Create three MAIL and two MOBILE scheduled reports
+ *
+ * Reports sent by mail can contain PNG graphs when the user specifies it.
+ * Depending on the system under test, generated images differ slightly.
+ * Because of this discrepancy, PNG graphs are only tested if the system under test
+ * has the characteristics described in 'canImagesBeIncludedInScheduledReports'.
+ * See tests/README.md for more detail.
+ *
+ * @see canImagesBeIncludedInScheduledReports
+ * @param int $idSite id of website created
+ */
+ public static function setUpScheduledReports($idSite)
+ {
+ // fake access is needed so API methods can call Piwik::getCurrentUserLogin(), e.g: 'ScheduledReports.addReport'
+ $pseudoMockAccess = new FakeAccess;
+ FakeAccess::$superUser = true;
+ Access::setSingletonInstance($pseudoMockAccess);
+
+ // retrieve available reports
+ $availableReportMetadata = APIScheduledReports::getReportMetadata($idSite, ScheduledReports::EMAIL_TYPE);
+
+ $availableReportIds = array();
+ foreach ($availableReportMetadata as $reportMetadata) {
+ $availableReportIds[] = $reportMetadata['uniqueId'];
+ }
+
+ //@review should we also test evolution graphs?
+ // set-up mail report
+ APIScheduledReports::getInstance()->addReport(
+ $idSite,
+ 'Mail Test report',
+ 'day', // overridden in getApiForTestingScheduledReports()
+ 0,
+ ScheduledReports::EMAIL_TYPE,
+ ReportRenderer::HTML_FORMAT, // overridden in getApiForTestingScheduledReports()
+ $availableReportIds,
+ array(ScheduledReports::DISPLAY_FORMAT_PARAMETER => ScheduledReports::DISPLAY_FORMAT_TABLES_ONLY)
+ );
+
+ // set-up sms report for one website
+ APIScheduledReports::getInstance()->addReport(
+ $idSite,
+ 'SMS Test report, one website',
+ 'day', // overridden in getApiForTestingScheduledReports()
+ 0,
+ MobileMessaging::MOBILE_TYPE,
+ MobileMessaging::SMS_FORMAT,
+ array("MultiSites_getOne"),
+ array("phoneNumbers" => array())
+ );
+
+ // set-up sms report for all websites
+ APIScheduledReports::getInstance()->addReport(
+ $idSite,
+ 'SMS Test report, all websites',
+ 'day', // overridden in getApiForTestingScheduledReports()
+ 0,
+ MobileMessaging::MOBILE_TYPE,
+ MobileMessaging::SMS_FORMAT,
+ array("MultiSites_getAll"),
+ array("phoneNumbers" => array())
+ );
+
+ if (self::canImagesBeIncludedInScheduledReports()) {
+ // set-up mail report with images
+ APIScheduledReports::getInstance()->addReport(
+ $idSite,
+ 'Mail Test report',
+ 'day', // overridden in getApiForTestingScheduledReports()
+ 0,
+ ScheduledReports::EMAIL_TYPE,
+ ReportRenderer::HTML_FORMAT, // overridden in getApiForTestingScheduledReports()
+ $availableReportIds,
+ array(ScheduledReports::DISPLAY_FORMAT_PARAMETER => ScheduledReports::DISPLAY_FORMAT_TABLES_AND_GRAPHS)
+ );
+
+ // set-up mail report with one row evolution based png graph
+ APIScheduledReports::getInstance()->addReport(
+ $idSite,
+ 'Mail Test report',
+ 'day',
+ 0,
+ ScheduledReports::EMAIL_TYPE,
+ ReportRenderer::HTML_FORMAT,
+ array('Actions_getPageTitles'),
+ array(
+ ScheduledReports::DISPLAY_FORMAT_PARAMETER => ScheduledReports::DISPLAY_FORMAT_GRAPHS_ONLY,
+ ScheduledReports::EVOLUTION_GRAPH_PARAMETER => 'true',
+ )
+ );
+ }
+ }
+
+ /**
+ * Return true if system under test has Piwik core team's most common configuration
+ */
+ public static function canImagesBeIncludedInScheduledReports()
+ {
+ $gdInfo = gd_info();
+ return
+ stristr(php_uname(), self::IMAGES_GENERATED_ONLY_FOR_OS) &&
+ strpos( phpversion(), self::IMAGES_GENERATED_FOR_PHP) !== false &&
+ strpos( $gdInfo['GD Version'], self::IMAGES_GENERATED_FOR_GD) !== false;
+ }
+
+ public static $geoIpDbUrl = 'http://piwik-team.s3.amazonaws.com/GeoIP.dat.gz';
+ public static $geoLiteCityDbUrl = 'http://piwik-team.s3.amazonaws.com/GeoLiteCity.dat.gz';
+
+ public static function downloadGeoIpDbs()
+ {
+ $geoIpOutputDir = PIWIK_INCLUDE_PATH . '/tests/lib/geoip-files';
+ self::downloadAndUnzip(self::$geoIpDbUrl, $geoIpOutputDir, 'GeoIP.dat');
+ self::downloadAndUnzip(self::$geoLiteCityDbUrl, $geoIpOutputDir, 'GeoIPCity.dat');
+ }
+
+ public static function downloadAndUnzip($url, $outputDir, $filename)
+ {
+ $bufferSize = 1024 * 1024;
+
+ if (!is_dir($outputDir)) {
+ mkdir($outputDir);
+ }
+
+ $deflatedOut = $outputDir . '/' . $filename;
+ $outfileName = $deflatedOut . '.gz';
+
+ if (file_exists($deflatedOut)) {
+ return;
+ }
+
+ $dump = fopen($url, 'rb');
+ $outfile = fopen($outfileName, 'wb');
+ while (!feof($dump)) {
+ fwrite($outfile, fread($dump, $bufferSize), $bufferSize);
+ }
+ fclose($dump);
+ fclose($outfile);
+
+ // unzip the dump
+ exec("gunzip -c \"" . $outfileName . "\" > \"$deflatedOut\"", $output, $return);
+ if ($return !== 0) {
+ Log::info("gunzip failed with file that has following contents:");
+ Log::info(file_get_contents($outfile));
+
+ throw new Exception("gunzip failed($return): " . implode("\n", $output));
+ }
+ }
+
+ protected static function executeLogImporter($logFile, $options)
+ {
+ $python = self::getPythonBinary();
+
+ // create the command
+ $cmd = $python
+ . ' "' . PIWIK_INCLUDE_PATH . '/misc/log-analytics/import_logs.py" ' # script loc
+ . '-ddd ' // debug
+ . '--url="' . self::getRootUrl() . 'tests/PHPUnit/proxy/" ' # proxy so that piwik uses test config files
+ ;
+
+ foreach ($options as $name => $value) {
+ $cmd .= $name;
+ if ($value !== false) {
+ $cmd .= '="' . $value . '"';
+ }
+ $cmd .= ' ';
+ }
+
+ $cmd .= '"' . $logFile . '" 2>&1';
+
+ // run the command
+ exec($cmd, $output, $result);
+ if ($result !== 0) {
+ throw new Exception("log importer failed: " . implode("\n", $output) . "\n\ncommand used: $cmd");
+ }
+
+ return $output;
+ }
+
+ public static function siteCreated($idSite)
+ {
+ return Db::fetchOne("SELECT COUNT(*) FROM " . Common::prefixTable('site') . " WHERE idsite = ?", array($idSite)) != 0;
+ }
+
+ public static function goalExists($idSite, $idGoal)
+ {
+ return Db::fetchOne("SELECT COUNT(*) FROM " . Common::prefixTable('goal') . " WHERE idgoal = ? AND idsite = ?", array($idGoal, $idSite)) != 0;
+ }
+
+ /**
+ * Connects to MySQL w/o specifying a database.
+ */
+ public static function connectWithoutDatabase()
+ {
+ $dbConfig = Config::getInstance()->database;
+ $oldDbName = $dbConfig['dbname'];
+ $dbConfig['dbname'] = null;
+
+ Db::createDatabaseObject($dbConfig);
+
+ $dbConfig['dbname'] = $oldDbName;
+ }
+
+ /**
+ * Sets up access instance.
+ */
+ public static function createAccessInstance()
+ {
+ Access::setSingletonInstance(null);
+ Access::getInstance();
+ Piwik::postEvent('Request.initAuthenticationObject');
+ }
+
+ public function dropDatabase($dbName = null)
+ {
+ $dbName = $dbName ?: $this->dbName ?: Config::getInstance()->database_tests['dbname'];
+
+ $this->log("Dropping database '$dbName'...");
+
+ $config = _parse_ini_file(PIWIK_INCLUDE_PATH . '/config/config.ini.php', true);
+ $originalDbName = $config['database']['dbname'];
+ if ($dbName == $originalDbName
+ && $dbName != 'piwik_tests'
+ ) { // santity check
+ throw new \Exception("Trying to drop original database '$originalDbName'. Something's wrong w/ the tests.");
+ }
+
+ DbHelper::dropDatabase($dbName);
+ }
+
+ public function log($message)
+ {
+ if ($this->printToScreen) {
+ echo $message . "\n";
+ }
+ }
+
+ // NOTE: since API_Request does sanitization, API methods do not. when calling them, we must
+ // sometimes do sanitization ourselves.
+ public static function makeXssContent($type, $sanitize = false)
+ {
+ $result = "<script>$('body').html('$type XSS!');</script>";
+ if ($sanitize) {
+ $result = Common::sanitizeInputValue($result);
+ }
+ return $result;
+ }
+
+ public static function updateDatabase($force = false)
+ {
+ Cache::deleteTrackerCache();
+ Option::clearCache();
+
+ 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 OverrideLogin extends Access
+{
+ public function getLogin()
+ {
+ return 'superUserLogin';
+ }
+} \ No newline at end of file
diff --git a/tests/PHPUnit/Impl/IntegrationTestCase.php b/tests/PHPUnit/Impl/IntegrationTestCase.php
new file mode 100644
index 0000000000..7036993eb0
--- /dev/null
+++ b/tests/PHPUnit/Impl/IntegrationTestCase.php
@@ -0,0 +1,97 @@
+<?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\Impl;
+
+use Piwik\Config;
+use Piwik\Db;
+
+/**
+ * Tests extending IntegrationTestCase are much slower to run: the setUp will
+ * create all Piwik tables in a freshly empty test database.
+ *
+ * This allows each test method to start from a clean DB and setup initial state to
+ * then test it.
+ *
+ */
+class IntegrationTestCase extends SystemTestCase
+{
+ /**
+ * @var Fixture
+ */
+ public static $fixture;
+ public static $tableData;
+
+ /**
+ * Implementation details:
+ *
+ * To increase speed of tests, database setup is done once in setUpBeforeClass.
+ * Afterwards, the content of the tables is stored in a static class variable,
+ * self::$tableData. Before each individual test, the database tables are
+ * truncated and the data in self::$tableData is restored.
+ *
+ * If your test modifies table columns, you will need to recreate the database
+ * completely. This can be accomplished by:
+ *
+ * public function setUp()
+ * {
+ * self::$fixture->performSetUp();
+ * }
+ *
+ * public function tearDown()
+ * {
+ * parent::tearDown();
+ * self::$fixture->performTearDown();
+ * }
+ */
+ public static function setUpBeforeClass()
+ {
+ static::configureFixture(static::$fixture);
+ parent::setUpBeforeClass();
+
+ self::$tableData = self::getDbTablesWithData();
+ }
+
+ public static function tearDownAfterClass()
+ {
+ self::$tableData = array();
+ }
+
+ /**
+ * Setup the database and create the base tables for all tests
+ */
+ public function setUp()
+ {
+ parent::setUp();
+
+ Config::getInstance()->setTestEnvironment();
+
+ if (!empty(self::$tableData)) {
+ self::restoreDbTables(self::$tableData);
+ }
+ }
+
+ /**
+ * Resets all caches and drops the database
+ */
+ public function tearDown()
+ {
+ self::$fixture->clearInMemoryCaches();
+
+ parent::tearDown();
+ }
+
+ protected static function configureFixture($fixture)
+ {
+ $fixture->loadTranslations = false;
+ $fixture->createSuperUser = false;
+ $fixture->configureComponents = false;
+ }
+}
+
+IntegrationTestCase::$fixture = new Fixture(); \ No newline at end of file
diff --git a/tests/PHPUnit/Impl/SystemTestCase.php b/tests/PHPUnit/Impl/SystemTestCase.php
new file mode 100755
index 0000000000..222fc5a38f
--- /dev/null
+++ b/tests/PHPUnit/Impl/SystemTestCase.php
@@ -0,0 +1,581 @@
+<?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\Impl;
+
+use Exception;
+use Piwik\ArchiveProcessor\Rules;
+use Piwik\Common;
+use Piwik\Config;
+use Piwik\DataAccess\ArchiveTableCreator;
+use Piwik\Db;
+use Piwik\DbHelper;
+use Piwik\ReportRenderer;
+use Piwik\Translate;
+use Piwik\Tests\Impl\Fixture;
+use Piwik\Log;
+use PHPUnit_Framework_TestCase;
+
+require_once PIWIK_INCLUDE_PATH . '/libs/PiwikTracker/PiwikTracker.php';
+
+/**
+ * Base class for System tests.
+ *
+ * Provides helpers to track data and then call API get* methods to check outputs automatically.
+ *
+ */
+abstract class SystemTestCase extends PHPUnit_Framework_TestCase
+{
+ /**
+ * Identifies the last language used in an API/Controller call.
+ *
+ * @var string
+ */
+ protected $lastLanguage;
+
+ protected $missingExpectedFiles = array();
+ protected $comparisonFailures = array();
+
+ public static $fixture;
+
+ public static function setUpBeforeClass()
+ {
+ Log::debug("Setting up " . get_called_class());
+
+ if (!isset(static::$fixture)) {
+ $fixture = new Fixture();
+ } else {
+ $fixture = static::$fixture;
+ }
+
+ $fixture->testCaseClass = get_called_class();
+
+ try {
+ $fixture->performSetUp();
+ } catch (Exception $e) {
+ static::fail("Failed to setup fixture: " . $e->getMessage() . "\n" . $e->getTraceAsString());
+ }
+ }
+
+ public static function tearDownAfterClass()
+ {
+ Log::debug("Tearing down " . get_called_class());
+
+ if (!isset(static::$fixture)) {
+ $fixture = new Fixture();
+ } else {
+ $fixture = static::$fixture;
+ }
+
+ $fixture->performTearDown();
+ }
+
+ /**
+ * Returns true if continuous integration running this request
+ * Useful to exclude tests which may fail only on this setup
+ */
+ public static function isTravisCI()
+ {
+ $travis = getenv('TRAVIS');
+ return !empty($travis);
+ }
+
+ public static function isPhpVersion53()
+ {
+ return strpos(PHP_VERSION, '5.3') === 0;
+ }
+
+ public static function isMysqli()
+ {
+ return getenv('MYSQL_ADAPTER') == 'MYSQLI';
+ }
+
+ protected function alertWhenImagesExcludedFromTests()
+ {
+ if (!Fixture::canImagesBeIncludedInScheduledReports()) {
+ $this->markTestSkipped(
+ 'Scheduled reports generated during integration tests will not contain the image graphs. ' .
+ 'For tests to generate images, use a machine with the following specifications : ' .
+ 'OS = '.Fixture::IMAGES_GENERATED_ONLY_FOR_OS.', PHP = '.Fixture::IMAGES_GENERATED_FOR_PHP .
+ ' and GD = ' . Fixture::IMAGES_GENERATED_FOR_GD
+ );
+ }
+ }
+
+ /**
+ * Return 4 Api Urls for testing scheduled reports :
+ * - one in HTML format with all available reports
+ * - one in PDF format with all available reports
+ * - two in SMS (one for each available report: MultiSites.getOne & MultiSites.getAll)
+ *
+ * @param string $dateTime eg '2010-01-01 12:34:56'
+ * @param string $period eg 'day', 'week', 'month', 'year'
+ * @return array
+ */
+ protected static function getApiForTestingScheduledReports($dateTime, $period)
+ {
+ $apiCalls = array();
+
+ // HTML Scheduled Report
+ array_push(
+ $apiCalls,
+ array(
+ 'ScheduledReports.generateReport',
+ array(
+ 'testSuffix' => '_scheduled_report_in_html_tables_only',
+ 'date' => $dateTime,
+ 'periods' => array($period),
+ 'format' => 'original',
+ 'fileExtension' => 'html',
+ 'otherRequestParameters' => array(
+ 'idReport' => 1,
+ 'reportFormat' => ReportRenderer::HTML_FORMAT,
+ 'outputType' => \Piwik\Plugins\ScheduledReports\API::OUTPUT_RETURN
+ )
+ )
+ )
+ );
+
+ // CSV Scheduled Report
+ array_push(
+ $apiCalls,
+ array(
+ 'ScheduledReports.generateReport',
+ array(
+ 'testSuffix' => '_scheduled_report_in_csv',
+ 'date' => $dateTime,
+ 'periods' => array($period),
+ 'format' => 'original',
+ 'fileExtension' => 'csv',
+ 'otherRequestParameters' => array(
+ 'idReport' => 1,
+ 'reportFormat' => ReportRenderer::CSV_FORMAT,
+ 'outputType' => \Piwik\Plugins\ScheduledReports\API::OUTPUT_RETURN
+ )
+ )
+ )
+ );
+
+ if (Fixture::canImagesBeIncludedInScheduledReports()) {
+ // PDF Scheduled Report
+ // tests/PHPUnit/System/processed/test_ecommerceOrderWithItems_scheduled_report_in_pdf_tables_only__ScheduledReports.generateReport_week.original.pdf
+ array_push(
+ $apiCalls,
+ array(
+ 'ScheduledReports.generateReport',
+ array(
+ 'testSuffix' => '_scheduled_report_in_pdf_tables_only',
+ 'date' => $dateTime,
+ 'periods' => array($period),
+ 'format' => 'original',
+ 'fileExtension' => 'pdf',
+ 'otherRequestParameters' => array(
+ 'idReport' => 1,
+ 'reportFormat' => ReportRenderer::PDF_FORMAT,
+ 'outputType' => \Piwik\Plugins\ScheduledReports\API::OUTPUT_RETURN
+ )
+ )
+ )
+ );
+ }
+
+ // SMS Scheduled Report, one site
+ array_push(
+ $apiCalls,
+ array(
+ 'ScheduledReports.generateReport',
+ array(
+ 'testSuffix' => '_scheduled_report_via_sms_one_site',
+ 'date' => $dateTime,
+ 'periods' => array($period),
+ 'format' => 'original',
+ 'fileExtension' => 'sms.txt',
+ 'otherRequestParameters' => array(
+ 'idReport' => 2,
+ 'outputType' => \Piwik\Plugins\ScheduledReports\API::OUTPUT_RETURN
+ )
+ )
+ )
+ );
+
+ // SMS Scheduled Report, all sites
+ array_push(
+ $apiCalls,
+ array(
+ 'ScheduledReports.generateReport',
+ array(
+ 'testSuffix' => '_scheduled_report_via_sms_all_sites',
+ 'date' => $dateTime,
+ 'periods' => array($period),
+ 'format' => 'original',
+ 'fileExtension' => 'sms.txt',
+ 'otherRequestParameters' => array(
+ 'idReport' => 3,
+ 'outputType' => \Piwik\Plugins\ScheduledReports\API::OUTPUT_RETURN
+ )
+ )
+ )
+ );
+
+ if (Fixture::canImagesBeIncludedInScheduledReports()) {
+ // HTML Scheduled Report with images
+ array_push(
+ $apiCalls,
+ array(
+ 'ScheduledReports.generateReport',
+ array(
+ 'testSuffix' => '_scheduled_report_in_html_tables_and_graph',
+ 'date' => $dateTime,
+ 'periods' => array($period),
+ 'format' => 'original',
+ 'fileExtension' => 'html',
+ 'otherRequestParameters' => array(
+ 'idReport' => 4,
+ 'reportFormat' => ReportRenderer::HTML_FORMAT,
+ 'outputType' => \Piwik\Plugins\ScheduledReports\API::OUTPUT_RETURN
+ )
+ )
+ )
+ );
+
+ // mail report with one row evolution based png graph
+ array_push(
+ $apiCalls,
+ array(
+ 'ScheduledReports.generateReport',
+ array(
+ 'testSuffix' => '_scheduled_report_in_html_row_evolution_graph',
+ 'date' => $dateTime,
+ 'periods' => array($period),
+ 'format' => 'original',
+ 'fileExtension' => 'html',
+ 'otherRequestParameters' => array(
+ 'idReport' => 5,
+ 'outputType' => \Piwik\Plugins\ScheduledReports\API::OUTPUT_RETURN
+ )
+ )
+ )
+ );
+ }
+
+ return $apiCalls;
+ }
+
+ protected function _testApiUrl($testName, $apiId, $requestUrl, $compareAgainst, $xmlFieldsToRemove = array(), $params = array())
+ {
+ list($processedFilePath, $expectedFilePath) =
+ $this->getProcessedAndExpectedPaths($testName, $apiId, $format = null, $compareAgainst);
+
+ $originalGET = $_GET;
+ $_GET = $requestUrl;
+ unset($_GET['serialize']);
+
+ $processedResponse = TestRequestResponse::loadFromApi($params, $requestUrl);
+ if (empty($compareAgainst)) {
+ $processedResponse->save($processedFilePath);
+ }
+
+ $_GET = $originalGET;
+
+ try {
+ $expectedResponse = TestRequestResponse::loadFromFile($expectedFilePath, $params, $requestUrl);
+ } catch (Exception $ex) {
+ $this->handleMissingExpectedFile($expectedFilePath, $processedResponse);
+ return;
+ }
+
+ try {
+ TestRequestResponse::assertEquals($expectedResponse, $processedResponse, "Differences with expected in '$processedFilePath'");
+ } catch (Exception $ex) {
+ $this->comparisonFailures[] = $ex;
+ }
+ }
+
+ private function handleMissingExpectedFile($expectedFilePath, TestRequestResponse $processedResponse)
+ {
+ $this->missingExpectedFiles[] = $expectedFilePath;
+
+ print("The expected file is not found at '$expectedFilePath'. The Processed response was:");
+ print("\n----------------------------\n\n");
+ var_dump($processedResponse->getResponseText());
+ print("\n----------------------------\n");
+ }
+
+ public static function assertApiResponseHasNoError($response)
+ {
+ if(!is_string($response)) {
+ $response = json_encode($response);
+ }
+ self::assertTrue(stripos($response, 'error') === false, "error in $response");
+ self::assertTrue(stripos($response, 'exception') === false, "exception in $response");
+ }
+
+ protected static function getProcessedAndExpectedDirs()
+ {
+ $path = static::getPathToTestDirectory();
+ $processedPath = $path . '/processed/';
+
+ if (!is_dir($processedPath)) {
+ mkdir($processedPath, $mode = 0777, $recursive = true);
+ }
+
+ if (!is_writable($processedPath)) {
+ self::fail('To run the tests, you need to give write permissions to the following directory (create it if '
+ . 'it doesn\'t exist).<code><br/>mkdir ' . $processedPath . '<br/>chmod 777 ' . $processedPath
+ . '</code><br/>');
+ }
+
+ return array($processedPath, $path . '/expected/');
+ }
+
+ private function getProcessedAndExpectedPaths($testName, $testId, $format = null, $compareAgainst = false)
+ {
+ $filenameSuffix = '__' . $testId;
+ if ($format) {
+ $filenameSuffix .= ".$format";
+ }
+
+ $processedFilename = $testName . $filenameSuffix;
+
+ $expectedFilename = $compareAgainst ? ('test_' . $compareAgainst) : $testName;
+ $expectedFilename .= $filenameSuffix;
+
+ list($processedDir, $expectedDir) = static::getProcessedAndExpectedDirs();
+
+ return array($processedDir . $processedFilename, $expectedDir . $expectedFilename);
+ }
+
+ /**
+ * Returns an array describing the API methods to call & compare with
+ * expected output.
+ *
+ * The returned array must be of the following format:
+ * <code>
+ * array(
+ * array('SomeAPI.method', array('testOption1' => 'value1', 'testOption2' => 'value2'),
+ * array(array('SomeAPI.method', 'SomeOtherAPI.method'), array(...)),
+ * .
+ * .
+ * .
+ * )
+ * </code>
+ *
+ * Valid test options are described in the ApiTestConfig class docs.
+ *
+ * All test options are optional, except 'idSite' & 'date'.
+ */
+ public function getApiForTesting()
+ {
+ return array();
+ }
+
+ /**
+ * Gets the string prefix used in the name of the expected/processed output files.
+ */
+ public static function getOutputPrefix()
+ {
+ $parts = explode("\\", get_called_class());
+ $result = end($parts);
+ $result = str_replace('Test_Piwik_Integration_', '', $result);
+ return $result;
+ }
+
+ /**
+ * Assert that the response of an API method call is the same as the contents in an
+ * expected file.
+ *
+ * @param string $api ie, `"UserSettings.getBrowser"`
+ * @param array $queryParams Query parameters to send to the API.
+ */
+ public function assertApiResponseEqualsExpected($apiMethod, $queryParams)
+ {
+ $this->runApiTests($apiMethod, array(
+ 'idSite' => $queryParams['idSite'],
+ 'date' => $queryParams['date'],
+ 'periods' => $queryParams['period'],
+ 'format' => isset($queryParams['format']) ? $queryParams['format'] : 'xml',
+ 'testSuffix' => '_' . $this->getName(), // TODO: instead of using a test suffix, the whole file name should just be the test method
+ 'otherRequestParameters' => $queryParams
+ ));
+ }
+
+ /**
+ * Runs API tests.
+ */
+ protected function runApiTests($api, $params)
+ {
+ $testConfig = new ApiTestConfig($params);
+
+ $testName = 'test_' . static::getOutputPrefix();
+ $this->missingExpectedFiles = array();
+ $this->comparisonFailures = array();
+
+ if ($testConfig->disableArchiving) {
+ Rules::$archivingDisabledByTests = true;
+ Config::getInstance()->General['browser_archiving_disabled_enforce'] = 1;
+ } else {
+ Rules::$archivingDisabledByTests = false;
+ Config::getInstance()->General['browser_archiving_disabled_enforce'] = 0;
+ }
+
+ if ($testConfig->language) {
+ $this->changeLanguage($testConfig->language);
+ }
+
+ $testRequests = new TestRequestCollection($api, $testConfig, $api);
+
+ foreach ($testRequests->getRequestUrls() as $apiId => $requestUrl) {
+ $this->_testApiUrl($testName . $testConfig->testSuffix, $apiId, $requestUrl, $testConfig->compareAgainst, $testConfig->xmlFieldsToRemove, $params);
+ }
+
+ // change the language back to en
+ if ($this->lastLanguage != 'en') {
+ $this->changeLanguage('en');
+ }
+
+ if (!empty($this->missingExpectedFiles)) {
+ $expectedDir = dirname(reset($this->missingExpectedFiles));
+ $this->fail(" ERROR: Could not find expected API output '"
+ . implode("', '", $this->missingExpectedFiles)
+ . "'. For new tests, to pass the test, you can copy files from the processed/ directory into"
+ . " $expectedDir after checking that the output is valid. %s ");
+ }
+
+ // Display as one error all sub-failures
+ if (!empty($this->comparisonFailures)) {
+ $this->printComparisonFailures();
+ throw reset($this->comparisonFailures);
+ }
+
+ return count($this->comparisonFailures) == 0;
+ }
+
+ private function printComparisonFailures()
+ {
+ $messages = '';
+ foreach ($this->comparisonFailures as $index => $failure) {
+ $msg = $failure->getMessage();
+ $msg = strtok($msg, "\n");
+ $messages .= "\n#" . ($index + 1) . ": " . $msg;
+ }
+ $messages .= " \n ";
+
+ print($messages);
+ }
+
+ /**
+ * changing the language within one request is a bit fancy
+ * in order to keep the core clean, we need a little hack here
+ *
+ * @param string $langId
+ */
+ protected function changeLanguage($langId)
+ {
+ if ($this->lastLanguage != $langId) {
+ $_GET['language'] = $langId;
+ Translate::reset();
+ Translate::reloadLanguage($langId);
+ }
+
+ $this->lastLanguage = $langId;
+ }
+
+ /**
+ * Path where expected/processed output files are stored.
+ */
+ public static function getPathToTestDirectory()
+ {
+ return dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'System';
+ }
+
+ /**
+ * Returns an array associating table names w/ lists of row data.
+ *
+ * @return array
+ */
+ protected static function getDbTablesWithData()
+ {
+ $result = array();
+ foreach (DbHelper::getTablesInstalled() as $tableName) {
+ $result[$tableName] = Db::fetchAll("SELECT * FROM `$tableName`");
+ }
+ return $result;
+ }
+
+ /**
+ * Truncates all tables then inserts the data in $tables into each
+ * mapped table.
+ *
+ * @param array $tables Array mapping table names with arrays of row data.
+ */
+ protected static function restoreDbTables($tables)
+ {
+ DbHelper::truncateAllTables();
+
+ // insert data
+ $existingTables = DbHelper::getTablesInstalled();
+ foreach ($tables as $table => $rows) {
+ // create table if it's an archive table
+ if (strpos($table, 'archive_') !== false && !in_array($table, $existingTables)) {
+ $tableType = strpos($table, 'archive_numeric') !== false ? 'archive_numeric' : 'archive_blob';
+
+ $createSql = DbHelper::getTableCreateSql($tableType);
+ $createSql = str_replace(Common::prefixTable($tableType), $table, $createSql);
+ Db::query($createSql);
+ }
+
+ if (empty($rows)) {
+ continue;
+ }
+
+ $rowsSql = array();
+ $bind = array();
+ foreach ($rows as $row) {
+ $values = array();
+ foreach ($row as $value) {
+ if (is_null($value)) {
+ $values[] = 'NULL';
+ } else if (is_numeric($value)) {
+ $values[] = $value;
+ } else if (!ctype_print($value)) {
+ $values[] = "x'" . bin2hex(substr($value, 1)) . "'";
+ } else {
+ $values[] = "?";
+ $bind[] = $value;
+ }
+ }
+
+ $rowsSql[] = "(" . implode(',', $values) . ")";
+ }
+
+ $sql = "INSERT INTO `$table` VALUES " . implode(',', $rowsSql);
+ Db::query($sql, $bind);
+ }
+ }
+
+ /**
+ * Drops all archive tables.
+ */
+ public static function deleteArchiveTables()
+ {
+ foreach (ArchiveTableCreator::getTablesArchivesInstalled() as $table) {
+ Log::debug("Dropping table $table");
+
+ Db::query("DROP TABLE IF EXISTS `$table`");
+ }
+
+ ArchiveTableCreator::refreshTableList($forceReload = true);
+ }
+
+ protected function skipWhenPhp53()
+ {
+ if(\Piwik\Tests\Impl\SystemTestCase::isPhpVersion53()) {
+ $this->markTestSkipped('Sometimes fail on php 5.3');
+ }
+ }
+}
diff --git a/tests/PHPUnit/Impl/TestRequestCollection.php b/tests/PHPUnit/Impl/TestRequestCollection.php
index 68cae0ff99..556ab1bb24 100644
--- a/tests/PHPUnit/Impl/TestRequestCollection.php
+++ b/tests/PHPUnit/Impl/TestRequestCollection.php
@@ -12,7 +12,6 @@ use Piwik\API\DocumentationGenerator;
use Piwik\API\Proxy;
use Piwik\API\Request;
use Piwik\UrlHelper;
-use Piwik\Tests\IntegrationTestCase;
use \Exception;
use \PHPUnit_Framework_Assert;
@@ -222,7 +221,7 @@ class TestRequestCollection
));
$content = $request->process();
- IntegrationTestCase::assertApiResponseHasNoError($content);
+ SystemTestCase::assertApiResponseHasNoError($content);
// find first row w/ subtable
foreach ($content as $row) {
diff --git a/tests/PHPUnit/Impl/TestRequestResponse.php b/tests/PHPUnit/Impl/TestRequestResponse.php
index bc2c56a337..026f2c43b4 100644
--- a/tests/PHPUnit/Impl/TestRequestResponse.php
+++ b/tests/PHPUnit/Impl/TestRequestResponse.php
@@ -9,7 +9,6 @@
namespace Piwik\Tests\Impl;
use Piwik\API\Request;
-use Piwik\Tests\IntegrationTestCase;
use PHPUnit_Framework_Assert as Asserts;
use Exception;
@@ -122,7 +121,7 @@ class TestRequestResponse
private function normalizeEncodingPhp533($apiResponse)
{
- if(!IntegrationTestCase::isPhpVersion53()
+ if(!SystemTestCase::isPhpVersion53()
|| strpos($apiResponse, '<result') === false) {
return $apiResponse;
}
diff --git a/tests/PHPUnit/Integration/AccessTest.php b/tests/PHPUnit/Integration/AccessTest.php
new file mode 100644
index 0000000000..aad0e22766
--- /dev/null
+++ b/tests/PHPUnit/Integration/AccessTest.php
@@ -0,0 +1,365 @@
+<?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\AuthResult;
+use Piwik\Tests\Impl\IntegrationTestCase;
+
+/**
+ * Class Core_AccessTest
+ *
+ * @group Core
+ */
+class Core_AccessTest extends IntegrationTestCase
+{
+ public function setUp()
+ {
+ parent::setUp();
+ Access::setSingletonInstance(null);
+ }
+
+ public function testGetListAccess()
+ {
+ $accessList = Access::getListAccess();
+ $shouldBe = array('noaccess', 'view', 'admin', 'superuser');
+ $this->assertEquals($shouldBe, $accessList);
+ }
+
+ public function testGetTokenAuthWithEmptyAccess()
+ {
+ $access = new Access();
+ $this->assertNull($access->getTokenAuth());
+ }
+
+ public function testGetLoginWithEmptyAccess()
+ {
+ $access = new Access();
+ $this->assertNull($access->getLogin());
+ }
+
+ public function testHasSuperUserAccessWithEmptyAccess()
+ {
+ $access = new Access();
+ $this->assertFalse($access->hasSuperUserAccess());
+ }
+
+ public function testHasSuperUserAccessWithSuperUserAccess()
+ {
+ $access = Access::getInstance();
+ $access->setSuperUserAccess(true);
+ $this->assertTrue($access->hasSuperUserAccess());
+ }
+
+ public function testHasSuperUserAccessWithNoSuperUserAccess()
+ {
+ $access = Access::getInstance();
+ $access->setSuperUserAccess(false);
+ $this->assertFalse($access->hasSuperUserAccess());
+ }
+
+ public function testGetSitesIdWithAtLeastViewAccessWithEmptyAccess()
+ {
+ $access = new Access();
+ $this->assertEmpty($access->getSitesIdWithAtLeastViewAccess());
+ }
+
+ public function testGetSitesIdWithAdminAccessWithEmptyAccess()
+ {
+ $access = new Access();
+ $this->assertEmpty($access->getSitesIdWithAdminAccess());
+ }
+
+ public function testGetSitesIdWithViewAccessWithEmptyAccess()
+ {
+ $access = new Access();
+ $this->assertEmpty($access->getSitesIdWithViewAccess());
+ }
+
+ /**
+ * @expectedException Piwik\NoAccessException
+ */
+ public function testCheckUserHasSuperUserAccessWithEmptyAccess()
+ {
+ $access = new Access();
+ $access->checkUserHasSuperUserAccess();
+ }
+
+ public function testCheckUserHasSuperUserAccessWithSuperUserAccess()
+ {
+ $access = Access::getInstance();
+ $access->setSuperUserAccess(true);
+ $access->checkUserHasSuperUserAccess();
+ }
+
+ /**
+ * @expectedException Piwik\NoAccessException
+ */
+ public function testCheckUserHasSomeAdminAccessWithEmptyAccess()
+ {
+ $access = new Access();
+ $access->checkUserHasSomeAdminAccess();
+ }
+
+ public function testCheckUserHasSomeAdminAccessWithSuperUserAccess()
+ {
+ $access = Access::getInstance();
+ $access->setSuperUserAccess(true);
+ $access->checkUserHasSomeAdminAccess();
+ }
+
+ public function testCheckUserHasSomeAdminAccessWithSomeAccess()
+ {
+ $mock = $this->getMock(
+ 'Piwik\Access',
+ array('getSitesIdWithAdminAccess')
+ );
+
+ $mock->expects($this->once())
+ ->method('getSitesIdWithAdminAccess')
+ ->will($this->returnValue(array(2, 9)));
+
+ $mock->checkUserHasSomeAdminAccess();
+ }
+
+ /**
+ * @expectedException Piwik\NoAccessException
+ */
+ public function testCheckUserHasSomeViewAccessWithEmptyAccess()
+ {
+ $access = new Access();
+ $access->checkUserHasSomeViewAccess();
+ }
+
+ public function testCheckUserHasSomeViewAccessWithSuperUserAccess()
+ {
+ $access = Access::getInstance();
+ $access->setSuperUserAccess(true);
+ $access->checkUserHasSomeViewAccess();
+ }
+
+ public function testCheckUserHasSomeViewAccessWithSomeAccess()
+ {
+ $mock = $this->getMock(
+ 'Piwik\Access',
+ array('getSitesIdWithAtLeastViewAccess')
+ );
+
+ $mock->expects($this->once())
+ ->method('getSitesIdWithAtLeastViewAccess')
+ ->will($this->returnValue(array(1, 2, 3, 4)));
+
+ $mock->checkUserHasSomeViewAccess();
+ }
+
+ /**
+ * @expectedException Piwik\NoAccessException
+ */
+ public function testCheckUserHasViewAccessWithEmptyAccessNoSiteIdsGiven()
+ {
+ $access = new Access();
+ $access->checkUserHasViewAccess(array());
+ }
+
+ public function testCheckUserHasViewAccessWithSuperUserAccess()
+ {
+ $access = Access::getInstance();
+ $access->setSuperUserAccess(true);
+ $access->checkUserHasViewAccess(array());
+ }
+
+ public function testCheckUserHasViewAccessWithSomeAccessSuccessIdSitesAsString()
+ {
+ $mock = $this->getMock(
+ 'Piwik\Access',
+ array('getSitesIdWithAtLeastViewAccess')
+ );
+
+ $mock->expects($this->once())
+ ->method('getSitesIdWithAtLeastViewAccess')
+ ->will($this->returnValue(array(1, 2, 3, 4)));
+
+ $mock->checkUserHasViewAccess('1,3');
+ }
+
+ public function testCheckUserHasViewAccessWithSomeAccessSuccessAllSites()
+ {
+ $mock = $this->getMock(
+ 'Piwik\Access',
+ array('getSitesIdWithAtLeastViewAccess')
+ );
+
+ $mock->expects($this->any())
+ ->method('getSitesIdWithAtLeastViewAccess')
+ ->will($this->returnValue(array(1, 2, 3, 4)));
+
+ $mock->checkUserHasViewAccess('all');
+ }
+
+ /**
+ * @expectedException Piwik\NoAccessException
+ */
+ public function testCheckUserHasViewAccessWithSomeAccessFailure()
+ {
+ $mock = $this->getMock(
+ 'Piwik\Access',
+ array('getSitesIdWithAtLeastViewAccess')
+ );
+
+ $mock->expects($this->once())
+ ->method('getSitesIdWithAtLeastViewAccess')
+ ->will($this->returnValue(array(1, 2, 3, 4)));
+
+ $mock->checkUserHasViewAccess(array(1, 5));
+ }
+
+ public function testCheckUserHasAdminAccessWithSuperUserAccess()
+ {
+ $access = Access::getInstance();
+ $access->setSuperUserAccess(true);
+ $access->checkUserHasAdminAccess(array());
+ }
+
+ /**
+ * @expectedException Piwik\NoAccessException
+ */
+ public function testCheckUserHasAdminAccessWithEmptyAccessNoSiteIdsGiven()
+ {
+ $access = new Access();
+ $access->checkUserHasViewAccess(array());
+ }
+
+ public function testCheckUserHasAdminAccessWithSomeAccessSuccessIdSitesAsString()
+ {
+ $mock = $this->getMock(
+ 'Piwik\Access',
+ array('getSitesIdWithAdminAccess')
+ );
+
+ $mock->expects($this->once())
+ ->method('getSitesIdWithAdminAccess')
+ ->will($this->returnValue(array(1, 2, 3, 4)));
+
+ $mock->checkUserHasAdminAccess('1,3');
+ }
+
+ public function testCheckUserHasAdminAccessWithSomeAccessSuccessAllSites()
+ {
+ $mock = $this->getMock(
+ 'Piwik\Access',
+ array('getSitesIdWithAdminAccess', 'getSitesIdWithAtLeastViewAccess')
+ );
+
+ $mock->expects($this->any())
+ ->method('getSitesIdWithAdminAccess')
+ ->will($this->returnValue(array(1, 2, 3, 4)));
+
+ $mock->expects($this->any())
+ ->method('getSitesIdWithAtLeastViewAccess')
+ ->will($this->returnValue(array(1, 2, 3, 4)));
+
+ $mock->checkUserHasAdminAccess('all');
+ }
+
+ /**
+ * @expectedException Piwik\NoAccessException
+ */
+ public function testCheckUserHasAdminAccessWithSomeAccessFailure()
+ {
+ $mock = $this->getMock(
+ 'Piwik\Access',
+ array('getSitesIdWithAdminAccess')
+ );
+
+ $mock->expects($this->once())
+ ->method('getSitesIdWithAdminAccess')
+ ->will($this->returnValue(array(1, 2, 3, 4)));
+
+ $mock->checkUserHasAdminAccess(array(1, 5));
+ }
+
+ public function testReloadAccessWithEmptyAuth()
+ {
+ $access = new Access();
+ $this->assertFalse($access->reloadAccess(null));
+ }
+
+ public function testReloadAccessWithEmptyAuthSuperUser()
+ {
+ $access = Access::getInstance();
+ $access->setSuperUserAccess(true);
+ $this->assertTrue($access->reloadAccess(null));
+ }
+
+ public function testReloadAccessWithMockedAuthValid()
+ {
+ $mock = $this->getMock('\\Piwik\\Auth', array('authenticate', 'getName', 'getTokenAuthSecret', 'getLogin', 'setTokenAuth', 'setLogin',
+ 'setPassword', 'setPasswordHash'));
+ $mock->expects($this->once())
+ ->method('authenticate')
+ ->will($this->returnValue(new AuthResult(AuthResult::SUCCESS, 'login', 'token')));
+
+ $mock->expects($this->any())->method('getName')->will($this->returnValue("test name"));
+
+ $access = Access::getInstance();
+ $this->assertTrue($access->reloadAccess($mock));
+ $this->assertFalse($access->hasSuperUserAccess());
+ }
+
+ public function test_doAsSuperUser_ChangesSuperUserAccessCorrectly()
+ {
+ Access::getInstance()->setSuperUserAccess(false);
+
+ $this->assertFalse(Access::getInstance()->hasSuperUserAccess());
+
+ Access::doAsSuperUser(function () {
+ Core_AccessTest::assertTrue(Access::getInstance()->hasSuperUserAccess());
+ });
+
+ $this->assertFalse(Access::getInstance()->hasSuperUserAccess());
+ }
+
+ public function test_doAsSuperUser_RemovesSuperUserAccess_IfExceptionThrown()
+ {
+ Access::getInstance()->setSuperUserAccess(false);
+
+ $this->assertFalse(Access::getInstance()->hasSuperUserAccess());
+
+ try {
+ Access::doAsSuperUser(function () {
+ throw new Exception();
+ });
+
+ $this->fail("Exception was not propagated by doAsSuperUser.");
+ } catch (Exception $ex)
+ {
+ // pass
+ }
+
+ $this->assertFalse(Access::getInstance()->hasSuperUserAccess());
+ }
+
+ public function test_doAsSuperUser_ReturnsCallbackResult()
+ {
+ $result = Access::doAsSuperUser(function () {
+ return 24;
+ });
+ $this->assertEquals(24, $result);
+ }
+
+ public function test_reloadAccess_DoesNotRemoveSuperUserAccess_IfUsedInDoAsSuperUser()
+ {
+ Access::getInstance()->setSuperUserAccess(false);
+
+ Access::doAsSuperUser(function () {
+ $access = Access::getInstance();
+
+ Core_AccessTest::assertTrue($access->hasSuperUserAccess());
+ $access->reloadAccess();
+ Core_AccessTest::assertTrue($access->hasSuperUserAccess());
+ });
+ }
+} \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/AnnotationsTest.php b/tests/PHPUnit/Integration/AnnotationsTest.php
deleted file mode 100755
index 9945b63902..0000000000
--- a/tests/PHPUnit/Integration/AnnotationsTest.php
+++ /dev/null
@@ -1,287 +0,0 @@
-<?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\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;
-
- public static function getOutputPrefix()
- {
- return 'annotations';
- }
-
- public function getApiForTesting()
- {
- $idSite1 = self::$fixture->idSite1;
-
- return array(
-
- // get
- array('Annotations.get', array('idSite' => $idSite1,
- 'date' => '2012-01-01',
- 'periods' => 'day',
- 'otherRequestParameters' => array('idNote' => 1))),
-
- // getAll
- array('Annotations.getAll', array('idSite' => $idSite1,
- 'date' => '2011-12-01',
- 'periods' => array('day', 'week', 'month'))),
- array('Annotations.getAll', array('idSite' => $idSite1,
- 'date' => '2012-01-01',
- 'periods' => array('year'))),
- array('Annotations.getAll', array('idSite' => $idSite1,
- 'date' => '2012-03-01',
- 'periods' => array('week'),
- 'otherRequestParameters' => array('lastN' => 6),
- 'testSuffix' => '_lastN')),
- array('Annotations.getAll', array('idSite' => $idSite1,
- 'date' => '2012-01-15,2012-02-15',
- 'periods' => array('range'),
- 'otherRequestParameters' => array('lastN' => 6),
- 'testSuffix' => '_range')),
- array('Annotations.getAll', array('idSite' => 'all',
- 'date' => '2012-01-01',
- 'periods' => array('month'),
- 'testSuffix' => '_multipleSites')),
-
- // getAnnotationCountForDates
- array('Annotations.getAnnotationCountForDates', array('idSite' => $idSite1,
- 'date' => '2011-12-01',
- 'periods' => array('day', 'week', 'month'))),
- array('Annotations.getAnnotationCountForDates', array('idSite' => $idSite1,
- 'date' => '2012-01-01',
- 'periods' => array('year'))),
- array('Annotations.getAnnotationCountForDates', array('idSite' => $idSite1,
- 'date' => '2012-03-01',
- 'periods' => array('week'),
- 'otherRequestParameters' => array('lastN' => 6),
- 'testSuffix' => '_lastN')),
- array('Annotations.getAnnotationCountForDates', array('idSite' => $idSite1,
- 'date' => '2012-01-15,2012-02-15',
- 'periods' => array('range'),
- 'otherRequestParameters' => array('lastN' => 6),
- 'testSuffix' => '_range')),
- array('Annotations.getAnnotationCountForDates', array('idSite' => 'all',
- 'date' => '2012-01-01',
- 'periods' => array('month'),
- 'testSuffix' => '_multipleSites')),
- );
- }
-
- /**
- * @dataProvider getApiForTesting
- */
- public function testApi($api, $params)
- {
- $this->runApiTests($api, $params);
- }
-
- public function testAddMultipleSitesFail()
- {
- try {
- API::getInstance()->add("1,2,3", "2012-01-01", "whatever");
- $this->fail("add should fail when given multiple sites in idSite");
- } catch (Exception $ex) {
- // pass
- }
- }
-
- public function testAddInvalidDateFail()
- {
- try {
- API::getInstance()->add(self::$fixture->idSite1, "invaliddate", "whatever");
- $this->fail("add should fail when given invalid date");
- } catch (Exception $ex) {
- // pass
- }
- }
-
- public function testSaveMultipleSitesFail()
- {
- try {
- API::getInstance()->save("1,2,3", 0);
- $this->fail("save should fail when given multiple sites");
- } catch (Exception $ex) {
- // pass
- }
- }
-
- public function testSaveInvalidDateFail()
- {
- try {
- API::getInstance()->save(self::$fixture->idSite1, 0, "invaliddate");
- $this->fail("save should fail when given an invalid date");
- } catch (Exception $ex) {
- // pass
- }
- }
-
- public function testSaveInvalidNoteIdFail()
- {
- try {
- API::getInstance()->save(self::$fixture->idSite1, -1);
- $this->fail("save should fail when given an invalid note id");
- } catch (Exception $ex) {
- // pass
- }
- }
-
- public function testDeleteMultipleSitesFail()
- {
- try {
- API::getInstance()->delete("1,2,3", 0);
- $this->fail("delete should fail when given multiple site IDs");
- } catch (Exception $ex) {
- // pass
- }
- }
-
- public function testDeleteInvalidNoteIdFail()
- {
- try {
- API::getInstance()->delete(self::$fixture->idSite1, -1);
- $this->fail("delete should fail when given an invalid site ID");
- } catch (Exception $ex) {
- // pass
- }
- }
-
- public function testGetMultipleSitesFail()
- {
- try {
- API::getInstance()->get("1,2,3", 0);
- $this->fail("get should fail when given multiple site IDs");
- } catch (Exception $ex) {
- // pass
- }
- }
-
- public function testGetInvalidNoteIdFail()
- {
- try {
- API::getInstance()->get(self::$fixture->idSite1, -1);
- $this->fail("get should fail when given an invalid note ID");
- } catch (Exception $ex) {
- // pass
- }
- }
-
- public function testSaveSuccess()
- {
- API::getInstance()->save(
- self::$fixture->idSite1, 0, $date = '2011-04-01', $note = 'new note text', $starred = 1);
-
- $expectedAnnotation = array(
- 'date' => '2011-04-01',
- 'note' => 'new note text',
- 'starred' => 1,
- 'user' => 'superUserLogin',
- 'idNote' => 0,
- 'canEditOrDelete' => true
- );
- $this->assertEquals($expectedAnnotation, API::getInstance()->get(self::$fixture->idSite1, 0));
- }
-
- public function testSaveNoChangesSuccess()
- {
- API::getInstance()->save(self::$fixture->idSite1, 1);
-
- $expectedAnnotation = array(
- 'date' => '2011-12-02',
- 'note' => '1: Site 1 annotation for 2011-12-02',
- 'starred' => 0,
- 'user' => 'superUserLogin',
- 'idNote' => 1,
- 'canEditOrDelete' => true
- );
- $this->assertEquals($expectedAnnotation, API::getInstance()->get(self::$fixture->idSite1, 1));
- }
-
- public function testDeleteSuccess()
- {
- API::getInstance()->delete(self::$fixture->idSite1, 1);
-
- try {
- API::getInstance()->get(self::$fixture->idSite1, 1);
- $this->fail("failed to delete annotation");
- } catch (Exception $ex) {
- // pass
- }
- }
-
- public function getPermissionsFailData()
- {
- return array(
- // getAll
- array(false, false, "module=API&method=Annotations.getAll&idSite=1&date=2012-01-01&period=year", true, "getAll should throw if user does not have view access"),
-
- // get
- array(false, false, "module=API&method=Annotations.get&idSite=1&idNote=0", true, "get should throw if user does not have view access"),
-
- // getAnnotationCountForDates
- array(false, false, "module=API&method=Annotations.getAnnotationCountForDates&idSite=1&date=2012-01-01&period=year", true, "getAnnotationCountForDates should throw if user does not have view access"),
-
- // add
- array(false, false, "module=API&method=Annotations.add&idSite=1&date=2011-02-01&note=whatever", true, "add should throw if user does not have view access"),
- array(false, true, "module=API&method=Annotations.add&idSite=1&date=2011-02-01&note=whatever2", false, "add should not throw if user has view access"),
- array(true, true, "module=API&method=Annotations.add&idSite=1&date=2011-02-01&note=whatever3", false, "add should not throw if user has admin access"),
-
- // save
- array(false, false, "module=API&method=Annotations.save&idSite=1&idNote=0&date=2011-03-01&note=newnote", true, "save should throw if user does not have view access"),
- array(false, true, "module=API&method=Annotations.save&idSite=1&idNote=0&date=2011-03-01&note=newnote", true, "save should throw if user has view access but did not edit note"),
- array(true, true, "module=API&method=Annotations.save&idSite=1&idNote=0&date=2011-03-01&note=newnote", false, "save should not throw if user has admin access"),
-
- // delete
- array(false, false, "module=API&method=Annotations.delete&idSite=1&idNote=0", true, "delete should throw if user does not have view access"),
- array(false, true, "module=API&method=Annotations.delete&idSite=1&idNote=0", true, "delete should throw if user does not have view access"),
- array(true, true, "module=API&method=Annotations.delete&idSite=1&idNote=0", false, "delete should not throw if user has admin access"),
- );
- }
-
- /**
- * @dataProvider getPermissionsFailData
- */
- public function testMethodPermissions($hasAdminAccess, $hasViewAccess, $request, $checkException, $failMessage)
- {
- // create fake access that denies user access
- $access = new FakeAccess();
- FakeAccess::$superUser = false;
- FakeAccess::$idSitesAdmin = $hasAdminAccess ? array(self::$fixture->idSite1) : array();
- FakeAccess::$idSitesView = $hasViewAccess ? array(self::$fixture->idSite1) : array();
- Access::setSingletonInstance($access);
-
- if ($checkException) {
- try {
- $request = new Request($request);
- $request->process();
- $this->fail($failMessage);
- } catch (Exception $ex) {
- // pass
- }
- } else {
- $request = new Request($request);
- $request->process();
-
- }
- }
-}
-
-AnnotationsTest::$fixture = new TwoSitesWithAnnotations(); \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/ApiGetReportMetadataTest.php b/tests/PHPUnit/Integration/ApiGetReportMetadataTest.php
deleted file mode 100755
index db49a8852b..0000000000
--- a/tests/PHPUnit/Integration/ApiGetReportMetadataTest.php
+++ /dev/null
@@ -1,92 +0,0 @@
-<?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\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 ApiGetReportMetadataTest extends IntegrationTestCase
-{
- public static $fixture = null; // initialized below class definition
-
- public function setUp()
- {
- parent::setUp();
-
- // From Piwik 1.5, we hide Goals.getConversions and other get* methods via @ignore, but we
- // ensure that they still work. This hack allows the API proxy to let us generate example
- // URLs for the ignored functions
- Proxy::getInstance()->setHideIgnoredFunctions(false);
- }
-
- public function tearDown()
- {
- parent::tearDown();
-
- // reset that value after the test
- Proxy::getInstance()->setHideIgnoredFunctions(true);
- }
-
- public static function getOutputPrefix()
- {
- return 'apiGetReportMetadata';
- }
-
- public function getApiForTesting()
- {
- $idSite = self::$fixture->idSite;
- $dateTime = self::$fixture->dateTime;
-
- return array(
- array('API', array('idSite' => $idSite, 'date' => $dateTime)),
-
- // test w/ hideMetricsDocs=true
- array('API.getMetadata', array('idSite' => $idSite, 'date' => $dateTime,
- 'apiModule' => 'Actions', 'apiAction' => 'get',
- 'testSuffix' => '_hideMetricsDoc',
- 'otherRequestParameters' => array('hideMetricsDoc' => 1))),
- array('API.getProcessedReport', array('idSite' => $idSite, 'date' => $dateTime,
- 'apiModule' => 'Actions', 'apiAction' => 'get',
- 'testSuffix' => '_hideMetricsDoc',
- 'otherRequestParameters' => array('hideMetricsDoc' => 1))),
-
- // Test w/ showRawMetrics=true
- array('API.getProcessedReport', array('idSite' => $idSite, 'date' => $dateTime,
- 'apiModule' => 'UserCountry', 'apiAction' => 'getCountry',
- 'testSuffix' => '_showRawMetrics',
- 'otherRequestParameters' => array('showRawMetrics' => 1))),
-
- // Test w/ showRawMetrics=true
- array('Actions.getPageTitles', array('idSite' => $idSite, 'date' => $dateTime,
- 'testSuffix' => '_pageTitleZeroString')),
-
- // test php renderer w/ array data
- array('API.getDefaultMetricTranslations', array('idSite' => $idSite, 'date' => $dateTime,
- 'format' => 'php', 'testSuffix' => '_phpRenderer')),
- );
- }
-
- /**
- * @dataProvider getApiForTesting
- */
- public function testApi($api, $params)
- {
- $this->runApiTests($api, $params);
- }
-}
-
-ApiGetReportMetadataTest::$fixture = new ThreeGoalsOnePageview(); \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/ApiGetReportMetadataYearTest.php b/tests/PHPUnit/Integration/ApiGetReportMetadataYearTest.php
deleted file mode 100755
index 44da8df449..0000000000
--- a/tests/PHPUnit/Integration/ApiGetReportMetadataYearTest.php
+++ /dev/null
@@ -1,52 +0,0 @@
-<?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\InvalidVisits;
-
-/**
- * test the Yearly metadata API response,
- * with no visits, with custom response language
- *
- * @group Integration
- * @group ApiGetReportMetadataYearTest
- */
-class ApiGetReportMetadataYearTest extends IntegrationTestCase
-{
- public static $fixture = null; // initialized below class definition
-
- public function getApiForTesting()
- {
- $params = array('idSite' => self::$fixture->idSite,
- 'date' => self::$fixture->dateTime,
- 'periods' => 'year',
- 'language' => 'fr');
- return array(
- array('API.getProcessedReport', $params),
- array('LanguagesManager.getAvailableLanguageNames', $params),
- array('SitesManager.getJavascriptTag', $params)
- );
- }
-
- public static function getOutputPrefix()
- {
- return 'apiGetReportMetadata_year';
- }
-
- /**
- * @dataProvider getApiForTesting
- */
- public function testApi($api, $params)
- {
- $this->runApiTests($api, $params);
- }
-}
-
-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
deleted file mode 100644
index 07cef4e5ff..0000000000
--- a/tests/PHPUnit/Integration/ArchiveCronTest.php
+++ /dev/null
@@ -1,167 +0,0 @@
-<?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\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,
- * Then call the API testing for "Browser archiving is disabled" (see disableArchiving)
- * 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 ArchiveCronTest extends IntegrationTestCase
-{
- public static $fixture = null; // initialized below class definition
-
- public function getApiForTesting()
- {
- $results = array();
-
- // First, API calls for Segmented reports
- // Disabling these tests as they randomly fail... This could actually be a bug.
- // FIXME - I have failed finding the cause for these test to randomly fail
- // eg.
-// foreach (self::$fixture->getDefaultSegments() as $segmentName => $info) {
-// $results[] = array('VisitsSummary.get', array('idSite' => 'all',
-// 'date' => '2012-08-09',
-// 'periods' => array('day', 'week', 'month', 'year'),
-// 'segment' => $info['definition'],
-// 'testSuffix' => '_' . $segmentName));
-//
-//
-// }
-
- // API Call Without segments
- // TODO uncomment week and year period
- $results[] = array('VisitsSummary.get', array('idSite' => 'all',
- 'date' => '2012-08-09',
- 'periods' => array('day', 'month', /* 'year', 'week' */)));
-
- $results[] = array('VisitsSummary.get', array('idSite' => 'all',
- 'date' => '2012-08-09',
- 'periods' => array('day', 'week', 'month', 'year'),
- 'segment' => 'browserCode==EP',
- 'testSuffix' => '_nonPreArchivedSegment'));
-
- $segments = array(ManySitesImportedLogs::SEGMENT_PRE_ARCHIVED,
- ManySitesImportedLogs::SEGMENT_PRE_ARCHIVED_CONTAINS_ENCODED
- );
- foreach($segments as $segment) {
- // TODO debugging travis
- continue;
-
- // Test with a pre-processed segment
- $results[] = array(array('VisitsSummary.get', 'Live.getLastVisitsDetails', 'VisitFrequency.get'),
- array('idSite' => '1',
- 'date' => '2012-08-09',
- 'periods' => array('day', 'year'),
- 'segment' => $segment,
- 'testSuffix' => '_preArchivedSegment'));
- }
-
- return $results;
- }
-
- public function testArchivePhpCron()
- {
- if(self::isPhpVersion53()) {
- $this->markTestSkipped('Fails on PHP 5.3 once in a blue moon.');
- }
-
- $this->setLastRunArchiveOptions();
- $output = $this->runArchivePhpCron();
-
- $this->compareArchivePhpOutputAgainstExpected($output);
-
- foreach ($this->getApiForTesting() as $testInfo) {
-
- list($api, $params) = $testInfo;
-
- if (!isset($params['testSuffix'])) {
- $params['testSuffix'] = '';
- }
- $params['testSuffix'] .= '_noOptions';
- $params['disableArchiving'] = true;
-
- $success = $this->runApiTests($api, $params);
-
- if (!$success) {
- var_dump($output);
- }
- }
- }
-
- private function setLastRunArchiveOptions()
- {
- $periodTypes = array('day', 'periods');
- $idSites = API::getInstance()->getAllSitesId();
-
- $daysAgoArchiveRanSuccessfully = 1500;
- $this->assertTrue($daysAgoArchiveRanSuccessfully > (\Piwik\CronArchive::ARCHIVE_SITES_WITH_TRAFFIC_SINCE / 86400));
- $time = Date::factory(self::$fixture->dateTime)->subDay($daysAgoArchiveRanSuccessfully)->getTimestamp();
-
- foreach ($periodTypes as $period) {
- foreach ($idSites as $idSite) {
- // lastRunKey() function inlined
- $lastRunArchiveOption = "lastRunArchive" . $period . "_" . $idSite;
- \Piwik\Option::set($lastRunArchiveOption, $time);
- }
- }
- }
-
- private function runArchivePhpCron()
- {
- $archivePhpScript = PIWIK_INCLUDE_PATH . '/tests/PHPUnit/proxy/archive.php';
- $urlToProxy = Fixture::getRootUrl() . 'tests/PHPUnit/proxy/index.php';
-
- // create the command
- $cmd = "php \"$archivePhpScript\" --url=\"$urlToProxy\" 2>&1";
-
- // run the command
- exec($cmd, $output, $result);
- if ($result !== 0 || stripos($result, "error")) {
- $message = 'This failed once after a lunar eclipse, and it has again randomly failed.';
- $message .= "\n\narchive cron failed: " . implode("\n", $output) . "\n\ncommand used: $cmd";
- $this->markTestSkipped($message);
- }
-
- return $output;
- }
-
- private function compareArchivePhpOutputAgainstExpected($output)
- {
- $output = implode("\n", $output);
-
- $fileName = 'test_ArchiveCronTest_archive_php_cron_output.txt';
- list($pathProcessed, $pathExpected) = static::getProcessedAndExpectedDirs();
-
- $expectedOutputFile = $pathExpected . $fileName;
- $processedFile = $pathProcessed . $fileName;
-
- file_put_contents($processedFile, $output);
-
- try {
- $this->assertTrue(is_readable($expectedOutputFile));
- $this->assertEquals(file_get_contents($expectedOutputFile), $output);
- } catch (Exception $ex) {
- $this->comparisonFailures[] = $ex;
- }
- }
-}
-
-ArchiveCronTest::$fixture = new ManySitesImportedLogs();
-ArchiveCronTest::$fixture->addSegments = true; \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/ArchiveInvalidationTest.php b/tests/PHPUnit/Integration/ArchiveInvalidationTest.php
deleted file mode 100644
index 1d04920a8c..0000000000
--- a/tests/PHPUnit/Integration/ArchiveInvalidationTest.php
+++ /dev/null
@@ -1,140 +0,0 @@
-<?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\API\Request;
-use Piwik\Config;
-use Piwik\Tests\Fixtures\VisitsTwoWebsitesWithAdditionalVisits;
-use Piwik\Tests\IntegrationTestCase;
-use Exception;
-
-/**
- * Track visits before website creation date and test that Piwik handles them correctly.
- *
- * This tests that the API method invalidateArchivedReports works correctly, that it deletes data:
- * - on one or multiple websites
- * - for a given set of dates (and optional period)
- *
- * @group Integration
- * @group ArchiveInvalidationTest
- */
-class ArchiveInvalidationTest extends IntegrationTestCase
-{
- public static $fixture = null; // initialized below class definition
-
- protected $suffix = '_NewDataShouldNotAppear';
-
- /**
- * @dataProvider getApiForTesting
- */
- public function testApi($api, $params)
- {
- $this->runApiTests($api, $params);
- }
-
- /**
- * This should NOT return data for old dates before website creation
- */
- public function getApiForTesting()
- {
- // We test a typical Numeric and a Recursive blob reports
- $apiToCall = array('VisitsSummary.get', 'Actions.getPageUrls');
-
- // Build tests for the 2 websites
- return array(
- array($apiToCall, array('idSite' => self::$fixture->idSite1,
- 'testSuffix' => 'Website' . self::$fixture->idSite1 . $this->suffix,
- 'date' => self::$fixture->dateTimeFirstDateWebsite1,
- 'periods' => 'month',
- 'setDateLastN' => 4, // 4months ahead
- 'otherRequestParameters' => array('expanded' => 1))
- ),
-
- array($apiToCall, array('idSite' => self::$fixture->idSite2,
- 'testSuffix' => 'Website' . self::$fixture->idSite2 . $this->suffix,
- 'date' => self::$fixture->dateTimeFirstDateWebsite2,
- 'periods' => 'month',
- 'segment' => 'pageUrl=@category/',
- 'setDateLastN' => 4, // 4months ahead
- 'otherRequestParameters' => array('expanded' => 1))
- ),
-
- array($apiToCall, array('idSite' => self::$fixture->idSite2,
- 'testSuffix' => 'Website' . self::$fixture->idSite2 . "_NewDataShouldNotAppear_BecauseWeekWasNotInvalidated",
- 'date' => self::$fixture->dateTimeFirstDateWebsite2,
- 'periods' => 'week',
- 'segment' => 'pageUrl=@category/',
- 'setDateLastN' => 4, // 4months ahead
- 'otherRequestParameters' => array('expanded' => 1))
- ),
- );
- }
-
- /**
- * @depends testApi
- * @dataProvider getApiForTesting
- */
- public function testSameApi($api, $params)
- {
- $this->setBrowserArchivingTriggering(0);
- self::$fixture->trackMoreVisits($params['idSite']);
-
- $this->invalidateTestArchives();
- $this->runApiTests($api, $params);
- }
-
- /**
- * @depends testApi
- * @depends testSameApi
- * @dataProvider getAnotherApiForTesting
- */
- public function testAnotherApi($api, $params)
- {
- $this->setBrowserArchivingTriggering(1);
-
- $this->runApiTests($api, $params);
- }
-
- /**
- * This is called after getApiToTest()
- * We invalidate old reports and check that data is now returned for old dates
- */
- public function getAnotherApiForTesting()
- {
- $this->suffix = '_NewDataShouldAppear';
- return $this->getApiForTesting();
- }
-
- public static function getOutputPrefix()
- {
- return 'Archive_Invalidation';
- }
-
- protected function setBrowserArchivingTriggering($value)
- {
- Config::getInstance()->General['enable_browser_archiving_triggering'] = $value;
- }
-
- protected function invalidateTestArchives()
- {
- $dateToInvalidate1 = new \DateTime(self::$fixture->dateTimeFirstDateWebsite1);
- $dateToInvalidate2 = new \DateTime(self::$fixture->dateTimeFirstDateWebsite2);
-
- $r = new Request("module=API&method=CoreAdminHome.invalidateArchivedReports&idSites=" . self::$fixture->idSite1 . "&dates=" . $dateToInvalidate1->format('Y-m-d'));
- $this->assertApiResponseHasNoError($r->process());
-
- // Days & Months reports only are invalidated and we test our weekly report will still show old data.
- $r = new Request("module=API&method=CoreAdminHome.invalidateArchivedReports&period=day&idSites=" . self::$fixture->idSite2 . "&dates=" . $dateToInvalidate2->format('Y-m-d'));
- $this->assertApiResponseHasNoError($r->process());
- $r = new Request("module=API&method=CoreAdminHome.invalidateArchivedReports&period=month&idSites=" . self::$fixture->idSite2 . "&dates=" . $dateToInvalidate2->format('Y-m-d'));
- $this->assertApiResponseHasNoError($r->process());
-
- }
-}
-
-ArchiveInvalidationTest::$fixture = new VisitsTwoWebsitesWithAdditionalVisits(); \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/ArchiveProcessingTest.php b/tests/PHPUnit/Integration/ArchiveProcessingTest.php
new file mode 100644
index 0000000000..88ec83bea6
--- /dev/null
+++ b/tests/PHPUnit/Integration/ArchiveProcessingTest.php
@@ -0,0 +1,508 @@
+<?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\ArchiveProcessor;
+use Piwik\ArchiveProcessor\Rules;
+use Piwik\Common;
+use Piwik\DataAccess\ArchiveTableCreator;
+use Piwik\Date;
+use Piwik\Db;
+use Piwik\Db\BatchInsert;
+use Piwik\Period;
+use Piwik\Piwik;
+use Piwik\Plugins\SitesManager\API;
+use Piwik\Segment;
+use Piwik\SettingsServer;
+use Piwik\Site;
+use Piwik\Tests\Impl\IntegrationTestCase;
+
+class Core_ArchiveProcessorTest extends ArchiveProcessor\Loader {
+
+ public function getParams()
+ {
+ return $this->params;
+ }
+ public function public_getMinTimeArchiveProcessed()
+ {
+ return $this->getMinTimeArchiveProcessed();
+ }
+ public function public_isArchiveTemporary()
+ {
+ return $this->isArchiveTemporary();
+ }
+}
+
+/**
+ * Class Core_ArchiveProcessorTest
+ *
+ * @group Core
+ */
+class Core_ArchiveProcessingTest extends IntegrationTestCase
+{
+ public function setUp()
+ {
+ parent::setUp();
+
+ // setup the access layer
+ $pseudoMockAccess = new FakeAccess;
+ FakeAccess::$superUser = true;
+ Access::setSingletonInstance($pseudoMockAccess);
+
+ ArchiveTableCreator::$tablesAlreadyInstalled = null;
+ }
+
+ public function tearDown()
+ {
+ Access::setSingletonInstance(null);
+ ArchiveTableCreator::$tablesAlreadyInstalled = null;
+ }
+
+ /**
+ * Creates a new website
+ *
+ * @param string $timezone
+ * @return Site
+ */
+ private function _createWebsite($timezone = 'UTC')
+ {
+ $idSite = API::getInstance()->addSite(
+ "site1",
+ array("http://piwik.net"),
+ $ecommerce = 0,
+ $siteSearch = 1, $searchKeywordParameters = null, $searchCategoryParameters = null,
+ $excludedIps = "",
+ $excludedQueryParameters = "",
+ $timezone);
+
+ Site::clearCache();
+ return new Site($idSite);
+ }
+
+ /**
+ * Creates a new ArchiveProcessor object
+ *
+ * @param string $periodLabel
+ * @param string $dateLabel
+ * @param string $siteTimezone
+ * @return \Core_ArchiveProcessorTest
+ */
+ private function _createArchiveProcessor($periodLabel, $dateLabel, $siteTimezone)
+ {
+ $site = $this->_createWebsite($siteTimezone);
+ $date = Date::factory($dateLabel);
+ $period = Period\Factory::build($periodLabel, $date);
+ $segment = new Segment('', $site->getId());
+
+ $params = new ArchiveProcessor\Parameters($site, $period, $segment);
+ return new \Core_ArchiveProcessorTest($params);
+ }
+
+ /**
+ * test of validity of an archive, for a month not finished
+ * @group Core
+ */
+ public function testInitCurrentMonth()
+ {
+ $siteTimezone = 'UTC+10';
+ $now = time();
+ // this test fails in the last 10 hours of the last day of the month
+ if(date('m', $now) != date('m', $now + 10 * 3600)) {
+ $this->markTestSkipped('testInitCurrentMonth will fail in the last hours of the month, skipping...');
+ }
+
+ $dateLabel = date('Y-m-d', $now);
+ $archiveProcessor = $this->_createArchiveProcessor('month', $dateLabel, $siteTimezone);
+ $archiveProcessor->time = $now;
+
+ // min finished timestamp considered when looking at archive timestamp
+ $timeout = Rules::getTodayArchiveTimeToLive();
+ $this->assertTrue($timeout >= 10);
+ $dateMinArchived = $now - $timeout;
+ $this->compareTimestamps($dateMinArchived, $archiveProcessor->public_getMinTimeArchiveProcessed());
+
+ $this->assertTrue($archiveProcessor->public_isArchiveTemporary());
+ }
+
+ private function compareTimestamps($expected, $processed)
+ {
+// $messageIfFails = Date::factory($expected)->getDatetime() . " != " . Date::factory($processed)->getDatetime();
+ $messageIfFails = "Expected [$expected] but got [$processed]";
+ $this->assertTrue( abs($expected-$processed) <=4 , $messageIfFails);
+ }
+
+ /**
+ * test of validity of an archive, for a month in the past
+ * @group Core
+ */
+ public function testInitDayInPast()
+ {
+ $archiveProcessor = $this->_createArchiveProcessor('day', '2010-01-01', 'UTC');
+
+ // min finished timestamp considered when looking at archive timestamp
+ $dateMinArchived = Date::factory('2010-01-02')->getTimestamp();
+ $this->assertEquals($dateMinArchived, $archiveProcessor->public_getMinTimeArchiveProcessed() + 1);
+
+ $this->assertEquals('2010-01-01 00:00:00', $archiveProcessor->getParams()->getDateStart()->getDateStartUTC());
+ $this->assertEquals('2010-01-01 23:59:59', $archiveProcessor->getParams()->getDateEnd()->getDateEndUTC());
+ $this->assertFalse($archiveProcessor->public_isArchiveTemporary());
+ }
+
+ /**
+ * test of validity of an archive, for a non UTC date in the past
+ * @group Core
+ */
+ public function testInitDayInPastNonUTCWebsite()
+ {
+ $timezone = 'UTC+5.5';
+ $archiveProcessor = $this->_createArchiveProcessor('day', '2010-01-01', $timezone);
+ // min finished timestamp considered when looking at archive timestamp
+ $dateMinArchived = Date::factory('2010-01-01 18:30:00');
+ $this->assertEquals($dateMinArchived->getTimestamp(), $archiveProcessor->public_getMinTimeArchiveProcessed() + 1);
+
+ $this->assertEquals('2009-12-31 18:30:00', $archiveProcessor->getParams()->getDateStart()->getDateStartUTC());
+ $this->assertEquals('2010-01-01 18:29:59', $archiveProcessor->getParams()->getDateEnd()->getDateEndUTC());
+ $this->assertFalse($archiveProcessor->public_isArchiveTemporary());
+ }
+
+ /**
+ * test of validity of an archive, for a non UTC month in the past
+ * @group Core
+ */
+ public function testInitMonthInPastNonUTCWebsite()
+ {
+ $timezone = 'UTC-5.5';
+ $archiveProcessor = $this->_createArchiveProcessor('month', '2010-01-02', $timezone);
+ // min finished timestamp considered when looking at archive timestamp
+ $dateMinArchived = Date::factory('2010-02-01 05:30:00');
+ $this->assertEquals($dateMinArchived->getTimestamp(), $archiveProcessor->public_getMinTimeArchiveProcessed() + 1);
+
+ $this->assertEquals('2010-01-01 05:30:00', $archiveProcessor->getParams()->getDateStart()->getDateStartUTC());
+ $this->assertEquals('2010-02-01 05:29:59', $archiveProcessor->getParams()->getDateEnd()->getDateEndUTC());
+ $this->assertFalse($archiveProcessor->public_isArchiveTemporary());
+ }
+
+ /**
+ * test of validity of an archive, for today's archive
+ * @group Core
+ */
+ public function testInitToday()
+ {
+ $now = time();
+ $siteTimezone = 'UTC-1';
+ $timestamp = Date::factory('now', $siteTimezone)->getTimestamp();
+ $dateLabel = date('Y-m-d', $timestamp);
+
+ Rules::setBrowserTriggerArchiving(true);
+
+ $archiveProcessor = $this->_createArchiveProcessor('day', $dateLabel, $siteTimezone);
+ $archiveProcessor->time = $now;
+
+ // we look at anything processed within the time to live range
+ $dateMinArchived = $now - Rules::getTodayArchiveTimeToLive();
+ $this->compareTimestamps($dateMinArchived, $archiveProcessor->public_getMinTimeArchiveProcessed() );
+ $this->assertTrue($archiveProcessor->public_isArchiveTemporary());
+
+ // when browsers don't trigger archives...
+ Rules::setBrowserTriggerArchiving(false);
+ // ...we force ArchiveProcessor to fetch any of the most recent archive
+ $dateMinArchived = false;
+
+ $this->compareTimestamps($dateMinArchived, $archiveProcessor->public_getMinTimeArchiveProcessed());
+
+ $this->assertEquals(date('Y-m-d', $timestamp) . ' 01:00:00', $archiveProcessor->getParams()->getDateStart()->getDateStartUTC());
+ $this->assertEquals(date('Y-m-d', $timestamp + 86400) . ' 00:59:59', $archiveProcessor->getParams()->getDateEnd()->getDateEndUTC());
+ $this->assertTrue($archiveProcessor->public_isArchiveTemporary());
+ }
+
+ /**
+ * test of validity of an archive, for today's archive with european timezone
+ * @group Core
+ */
+ public function testInitTodayEurope()
+ {
+ if (!SettingsServer::isTimezoneSupportEnabled()) {
+ $this->markTestSkipped('timezones needs to be supported');
+ }
+
+ $now = time();
+ $siteTimezone = 'Europe/Paris';
+ $timestamp = Date::factory('now', $siteTimezone)->getTimestamp();
+ $dateLabel = date('Y-m-d', $timestamp);
+
+ Rules::setBrowserTriggerArchiving(true);
+
+ $archiveProcessor = $this->_createArchiveProcessor('day', $dateLabel, $siteTimezone);
+ $archiveProcessor->time = $now;
+
+ // we look at anything processed within the time to live range
+ $dateMinArchived = $now - Rules::getTodayArchiveTimeToLive();
+ $this->compareTimestamps($dateMinArchived, $archiveProcessor->public_getMinTimeArchiveProcessed());
+ $this->assertTrue($archiveProcessor->public_isArchiveTemporary());
+
+ // when browsers don't trigger archives...
+ Rules::setBrowserTriggerArchiving(false);
+ // ...we force ArchiveProcessor to fetch any of the most recent archive
+ $dateMinArchived = false;
+
+ $this->compareTimestamps($dateMinArchived, $archiveProcessor->public_getMinTimeArchiveProcessed());
+
+ // this test varies with DST
+ $this->assertTrue($archiveProcessor->getParams()->getDateStart()->getDateStartUTC() == date('Y-m-d', $timestamp - 86400) . ' 22:00:00' ||
+ $archiveProcessor->getParams()->getDateStart()->getDateStartUTC() == date('Y-m-d', $timestamp - 86400) . ' 23:00:00');
+ $this->assertTrue($archiveProcessor->getParams()->getDateEnd()->getDateEndUTC() == date('Y-m-d', $timestamp) . ' 21:59:59' ||
+ $archiveProcessor->getParams()->getDateEnd()->getDateEndUTC() == date('Y-m-d', $timestamp) . ' 22:59:59');
+
+ $this->assertTrue($archiveProcessor->public_isArchiveTemporary());
+ }
+
+ /**
+ * test of validity of an archive, for today's archive with toronto's timezone
+ * @group Core
+ */
+ public function testInitTodayToronto()
+ {
+ if (!SettingsServer::isTimezoneSupportEnabled()) {
+ $this->markTestSkipped('timezones needs to be supported');
+ }
+
+ $now = time();
+ $siteTimezone = 'America/Toronto';
+ $timestamp = Date::factory('now', $siteTimezone)->getTimestamp();
+ $dateLabel = date('Y-m-d', $timestamp);
+
+ Rules::setBrowserTriggerArchiving(true);
+
+ $archiveProcessor = $this->_createArchiveProcessor('day', $dateLabel, $siteTimezone);
+ $archiveProcessor->time = $now;
+
+ // we look at anything processed within the time to live range
+ $dateMinArchived = $now - Rules::getTodayArchiveTimeToLive();
+ $this->compareTimestamps($dateMinArchived, $archiveProcessor->public_getMinTimeArchiveProcessed() );
+ $this->assertTrue($archiveProcessor->public_isArchiveTemporary());
+
+ // when browsers don't trigger archives...
+ Rules::setBrowserTriggerArchiving(false);
+ // ...we force ArchiveProcessor to fetch any of the most recent archive
+ $dateMinArchived = false;
+ $this->compareTimestamps($dateMinArchived, $archiveProcessor->public_getMinTimeArchiveProcessed());
+
+ // this test varies with DST
+ $this->assertTrue($archiveProcessor->getParams()->getDateStart()->getDateStartUTC() == date('Y-m-d', $timestamp) . ' 04:00:00' ||
+ $archiveProcessor->getParams()->getDateStart()->getDateStartUTC() == date('Y-m-d', $timestamp) . ' 05:00:00');
+ $this->assertTrue($archiveProcessor->getParams()->getDateEnd()->getDateEndUTC() == date('Y-m-d', $timestamp + 86400) . ' 03:59:59' ||
+ $archiveProcessor->getParams()->getDateEnd()->getDateEndUTC() == date('Y-m-d', $timestamp + 86400) . ' 04:59:59');
+
+ $this->assertTrue($archiveProcessor->public_isArchiveTemporary());
+ }
+
+ /**
+ * Testing batch insert
+ * @group Core
+ */
+ public function testTableInsertBatch()
+ {
+ $table = Common::prefixTable('site_url');
+ $data = $this->_getDataInsert();
+ try {
+ $didWeUseBulk = BatchInsert::tableInsertBatch($table,
+ array('idsite', 'url'),
+ $data,
+ $throwException = true);
+
+ } catch (Exception $e) {
+ $didWeUseBulk = $e->getMessage();
+ }
+ $this->_checkLoadDataInFileWasUsed($didWeUseBulk);
+
+ if ($didWeUseBulk === true) {
+ $this->_checkTableIsExpected($table, $data);
+
+ // INSERT again the bulk. Because we use keyword LOCAL the data will be REPLACED automatically (see mysql doc)
+ BatchInsert::tableInsertBatch($table, array('idsite', 'url'), $data);
+ $this->_checkTableIsExpected($table, $data);
+ }
+ }
+
+ protected function _checkLoadDataInFileWasUsed($didWeUseBulk)
+ {
+ static $skippedOnce = false;
+ if ($didWeUseBulk !== true
+ && $skippedOnce === false
+ ) {
+ $skippedOnce = true;
+ $this->fail(
+ 'Performance notice: LOAD DATA [LOCAL] INFILE query is not working, so Piwik will fallback to using plain INSERTs '
+ . ' which will result in a slightly slower Archiving process.'
+ . ". \n"
+ . ' 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 (https://github.com/piwik/piwik/issues/3605)"
+ );
+ }
+ return $didWeUseBulk;
+ }
+
+ /**
+ * Testing plain inserts
+ * @group Core
+ */
+ public function testTableInsertBatchIterate()
+ {
+ $table = Common::prefixTable('site_url');
+ $data = $this->_getDataInsert();
+ BatchInsert::tableInsertBatchIterate($table, array('idsite', 'url'), $data);
+ $this->_checkTableIsExpected($table, $data);
+
+ // If we insert AGAIN, expect to throw an error because the primary key already exists
+ try {
+ BatchInsert::tableInsertBatchIterate($table, array('idsite', 'url'), $data, $ignoreWhenDuplicate = false);
+ } catch (Exception $e) {
+ // However if we insert with keyword REPLACE, then the new data should be saved
+ BatchInsert::tableInsertBatchIterate($table, array('idsite', 'url'), $data, $ignoreWhenDuplicate = true);
+ $this->_checkTableIsExpected($table, $data);
+ return;
+ }
+ $this->fail('Exception expected');
+ }
+
+ /**
+ * Testing batch insert (BLOB)
+ * @group Core
+ */
+ public function testTableInsertBatchBlob()
+ {
+ $dateLabel = '2011-03-31';
+ $table = ArchiveTableCreator::getBlobTable(Date::factory($dateLabel));
+
+ $data = $this->_getBlobDataInsert();
+ try {
+ $didWeUseBulk = BatchInsert::tableInsertBatch($table,
+ array('idarchive', 'name', 'idsite', 'date1', 'date2', 'period', 'ts_archived', 'value'),
+ $data,
+ $throwException = true);
+ } catch (Exception $e) {
+ $didWeUseBulk = $e->getMessage();
+ }
+ $this->_checkLoadDataInFileWasUsed($didWeUseBulk);
+
+ // If bulk wasn't used the exception was caught and the INSERT didn't work
+ if ($didWeUseBulk === true) {
+ $this->_checkTableIsExpectedBlob($table, $data);
+ }
+ // INSERT again the bulk. Because we use keyword LOCAL the data will be REPLACED automatically (see mysql doc)
+ $didWeUseBulk = BatchInsert::tableInsertBatch($table, array('idarchive', 'name', 'idsite', 'date1', 'date2', 'period', 'ts_archived', 'value'), $data);
+ if ($didWeUseBulk === true) {
+ $this->_checkTableIsExpectedBlob($table, $data);
+ }
+ }
+
+ /**
+ * Testing plain inserts (BLOB)
+ * @group Core
+ */
+ public function testTableInsertBatchIterateBlob()
+ {
+ $dateLabel = '2011-03-31';
+ $table = ArchiveTableCreator::getBlobTable(Date::factory($dateLabel));
+
+ $data = $this->_getBlobDataInsert();
+ BatchInsert::tableInsertBatchIterate($table, array('idarchive', 'name', 'idsite', 'date1', 'date2', 'period', 'ts_archived', 'value'), $data);
+ $this->_checkTableIsExpectedBlob($table, $data);
+
+ // If we insert AGAIN, expect to throw an error because the primary key already exist
+ try {
+ BatchInsert::tableInsertBatchIterate($table, array('idarchive', 'name', 'idsite', 'date1', 'date2', 'period', 'ts_archived', 'value'), $data, $ignoreWhenDuplicate = false);
+ } catch (Exception $e) {
+ // However if we insert with keyword REPLACE, then the new data should be saved
+ BatchInsert::tableInsertBatchIterate($table, array('idarchive', 'name', 'idsite', 'date1', 'date2', 'period', 'ts_archived', 'value'), $data, $ignoreWhenDuplicate = true);
+ $this->_checkTableIsExpectedBlob($table, $data);
+ return;
+ }
+ $this->fail('Exception expected');
+ }
+
+ protected function _checkTableIsExpected($table, $data)
+ {
+ $fetched = Db::fetchAll('SELECT * FROM ' . $table);
+ foreach ($data as $id => $row) {
+ $this->assertEquals($fetched[$id]['idsite'], $data[$id][0], "record $id is not {$data[$id][0]}");
+ $this->assertEquals($fetched[$id]['url'], $data[$id][1], "Record $id bug, not {$data[$id][1]} BUT {$fetched[$id]['url']}");
+ }
+ }
+
+ protected function _checkTableIsExpectedBlob($table, $data)
+ {
+ $fetched = Db::fetchAll('SELECT * FROM ' . $table);
+ foreach ($data as $id => $row) {
+ $this->assertEquals($fetched[$id]['idarchive'], $data[$id][0], "record $id idarchive is not '{$data[$id][0]}'");
+ $this->assertEquals($fetched[$id]['name'], $data[$id][1], "record $id name is not '{$data[$id][1]}'");
+ $this->assertEquals($fetched[$id]['idsite'], $data[$id][2], "record $id idsite is not '{$data[$id][2]}'");
+ $this->assertEquals($fetched[$id]['date1'], $data[$id][3], "record $id date1 is not '{$data[$id][3]}'");
+ $this->assertEquals($fetched[$id]['date2'], $data[$id][4], "record $id date2 is not '{$data[$id][4]}'");
+ $this->assertEquals($fetched[$id]['period'], $data[$id][5], "record $id period is not '{$data[$id][5]}'");
+ $this->assertEquals($fetched[$id]['ts_archived'], $data[$id][6], "record $id ts_archived is not '{$data[$id][6]}'");
+ $this->assertEquals($fetched[$id]['value'], $data[$id][7], "record $id value is unexpected");
+ }
+ }
+
+ /*
+ * Schema for site_url table:
+ * site_url (
+ * idsite INTEGER(10) UNSIGNED NOT NULL,
+ * url VARCHAR(255) NOT NULL,
+ * PRIMARY KEY(idsite, url)
+ * )
+ */
+ protected function _getDataInsert()
+ {
+ return array(
+ array(1, 'test'),
+ array(2, 'te" \n st2'),
+ array(3, " \n \r \t test"),
+
+ // these aren't expected to work on a column of datatype VARCHAR
+// array(4, gzcompress( " \n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942")),
+// array(5, gzcompress('test4')),
+
+ array(6, 'test5'),
+ array(7, '简体中文'),
+ array(8, '"'),
+ array(9, "'"),
+ array(10, '\\'),
+ array(11, '\\"'),
+ array(12, '\\\''),
+ array(13, "\t"),
+ array(14, "test \x00 null"),
+ array(15, "\x00\x01\x02\0x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"),
+ );
+ }
+
+ /**
+ * see archive_blob table
+ */
+ protected function _getBlobDataInsert()
+ {
+ $ts = '2011-03-31 17:48:00';
+ $str = '';
+ for ($i = 0; $i < 256; $i++) {
+ $str .= chr($i);
+ }
+ $array[] = array(1, 'bytes 0-255', 1, '2011-03-31', '2011-03-31', Piwik::$idPeriods['day'], $ts, $str);
+
+ $array[] = array(2, 'compressed string', 1, '2011-03-31', '2011-03-31', Piwik::$idPeriods['day'], $ts, gzcompress(" \n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942"));
+
+ $str = file_get_contents(PIWIK_PATH_TEST_TO_ROOT . '/tests/resources/lipsum.txt');
+ $array[] = array(3, 'lorem ipsum', 1, '2011-03-31', '2011-03-31', Piwik::$idPeriods['day'], $ts, $str);
+
+ $array[] = array(4, 'lorem ipsum compressed', 1, '2011-03-31', '2011-03-31', Piwik::$idPeriods['day'], $ts, gzcompress($str));
+
+ return $array;
+ }
+}
diff --git a/tests/PHPUnit/Integration/ArchiveWebTest.php b/tests/PHPUnit/Integration/ArchiveWebTest.php
deleted file mode 100644
index 3d3d04acac..0000000000
--- a/tests/PHPUnit/Integration/ArchiveWebTest.php
+++ /dev/null
@@ -1,79 +0,0 @@
-<?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\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.
- *
- * @group Integration
- * @group ArchiveWebTest
- */
-class ArchiveWebTest extends IntegrationTestCase
-{
- public static $fixture = null; // initialized below class definition
-
- public function testWebArchiving()
- {
- if(self::isMysqli() && self::isTravisCI()) {
- $this->markTestSkipped('Skipping on Mysqli as it randomly fails.');
- }
-
- $host = Fixture::getRootUrl();
- $token = Fixture::getTokenAuth();
-
- $urlTmp = Option::get('piwikUrl');
- Option::set('piwikUrl', $host . 'tests/PHPUnit/proxy/index.php');
-
- $url = $host . 'tests/PHPUnit/proxy/archive.php?token_auth=' . $token;
- $output = Http::sendHttpRequest($url, 600);
-
- // ignore random build issues
- if (empty($output) || strpos($output, \Piwik\CronArchive::NO_ERROR) === false) {
- $message = "This test has failed. Because it sometimes randomly fails, we skip the test, and ignore this failure.\n";
- $message .= "If you see this message often, or in every build, please investigate as this should only be a random and rare occurence!\n";
- $message .= "\n\narchive web failed: " . $output . "\n\nurl used: $url";
- $this->markTestSkipped($message);
- }
-
- if (!empty($urlTmp)) {
- Option::set('piwikUrl', $urlTmp);
- } else {
- Option::delete('piwikUrl');
- }
-
- $this->assertContains('Starting Piwik reports archiving...', $output);
- $this->assertContains('Archived website id = 1', $output);
- $this->assertContains('Done archiving!', $output);
- $this->compareArchivePhpOutputAgainstExpected($output);
- }
-
- private function compareArchivePhpOutputAgainstExpected($output)
- {
- $fileName = 'test_ArchiveCronTest_archive_php_cron_output.txt';
- list($pathProcessed, $pathExpected) = static::getProcessedAndExpectedDirs();
-
- $expectedOutputFile = $pathExpected . $fileName;
-
- try {
- $this->assertTrue(is_readable($expectedOutputFile));
- $this->assertEquals(file_get_contents($expectedOutputFile), $output);
- } catch (Exception $ex) {
- $this->comparisonFailures[] = $ex;
- }
- }
-}
-
-ArchiveWebTest::$fixture = new ManySitesImportedLogs();
-ArchiveWebTest::$fixture->addSegments = true; \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/AssetManager/UIAssetMinifierTest.php b/tests/PHPUnit/Integration/AssetManager/UIAssetMinifierTest.php
new file mode 100644
index 0000000000..1ece0ca556
--- /dev/null
+++ b/tests/PHPUnit/Integration/AssetManager/UIAssetMinifierTest.php
@@ -0,0 +1,55 @@
+<?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\AssetManager\UIAsset\OnDiskUIAsset;
+use Piwik\AssetManager\UIAssetMinifier;
+
+class Piwik_Test_UIAssetMinifierTest extends PHPUnit_Framework_TestCase
+{
+
+ /**
+ * @var UIAssetMinifier
+ */
+ private $assetMinifier;
+
+ public function setUp()
+ {
+ $this->assetMinifier = UIAssetMinifier::getInstance();
+ }
+
+ public function provider_isMinifiedJs()
+ {
+ return array(
+ array('libs/jquery/jquery.js', true),
+ array('libs/jquery/jquery-ui.js', true),
+ array('libs/jquery/jquery.browser.js', true),
+ array('libs/jqplot/jqplot-custom.min.js', true),
+ array('plugins/TreemapVisualization/libs/Jit/jit-2.0.1-yc.js', true),
+ array('plugins/TreemapVisualization/javascripts/treemapViz.js', false),
+ array('plugins/UserCountryMap/javascripts/vendor/raphael.min.js', true),
+ array('plugins/UserCountryMap/javascripts/vendor/jquery.qtip.min.js', true),
+ array('plugins/UserCountryMap/javascripts/vendor/kartograph.min.js', true),
+ array('plugins/UserCountryMap/javascripts/vendor/jquery.qtip.min.js', true),
+ );
+ }
+
+ /**
+ * @group Core
+ * @dataProvider provider_isMinifiedJs
+ */
+ public function test_isMinifiedJs($scriptFileName, $isMinified)
+ {
+ $scriptFile = new OnDiskUIAsset(PIWIK_USER_PATH, $scriptFileName);
+
+ $this->assertEquals(
+ $isMinified,
+ $this->assetMinifier->isMinifiedJs($scriptFile->getContent())
+ );
+ }
+}
diff --git a/tests/PHPUnit/Integration/AutoSuggestAPITest.php b/tests/PHPUnit/Integration/AutoSuggestAPITest.php
deleted file mode 100644
index 564414e33c..0000000000
--- a/tests/PHPUnit/Integration/AutoSuggestAPITest.php
+++ /dev/null
@@ -1,148 +0,0 @@
-<?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\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 AutoSuggestAPITest extends IntegrationTestCase
-{
- public static $fixture = null; // initialized below class definition
-
- protected static $processed = 0;
- protected static $skipped = array();
-
- /**
- * @dataProvider getApiForTesting
- */
- public function testApi($api, $params)
- {
- if(self::isPhpVersion53() && self::isTravisCI()) {
- $this->markTestSkipped("Skipping this test as it seg faults on php 5.3 (bug triggered on travis)");
- }
-
- $this->runApiTests($api, $params);
- }
-
- public function getApiForTesting()
- {
- // we will test all segments from all plugins
- Fixture::loadAllPlugins();
-
- $idSite = self::$fixture->idSite;
- $apiForTesting = array();
-
- $segments = \Piwik\Plugins\API\API::getInstance()->getSegmentsMetadata(self::$fixture->idSite);
- foreach ($segments as $segment) {
- $apiForTesting[] = $this->getApiForTestingForSegment($idSite, $segment['segment']);
- }
-
- if (self::isMysqli() || self::isTravisCI()) {
- // Skip the test on Mysqli as it fails due to rounding Float errors on latitude/longitude
- // then the test started failing after bc19503 and I cannot understand why
- echo "Skipped test \n";
- } else {
- $apiForTesting[] = array('Live.getLastVisitsDetails',
- array('idSite' => $idSite,
- 'date' => '1998-07-12,today',
- 'period' => 'range',
- 'otherRequestParameters' => array('filter_limit' => 1000)));
-
- }
- return $apiForTesting;
- }
-
- /**
- * @param $idSite
- * @param $segment
- * @return array
- */
- protected function getApiForTestingForSegment($idSite, $segment)
- {
- return array('API.getSuggestedValuesForSegment',
- array('idSite' => $idSite,
- 'testSuffix' => '_' . $segment,
- 'otherRequestParameters' => array('segmentName' => $segment)));
- }
-
- /**
- * @depends testApi
- * @dataProvider getAnotherApiForTesting
- */
- public function testAnotherApi($api, $params)
- {
- // Get the top segment value
- $request = new Request(
- 'method=API.getSuggestedValuesForSegment'
- . '&segmentName=' . $params['segmentToComplete']
- . '&idSite=' . $params['idSite']
- . '&format=php&serialize=0'
- );
- $response = $request->process();
- $this->assertApiResponseHasNoError($response);
- $topSegmentValue = @$response[0];
-
- if ($topSegmentValue !== false && !is_null($topSegmentValue)) {
- // Now build the segment request
- $segmentValue = rawurlencode(html_entity_decode($topSegmentValue));
- $params['segment'] = $params['segmentToComplete'] . '==' . $segmentValue;
- unset($params['segmentToComplete']);
- $this->runApiTests($api, $params);
- self::$processed++;
- } else {
- self::$skipped[] = $params['segmentToComplete'];
- }
-
- }
-
- public function getAnotherApiForTesting()
- {
- $apiForTesting = array();
- $segments = \Piwik\Plugins\API\API::getInstance()->getSegmentsMetadata(self::$fixture->idSite);
- foreach ($segments as $segment) {
- if(self::isTravisCI() && $segment['segment'] == 'deviceType') {
- // test started failing after bc19503 and I cannot understand why
- continue;
- }
- $apiForTesting[] = array('VisitsSummary.get',
- array('idSite' => self::$fixture->idSite,
- 'date' => date("Y-m-d", strtotime(self::$fixture->dateTime)) . ',today',
- 'period' => 'range',
- 'testSuffix' => '_' . $segment['segment'],
- 'segmentToComplete' => $segment['segment']));
- }
- return $apiForTesting;
- }
-
- /**
- * @depends testAnotherApi
- */
- public function testCheckOtherTestsWereComplete()
- {
- // Check that only a few haven't been tested specifically (these are all custom variables slots since we only test slot 1, 2, 5 (see the fixture) and example dimension slots)
- $maximumSegmentsToSkip = 16;
- $this->assertTrue(count(self::$skipped) <= $maximumSegmentsToSkip, 'SKIPPED ' . count(self::$skipped) . ' segments --> some segments had no "auto-suggested values"
- but we should try and test the autosuggest for all new segments. Segments skipped were: ' . implode(', ', self::$skipped));
-
- // and check that most others have been tested
- $minimumSegmentsToTest = 46;
- $this->assertTrue(self::$processed >= $minimumSegmentsToTest, 'PROCESSED ' . self::$processed . ' segments --> it seems some segments "auto-suggested values" haven\'t been tested as we were expecting');
- }
-}
-
-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
deleted file mode 100644
index c931a4fcb8..0000000000
--- a/tests/PHPUnit/Integration/BackwardsCompatibility1XTest.php
+++ /dev/null
@@ -1,137 +0,0 @@
-<?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\Plugins\VisitFrequency\API as VisitFrequencyApi;
-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 BackwardsCompatibility1XTest extends IntegrationTestCase
-{
- const FIXTURE_LOCATION = '/tests/resources/piwik-1.13-dump.sql';
-
- public static $fixture = null; // initialized below class
-
- public static function setUpBeforeClass()
- {
- parent::setUpBeforeClass();
-
- // note: not sure why I have to manually install plugin
- \Piwik\Plugin\Manager::getInstance()->loadPlugin('CustomAlerts')->install();
-
- $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) {
- Db::query("TRUNCATE TABLE " . Common::prefixTable($table));
- }
-
- self::trackTwoVisitsOnSameDay();
-
- // launch archiving
- VisitFrequencyApi::getInstance()->get(1, 'year', '2012-12-29');
- }
-
-
- /**
- * add two visits from same visitor on dec. 29
- */
- private static function trackTwoVisitsOnSameDay()
- {
- $t = Fixture::getTracker(1, '2012-12-29 01:01:30', $defaultInit = true, $useLocal = true);
- $t->enableBulkTracking();
-
- $t->setUrl('http://site.com/index.htm');
- $t->setIp('136.5.3.2');
- $t->doTrackPageView('incredible title!');
-
- $t->setForceVisitDateTime('2012-12-29 03:01:30');
- $t->setUrl('http://site.com/other/index.htm');
- $t->DEBUG_APPEND_URL = '&_idvc=2'; // make sure visit is marked as returning
- $t->doTrackPageView('other incredible title!');
-
- $t->doBulkTrack();
- }
-
- /**
- * @dataProvider getApiForTesting
- */
- public function testApi($api, $params)
- {
- // note: not sure why I have to manually activate plugin in order for `./console tests:run BackwardsCompatibility1XTest` to work
- try {
- \Piwik\Plugin\Manager::getInstance()->activatePlugin('DevicesDetection');
- } catch(\Exception $e) {
- }
-
- $this->runApiTests($api, $params);
- }
-
- public function getApiForTesting()
- {
- $idSite = 1;
- $dateTime = '2012-03-06 11:22:33';
-
- $apiNotToCall = array(
- // in the SQL dump, a referrer is named referer.com, but now in OneVisitorTwoVisits it is referrer.com
- 'Referrers',
-
- // changes made to SQL dump to test VisitFrequency change the day of week
- 'VisitTime.getByDayOfWeek',
-
- // did not exist in Piwik 1.X
- 'DevicesDetection.getBrowserEngines',
-
- // we test VisitFrequency explicitly
- 'VisitFrequency.get',
-
- // the Action.getPageTitles test fails for unknown reason, so skipping it
- // eg. https://travis-ci.org/piwik/piwik/jobs/24449365
- 'Action.getPageTitles'
- );
-
- return array(
- array('all', array('idSite' => $idSite, 'date' => $dateTime,
- 'compareAgainst' => 'OneVisitorTwoVisits',
- 'disableArchiving' => true,
- 'apiNotToCall' => $apiNotToCall,
- 'otherRequestParameters' => array(
- 'hideColumns' => 'nb_users',
- ))),
-
- array('VisitFrequency.get', array('idSite' => $idSite, 'date' => '2012-03-03', 'setDateLastN' => true,
- 'disableArchiving' => true, 'testSuffix' => '_multipleDates')),
-
- array('VisitFrequency.get', array('idSite' => $idSite, 'date' => $dateTime,
- 'periods' => array('day', 'week', 'month', 'year'),
- 'disableArchiving' => false)),
-
- array('VisitFrequency.get', array('idSite' => $idSite, 'date' => '2012-03-06,2012-12-31',
- 'periods' => array('range'), 'disableArchiving' => true)),
-
- array('VisitFrequency.get', array('idSite' => $idSite, 'date' => '2012-03-03,2012-12-12', 'periods' => array('month'),
- 'testSuffix' => '_multipleOldNew', 'disableArchiving' => true))
- );
- }
-}
-
-BackwardsCompatibility1XTest::$fixture = new SqlDump();
-BackwardsCompatibility1XTest::$fixture->dumpUrl = PIWIK_INCLUDE_PATH . BackwardsCompatibility1XTest::FIXTURE_LOCATION;
-BackwardsCompatibility1XTest::$fixture->tablesPrefix = '';
diff --git a/tests/PHPUnit/Integration/BlobReportLimitingTest.php b/tests/PHPUnit/Integration/BlobReportLimitingTest.php
deleted file mode 100755
index b0aa0731a2..0000000000
--- a/tests/PHPUnit/Integration/BlobReportLimitingTest.php
+++ /dev/null
@@ -1,166 +0,0 @@
-<?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\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 BlobReportLimitingTest extends IntegrationTestCase
-{
- public static $fixture = null; // initialized below class definition
-
- public static function setUpBeforeClass()
- {
- self::setUpConfigOptions();
- parent::setUpBeforeClass();
- }
-
- public function getApiForTesting()
- {
- // TODO: test Provider plugin? Not sure if it's possible.
- $apiToCall = array(
- 'Actions.getPageUrls', 'Actions.getPageTitles', 'Actions.getDownloads', 'Actions.getOutlinks',
- 'CustomVariables.getCustomVariables',
- 'Referrers.getReferrerType', 'Referrers.getKeywords', 'Referrers.getSearchEngines',
- 'Referrers.getWebsites', 'Referrers.getAll', /* TODO 'Referrers.getCampaigns', */
- 'UserSettings.getResolution', 'UserSettings.getConfiguration', 'UserSettings.getOS',
- 'UserSettings.getBrowserVersion',
- 'UserCountry.getRegion', 'UserCountry.getCity',
- );
-
- $ecommerceApi = array('Goals.getItemsSku', 'Goals.getItemsName', 'Goals.getItemsCategory');
-
- return array(
- array($apiToCall, array('idSite' => self::$fixture->idSite,
- 'date' => self::$fixture->dateTime,
- 'periods' => array('day'))),
-
- array($ecommerceApi, array('idSite' => self::$fixture->idSite,
- 'date' => self::$fixture->nextDay,
- 'periods' => 'day')),
- );
- }
-
- public function getRankingQueryDisabledApiForTesting()
- {
- $idSite = self::$fixture->idSite;
- $dateTime = self::$fixture->dateTime;
-
- return array(
- array('Actions.getPageUrls', array('idSite' => $idSite,
- 'date' => $dateTime,
- 'periods' => array('day'))),
-
- array('Provider.getProvider', array('idSite' => $idSite,
- 'date' => $dateTime,
- 'periods' => array('month'))),
-
- array('Provider.getProvider', array('idSite' => $idSite,
- 'date' => $dateTime,
- 'periods' => array('month'),
- 'segment' => 'provider==comcast.net',
- 'testSuffix' => '_segment_provider')),
-
- // test getDownloads w/ period=range & flat=1
- array('Actions.getDownloads', array('idSite' => $idSite,
- 'date' => '2010-01-02,2010-01-05',
- 'periods' => 'range',
- 'testSuffix' => '_rangeFlat',
- 'otherRequestParameters' => array(
- 'flat' => 1,
- 'expanded' => 0
- ))),
- );
- }
-
- /**
- * @dataProvider getApiForTesting
- */
- public function testApi($api, $params)
- {
- $this->runApiTests($api, $params);
- }
-
- public function testApiWithRankingQuery()
- {
- // custom setup
- self::deleteArchiveTables();
- Config::getInstance()->General['archiving_ranking_query_row_limit'] = 3;
- ArchivingHelper::reloadConfig();
-
- foreach ($this->getApiForTesting() as $pair) {
- list($apiToCall, $params) = $pair;
-
- if (empty($params['testSuffix'])) {
- $params['testSuffix'] = '';
- }
- $params['testSuffix'] .= '_rankingQuery';
-
- $this->runApiTests($apiToCall, $params);
- }
- }
-
- public function testApiWithRankingQueryDisabled()
- {
- self::deleteArchiveTables();
- $generalConfig =& Config::getInstance()->General;
- $generalConfig['datatable_archiving_maximum_rows_referrers'] = 500;
- $generalConfig['datatable_archiving_maximum_rows_subtable_referrers'] = 500;
- $generalConfig['datatable_archiving_maximum_rows_actions'] = 500;
- $generalConfig['datatable_archiving_maximum_rows_subtable_actions'] = 500;
- $generalConfig['datatable_archiving_maximum_rows_standard'] = 500;
- $generalConfig['datatable_archiving_maximum_rows_custom_variables'] = 500;
- $generalConfig['datatable_archiving_maximum_rows_subtable_custom_variables'] = 500;
- $generalConfig['archiving_ranking_query_row_limit'] = 0;
-
- foreach ($this->getRankingQueryDisabledApiForTesting() as $pair) {
- list($apiToCall, $params) = $pair;
-
- if (empty($params['testSuffix'])) {
- $params['testSuffix'] = '';
- }
- $params['testSuffix'] .= '_rankingQueryDisabled';
-
- $this->runApiTests($apiToCall, $params);
- }
- }
-
- public static function getOutputPrefix()
- {
- return 'reportLimiting';
- }
-
- protected static function setUpConfigOptions()
- {
- Config::getInstance()->setTestEnvironment();
-
- $generalConfig =& Config::getInstance()->General;
- $generalConfig['datatable_archiving_maximum_rows_referers'] = 3;
- $generalConfig['datatable_archiving_maximum_rows_subtable_referers'] = 2;
- $generalConfig['datatable_archiving_maximum_rows_actions'] = 4;
- $generalConfig['datatable_archiving_maximum_rows_custom_variables'] = 3;
- $generalConfig['datatable_archiving_maximum_rows_subtable_custom_variables'] = 2;
- $generalConfig['datatable_archiving_maximum_rows_subtable_actions'] = 2;
- $generalConfig['datatable_archiving_maximum_rows_standard'] = 3;
- $generalConfig['archiving_ranking_query_row_limit'] = 50000;
- }
-}
-
-BlobReportLimitingTest::$fixture = new ManyVisitsWithMockLocationProvider();
-BlobReportLimitingTest::$fixture->createConfig = false; \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/CliMultiTest.php b/tests/PHPUnit/Integration/CliMultiTest.php
new file mode 100644
index 0000000000..65df6b89ba
--- /dev/null
+++ b/tests/PHPUnit/Integration/CliMultiTest.php
@@ -0,0 +1,251 @@
+<?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\CliMulti;
+use Piwik\Version;
+use Piwik\Tests\Impl\SystemTestCase;
+use Piwik\Tests\Impl\Fixture;
+
+/**
+ * Class Core_CliMultiTest
+ *
+ * @group Core
+ */
+class Core_CliMultiTest extends SystemTestCase
+{
+ /**
+ * @var \Piwik\CliMulti
+ */
+ private $cliMulti;
+
+ /**
+ * @var string
+ */
+ private $authToken = '';
+
+ /**
+ * @var string[]
+ */
+ private $urls = array();
+
+ /**
+ * @var string[]
+ */
+ private $responses = array();
+
+ public function setUp()
+ {
+ parent::setUp();
+
+ $this->cliMulti = new CliMulti();
+ $this->authToken = Fixture::getTokenAuth();
+
+ $this->urls = array(
+ 'getAnswerToLife' => $this->completeUrl('?module=API&method=ExampleAPI.getAnswerToLife&format=JSON'),
+ 'getPiwikVersion' => $this->completeUrl('?module=API&method=API.getPiwikVersion&format=JSON'),
+ );
+
+ $this->responses = array(
+ 'getAnswerToLife' => '{"value":42}',
+ 'getPiwikVersion' => '{"value":"' . Version::VERSION . '"}'
+ );
+
+ \Piwik\Common::$isCliMode = true;
+ }
+
+ public function test_request_shouldNotFailAndReturnNoResponse_IfNoUrlsAreGiven()
+ {
+ $response = $this->cliMulti->request(array());
+
+ $this->assertEquals(array(), $response);
+ }
+
+ /**
+ * @expectedException \Exception
+ * @expectedExceptionMessage array
+ */
+ public function test_request_shouldFail_IfUrlsIsNotAnArray()
+ {
+ $this->cliMulti->request('');
+ }
+
+ public function test_request_shouldReturnResultAsArray_IfOnlyOneUrlIsGiven()
+ {
+ $urls = $this->buildUrls('getAnswerToLife');
+
+ $this->assertRequestReturnsValidResponses($urls, array('getAnswerToLife'));
+ }
+
+ public function test_request_shouldRunAsync()
+ {
+ $this->skipWhenPhp53();
+ $this->assertTrue($this->cliMulti->supportsAsync);
+ }
+
+ public function test_request_shouldRequestAllUrls_IfMultipleUrlsAreGiven()
+ {
+ $urls = $this->buildUrls('getPiwikVersion', 'getAnswerToLife');
+
+ $this->assertRequestReturnsValidResponses($urls, array('getPiwikVersion', 'getAnswerToLife'));
+ }
+
+ public function test_request_shouldRequestAllUrls_IfMultipleUrlsAreGiven_WithConcurrentRequestLimit()
+ {
+ $urls = $this->buildUrls('getPiwikVersion', 'getAnswerToLife', 'getPiwikVersion');
+
+ $this->cliMulti->setConcurrentProcessesLimit(1);
+ $this->assertRequestReturnsValidResponses($urls, array('getPiwikVersion', 'getAnswerToLife', 'getPiwikVersion'));
+ }
+
+ public function test_request_shouldRequestAllUrls_IfMultipleUrlsAreGiven_WithHighConcurrentRequestLimit()
+ {
+ $urls = $this->buildUrls('getPiwikVersion', 'getAnswerToLife', 'getPiwikVersion');
+
+ $this->cliMulti->setConcurrentProcessesLimit(10);
+ $this->assertRequestReturnsValidResponses($urls, array('getPiwikVersion', 'getAnswerToLife', 'getPiwikVersion'));
+ }
+
+ public function test_request_shouldReturnSameAmountOfResponses_IfSameUrlAppearsMultipleTimes()
+ {
+ $urls = $this->buildUrls('getAnswerToLife', 'getAnswerToLife', 'getPiwikVersion');
+
+ $this->assertRequestReturnsValidResponses($urls, array('getAnswerToLife', 'getAnswerToLife', 'getPiwikVersion'));
+ }
+
+ public function test_request_shouldCleanupAllTempFiles_OnceAllRequestsAreFinished()
+ {
+ $filesBefore = $this->getFilesInTmpFolder();
+
+ $this->cliMulti->request($this->buildUrls('getAnswerToLife', 'getAnswerToLife'));
+
+ $filesAfter = $this->getFilesInTmpFolder();
+
+ $this->assertSame($filesAfter, $filesBefore, "Diff is :" . implode(", ", array_diff($filesAfter, $filesBefore)));
+ $this->assertGreaterThan(1, $filesAfter);
+ }
+
+ public function test_request_shouldWorkInCaseItDoesNotRunFromCli()
+ {
+ $urls = $this->buildUrls('getAnswerToLife', 'getAnswerToLife');
+
+ \Piwik\Common::$isCliMode = false;
+ $this->assertRequestReturnsValidResponses($urls, array('getAnswerToLife', 'getAnswerToLife'));
+ }
+
+ /**
+ * This is a known issue, we do not get a content in case Piwik ends with an exit or redirect, but we have to make
+ * sure we detect the request has finished though
+ */
+ public function test_request_shouldDetectFinishOfRequest_IfNoParamsAreGiven()
+ {
+ $this->skipWhenPhp53();
+ $response = $this->cliMulti->request(array($this->completeUrl('')));
+ $this->assertStringStartsWith('Error: no website was found', $response[0]);
+ }
+
+ public function test_request_shouldBeAbleToRenderARegularPageInPiwik()
+ {
+ $this->skipWhenPhp53();
+ Fixture::createWebsite('2014-01-01 00:00:00');
+
+ $urls = array($this->completeUrl('/?module=Widgetize&idSite=1&period=day&date=today'));
+
+ $response = $this->cliMulti->request($urls);
+
+ $message = "Response was: " . substr( implode("\n\n", $response), 0, 4000);
+ $this->assertTrue(false !== strpos($response[0], '<meta name="generator" content="Piwik - free/libre analytics platform"/>'), $message);
+ $this->assertTrue(false !== strpos($response[0], 'Widgetize the full dashboard'). $message);
+ }
+
+ public function test_shouldFallback_IfAsyncIsNotSupported()
+ {
+ $this->cliMulti->supportsAsync = false;
+
+ $urls = $this->buildUrls('getPiwikVersion', 'getAnswerToLife', 'getPiwikVersion');
+
+ $this->assertRequestReturnsValidResponses($urls, array('getPiwikVersion', 'getAnswerToLife', 'getPiwikVersion'));
+ }
+
+ public function test_cleanupNotRemovedFiles_shouldOnlyRemoveFiles_IfTheyAreOlderThanOneWeek()
+ {
+ $timeOneWeekAgo = strtotime('-1 week');
+
+ // make sure -1 week returns a timestamp one week ago
+ $this->assertGreaterThan(604797, time() - $timeOneWeekAgo);
+ $this->assertLessThan(604803, time() - $timeOneWeekAgo);
+
+ $tmpDir = CliMulti::getTmpPath() . '/';
+ touch($tmpDir . 'now.pid');
+ touch($tmpDir . 'now.output');
+ touch($tmpDir . 'toberemoved.pid', $timeOneWeekAgo - 10);
+ touch($tmpDir . 'toberemoved.output', $timeOneWeekAgo - 10);
+ touch($tmpDir . 'toBeNotRemoved.pid', $timeOneWeekAgo + 10);
+ touch($tmpDir . 'toBeNotRemoved.output', $timeOneWeekAgo + 10);
+
+ CliMulti::cleanupNotRemovedFiles();
+
+ $this->assertFileExists($tmpDir . 'now.pid');
+ $this->assertFileExists($tmpDir . 'now.output');
+ $this->assertFileExists($tmpDir . 'toBeNotRemoved.output');
+ $this->assertFileExists($tmpDir . 'toBeNotRemoved.output');
+
+ $this->assertFileNotExists($tmpDir . 'toberemoved.output');
+ $this->assertFileNotExists($tmpDir . 'toberemoved.output');
+ }
+
+ private function assertRequestReturnsValidResponses($urls, $expectedResponseIds)
+ {
+ $actualResponse = $this->cliMulti->request($urls);
+
+ $this->assertInternalType('array', $actualResponse);
+ $this->assertCount(count($expectedResponseIds), $actualResponse);
+
+ $expected = array();
+ foreach ($expectedResponseIds as $expectedResponseId) {
+ $expected[] = $this->responses[$expectedResponseId];
+ }
+
+ $this->assertEquals($expected, $actualResponse);
+ }
+
+ private function buildUrls()
+ {
+ $urls = array();
+
+ foreach (func_get_args() as $urlId) {
+ $urls[] = $this->urls[$urlId];
+ }
+
+ return $urls;
+ }
+
+ private function completeUrl($query)
+ {
+ $host = Fixture::getRootUrl();
+
+ if (false === strpos($query, '?')) {
+ $query .= '?';
+ } else {
+ $query .= '&';
+ }
+
+ return $host . 'tests/PHPUnit/proxy/index.php' . $query . 'testmode=1&token_auth=' . $this->authToken;
+ }
+
+ private function getFilesInTmpFolder()
+ {
+ $dir = PIWIK_INCLUDE_PATH . '/tmp';
+
+ $files = \_glob($dir . "/*", null);
+ $subFiles = \_glob($dir . "/*/*", null);
+
+ $files = array_merge($files, $subFiles);
+
+ return $files;
+ }
+} \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/Core/AccessTest.php b/tests/PHPUnit/Integration/Core/AccessTest.php
deleted file mode 100644
index ec1eb9bd29..0000000000
--- a/tests/PHPUnit/Integration/Core/AccessTest.php
+++ /dev/null
@@ -1,364 +0,0 @@
-<?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\AuthResult;
-
-/**
- * Class Core_AccessTest
- *
- * @group Core
- */
-class Core_AccessTest extends DatabaseTestCase
-{
- public function setUp()
- {
- parent::setUp();
- Access::setSingletonInstance(null);
- }
-
- public function testGetListAccess()
- {
- $accessList = Access::getListAccess();
- $shouldBe = array('noaccess', 'view', 'admin', 'superuser');
- $this->assertEquals($shouldBe, $accessList);
- }
-
- public function testGetTokenAuthWithEmptyAccess()
- {
- $access = new Access();
- $this->assertNull($access->getTokenAuth());
- }
-
- public function testGetLoginWithEmptyAccess()
- {
- $access = new Access();
- $this->assertNull($access->getLogin());
- }
-
- public function testHasSuperUserAccessWithEmptyAccess()
- {
- $access = new Access();
- $this->assertFalse($access->hasSuperUserAccess());
- }
-
- public function testHasSuperUserAccessWithSuperUserAccess()
- {
- $access = Access::getInstance();
- $access->setSuperUserAccess(true);
- $this->assertTrue($access->hasSuperUserAccess());
- }
-
- public function testHasSuperUserAccessWithNoSuperUserAccess()
- {
- $access = Access::getInstance();
- $access->setSuperUserAccess(false);
- $this->assertFalse($access->hasSuperUserAccess());
- }
-
- public function testGetSitesIdWithAtLeastViewAccessWithEmptyAccess()
- {
- $access = new Access();
- $this->assertEmpty($access->getSitesIdWithAtLeastViewAccess());
- }
-
- public function testGetSitesIdWithAdminAccessWithEmptyAccess()
- {
- $access = new Access();
- $this->assertEmpty($access->getSitesIdWithAdminAccess());
- }
-
- public function testGetSitesIdWithViewAccessWithEmptyAccess()
- {
- $access = new Access();
- $this->assertEmpty($access->getSitesIdWithViewAccess());
- }
-
- /**
- * @expectedException Piwik\NoAccessException
- */
- public function testCheckUserHasSuperUserAccessWithEmptyAccess()
- {
- $access = new Access();
- $access->checkUserHasSuperUserAccess();
- }
-
- public function testCheckUserHasSuperUserAccessWithSuperUserAccess()
- {
- $access = Access::getInstance();
- $access->setSuperUserAccess(true);
- $access->checkUserHasSuperUserAccess();
- }
-
- /**
- * @expectedException Piwik\NoAccessException
- */
- public function testCheckUserHasSomeAdminAccessWithEmptyAccess()
- {
- $access = new Access();
- $access->checkUserHasSomeAdminAccess();
- }
-
- public function testCheckUserHasSomeAdminAccessWithSuperUserAccess()
- {
- $access = Access::getInstance();
- $access->setSuperUserAccess(true);
- $access->checkUserHasSomeAdminAccess();
- }
-
- public function testCheckUserHasSomeAdminAccessWithSomeAccess()
- {
- $mock = $this->getMock(
- 'Piwik\Access',
- array('getSitesIdWithAdminAccess')
- );
-
- $mock->expects($this->once())
- ->method('getSitesIdWithAdminAccess')
- ->will($this->returnValue(array(2, 9)));
-
- $mock->checkUserHasSomeAdminAccess();
- }
-
- /**
- * @expectedException Piwik\NoAccessException
- */
- public function testCheckUserHasSomeViewAccessWithEmptyAccess()
- {
- $access = new Access();
- $access->checkUserHasSomeViewAccess();
- }
-
- public function testCheckUserHasSomeViewAccessWithSuperUserAccess()
- {
- $access = Access::getInstance();
- $access->setSuperUserAccess(true);
- $access->checkUserHasSomeViewAccess();
- }
-
- public function testCheckUserHasSomeViewAccessWithSomeAccess()
- {
- $mock = $this->getMock(
- 'Piwik\Access',
- array('getSitesIdWithAtLeastViewAccess')
- );
-
- $mock->expects($this->once())
- ->method('getSitesIdWithAtLeastViewAccess')
- ->will($this->returnValue(array(1, 2, 3, 4)));
-
- $mock->checkUserHasSomeViewAccess();
- }
-
- /**
- * @expectedException Piwik\NoAccessException
- */
- public function testCheckUserHasViewAccessWithEmptyAccessNoSiteIdsGiven()
- {
- $access = new Access();
- $access->checkUserHasViewAccess(array());
- }
-
- public function testCheckUserHasViewAccessWithSuperUserAccess()
- {
- $access = Access::getInstance();
- $access->setSuperUserAccess(true);
- $access->checkUserHasViewAccess(array());
- }
-
- public function testCheckUserHasViewAccessWithSomeAccessSuccessIdSitesAsString()
- {
- $mock = $this->getMock(
- 'Piwik\Access',
- array('getSitesIdWithAtLeastViewAccess')
- );
-
- $mock->expects($this->once())
- ->method('getSitesIdWithAtLeastViewAccess')
- ->will($this->returnValue(array(1, 2, 3, 4)));
-
- $mock->checkUserHasViewAccess('1,3');
- }
-
- public function testCheckUserHasViewAccessWithSomeAccessSuccessAllSites()
- {
- $mock = $this->getMock(
- 'Piwik\Access',
- array('getSitesIdWithAtLeastViewAccess')
- );
-
- $mock->expects($this->any())
- ->method('getSitesIdWithAtLeastViewAccess')
- ->will($this->returnValue(array(1, 2, 3, 4)));
-
- $mock->checkUserHasViewAccess('all');
- }
-
- /**
- * @expectedException Piwik\NoAccessException
- */
- public function testCheckUserHasViewAccessWithSomeAccessFailure()
- {
- $mock = $this->getMock(
- 'Piwik\Access',
- array('getSitesIdWithAtLeastViewAccess')
- );
-
- $mock->expects($this->once())
- ->method('getSitesIdWithAtLeastViewAccess')
- ->will($this->returnValue(array(1, 2, 3, 4)));
-
- $mock->checkUserHasViewAccess(array(1, 5));
- }
-
- public function testCheckUserHasAdminAccessWithSuperUserAccess()
- {
- $access = Access::getInstance();
- $access->setSuperUserAccess(true);
- $access->checkUserHasAdminAccess(array());
- }
-
- /**
- * @expectedException Piwik\NoAccessException
- */
- public function testCheckUserHasAdminAccessWithEmptyAccessNoSiteIdsGiven()
- {
- $access = new Access();
- $access->checkUserHasViewAccess(array());
- }
-
- public function testCheckUserHasAdminAccessWithSomeAccessSuccessIdSitesAsString()
- {
- $mock = $this->getMock(
- 'Piwik\Access',
- array('getSitesIdWithAdminAccess')
- );
-
- $mock->expects($this->once())
- ->method('getSitesIdWithAdminAccess')
- ->will($this->returnValue(array(1, 2, 3, 4)));
-
- $mock->checkUserHasAdminAccess('1,3');
- }
-
- public function testCheckUserHasAdminAccessWithSomeAccessSuccessAllSites()
- {
- $mock = $this->getMock(
- 'Piwik\Access',
- array('getSitesIdWithAdminAccess', 'getSitesIdWithAtLeastViewAccess')
- );
-
- $mock->expects($this->any())
- ->method('getSitesIdWithAdminAccess')
- ->will($this->returnValue(array(1, 2, 3, 4)));
-
- $mock->expects($this->any())
- ->method('getSitesIdWithAtLeastViewAccess')
- ->will($this->returnValue(array(1, 2, 3, 4)));
-
- $mock->checkUserHasAdminAccess('all');
- }
-
- /**
- * @expectedException Piwik\NoAccessException
- */
- public function testCheckUserHasAdminAccessWithSomeAccessFailure()
- {
- $mock = $this->getMock(
- 'Piwik\Access',
- array('getSitesIdWithAdminAccess')
- );
-
- $mock->expects($this->once())
- ->method('getSitesIdWithAdminAccess')
- ->will($this->returnValue(array(1, 2, 3, 4)));
-
- $mock->checkUserHasAdminAccess(array(1, 5));
- }
-
- public function testReloadAccessWithEmptyAuth()
- {
- $access = new Access();
- $this->assertFalse($access->reloadAccess(null));
- }
-
- public function testReloadAccessWithEmptyAuthSuperUser()
- {
- $access = Access::getInstance();
- $access->setSuperUserAccess(true);
- $this->assertTrue($access->reloadAccess(null));
- }
-
- public function testReloadAccessWithMockedAuthValid()
- {
- $mock = $this->getMock('\\Piwik\\Auth', array('authenticate', 'getName', 'getTokenAuthSecret', 'getLogin', 'setTokenAuth', 'setLogin',
- 'setPassword', 'setPasswordHash'));
- $mock->expects($this->once())
- ->method('authenticate')
- ->will($this->returnValue(new AuthResult(AuthResult::SUCCESS, 'login', 'token')));
-
- $mock->expects($this->any())->method('getName')->will($this->returnValue("test name"));
-
- $access = Access::getInstance();
- $this->assertTrue($access->reloadAccess($mock));
- $this->assertFalse($access->hasSuperUserAccess());
- }
-
- public function test_doAsSuperUser_ChangesSuperUserAccessCorrectly()
- {
- Access::getInstance()->setSuperUserAccess(false);
-
- $this->assertFalse(Access::getInstance()->hasSuperUserAccess());
-
- Access::doAsSuperUser(function () {
- Core_AccessTest::assertTrue(Access::getInstance()->hasSuperUserAccess());
- });
-
- $this->assertFalse(Access::getInstance()->hasSuperUserAccess());
- }
-
- public function test_doAsSuperUser_RemovesSuperUserAccess_IfExceptionThrown()
- {
- Access::getInstance()->setSuperUserAccess(false);
-
- $this->assertFalse(Access::getInstance()->hasSuperUserAccess());
-
- try {
- Access::doAsSuperUser(function () {
- throw new Exception();
- });
-
- $this->fail("Exception was not propagated by doAsSuperUser.");
- } catch (Exception $ex)
- {
- // pass
- }
-
- $this->assertFalse(Access::getInstance()->hasSuperUserAccess());
- }
-
- public function test_doAsSuperUser_ReturnsCallbackResult()
- {
- $result = Access::doAsSuperUser(function () {
- return 24;
- });
- $this->assertEquals(24, $result);
- }
-
- public function test_reloadAccess_DoesNotRemoveSuperUserAccess_IfUsedInDoAsSuperUser()
- {
- Access::getInstance()->setSuperUserAccess(false);
-
- Access::doAsSuperUser(function () {
- $access = Access::getInstance();
-
- Core_AccessTest::assertTrue($access->hasSuperUserAccess());
- $access->reloadAccess();
- Core_AccessTest::assertTrue($access->hasSuperUserAccess());
- });
- }
-} \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/Core/ArchiveProcessingTest.php b/tests/PHPUnit/Integration/Core/ArchiveProcessingTest.php
deleted file mode 100644
index eaa6d6807d..0000000000
--- a/tests/PHPUnit/Integration/Core/ArchiveProcessingTest.php
+++ /dev/null
@@ -1,507 +0,0 @@
-<?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\ArchiveProcessor;
-use Piwik\ArchiveProcessor\Rules;
-use Piwik\Common;
-use Piwik\DataAccess\ArchiveTableCreator;
-use Piwik\Date;
-use Piwik\Db;
-use Piwik\Db\BatchInsert;
-use Piwik\Period;
-use Piwik\Piwik;
-use Piwik\Plugins\SitesManager\API;
-use Piwik\Segment;
-use Piwik\SettingsServer;
-use Piwik\Site;
-
-class Core_ArchiveProcessorTest extends ArchiveProcessor\Loader {
-
- public function getParams()
- {
- return $this->params;
- }
- public function public_getMinTimeArchiveProcessed()
- {
- return $this->getMinTimeArchiveProcessed();
- }
- public function public_isArchiveTemporary()
- {
- return $this->isArchiveTemporary();
- }
-}
-
-/**
- * Class Core_ArchiveProcessorTest
- *
- * @group Core
- */
-class Core_ArchiveProcessingTest extends DatabaseTestCase
-{
- public function setUp()
- {
- parent::setUp();
-
- // setup the access layer
- $pseudoMockAccess = new FakeAccess;
- FakeAccess::$superUser = true;
- Access::setSingletonInstance($pseudoMockAccess);
-
- ArchiveTableCreator::$tablesAlreadyInstalled = null;
- }
-
- public function tearDown()
- {
- Access::setSingletonInstance(null);
- ArchiveTableCreator::$tablesAlreadyInstalled = null;
- }
-
- /**
- * Creates a new website
- *
- * @param string $timezone
- * @return Site
- */
- private function _createWebsite($timezone = 'UTC')
- {
- $idSite = API::getInstance()->addSite(
- "site1",
- array("http://piwik.net"),
- $ecommerce = 0,
- $siteSearch = 1, $searchKeywordParameters = null, $searchCategoryParameters = null,
- $excludedIps = "",
- $excludedQueryParameters = "",
- $timezone);
-
- Site::clearCache();
- return new Site($idSite);
- }
-
- /**
- * Creates a new ArchiveProcessor object
- *
- * @param string $periodLabel
- * @param string $dateLabel
- * @param string $siteTimezone
- * @return \Core_ArchiveProcessorTest
- */
- private function _createArchiveProcessor($periodLabel, $dateLabel, $siteTimezone)
- {
- $site = $this->_createWebsite($siteTimezone);
- $date = Date::factory($dateLabel);
- $period = Period\Factory::build($periodLabel, $date);
- $segment = new Segment('', $site->getId());
-
- $params = new ArchiveProcessor\Parameters($site, $period, $segment);
- return new \Core_ArchiveProcessorTest($params);
- }
-
- /**
- * test of validity of an archive, for a month not finished
- * @group Core
- */
- public function testInitCurrentMonth()
- {
- $siteTimezone = 'UTC+10';
- $now = time();
- // this test fails in the last 10 hours of the last day of the month
- if(date('m', $now) != date('m', $now + 10 * 3600)) {
- $this->markTestSkipped('testInitCurrentMonth will fail in the last hours of the month, skipping...');
- }
-
- $dateLabel = date('Y-m-d', $now);
- $archiveProcessor = $this->_createArchiveProcessor('month', $dateLabel, $siteTimezone);
- $archiveProcessor->time = $now;
-
- // min finished timestamp considered when looking at archive timestamp
- $timeout = Rules::getTodayArchiveTimeToLive();
- $this->assertTrue($timeout >= 10);
- $dateMinArchived = $now - $timeout;
- $this->compareTimestamps($dateMinArchived, $archiveProcessor->public_getMinTimeArchiveProcessed());
-
- $this->assertTrue($archiveProcessor->public_isArchiveTemporary());
- }
-
- private function compareTimestamps($expected, $processed)
- {
-// $messageIfFails = Date::factory($expected)->getDatetime() . " != " . Date::factory($processed)->getDatetime();
- $messageIfFails = "Expected [$expected] but got [$processed]";
- $this->assertTrue( abs($expected-$processed) <=4 , $messageIfFails);
- }
-
- /**
- * test of validity of an archive, for a month in the past
- * @group Core
- */
- public function testInitDayInPast()
- {
- $archiveProcessor = $this->_createArchiveProcessor('day', '2010-01-01', 'UTC');
-
- // min finished timestamp considered when looking at archive timestamp
- $dateMinArchived = Date::factory('2010-01-02')->getTimestamp();
- $this->assertEquals($dateMinArchived, $archiveProcessor->public_getMinTimeArchiveProcessed() + 1);
-
- $this->assertEquals('2010-01-01 00:00:00', $archiveProcessor->getParams()->getDateStart()->getDateStartUTC());
- $this->assertEquals('2010-01-01 23:59:59', $archiveProcessor->getParams()->getDateEnd()->getDateEndUTC());
- $this->assertFalse($archiveProcessor->public_isArchiveTemporary());
- }
-
- /**
- * test of validity of an archive, for a non UTC date in the past
- * @group Core
- */
- public function testInitDayInPastNonUTCWebsite()
- {
- $timezone = 'UTC+5.5';
- $archiveProcessor = $this->_createArchiveProcessor('day', '2010-01-01', $timezone);
- // min finished timestamp considered when looking at archive timestamp
- $dateMinArchived = Date::factory('2010-01-01 18:30:00');
- $this->assertEquals($dateMinArchived->getTimestamp(), $archiveProcessor->public_getMinTimeArchiveProcessed() + 1);
-
- $this->assertEquals('2009-12-31 18:30:00', $archiveProcessor->getParams()->getDateStart()->getDateStartUTC());
- $this->assertEquals('2010-01-01 18:29:59', $archiveProcessor->getParams()->getDateEnd()->getDateEndUTC());
- $this->assertFalse($archiveProcessor->public_isArchiveTemporary());
- }
-
- /**
- * test of validity of an archive, for a non UTC month in the past
- * @group Core
- */
- public function testInitMonthInPastNonUTCWebsite()
- {
- $timezone = 'UTC-5.5';
- $archiveProcessor = $this->_createArchiveProcessor('month', '2010-01-02', $timezone);
- // min finished timestamp considered when looking at archive timestamp
- $dateMinArchived = Date::factory('2010-02-01 05:30:00');
- $this->assertEquals($dateMinArchived->getTimestamp(), $archiveProcessor->public_getMinTimeArchiveProcessed() + 1);
-
- $this->assertEquals('2010-01-01 05:30:00', $archiveProcessor->getParams()->getDateStart()->getDateStartUTC());
- $this->assertEquals('2010-02-01 05:29:59', $archiveProcessor->getParams()->getDateEnd()->getDateEndUTC());
- $this->assertFalse($archiveProcessor->public_isArchiveTemporary());
- }
-
- /**
- * test of validity of an archive, for today's archive
- * @group Core
- */
- public function testInitToday()
- {
- $now = time();
- $siteTimezone = 'UTC-1';
- $timestamp = Date::factory('now', $siteTimezone)->getTimestamp();
- $dateLabel = date('Y-m-d', $timestamp);
-
- Rules::setBrowserTriggerArchiving(true);
-
- $archiveProcessor = $this->_createArchiveProcessor('day', $dateLabel, $siteTimezone);
- $archiveProcessor->time = $now;
-
- // we look at anything processed within the time to live range
- $dateMinArchived = $now - Rules::getTodayArchiveTimeToLive();
- $this->compareTimestamps($dateMinArchived, $archiveProcessor->public_getMinTimeArchiveProcessed() );
- $this->assertTrue($archiveProcessor->public_isArchiveTemporary());
-
- // when browsers don't trigger archives...
- Rules::setBrowserTriggerArchiving(false);
- // ...we force ArchiveProcessor to fetch any of the most recent archive
- $dateMinArchived = false;
-
- $this->compareTimestamps($dateMinArchived, $archiveProcessor->public_getMinTimeArchiveProcessed());
-
- $this->assertEquals(date('Y-m-d', $timestamp) . ' 01:00:00', $archiveProcessor->getParams()->getDateStart()->getDateStartUTC());
- $this->assertEquals(date('Y-m-d', $timestamp + 86400) . ' 00:59:59', $archiveProcessor->getParams()->getDateEnd()->getDateEndUTC());
- $this->assertTrue($archiveProcessor->public_isArchiveTemporary());
- }
-
- /**
- * test of validity of an archive, for today's archive with european timezone
- * @group Core
- */
- public function testInitTodayEurope()
- {
- if (!SettingsServer::isTimezoneSupportEnabled()) {
- $this->markTestSkipped('timezones needs to be supported');
- }
-
- $now = time();
- $siteTimezone = 'Europe/Paris';
- $timestamp = Date::factory('now', $siteTimezone)->getTimestamp();
- $dateLabel = date('Y-m-d', $timestamp);
-
- Rules::setBrowserTriggerArchiving(true);
-
- $archiveProcessor = $this->_createArchiveProcessor('day', $dateLabel, $siteTimezone);
- $archiveProcessor->time = $now;
-
- // we look at anything processed within the time to live range
- $dateMinArchived = $now - Rules::getTodayArchiveTimeToLive();
- $this->compareTimestamps($dateMinArchived, $archiveProcessor->public_getMinTimeArchiveProcessed());
- $this->assertTrue($archiveProcessor->public_isArchiveTemporary());
-
- // when browsers don't trigger archives...
- Rules::setBrowserTriggerArchiving(false);
- // ...we force ArchiveProcessor to fetch any of the most recent archive
- $dateMinArchived = false;
-
- $this->compareTimestamps($dateMinArchived, $archiveProcessor->public_getMinTimeArchiveProcessed());
-
- // this test varies with DST
- $this->assertTrue($archiveProcessor->getParams()->getDateStart()->getDateStartUTC() == date('Y-m-d', $timestamp - 86400) . ' 22:00:00' ||
- $archiveProcessor->getParams()->getDateStart()->getDateStartUTC() == date('Y-m-d', $timestamp - 86400) . ' 23:00:00');
- $this->assertTrue($archiveProcessor->getParams()->getDateEnd()->getDateEndUTC() == date('Y-m-d', $timestamp) . ' 21:59:59' ||
- $archiveProcessor->getParams()->getDateEnd()->getDateEndUTC() == date('Y-m-d', $timestamp) . ' 22:59:59');
-
- $this->assertTrue($archiveProcessor->public_isArchiveTemporary());
- }
-
- /**
- * test of validity of an archive, for today's archive with toronto's timezone
- * @group Core
- */
- public function testInitTodayToronto()
- {
- if (!SettingsServer::isTimezoneSupportEnabled()) {
- $this->markTestSkipped('timezones needs to be supported');
- }
-
- $now = time();
- $siteTimezone = 'America/Toronto';
- $timestamp = Date::factory('now', $siteTimezone)->getTimestamp();
- $dateLabel = date('Y-m-d', $timestamp);
-
- Rules::setBrowserTriggerArchiving(true);
-
- $archiveProcessor = $this->_createArchiveProcessor('day', $dateLabel, $siteTimezone);
- $archiveProcessor->time = $now;
-
- // we look at anything processed within the time to live range
- $dateMinArchived = $now - Rules::getTodayArchiveTimeToLive();
- $this->compareTimestamps($dateMinArchived, $archiveProcessor->public_getMinTimeArchiveProcessed() );
- $this->assertTrue($archiveProcessor->public_isArchiveTemporary());
-
- // when browsers don't trigger archives...
- Rules::setBrowserTriggerArchiving(false);
- // ...we force ArchiveProcessor to fetch any of the most recent archive
- $dateMinArchived = false;
- $this->compareTimestamps($dateMinArchived, $archiveProcessor->public_getMinTimeArchiveProcessed());
-
- // this test varies with DST
- $this->assertTrue($archiveProcessor->getParams()->getDateStart()->getDateStartUTC() == date('Y-m-d', $timestamp) . ' 04:00:00' ||
- $archiveProcessor->getParams()->getDateStart()->getDateStartUTC() == date('Y-m-d', $timestamp) . ' 05:00:00');
- $this->assertTrue($archiveProcessor->getParams()->getDateEnd()->getDateEndUTC() == date('Y-m-d', $timestamp + 86400) . ' 03:59:59' ||
- $archiveProcessor->getParams()->getDateEnd()->getDateEndUTC() == date('Y-m-d', $timestamp + 86400) . ' 04:59:59');
-
- $this->assertTrue($archiveProcessor->public_isArchiveTemporary());
- }
-
- /**
- * Testing batch insert
- * @group Core
- */
- public function testTableInsertBatch()
- {
- $table = Common::prefixTable('site_url');
- $data = $this->_getDataInsert();
- try {
- $didWeUseBulk = BatchInsert::tableInsertBatch($table,
- array('idsite', 'url'),
- $data,
- $throwException = true);
-
- } catch (Exception $e) {
- $didWeUseBulk = $e->getMessage();
- }
- $this->_checkLoadDataInFileWasUsed($didWeUseBulk);
-
- if ($didWeUseBulk === true) {
- $this->_checkTableIsExpected($table, $data);
-
- // INSERT again the bulk. Because we use keyword LOCAL the data will be REPLACED automatically (see mysql doc)
- BatchInsert::tableInsertBatch($table, array('idsite', 'url'), $data);
- $this->_checkTableIsExpected($table, $data);
- }
- }
-
- protected function _checkLoadDataInFileWasUsed($didWeUseBulk)
- {
- static $skippedOnce = false;
- if ($didWeUseBulk !== true
- && $skippedOnce === false
- ) {
- $skippedOnce = true;
- $this->fail(
- 'Performance notice: LOAD DATA [LOCAL] INFILE query is not working, so Piwik will fallback to using plain INSERTs '
- . ' which will result in a slightly slower Archiving process.'
- . ". \n"
- . ' 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 (https://github.com/piwik/piwik/issues/3605)"
- );
- }
- return $didWeUseBulk;
- }
-
- /**
- * Testing plain inserts
- * @group Core
- */
- public function testTableInsertBatchIterate()
- {
- $table = Common::prefixTable('site_url');
- $data = $this->_getDataInsert();
- BatchInsert::tableInsertBatchIterate($table, array('idsite', 'url'), $data);
- $this->_checkTableIsExpected($table, $data);
-
- // If we insert AGAIN, expect to throw an error because the primary key already exists
- try {
- BatchInsert::tableInsertBatchIterate($table, array('idsite', 'url'), $data, $ignoreWhenDuplicate = false);
- } catch (Exception $e) {
- // However if we insert with keyword REPLACE, then the new data should be saved
- BatchInsert::tableInsertBatchIterate($table, array('idsite', 'url'), $data, $ignoreWhenDuplicate = true);
- $this->_checkTableIsExpected($table, $data);
- return;
- }
- $this->fail('Exception expected');
- }
-
- /**
- * Testing batch insert (BLOB)
- * @group Core
- */
- public function testTableInsertBatchBlob()
- {
- $dateLabel = '2011-03-31';
- $table = ArchiveTableCreator::getBlobTable(Date::factory($dateLabel));
-
- $data = $this->_getBlobDataInsert();
- try {
- $didWeUseBulk = BatchInsert::tableInsertBatch($table,
- array('idarchive', 'name', 'idsite', 'date1', 'date2', 'period', 'ts_archived', 'value'),
- $data,
- $throwException = true);
- } catch (Exception $e) {
- $didWeUseBulk = $e->getMessage();
- }
- $this->_checkLoadDataInFileWasUsed($didWeUseBulk);
-
- // If bulk wasn't used the exception was caught and the INSERT didn't work
- if ($didWeUseBulk === true) {
- $this->_checkTableIsExpectedBlob($table, $data);
- }
- // INSERT again the bulk. Because we use keyword LOCAL the data will be REPLACED automatically (see mysql doc)
- $didWeUseBulk = BatchInsert::tableInsertBatch($table, array('idarchive', 'name', 'idsite', 'date1', 'date2', 'period', 'ts_archived', 'value'), $data);
- if ($didWeUseBulk === true) {
- $this->_checkTableIsExpectedBlob($table, $data);
- }
- }
-
- /**
- * Testing plain inserts (BLOB)
- * @group Core
- */
- public function testTableInsertBatchIterateBlob()
- {
- $dateLabel = '2011-03-31';
- $table = ArchiveTableCreator::getBlobTable(Date::factory($dateLabel));
-
- $data = $this->_getBlobDataInsert();
- BatchInsert::tableInsertBatchIterate($table, array('idarchive', 'name', 'idsite', 'date1', 'date2', 'period', 'ts_archived', 'value'), $data);
- $this->_checkTableIsExpectedBlob($table, $data);
-
- // If we insert AGAIN, expect to throw an error because the primary key already exist
- try {
- BatchInsert::tableInsertBatchIterate($table, array('idarchive', 'name', 'idsite', 'date1', 'date2', 'period', 'ts_archived', 'value'), $data, $ignoreWhenDuplicate = false);
- } catch (Exception $e) {
- // However if we insert with keyword REPLACE, then the new data should be saved
- BatchInsert::tableInsertBatchIterate($table, array('idarchive', 'name', 'idsite', 'date1', 'date2', 'period', 'ts_archived', 'value'), $data, $ignoreWhenDuplicate = true);
- $this->_checkTableIsExpectedBlob($table, $data);
- return;
- }
- $this->fail('Exception expected');
- }
-
- protected function _checkTableIsExpected($table, $data)
- {
- $fetched = Db::fetchAll('SELECT * FROM ' . $table);
- foreach ($data as $id => $row) {
- $this->assertEquals($fetched[$id]['idsite'], $data[$id][0], "record $id is not {$data[$id][0]}");
- $this->assertEquals($fetched[$id]['url'], $data[$id][1], "Record $id bug, not {$data[$id][1]} BUT {$fetched[$id]['url']}");
- }
- }
-
- protected function _checkTableIsExpectedBlob($table, $data)
- {
- $fetched = Db::fetchAll('SELECT * FROM ' . $table);
- foreach ($data as $id => $row) {
- $this->assertEquals($fetched[$id]['idarchive'], $data[$id][0], "record $id idarchive is not '{$data[$id][0]}'");
- $this->assertEquals($fetched[$id]['name'], $data[$id][1], "record $id name is not '{$data[$id][1]}'");
- $this->assertEquals($fetched[$id]['idsite'], $data[$id][2], "record $id idsite is not '{$data[$id][2]}'");
- $this->assertEquals($fetched[$id]['date1'], $data[$id][3], "record $id date1 is not '{$data[$id][3]}'");
- $this->assertEquals($fetched[$id]['date2'], $data[$id][4], "record $id date2 is not '{$data[$id][4]}'");
- $this->assertEquals($fetched[$id]['period'], $data[$id][5], "record $id period is not '{$data[$id][5]}'");
- $this->assertEquals($fetched[$id]['ts_archived'], $data[$id][6], "record $id ts_archived is not '{$data[$id][6]}'");
- $this->assertEquals($fetched[$id]['value'], $data[$id][7], "record $id value is unexpected");
- }
- }
-
- /*
- * Schema for site_url table:
- * site_url (
- * idsite INTEGER(10) UNSIGNED NOT NULL,
- * url VARCHAR(255) NOT NULL,
- * PRIMARY KEY(idsite, url)
- * )
- */
- protected function _getDataInsert()
- {
- return array(
- array(1, 'test'),
- array(2, 'te" \n st2'),
- array(3, " \n \r \t test"),
-
- // these aren't expected to work on a column of datatype VARCHAR
-// array(4, gzcompress( " \n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942")),
-// array(5, gzcompress('test4')),
-
- array(6, 'test5'),
- array(7, '简体中文'),
- array(8, '"'),
- array(9, "'"),
- array(10, '\\'),
- array(11, '\\"'),
- array(12, '\\\''),
- array(13, "\t"),
- array(14, "test \x00 null"),
- array(15, "\x00\x01\x02\0x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"),
- );
- }
-
- /**
- * see archive_blob table
- */
- protected function _getBlobDataInsert()
- {
- $ts = '2011-03-31 17:48:00';
- $str = '';
- for ($i = 0; $i < 256; $i++) {
- $str .= chr($i);
- }
- $array[] = array(1, 'bytes 0-255', 1, '2011-03-31', '2011-03-31', Piwik::$idPeriods['day'], $ts, $str);
-
- $array[] = array(2, 'compressed string', 1, '2011-03-31', '2011-03-31', Piwik::$idPeriods['day'], $ts, gzcompress(" \n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942\n \r \t teste eigaj oegheao geaoh guoea98742983 2 342942"));
-
- $str = file_get_contents(PIWIK_PATH_TEST_TO_ROOT . '/tests/resources/lipsum.txt');
- $array[] = array(3, 'lorem ipsum', 1, '2011-03-31', '2011-03-31', Piwik::$idPeriods['day'], $ts, $str);
-
- $array[] = array(4, 'lorem ipsum compressed', 1, '2011-03-31', '2011-03-31', Piwik::$idPeriods['day'], $ts, gzcompress($str));
-
- return $array;
- }
-}
diff --git a/tests/PHPUnit/Integration/Core/CliMultiTest.php b/tests/PHPUnit/Integration/Core/CliMultiTest.php
deleted file mode 100644
index fc337957f2..0000000000
--- a/tests/PHPUnit/Integration/Core/CliMultiTest.php
+++ /dev/null
@@ -1,248 +0,0 @@
-<?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\CliMulti;
-use Piwik\Version;
-use Piwik\Tests\IntegrationTestCase;
-use Piwik\Tests\Fixture;
-
-/**
- * Class Core_CliMultiTest
- *
- * @group Core
- */
-class Core_CliMultiTest extends IntegrationTestCase
-{
- /**
- * @var \Piwik\CliMulti
- */
- private $cliMulti;
-
- /**
- * @var string
- */
- private $authToken = '';
-
- /**
- * @var string[]
- */
- private $urls = array();
-
- /**
- * @var string[]
- */
- private $responses = array();
-
- public function setUp()
- {
- parent::setUp();
-
- $this->cliMulti = new CliMulti();
- $this->authToken = Fixture::getTokenAuth();
-
- $this->urls = array(
- 'getAnswerToLife' => $this->completeUrl('?module=API&method=ExampleAPI.getAnswerToLife&format=JSON'),
- 'getPiwikVersion' => $this->completeUrl('?module=API&method=API.getPiwikVersion&format=JSON'),
- );
-
- $this->responses = array(
- 'getAnswerToLife' => '{"value":42}',
- 'getPiwikVersion' => '{"value":"' . Version::VERSION . '"}'
- );
-
- \Piwik\Common::$isCliMode = true;
- }
-
- public function test_request_shouldNotFailAndReturnNoResponse_IfNoUrlsAreGiven()
- {
- $response = $this->cliMulti->request(array());
-
- $this->assertEquals(array(), $response);
- }
-
- /**
- * @expectedException \Exception
- * @expectedExceptionMessage array
- */
- public function test_request_shouldFail_IfUrlsIsNotAnArray()
- {
- $this->cliMulti->request('');
- }
-
- public function test_request_shouldReturnResultAsArray_IfOnlyOneUrlIsGiven()
- {
- $urls = $this->buildUrls('getAnswerToLife');
-
- $this->assertRequestReturnsValidResponses($urls, array('getAnswerToLife'));
- }
-
- public function test_request_shouldRunAsync()
- {
- $this->assertTrue($this->cliMulti->supportsAsync);
- }
-
- public function test_request_shouldRequestAllUrls_IfMultipleUrlsAreGiven()
- {
- $urls = $this->buildUrls('getPiwikVersion', 'getAnswerToLife');
-
- $this->assertRequestReturnsValidResponses($urls, array('getPiwikVersion', 'getAnswerToLife'));
- }
-
- public function test_request_shouldRequestAllUrls_IfMultipleUrlsAreGiven_WithConcurrentRequestLimit()
- {
- $urls = $this->buildUrls('getPiwikVersion', 'getAnswerToLife', 'getPiwikVersion');
-
- $this->cliMulti->setConcurrentProcessesLimit(1);
- $this->assertRequestReturnsValidResponses($urls, array('getPiwikVersion', 'getAnswerToLife', 'getPiwikVersion'));
- }
-
- public function test_request_shouldRequestAllUrls_IfMultipleUrlsAreGiven_WithHighConcurrentRequestLimit()
- {
- $urls = $this->buildUrls('getPiwikVersion', 'getAnswerToLife', 'getPiwikVersion');
-
- $this->cliMulti->setConcurrentProcessesLimit(10);
- $this->assertRequestReturnsValidResponses($urls, array('getPiwikVersion', 'getAnswerToLife', 'getPiwikVersion'));
- }
-
- public function test_request_shouldReturnSameAmountOfResponses_IfSameUrlAppearsMultipleTimes()
- {
- $urls = $this->buildUrls('getAnswerToLife', 'getAnswerToLife', 'getPiwikVersion');
-
- $this->assertRequestReturnsValidResponses($urls, array('getAnswerToLife', 'getAnswerToLife', 'getPiwikVersion'));
- }
-
- public function test_request_shouldCleanupAllTempFiles_OnceAllRequestsAreFinished()
- {
- $filesBefore = $this->getFilesInTmpFolder();
-
- $this->cliMulti->request($this->buildUrls('getAnswerToLife', 'getAnswerToLife'));
-
- $filesAfter = $this->getFilesInTmpFolder();
-
- $this->assertSame($filesAfter, $filesBefore, "Diff is :" . implode(", ", array_diff($filesAfter, $filesBefore)));
- $this->assertGreaterThan(1, $filesAfter);
- }
-
- public function test_request_shouldWorkInCaseItDoesNotRunFromCli()
- {
- $urls = $this->buildUrls('getAnswerToLife', 'getAnswerToLife');
-
- \Piwik\Common::$isCliMode = false;
- $this->assertRequestReturnsValidResponses($urls, array('getAnswerToLife', 'getAnswerToLife'));
- }
-
- /**
- * This is a known issue, we do not get a content in case Piwik ends with an exit or redirect, but we have to make
- * sure we detect the request has finished though
- */
- public function test_request_shouldDetectFinishOfRequest_IfNoParamsAreGiven()
- {
- $response = $this->cliMulti->request(array($this->completeUrl('')));
- $this->assertStringStartsWith('Error: no website was found', $response[0]);
- }
-
- public function test_request_shouldBeAbleToRenderARegularPageInPiwik()
- {
- Fixture::createWebsite('2014-01-01 00:00:00');
-
- $urls = array($this->completeUrl('/?module=Widgetize&idSite=1&period=day&date=today'));
-
- $response = $this->cliMulti->request($urls);
-
- $message = "Response was: " . substr( implode("\n\n", $response), 0, 4000);
- $this->assertTrue(false !== strpos($response[0], '<meta name="generator" content="Piwik - free/libre analytics platform"/>'), $message);
- $this->assertTrue(false !== strpos($response[0], 'Widgetize the full dashboard'). $message);
- }
-
- public function test_shouldFallback_IfAsyncIsNotSupported()
- {
- $this->cliMulti->supportsAsync = false;
-
- $urls = $this->buildUrls('getPiwikVersion', 'getAnswerToLife', 'getPiwikVersion');
-
- $this->assertRequestReturnsValidResponses($urls, array('getPiwikVersion', 'getAnswerToLife', 'getPiwikVersion'));
- }
-
- public function test_cleanupNotRemovedFiles_shouldOnlyRemoveFiles_IfTheyAreOlderThanOneWeek()
- {
- $timeOneWeekAgo = strtotime('-1 week');
-
- // make sure -1 week returns a timestamp one week ago
- $this->assertGreaterThan(604797, time() - $timeOneWeekAgo);
- $this->assertLessThan(604803, time() - $timeOneWeekAgo);
-
- $tmpDir = CliMulti::getTmpPath() . '/';
- touch($tmpDir . 'now.pid');
- touch($tmpDir . 'now.output');
- touch($tmpDir . 'toberemoved.pid', $timeOneWeekAgo - 10);
- touch($tmpDir . 'toberemoved.output', $timeOneWeekAgo - 10);
- touch($tmpDir . 'toBeNotRemoved.pid', $timeOneWeekAgo + 10);
- touch($tmpDir . 'toBeNotRemoved.output', $timeOneWeekAgo + 10);
-
- CliMulti::cleanupNotRemovedFiles();
-
- $this->assertFileExists($tmpDir . 'now.pid');
- $this->assertFileExists($tmpDir . 'now.output');
- $this->assertFileExists($tmpDir . 'toBeNotRemoved.output');
- $this->assertFileExists($tmpDir . 'toBeNotRemoved.output');
-
- $this->assertFileNotExists($tmpDir . 'toberemoved.output');
- $this->assertFileNotExists($tmpDir . 'toberemoved.output');
- }
-
- private function assertRequestReturnsValidResponses($urls, $expectedResponseIds)
- {
- $actualResponse = $this->cliMulti->request($urls);
-
- $this->assertInternalType('array', $actualResponse);
- $this->assertCount(count($expectedResponseIds), $actualResponse);
-
- $expected = array();
- foreach ($expectedResponseIds as $expectedResponseId) {
- $expected[] = $this->responses[$expectedResponseId];
- }
-
- $this->assertEquals($expected, $actualResponse);
- }
-
- private function buildUrls()
- {
- $urls = array();
-
- foreach (func_get_args() as $urlId) {
- $urls[] = $this->urls[$urlId];
- }
-
- return $urls;
- }
-
- private function completeUrl($query)
- {
- $host = Fixture::getRootUrl();
-
- if (false === strpos($query, '?')) {
- $query .= '?';
- } else {
- $query .= '&';
- }
-
- return $host . 'tests/PHPUnit/proxy/index.php' . $query . 'testmode=1&token_auth=' . $this->authToken;
- }
-
- private function getFilesInTmpFolder()
- {
- $dir = PIWIK_INCLUDE_PATH . '/tmp';
-
- $files = \_glob($dir . "/*", null);
- $subFiles = \_glob($dir . "/*/*", null);
-
- $files = array_merge($files, $subFiles);
-
- return $files;
- }
-} \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/Core/CronArchive/SharedSiteIdsTest.php b/tests/PHPUnit/Integration/Core/CronArchive/SharedSiteIdsTest.php
deleted file mode 100644
index eca1d85aea..0000000000
--- a/tests/PHPUnit/Integration/Core/CronArchive/SharedSiteIdsTest.php
+++ /dev/null
@@ -1,114 +0,0 @@
-<?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\CronArchive\SharedSiteIds;
-
-/**
- * @group Core
- * @group SharedSiteIdsTest
- */
-class SharedSiteIdsTest extends DatabaseTestCase
-{
- /**
- * @var SharedSiteIds
- */
- private $sharedSiteIds;
-
- public function setUp()
- {
- parent::setUp();
-
- $this->sharedSiteIds = new SharedSiteIds(array(1,2,5,9));
- }
-
- public function tearDown()
- {
- $siteIdsToCleanup = new SharedSiteIds(array());
- $siteIdsToCleanup->setSiteIdsToArchive(array());
-
- parent::tearDown();
- }
-
- public function test_construct_withEmptyValue()
- {
- $this->sharedSiteIds->setSiteIdsToArchive(array());
-
- $siteIds = new SharedSiteIds(null);
- $this->assertEquals(0, $siteIds->getNumSites());
- $this->assertNull($siteIds->getNextSiteId());
- }
-
- public function test_isSupported()
- {
- $this->assertTrue(SharedSiteIds::isSupported());
- }
-
- public function test_getNumSites()
- {
- $this->assertEquals(4, $this->sharedSiteIds->getNumSites());
- }
-
- public function test_getAllSiteIdsToArchive()
- {
- $this->assertEquals(array(1,2,5,9), $this->sharedSiteIds->getAllSiteIdsToArchive());
- }
-
- public function test_getNumProcessedWebsites_getNextSiteId()
- {
- $this->assertEquals(0, $this->sharedSiteIds->getNumProcessedWebsites());
-
- $this->assertEquals(1, $this->sharedSiteIds->getNextSiteId());
- $this->assertEquals(1, $this->sharedSiteIds->getNumProcessedWebsites());
-
- $this->assertEquals(2, $this->sharedSiteIds->getNextSiteId());
- $this->assertEquals(2, $this->sharedSiteIds->getNumProcessedWebsites());
-
- $this->assertEquals(5, $this->sharedSiteIds->getNextSiteId());
- $this->assertEquals(3, $this->sharedSiteIds->getNumProcessedWebsites());
-
- $this->assertEquals(9, $this->sharedSiteIds->getNextSiteId());
- $this->assertEquals(4, $this->sharedSiteIds->getNumProcessedWebsites());
-
- $this->assertNull($this->sharedSiteIds->getNextSiteId());
- $this->assertEquals(4, $this->sharedSiteIds->getNumProcessedWebsites());
- }
-
- public function test_usingMultipleSharedSiteIds()
- {
- $second = new SharedSiteIds(array(7,9,11,6,1,2));
-
- // should ignore his queue and help processing the existing queue
- $this->assertEquals(4, $second->getNumSites());
- $this->assertEquals(4, $this->sharedSiteIds->getNumSites());
-
- $this->assertEquals(array(1,2,5,9), $second->getAllSiteIdsToArchive());
- $this->assertEquals(1, $second->getNextSiteId());
- $this->assertEquals(1, $second->getNumProcessedWebsites());
-
- $this->assertEquals(array(2,5,9), $this->sharedSiteIds->getAllSiteIdsToArchive());
- $this->assertEquals(2, $this->sharedSiteIds->getNextSiteId());
- $this->assertEquals(2, $this->sharedSiteIds->getNumProcessedWebsites());
-
- $this->assertEquals(array(5,9), $second->getAllSiteIdsToArchive());
- $this->assertEquals(5, $second->getNextSiteId());
- $this->assertEquals(3, $second->getNumProcessedWebsites());
-
- $this->assertEquals(array(9), $this->sharedSiteIds->getAllSiteIdsToArchive());
- $this->assertEquals(9, $this->sharedSiteIds->getNextSiteId());
- $this->assertEquals(4, $this->sharedSiteIds->getNumProcessedWebsites());
-
- $this->assertNull($second->getNextSiteId());
- $this->assertEquals(4, $second->getNumProcessedWebsites());
- $this->assertEquals(array(), $second->getAllSiteIdsToArchive());
-
- $this->assertNull($this->sharedSiteIds->getNextSiteId());
- $this->assertEquals(4, $this->sharedSiteIds->getNumProcessedWebsites());
- $this->assertEquals(array(), $this->sharedSiteIds->getAllSiteIdsToArchive());
- }
-
-} \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/Core/DbTest.php b/tests/PHPUnit/Integration/Core/DbTest.php
deleted file mode 100644
index daa2c33ecb..0000000000
--- a/tests/PHPUnit/Integration/Core/DbTest.php
+++ /dev/null
@@ -1,32 +0,0 @@
-<?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\Common;
-use Piwik\Db;
-
-/**
- * Class Core_DbTest
- *
- * @group Core
- */
-class Core_DbTest extends DatabaseTestCase
-{
-
- public function test_getColumnNamesFromTable()
- {
- $this->assertColumnNames('access', array('login', 'idsite', 'access'));
- $this->assertColumnNames('option', array('option_name', 'option_value', 'autoload'));
- }
-
- private function assertColumnNames($tableName, $expectedColumnNames)
- {
- $colmuns = Db::getColumnNamesFromTable(Common::prefixTable($tableName));
-
- $this->assertEquals($expectedColumnNames, $colmuns);
- }
-
-} \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/Core/JsProxyTest.php b/tests/PHPUnit/Integration/Core/JsProxyTest.php
deleted file mode 100644
index cd4c84a763..0000000000
--- a/tests/PHPUnit/Integration/Core/JsProxyTest.php
+++ /dev/null
@@ -1,88 +0,0 @@
-<?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\Tests\Fixture;
-
-class Test_Piwik_JsProxy extends PHPUnit_Framework_TestCase
-{
- /**
- * @group Core
- */
- function testPiwikJs()
- {
- $curlHandle = curl_init();
- curl_setopt($curlHandle, CURLOPT_URL, $this->getStaticSrvUrl() . '/js/');
- curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, true);
- $fullResponse = curl_exec($curlHandle);
- $responseInfo = curl_getinfo($curlHandle);
- curl_close($curlHandle);
-
- $this->assertEquals(200, $responseInfo["http_code"], 'Ok response');
-
- $piwik_js = file_get_contents(PIWIK_PATH_TEST_TO_ROOT . '/piwik.js');
- $this->assertEquals($piwik_js, $fullResponse, 'script content');
- }
-
- /**
- * @group Core
- */
- function testPiwikJsNoComment()
- {
- $curlHandle = curl_init();
- curl_setopt($curlHandle, CURLOPT_URL, $this->getStaticSrvUrl() . '/js/tracker.php');
- curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, true);
- $fullResponse = curl_exec($curlHandle);
- $responseInfo = curl_getinfo($curlHandle);
- curl_close($curlHandle);
-
- $this->assertEquals(200, $responseInfo["http_code"], 'Ok response');
-
- $piwikJs = file_get_contents(PIWIK_PATH_TEST_TO_ROOT . '/piwik.js');
- $piwikNoCommentJs = substr($piwikJs, strpos($piwikJs, "*/\n") + 3);
- $this->assertEquals($piwikNoCommentJs, $fullResponse, 'script content (if comment shows, $byteStart value in /js/tracker.php)');
- }
-
- /**
- * @group Core
- */
- function testPiwikPhp()
- {
- $curlHandle = curl_init();
- $url = $this->getStaticSrvUrl() . '/js/?idsite=1';
- curl_setopt($curlHandle, CURLOPT_URL, $url);
- curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, true);
- $fullResponse = curl_exec($curlHandle);
- $responseInfo = curl_getinfo($curlHandle);
- curl_close($curlHandle);
-
- // FIXME
- $this->markTestSkipped('skipped test as it started failing on travis (works locally) - response was ' . var_export($responseInfo, true));
-
- $this->assertEquals($responseInfo["http_code"], 200, 'Ok response');
- $expected = "R0lGODlhAQABAIAAAAAAAAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==";
- $processed = base64_encode($fullResponse);
- if ($expected != $processed) {
- $this->markTestSkipped("testPiwikPhp invalid response content: " . $fullResponse);
- }
-
- $this->assertEquals(
- $expected,
- $processed,
- 'checking for image content' . "\n\n\n\nRaw content: \n\n\n" . $fullResponse
- );
-
- }
-
- /**
- * Helper methods
- */
- private function getStaticSrvUrl()
- {
- return Fixture::getRootUrl();
- }
-}
diff --git a/tests/PHPUnit/Integration/Core/LogTest.php b/tests/PHPUnit/Integration/Core/LogTest.php
deleted file mode 100644
index a3923183ae..0000000000
--- a/tests/PHPUnit/Integration/Core/LogTest.php
+++ /dev/null
@@ -1,303 +0,0 @@
-<?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\Common;
-use Piwik\Config;
-use Piwik\Db;
-use Piwik\Error;
-use Piwik\ExceptionHandler;
-use Piwik\Log;
-use Piwik\Plugins\TestPlugin\TestLoggingUtility;
-
-require_once PIWIK_INCLUDE_PATH . '/tests/resources/TestPluginLogClass.php';
-
-/**
- * Class Core_LogTest
- *
- * @group Core
- * @group Core_LogTest
- */
-class Core_LogTest extends DatabaseTestCase
-{
- const TESTMESSAGE = 'test%smessage';
- const STRING_MESSAGE_FORMAT = '[%tag%] %message%';
- const STRING_MESSAGE_FORMAT_SPRINTF = "[%s] %s";
-
- public static $expectedExceptionOutput = array(
- 'screen' => 'dummy error message<br />
- <br />
- --&gt; To temporarily debug this error further, set const PIWIK_PRINT_ERROR_BACKTRACE=true; in index.php',
- 'file' => '[Core_LogTest] LogTest.php(165): dummy error message
- dummy backtrace',
- 'database' => '[Core_LogTest] LogTest.php(165): dummy error message
-dummy backtrace'
- );
-
- public static $expectedErrorOutput = array(
- 'screen' => '<div style=\'word-wrap: break-word; border: 3px solid red; padding:4px; width:70%; background-color:#FFFF96;\'>
- <strong>There is an error. Please report the message (Piwik 2.0)
- and full backtrace in the <a href=\'?module=Proxy&action=redirect&url=http://forum.piwik.org\' target=\'_blank\'>Piwik forums</a> (please do a Search first as it might have been reported already!).<br /><br/>
- Unknown error (102):</strong> <em>dummy error string</em> in <strong>dummyerrorfile.php</strong> on line <strong>145</strong>
-<br /><br />Backtrace --&gt;<div style="font-family:Courier;font-size:10pt"><br />
-dummy backtrace</div><br />
- </pre></div><br />',
- 'file' => '[Core_LogTest] dummyerrorfile.php(145): Unknown error (102) - dummy error string
- dummy backtrace',
- 'database' => '[Core_LogTest] dummyerrorfile.php(145): Unknown error (102) - dummy error string
-dummy backtrace'
- );
-
- private $screenOutput;
-
- public static function setUpBeforeClass()
- {
- parent::setUpBeforeClass();
-
- Error::setErrorHandler();
- ExceptionHandler::setUp();
- }
-
- public static function tearDownAfterClass()
- {
- restore_error_handler();
- restore_exception_handler();
-
- parent::tearDownAfterClass();
- }
-
- public function setUp()
- {
- parent::setUp();
-
- Config::getInstance()->log['string_message_format'] = self::STRING_MESSAGE_FORMAT;
- Config::getInstance()->log['logger_file_path'] = self::getDefaultLogFileLocation();
- @unlink(self::getLogFileLocation());
- Log::unsetInstance();
- Error::$debugBacktraceForTests = ExceptionHandler::$debugBacktraceForTests = "dummy backtrace";
- }
-
- public function tearDown()
- {
- parent::tearDown();
-
- Log::unsetInstance();
- @unlink(self::getLogFileLocation());
- Error::$debugBacktraceForTests = ExceptionHandler::$debugBacktraceForTests = null;
- }
-
- /**
- * Data provider for every test.
- */
- public function getBackendsToTest()
- {
- return array(array('screen'),
- array('file'),
- array('database'));
- }
-
- /**
- * @group Core
- *
- * @dataProvider getBackendsToTest
- */
- public function testLoggingWorksWhenMessageIsString($backend)
- {
- Config::getInstance()->log['log_writers'] = array($backend);
-
- ob_start();
- Log::warning(self::TESTMESSAGE);
- $this->screenOutput = ob_get_contents();
- ob_end_clean();
-
- $this->checkBackend($backend, self::TESTMESSAGE, $formatMessage = true, $tag = 'Core_LogTest');
- }
-
- /**
- * @group Core
- *
- * @dataProvider getBackendsToTest
- */
- public function testLoggingWorksWhenMessageIsSprintfString($backend)
- {
- Config::getInstance()->log['log_writers'] = array($backend);
-
- ob_start();
- Log::warning(self::TESTMESSAGE, " subst ");
- $this->screenOutput = ob_get_contents();
- ob_end_clean();
-
- $this->checkBackend($backend, sprintf(self::TESTMESSAGE, " subst "), $formatMessage = true, $tag = 'Core_LogTest');
- }
-
- /**
- * @group Core
- *
- * @dataProvider getBackendsToTest
- */
- public function testLoggingWorksWhenMessageIsError($backend)
- {
- Config::getInstance()->log['log_writers'] = array($backend);
-
- ob_start();
- $error = new Error(102, "dummy error string", "dummyerrorfile.php", 145, "dummy backtrace");
- Log::error($error);
- $this->screenOutput = ob_get_contents();
- ob_end_clean();
-
- $this->checkBackend($backend, self::$expectedErrorOutput[$backend], $formatMessage = false, $tag = 'Core_LogTest');
- $this->checkBackend('screen', self::$expectedErrorOutput['screen']); // errors should always written to the screen
- }
-
- /**
- * @group Core
- *
- * @dataProvider getBackendsToTest
- */
- public function testLoggingWorksWhenMessageIsException($backend)
- {
- Config::getInstance()->log['log_writers'] = array($backend);
-
- ob_start();
- $exception = new Exception("dummy error message");
- Log::error($exception);
- $this->screenOutput = ob_get_contents();
- ob_end_clean();
-
- $this->checkBackend($backend, self::$expectedExceptionOutput[$backend], $formatMessage = false, $tag = 'Core_LogTest');
- $this->checkBackend('screen', self::$expectedExceptionOutput['screen']); // errors should always written to the screen
- }
-
- /**
- * @group Core
- *
- * @dataProvider getBackendsToTest
- */
- public function testLoggingCorrectlyIdentifiesPlugin($backend)
- {
- Config::getInstance()->log['log_writers'] = array($backend);
-
- ob_start();
- TestLoggingUtility::doLog(self::TESTMESSAGE);
- $this->screenOutput = ob_get_contents();
- ob_end_clean();
-
- $this->checkBackend($backend, self::TESTMESSAGE, $formatMessage = true, $tag = 'TestPlugin');
- }
-
- /**
- * @group Core
- *
- * @dataProvider getBackendsToTest
- */
- public function testLogMessagesIgnoredWhenNotWithinLevel($backend)
- {
- Config::getInstance()->log['log_writers'] = array($backend);
- Config::getInstance()->log['log_level'] = 'ERROR';
-
- ob_start();
- Log::info(self::TESTMESSAGE);
- $this->screenOutput = ob_get_contents();
- ob_end_clean();
-
- $this->checkNoMessagesLogged($backend);
- }
-
- /**
- * @group Core
- * @dataProvider getBackendsToTest
- */
- public function testLogMessagesAreTrimmed($backend)
- {
- Config::getInstance()->log['log_writers'] = array($backend);
-
- ob_start();
- TestLoggingUtility::doLog(" \n ".self::TESTMESSAGE."\n\n\n \n");
- $this->screenOutput = ob_get_contents();
- ob_end_clean();
-
- $this->checkBackend($backend, self::TESTMESSAGE, $formatMessage = true, $tag = 'TestPlugin');
- }
-
- private function checkBackend($backend, $expectedMessage, $formatMessage = false, $tag = false)
- {
- if ($formatMessage) {
- $expectedMessage = sprintf(self::STRING_MESSAGE_FORMAT_SPRINTF, $tag, $expectedMessage);
- }
-
- // remove version number from message
- $expectedMessage = str_replace("(Piwik 2.0)", "", $expectedMessage);
- $this->screenOutput = str_replace("(Piwik ". \Piwik\Version::VERSION.")", "", $this->screenOutput);
-
- if ($backend == 'screen') {
- if ($formatMessage
- && !Common::isPhpCliMode()) {
- $expectedMessage = '<pre>' . $expectedMessage . '</pre>';
- }
-
- $this->screenOutput = $this->removePathsFromBacktrace($this->screenOutput);
-
- $this->assertEquals($expectedMessage . "\n", $this->screenOutput, "unexpected output: ".$this->screenOutput);
- } else if ($backend == 'file') {
- $this->assertTrue(file_exists(self::getLogFileLocation()));
-
- $fileContents = file_get_contents(self::getLogFileLocation());
- $fileContents = $this->removePathsFromBacktrace($fileContents);
-
- $this->assertEquals($expectedMessage . "\n", $fileContents);
- } else if ($backend == 'database') {
- $count = Db::fetchOne("SELECT COUNT(*) FROM " . Common::prefixTable('logger_message'));
- $this->assertEquals(1, $count);
-
- $message = Db::fetchOne("SELECT message FROM " . Common::prefixTable('logger_message') . " LIMIT 1");
- $message = $this->removePathsFromBacktrace($message);
- $this->assertEquals($expectedMessage, $message);
-
- $tagInDb = Db::fetchOne("SELECT tag FROM " . Common::prefixTable('logger_message') . " LIMIT 1");
- if ($tag === false) {
- $this->assertEmpty($tagInDb);
- } else {
- $this->assertEquals($tag, $tagInDb);
- }
- }
- }
-
- private function checkNoMessagesLogged($backend)
- {
- if ($backend == 'screen') {
- $this->assertEmpty($this->screenOutput, "Output not empty: ".$this->screenOutput);
- } else if ($backend == 'file') {
- $this->assertFalse(file_exists(self::getLogFileLocation()));
- } else if ($backend == 'database') {
- $this->assertEquals(0, Db::fetchOne("SELECT COUNT(*) FROM " . Common::prefixTable('logger_message')));
- }
- }
-
- private function removePathsFromBacktrace($content)
- {
- return preg_replace_callback("/(?:\/[^\s(<>]+)*\//", function ($matches) {
- if ($matches[0] == '/') {
- return '/';
- } else {
- return '';
- }
- }, $content);
- }
-
- public static function getLogFileLocation()
- {
- $path = self::getDefaultLogFileLocation();
- $path = \Piwik\SettingsPiwik::rewriteTmpPathWithInstanceId($path);
- return $path;
- }
-
- protected static function getDefaultLogFileLocation()
- {
- $path = PIWIK_INCLUDE_PATH . '/tmp/logs/piwik.test.log';
- return $path;
- }
-
-} \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/Core/OptionTest.php b/tests/PHPUnit/Integration/Core/OptionTest.php
deleted file mode 100644
index 41a12df3fd..0000000000
--- a/tests/PHPUnit/Integration/Core/OptionTest.php
+++ /dev/null
@@ -1,191 +0,0 @@
-<?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\Common;
-use Piwik\Db;
-use Piwik\Option;
-
-/**
- * Class Core_OptionTest
- *
- * @group Core
- * @group Core_OptionTest
- */
-class Core_OptionTest extends DatabaseTestCase
-{
- /**
- * @group Core
- */
- public function testGet()
- {
- // empty table, expect false (i.e., not found)
- $this->assertFalse(Option::get('anonymous_defaultReport'));
-
- // populate table, expect '1' (i.e., found)
- Db::query("INSERT INTO `" . Common::prefixTable('option') . "` VALUES ('anonymous_defaultReport', '1', false)");
- $this->assertSame('1', Option::get('anonymous_defaultReport'));
-
- // delete row (bypassing API), expect '1' (i.e., from cache)
- Db::query("DELETE FROM `" . Common::prefixTable('option') . "` WHERE option_name = ?", array('anonymous_defaultReport'));
- $this->assertSame('1', Option::get('anonymous_defaultReport'));
-
- // force cache reload, expect false (i.e., not found)
- Option::clearCache();
- $this->assertFalse(Option::get('anonymous_defaultReport'));
- }
-
- /**
- * @group Core
- */
- public function testGetOption()
- {
- // empty table, expect false (i.e., not found)
- $this->assertFalse(Option::get('anonymous_defaultReport'));
-
- // populate table, expect '1' (i.e., found)
- Db::query("INSERT INTO `" . Common::prefixTable('option') . "` VALUES ('anonymous_defaultReport', '1',true)");
- $this->assertSame('1', Option::get('anonymous_defaultReport'));
-
- // delete row (bypassing API), expect '1' (i.e., from cache)
- Db::query("DELETE FROM `" . Common::prefixTable('option') . "` WHERE option_name = ?", array('anonymous_defaultReport'));
- $this->assertSame('1', Option::get('anonymous_defaultReport'));
-
- // force cache reload, expect false (i.e., not found)
- Option::clearCache();
- $this->assertFalse(Option::get('anonymous_defaultReport'));
- }
-
- /**
- * @group Core
- */
- public function testSet()
- {
- // empty table, expect false (i.e., not found)
- $this->assertFalse(Option::get('anonymous_defaultReport'));
-
- // populate table, expect '1'
- Option::set('anonymous_defaultReport', '1', true);
- $this->assertSame('1', Option::get('anonymous_defaultReport'));
- }
-
- /**
- * @group Core
- */
- public function testSetOption()
- {
- // empty table, expect false (i.e., not found)
- $this->assertFalse(Option::get('anonymous_defaultReport'));
-
- // populate table, expect '1'
- Option::set('anonymous_defaultReport', '1', false);
- $this->assertSame('1', Option::get('anonymous_defaultReport'));
- }
-
- /**
- * @group Core
- */
- public function testDelete()
- {
- // empty table, expect false (i.e., not found)
- $this->assertFalse(Option::get('anonymous_defaultReport'));
- $this->assertFalse(Option::get('admin_defaultReport'));
-
- // populate table, expect '1'
- Option::set('anonymous_defaultReport', '1', true);
- Option::delete('_defaultReport');
- $this->assertSame('1', Option::get('anonymous_defaultReport'));
-
- // populate table, expect '2'
- Option::set('admin_defaultReport', '2', false);
- Option::delete('_defaultReport');
- $this->assertSame('2', Option::get('admin_defaultReport'));
-
- // delete with non-matching value, expect '1'
- Option::delete('anonymous_defaultReport', '2');
- $this->assertSame('1', Option::get('anonymous_defaultReport'));
-
- // delete with matching value, expect false
- Option::delete('anonymous_defaultReport', '1');
- $this->assertFalse(Option::get('anonymous_defaultReport'));
-
- // this shouldn't have been deleted, expect '2'
- $this->assertSame('2', Option::get('admin_defaultReport'));
-
- // deleted, expect false
- Option::delete('admin_defaultReport');
- $this->assertFalse(Option::get('admin_defaultReport'));
- }
-
- /**
- * @group Core
- */
- public function testDeleteLike()
- {
- // empty table, expect false (i.e., not found)
- $this->assertFalse(Option::get('anonymous_defaultReport'));
- $this->assertFalse(Option::get('admin_defaultReport'));
- $this->assertFalse(Option::get('visitor_defaultReport'));
-
- // insert guard - to test unescaped underscore
- Option::set('adefaultReport', '0', true);
- $this->assertTrue(Option::get('adefaultReport') === '0');
-
- // populate table, expect '1'
- Option::set('anonymous_defaultReport', '1', true);
- Option::deleteLike('\_defaultReport');
- $this->assertSame('1', Option::get('anonymous_defaultReport'));
- $this->assertSame('0', Option::get('adefaultReport'));
-
- // populate table, expect '2'
- Option::set('admin_defaultReport', '2', false);
- Option::deleteLike('\_defaultReport');
- $this->assertSame('2', Option::get('admin_defaultReport'));
- $this->assertSame('0', Option::get('adefaultReport'));
-
- // populate table, expect '3'
- Option::set('visitor_defaultReport', '3', false);
- Option::deleteLike('\_defaultReport');
- $this->assertSame('3', Option::get('visitor_defaultReport'));
- $this->assertSame('0', Option::get('adefaultReport'));
-
- // delete with non-matching value, expect '1'
- Option::deleteLike('%\_defaultReport', '4');
- $this->assertSame('1', Option::get('anonymous_defaultReport'));
- $this->assertSame('0', Option::get('adefaultReport'));
-
- // delete with matching pattern, expect false
- Option::deleteLike('%\_defaultReport', '1');
- $this->assertFalse(Option::get('anonymous_defaultReport'));
- $this->assertSame('0', Option::get('adefaultReport'));
-
- // this shouldn't have been deleted, expect '2' and '3'
- $this->assertSame('2', Option::get('admin_defaultReport'));
- $this->assertSame('3', Option::get('visitor_defaultReport'));
- $this->assertSame('0', Option::get('adefaultReport'));
-
- // deleted, expect false (except for the guard)
- Option::deleteLike('%\_defaultReport');
- $this->assertFalse(Option::get('admin_defaultReport'));
- $this->assertFalse(Option::get('visitor_defaultReport'));
-
- // unescaped backslash (single quotes)
- Option::deleteLike('%\_defaultReport');
- $this->assertSame('0', Option::get('adefaultReport'));
-
- // escaped backslash (single quotes)
- Option::deleteLike('%\\_defaultReport');
- $this->assertSame('0', Option::get('adefaultReport'));
-
- // unescaped backslash (double quotes)
- Option::deleteLike("%\_defaultReport");
- $this->assertSame('0', Option::get('adefaultReport'));
-
- // escaped backslash (double quotes)
- Option::deleteLike("%\\_defaultReport");
- $this->assertSame('0', Option::get('adefaultReport'));
- }
-}
diff --git a/tests/PHPUnit/Integration/Core/PiwikTest.php b/tests/PHPUnit/Integration/Core/PiwikTest.php
deleted file mode 100644
index 23692355d5..0000000000
--- a/tests/PHPUnit/Integration/Core/PiwikTest.php
+++ /dev/null
@@ -1,386 +0,0 @@
-<?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\Filesystem;
-use Piwik\MetricsFormatter;
-use Piwik\Piwik;
-use Piwik\Plugins\SitesManager\API;
-use Piwik\Translate;
-
-/**
- * Class Core_PiwikTest
- *
- * @group Core
- */
-class Core_PiwikTest extends DatabaseTestCase
-{
- public function setUp()
- {
- parent::setUp();
- }
-
- /**
- * Tests the generated JS code
- * @group Core
- */
- public function testJavascriptTrackingCode_withAllOptions()
- {
- $jsTag = Piwik::getJavascriptCode($idSite = 1, $piwikUrl = 'http://localhost/piwik',
- $mergeSubdomains = true, $groupPageTitlesByDomain = true, $mergeAliasUrls = true,
- $visitorCustomVariables = array( array("name", "value"), array("name 2", "value 2") ),
- $pageCustomVariables = array( array("page cvar", "page cvar value") ),
- $customCampaignNameQueryParam = "campaignKey", $customCampaignKeywordParam = "keywordKey",
- $doNotTrack = true);
-
- $expected = "&lt;!-- Piwik --&gt;
-&lt;script type=&quot;text/javascript&quot;&gt;
- var _paq = _paq || [];
- _paq.push([\"setDocumentTitle\", document.domain + \"/\" + document.title]);
- // you can set up to 5 custom variables for each visitor
- _paq.push([\"setCustomVariable\", 1, \"name\", \"value\", \"visit\"]);
- _paq.push([\"setCustomVariable\", 2, \"name 2\", \"value 2\", \"visit\"]);
- // you can set up to 5 custom variables for each action (page view, download, click, site search)
- _paq.push([\"setCustomVariable\", 1, \"page cvar\", \"page cvar value\", \"page\"]);
- _paq.push([\"setCampaignNameKey\", \"campaignKey\"]);
- _paq.push([\"setCampaignKeywordKey\", \"keywordKey\"]);
- _paq.push([\"setDoNotTrack\", true]);
- _paq.push(['trackPageView']);
- _paq.push(['enableLinkTracking']);
- (function() {
- var u=&quot;//localhost/piwik/&quot;;
- _paq.push(['setTrackerUrl', u+'piwik.php']);
- _paq.push(['setSiteId', 1]);
- var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
- g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
- })();
-&lt;/script&gt;
-&lt;noscript&gt;&lt;p&gt;&lt;img src=&quot;//localhost/piwik/piwik.php?idsite=1&quot; style=&quot;border:0;&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;&lt;/noscript&gt;
-&lt;!-- End Piwik Code --&gt;
-";
-
- $this->assertEquals($expected, $jsTag);
- }
-
- /**
- * Tests the generated JS code with protocol overwrite
- * @group Core
- */
- public function testJavascriptTrackingCode_withAllOptionsAndProtocolOverwrite()
- {
- Piwik::addAction('Piwik.getJavascriptCode', function (&$codeImpl) {
- $codeImpl['protocol'] = 'https://';
- });
-
- $jsTag = Piwik::getJavascriptCode($idSite = 1, $piwikUrl = 'http://localhost/piwik',
- $mergeSubdomains = true, $groupPageTitlesByDomain = true, $mergeAliasUrls = true,
- $visitorCustomVariables = array( array("name", "value"), array("name 2", "value 2") ),
- $pageCustomVariables = array( array("page cvar", "page cvar value") ),
- $customCampaignNameQueryParam = "campaignKey", $customCampaignKeywordParam = "keywordKey",
- $doNotTrack = true);
-
- $expected = "&lt;!-- Piwik --&gt;
-&lt;script type=&quot;text/javascript&quot;&gt;
- var _paq = _paq || [];
- _paq.push([\"setDocumentTitle\", document.domain + \"/\" + document.title]);
- // you can set up to 5 custom variables for each visitor
- _paq.push([\"setCustomVariable\", 1, \"name\", \"value\", \"visit\"]);
- _paq.push([\"setCustomVariable\", 2, \"name 2\", \"value 2\", \"visit\"]);
- // you can set up to 5 custom variables for each action (page view, download, click, site search)
- _paq.push([\"setCustomVariable\", 1, \"page cvar\", \"page cvar value\", \"page\"]);
- _paq.push([\"setCampaignNameKey\", \"campaignKey\"]);
- _paq.push([\"setCampaignKeywordKey\", \"keywordKey\"]);
- _paq.push([\"setDoNotTrack\", true]);
- _paq.push(['trackPageView']);
- _paq.push(['enableLinkTracking']);
- (function() {
- var u=&quot;https://localhost/piwik/&quot;;
- _paq.push(['setTrackerUrl', u+'piwik.php']);
- _paq.push(['setSiteId', 1]);
- var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
- g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
- })();
-&lt;/script&gt;
-&lt;noscript&gt;&lt;p&gt;&lt;img src=&quot;https://localhost/piwik/piwik.php?idsite=1&quot; style=&quot;border:0;&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;&lt;/noscript&gt;
-&lt;!-- End Piwik Code --&gt;
-";
-
- $this->assertEquals($expected, $jsTag);
- }
-
- /**
- * Tests the generated JS code with options before tracker url
- * @group Core
- */
- public function testJavascriptTrackingCode_withAllOptionsAndOptionsBeforeTrackerUrl()
- {
- Piwik::addAction('Piwik.getJavascriptCode', function (&$codeImpl) {
- $codeImpl['optionsBeforeTrackerUrl'] .= "_paq.push(['setAPIUrl', 'http://localhost/statistics']);\n ";
- });
-
- $jsTag = Piwik::getJavascriptCode($idSite = 1, $piwikUrl = 'http://localhost/piwik',
- $mergeSubdomains = true, $groupPageTitlesByDomain = true, $mergeAliasUrls = true,
- $visitorCustomVariables = array( array("name", "value"), array("name 2", "value 2") ),
- $pageCustomVariables = array( array("page cvar", "page cvar value") ),
- $customCampaignNameQueryParam = "campaignKey", $customCampaignKeywordParam = "keywordKey",
- $doNotTrack = true);
-
- $expected = "&lt;!-- Piwik --&gt;
-&lt;script type=&quot;text/javascript&quot;&gt;
- var _paq = _paq || [];
- _paq.push([\"setDocumentTitle\", document.domain + \"/\" + document.title]);
- // you can set up to 5 custom variables for each visitor
- _paq.push([\"setCustomVariable\", 1, \"name\", \"value\", \"visit\"]);
- _paq.push([\"setCustomVariable\", 2, \"name 2\", \"value 2\", \"visit\"]);
- // you can set up to 5 custom variables for each action (page view, download, click, site search)
- _paq.push([\"setCustomVariable\", 1, \"page cvar\", \"page cvar value\", \"page\"]);
- _paq.push([\"setCampaignNameKey\", \"campaignKey\"]);
- _paq.push([\"setCampaignKeywordKey\", \"keywordKey\"]);
- _paq.push([\"setDoNotTrack\", true]);
- _paq.push(['trackPageView']);
- _paq.push(['enableLinkTracking']);
- (function() {
- var u=&quot;//localhost/piwik/&quot;;
- _paq.push(['setAPIUrl', 'http://localhost/statistics']);
- _paq.push(['setTrackerUrl', u+'piwik.php']);
- _paq.push(['setSiteId', 1]);
- var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
- g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
- })();
-&lt;/script&gt;
-&lt;noscript&gt;&lt;p&gt;&lt;img src=&quot;//localhost/piwik/piwik.php?idsite=1&quot; style=&quot;border:0;&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;&lt;/noscript&gt;
-&lt;!-- End Piwik Code --&gt;
-";
-
- $this->assertEquals($expected, $jsTag);
- }
-
- /**
- * Dataprovider for testIsNumericValid
- */
- public function getValidNumeric()
- {
- $valid = array(
- -1, 0, 1, 1.5, -1.5, 21111, 89898, 99999999999, -4565656,
- (float)-1, (float)0, (float)1, (float)1.5, (float)-1.5, (float)21111, (float)89898, (float)99999999999, (float)-4565656,
- (int)-1, (int)0, (int)1, (int)1.5, (int)-1.5, (int)21111, (int)89898, (int)99999999999, (int)-4565656,
- '-1', '0', '1', '1.5', '-1.5', '21111', '89898', '99999999999', '-4565656',
- '1e3', '0x123', "-1e-2",
- );
- foreach ($valid as $key => $value) {
- $valid[$key] = array($value);
- }
- return $valid;
- }
-
- /**
- * @dataProvider getValidNumeric
- */
- public function testIsNumericValid($toTest)
- {
- $this->assertTrue(is_numeric($toTest), $toTest . " not valid but should!");
- }
-
- /**
- * Dataprovider for testIsNumericNotValid
- */
- public function getInvalidNumeric()
- {
- $notValid = array(
- '-1.0.0', '1,2', '--1', '-.', '- 1', '1-',
- );
- foreach ($notValid as $key => $value) {
- $notValid[$key] = array($value);
- }
- return $notValid;
- }
-
- /**
- * @dataProvider getInvalidNumeric
- */
- public function testIsNumericNotValid($toTest)
- {
- $this->assertFalse(is_numeric($toTest), $toTest . " valid but shouldn't!");
- }
-
- public function testSecureDiv()
- {
- $this->assertSame(3, Piwik::secureDiv(9, 3));
- $this->assertSame(0, Piwik::secureDiv(9, 0));
- $this->assertSame(10, Piwik::secureDiv(10, 1));
- $this->assertSame(10.0, Piwik::secureDiv(10.0, 1.0));
- $this->assertSame(5.5, Piwik::secureDiv(11.0, 2));
- $this->assertSame(0, Piwik::secureDiv(11.0, 'a'));
- }
-
- /**
- * Dataprovider for testGetPrettyTimeFromSeconds
- */
- public function getPrettyTimeFromSecondsData()
- {
- return array(
- array(30, array('30s', '00:00:30')),
- array(60, array('1 min 0s', '00:01:00')),
- array(100, array('1 min 40s', '00:01:40')),
- array(3600, array('1 hours 0 min', '01:00:00')),
- array(3700, array('1 hours 1 min', '01:01:40')),
- array(86400 + 3600 * 10, array('1 days 10 hours', '34:00:00')),
- array(86400 * 365, array('365 days 0 hours', '8760:00:00')),
- array((86400 * (365.25 + 10)), array('1 years 10 days', '9006:00:00')),
- array(1.342, array('1.34s', '00:00:01.34')),
- array(.342, array('0.34s', '00:00:00.34')),
- array(.02, array('0.02s', '00:00:00.02')),
- array(.002, array('0.002s', '00:00:00')),
- array(1.002, array('1s', '00:00:01')),
- array(1.02, array('1.02s', '00:00:01.02')),
- array(1.2, array('1.2s', '00:00:01.20')),
- array(122.1, array('2 min 2.1s', '00:02:02.10')),
- array(-122.1, array('-2 min 2.1s', '-00:02:02.10')),
- array(86400 * -365, array('-365 days 0 hours', '-8760:00:00'))
- );
- }
-
- /**
- * @dataProvider getPrettyTimeFromSecondsData
- */
- public function testGetPrettyTimeFromSeconds($seconds, $expected)
- {
- if (($seconds * 100) > PHP_INT_MAX) {
- $this->markTestSkipped("Will not pass on 32-bit machine.");
- }
-
- Translate::loadEnglishTranslation();
-
- $sentenceExpected = str_replace(' ', '&nbsp;', $expected[0]);
- $numericExpected = $expected[1];
- $this->assertEquals($sentenceExpected, MetricsFormatter::getPrettyTimeFromSeconds($seconds, $sentence = true));
- $this->assertEquals($numericExpected, MetricsFormatter::getPrettyTimeFromSeconds($seconds, $sentence = false));
-
- Translate::unloadEnglishTranslation();
- }
-
- /**
- * Dataprovider for testCheckValidLoginString
- */
- public function getInvalidLoginStringData()
- {
- $notValid = array(
- '',
- ' ',
- 'a',
- 'aa',
- 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
- 'alpha/beta',
- 'alpha:beta',
- 'alpha;beta',
- 'alpha<beta',
- 'alpha=beta',
- 'alpha>beta',
- 'alpha?beta',
- );
- foreach ($notValid as $key => $value) {
- $notValid[$key] = array($value);
- }
- return $notValid;
- }
-
- /**
- * @dataProvider getInvalidLoginStringData
- * @expectedException \Exception
- */
- public function testCheckInvalidLoginString($toTest)
- {
- Piwik::checkValidLoginString($toTest);
- }
-
- /**
- * Dataprovider for testCheckValidLoginString
- */
- public function getValidLoginStringData()
- {
- $valid = array(
- 'aaa',
- 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
- 'shoot_puck@the-goal.com',
- );
- foreach ($valid as $key => $value) {
- $valid[$key] = array($value);
- }
- return $valid;
- }
-
- /**
- * @dataProvider getValidLoginStringData
- */
- public function testCheckValidLoginString($toTest)
- {
- $this->assertNull(Piwik::checkValidLoginString($toTest));
- }
-
- /**
- * Dataprovider for testGetPrettyValue
- */
- public function getGetPrettyValueTestCases()
- {
- return array(
- array('revenue', 12, '$ 12'),
- array('revenue_evolution', '100 %', '100 %'),
- array('avg_time_generation', '3.333', '3.33s'),
- array('avg_time_generation', '333.333', '5&nbsp;min&nbsp;33.33s'),
- array('avg_time_on_page', '3', '00:00:03'),
- array('avg_time_on_page', '333', '00:05:33'),
- );
- }
-
- /**
- * @dataProvider getGetPrettyValueTestCases
- */
- public function testGetPrettyValue($columnName, $value, $expected)
- {
- Translate::loadEnglishTranslation();
-
- $access = Access::getInstance();
- $access->setSuperUserAccess(true);
-
- $idsite = API::getInstance()->addSite("test", "http://test");
-
- $this->assertEquals(
- $expected,
- MetricsFormatter::getPrettyValue($idsite, $columnName, $value, false, false)
- );
-
- Translate::unloadEnglishTranslation();
- }
-
- /**
- * Data provider for testIsAssociativeArray.
- */
- public function getIsAssociativeArrayTestCases()
- {
- return array(
- array(array(0 => 'a', 1 => 'b', 2 => 'c', 3 => 'd', 4 => 'e', 5 => 'f'), false),
- array(array(-1 => 'a', 0 => 'a', 1 => 'a', 2 => 'a', 3 => 'a'), true),
- array(array(4 => 'a', 5 => 'a', 6 => 'a', 7 => 'a', 8 => 'a'), true),
- array(array(0 => 'a', 2 => 'a', 3 => 'a', 4 => 'a', 5 => 'a'), true),
- array(array('abc' => 'a', 0 => 'b', 'sdfds' => 'd'), true),
- array(array('abc' => 'def'), true)
- );
- }
-
- /**
- * @dataProvider getIsAssociativeArrayTestCases
- */
- public function testIsAssociativeArray($array, $expected)
- {
- $this->assertEquals($expected, Piwik::isAssociativeArray($array));
- }
-
- public function testCheckIfFileSystemIsNFSOnNonNFS()
- {
- $this->assertFalse(Filesystem::checkIfFileSystemIsNFS());
- }
-}
diff --git a/tests/PHPUnit/Integration/Core/Plugin/SettingsTest.php b/tests/PHPUnit/Integration/Core/Plugin/SettingsTest.php
deleted file mode 100644
index 41446db7ee..0000000000
--- a/tests/PHPUnit/Integration/Core/Plugin/SettingsTest.php
+++ /dev/null
@@ -1,675 +0,0 @@
-<?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\Plugin\Settings as PluginSettings;
-use Piwik\Settings\Setting;
-
-class CorePluginSettingsTest extends \Piwik\Plugins\ExampleSettingsPlugin\Settings {
-
- public function init()
- {
-
- }
-
- public function addSetting(Setting $setting)
- {
- parent::addSetting($setting);
- }
-}
-
-/**
- * Class Core_Plugin_SettingsTest
- * @group Core
- * @group PluginSettings
- */
-class Core_Plugin_SettingsTest extends DatabaseTestCase
-{
- /**
- * @var CorePluginSettingsTest
- */
- private $settings;
-
- public function setUp()
- {
- parent::setUp();
- Access::setSingletonInstance(null);
-
- $this->settings = $this->createSettingsInstance();
- }
-
- public function tearDown()
- {
- $this->setSuperUser();
- if ($this->settings) {
- $this->settings->removeAllPluginSettings();
- }
-
- parent::tearDown();
- }
-
- /**
- * @expectedException \Exception
- * @expectedExceptionMessage A setting with name "myname" does already exist for plugin "ExampleSettingsPlugin"
- */
- public function test_addSetting_shouldThrowException_InCaseTwoSettingsHaveTheSameName()
- {
- $this->addUserSetting('myname', 'mytitle');
-
- $setting = $this->buildUserSetting('myname', 'mytitle2');
- $this->settings->addSetting($setting);
- }
-
- /**
- * @expectedException \Exception
- * @expectedExceptionMessage The setting name "myname_" in plugin "ExampleSettingsPlugin" is not valid. Only alpha and numerical characters are allowed
- */
- public function test_addSetting_shouldThrowException_IfTheSettingNameIsNotValid()
- {
- $setting = $this->buildUserSetting('myname_', 'mytitle');
- $this->settings->addSetting($setting);
- }
-
- public function test_addSetting_shouldAssignDefaultType_IfFieldIsGivenButNoType()
- {
- $setting = $this->buildUserSetting('myname', 'mytitle');
- $setting->uiControlType = CorePluginSettingsTest::CONTROL_MULTI_SELECT;
-
- $this->settings->addSetting($setting);
-
- $this->assertEquals(CorePluginSettingsTest::TYPE_ARRAY, $setting->type);
- }
-
- public function test_addSetting_shouldAssignDefaultField_IfTypeIsGivenButNoField()
- {
- $setting = $this->buildUserSetting('myname', 'mytitle');
- $setting->type = CorePluginSettingsTest::TYPE_ARRAY;
-
- $this->settings->addSetting($setting);
-
- $this->assertEquals(CorePluginSettingsTest::CONTROL_MULTI_SELECT, $setting->uiControlType);
- }
-
- public function test_addSetting_shouldAddAValidator_IfFieldOptionsAreGiven()
- {
- $setting = $this->buildUserSetting('myname', 'mytitle');
- $setting->availableValues = array('allowedval' => 'DisplayName', 'allowedval2' => 'Name 2');
-
- $this->settings->addSetting($setting);
-
- $this->assertInstanceOf('\Closure', $setting->validate);
- }
-
- public function test_addSetting_shouldAddTheSettings_IfValid()
- {
- $setting = $this->addUserSetting('myname', 'mytitle');
-
- $this->assertEquals(array('myname' => $setting), $this->settings->getSettings());
- }
-
- public function test_addSetting_shouldPassTheStorage_ToTheSetting()
- {
- $this->setSuperUser();
-
- $setting = $this->buildUserSetting('myname', 'mytitle', 'myRandomName');
- $this->settings->addSetting($setting);
-
- $this->settings->setSettingValue($setting, 5);
- $this->assertSettingHasValue($setting, 5);
-
- $this->assertEquals($setting->getValue(), 5);
-
- $this->settings->setSettingValue($setting, 'test3434');
- $this->assertEquals($setting->getValue(), 'test3434');
- }
-
- /**
- * @expectedException \Exception
- * @expectedExceptionMessage The setting myname2 does not exist
- */
- public function test_setSettingValue_shouldThrowException_IfTryingToSetAValueForNotAvailableSetting()
- {
- $this->addUserSetting('myname', 'mytitle');
-
- $setting = $this->buildUserSetting('myname2', 'mytitle2');
- $this->settings->setSettingValue($setting, 2);
- }
-
- /**
- * @expectedException \Exception
- * @expectedExceptionMessage CoreAdminHome_PluginSettingChangeNotAllowed
- */
- public function test_setSettingValue_shouldThrowException_IfAUserIsTryingToSetASettingWhichNeedsSuperUserPermission()
- {
- $this->setUser();
- $setting = $this->addSystemSetting('mysystem', 'mytitle');
-
- $this->settings->setSettingValue($setting, 2);
- }
-
- /**
- * @expectedException \Exception
- * @expectedExceptionMessage CoreAdminHome_PluginSettingChangeNotAllowed
- */
- public function test_setSettingValue_shouldThrowException_IfAnonymousIsTryingToSetASettingWhichNeedsUserPermission()
- {
- $setting = $this->addUserSetting('mysystem', 'mytitle');
-
- $this->settings->setSettingValue($setting, 2);
- }
-
- public function test_setSettingValue_shouldSucceed_IfUserIsTryingToSetASettingWhichNeedsUserPermission()
- {
- $this->setUser();
- $setting = $this->addUserSetting('mysystem', 'mytitle');
-
- $this->settings->setSettingValue($setting, 2);
-
- $this->assertSettingHasValue($setting, 2);
- }
-
- public function test_setSettingValue_shouldSucceed_IfSuperUserTriesToSaveASettingWhichRequiresSuperUserPermission()
- {
- $this->setSuperUser();
-
- $setting = $this->addSystemSetting('mysystem', 'mytitle');
-
- $this->settings->setSettingValue($setting, 2);
-
- $this->assertSettingHasValue($setting, 2);
- }
-
- public function test_setSettingValue_shouldNotPersistValueInDatabase_OnSuccess()
- {
- $this->setSuperUser();
-
- $setting = $this->buildSystemSetting('mysystem', 'mytitle');
- $this->settings->addSetting($setting);
- $this->settings->setSettingValue($setting, 2);
-
- // make sure stored on the instance
- $this->assertSettingHasValue($setting, 2);
- $this->assertSettingIsNotSavedInTheDb('mysystem', null);
- }
-
- /**
- * @expectedException \Exception
- * @expectedExceptionMessage CoreAdminHome_PluginSettingsValueNotAllowed
- */
- public function test_setSettingValue_shouldApplyValidationAndFail_IfOptionsAreSet()
- {
- $this->setUser();
- $setting = $this->buildUserSetting('mysystem', 'mytitle');
- $setting->availableValues = array('allowed' => 'text', 'allowed2' => 'text2');
-
- $this->settings->addSetting($setting);
-
- $this->settings->setSettingValue($setting, 'notallowed');
- }
-
- /**
- * @expectedException \Exception
- * @expectedExceptionMessage CoreAdminHome_PluginSettingsValueNotAllowed
- */
- public function test_setSettingValue_shouldApplyValidationAndFail_IfOptionsAreSetAndValueIsAnArray()
- {
- $this->setUser();
- $setting = $this->buildUserSetting('mysystem', 'mytitle');
- $setting->availableValues = array('allowed' => 'text', 'allowed2' => 'text2');
- $setting->uiControlType = PluginSettings::CONTROL_MULTI_SELECT;
-
- $this->settings->addSetting($setting);
-
- $this->settings->setSettingValue($setting, array('allowed', 'notallowed'));
- }
-
- public function test_setSettingValue_shouldApplyValidationAndSucceed_IfOptionsAreSet()
- {
- $this->setUser();
- $setting = $this->buildUserSetting('mysystem', 'mytitle');
- $setting->availableValues = array('allowed' => 'text', 'allowed2' => 'text2');
- $setting->uiControlType = PluginSettings::CONTROL_MULTI_SELECT;
-
- $this->settings->addSetting($setting);
-
- $this->settings->setSettingValue($setting, array('allowed', 'allowed2'));
- $this->assertSettingHasValue($setting, array('allowed', 'allowed2'));
-
- $setting->type = PluginSettings::TYPE_STRING;
- $this->settings->setSettingValue($setting, 'allowed');
- $this->assertSettingHasValue($setting, 'allowed');
- }
-
- public function test_setSettingValue_shouldCastValue_IfTypeIsSetButNoFilter()
- {
- $this->setUser();
-
- // cast to INT
- $setting = $this->addUserSetting('mysystem', 'mytitle');
- $setting->type = PluginSettings::TYPE_INT;
- $this->settings->setSettingValue($setting, '31xm42');
- $this->assertSettingHasValue($setting, 31, 'integer');
-
- // ARRAY
- $setting->type = PluginSettings::TYPE_ARRAY;
- $this->settings->setSettingValue($setting, '31xm42');
- $this->assertSettingHasValue($setting, array('31xm42'), 'array');
-
- // BOOL
- $setting->type = PluginSettings::TYPE_BOOL;
- $this->settings->setSettingValue($setting, '1');
- $this->assertSettingHasValue($setting, true, 'boolean');
-
- // FLOAT
- $setting->type = PluginSettings::TYPE_FLOAT;
- $this->settings->setSettingValue($setting, '1.21');
- $this->assertSettingHasValue($setting, 1.21, 'float');
-
- // STRING
- $setting->type = PluginSettings::TYPE_STRING;
- $this->settings->setSettingValue($setting, '31xm42');
- $this->assertSettingHasValue($setting, '31xm42');
- }
-
- public function test_setSettingValue_shouldApplyFilterAndNotCast_IfAFilterIsSet()
- {
- $this->setUser();
-
- $setting = $this->buildUserSetting('mysystem', 'mytitle');
- $setting->type = PluginSettings::TYPE_INT;
-
- $self = $this;
- $setting->transform = function ($value, $userSetting) use ($self, $setting) {
- $self->assertEquals('31xm42', $value);
- $self->assertEquals($setting, $userSetting);
-
- return '43939kmf3m3';
- };
-
- $this->settings->addSetting($setting);
- $this->settings->setSettingValue($setting, '31xm42');
-
- // should not be casted to int
- $this->assertSettingHasValue($setting, '43939kmf3m3', 'string');
- }
-
- public function test_getSettingValue_shouldReturnUncastedDefaultValue_IfNoValueIsSet()
- {
- $this->setUser();
-
- $setting = $this->addUserSetting('mydefaultsystem', 'mytitle');
- $setting->type = PluginSettings::TYPE_INT;
- $setting->defaultValue ='mytestvalue';
-
- // should not be casted to int
- $this->assertSettingHasValue($setting, 'mytestvalue', 'string');
- }
-
- /**
- * @expectedException \Exception
- * @expectedExceptionMessage The setting myusersetting does not exist
- */
- public function test_getSettingValue_shouldThrowException_IfGivenSettingDoesNotExist()
- {
- $setting = $this->buildUserSetting('myusersetting', 'mytitle');
-
- $this->settings->getSettingValue($setting);
- }
-
- /**
- * @expectedException \Exception
- * @expectedExceptionMessage CoreAdminHome_PluginSettingReadNotAllowed
- */
- public function test_getSettingValue_shouldThrowException_IfUserHasNotEnoughPermissionToReadValue()
- {
- $this->setUser();
- $setting = $this->addSystemSetting('myusersetting', 'mytitle');
- $this->settings->getSettingValue($setting);
- }
-
- public function test_getSettingValue_shouldReturnValue_IfReadbleByCurrentUserIsAllowed()
- {
- $this->setUser();
- $setting = $this->addSystemSetting('myusersetting', 'mytitle');
- $setting->readableByCurrentUser = true;
-
- $this->assertEquals('', $this->settings->getSettingValue($setting));
- }
-
- public function test_getSettingValue_shouldReturnValue_IfValueExistsAndUserHasPermission()
- {
- $this->setUser();
- $setting = $this->addUserSetting('myusersetting', 'mytitle');
- $setting->type = PluginSettings::TYPE_ARRAY;
- $this->settings->setSettingValue($setting, array(2,3,4));
-
- $this->assertSettingHasValue($setting, array(2,3,4));
- }
-
- /**
- * @expectedException \Exception
- * @expectedExceptionMessage CoreAdminHome_PluginSettingChangeNotAllowed
- */
- public function test_removeSettingValue_shouldThrowException_IfUserHasNotEnoughUserPermissions()
- {
- $setting = $this->addUserSetting('myusersetting', 'mytitle');
- $this->settings->removeSettingValue($setting);
- }
-
- /**
- * @expectedException \Exception
- * @expectedExceptionMessage CoreAdminHome_PluginSettingChangeNotAllowed
- */
- public function test_removeSettingValue_shouldThrowException_IfUserHasNotEnoughAdminPermissions()
- {
- $this->setUser();
- $setting = $this->addSystemSetting('mysystemsetting', 'mytitle');
- $this->settings->removeSettingValue($setting);
- }
-
- public function test_removeSettingValue_shouldRemoveValue_IfValueExistsAndHasEnoughPermissions()
- {
- $this->setUser();
- $setting = $this->addUserSetting('myusersetting', 'mytitle');
- $this->settings->setSettingValue($setting, '12345657');
- $this->assertSettingHasValue($setting, '12345657');
-
- $this->settings->removeSettingValue($setting);
- $this->assertSettingHasValue($setting, null);
- }
-
- public function test_removeSettingValue_shouldRemoveValue_ShouldNotSaveValueInDb()
- {
- $this->setSuperUser();
-
- $setting = $this->addSystemSetting('myusersetting', 'mytitle');
- $this->settings->setSettingValue($setting, '12345657');
- $this->settings->save();
-
- $this->settings->removeSettingValue($setting);
- $this->assertSettingHasValue($setting, null);
-
- // should still have same value
- $this->assertSettingIsNotSavedInTheDb('myusersetting', '12345657');
- }
-
- public function test_getSettingsForCurrentUser_shouldOnlyReturnSettingsHavingEnoughAdminPermissions()
- {
- $this->setUser();
-
- $this->addSystemSetting('mysystemsetting1', 'mytitle1');
- $this->addSystemSetting('mysystemsetting2', 'mytitle2');
- $this->addSystemSetting('mysystemsetting3', 'mytitle3');
- $this->addSystemSetting('mysystemsetting4', 'mytitle4');
- $userSetting = $this->addUserSetting('myusersetting1', 'mytitle5');
-
- $this->assertEquals(array('myusersetting1' => $userSetting), $this->settings->getSettingsForCurrentUser());
-
- // but all of them should be available via getSettings()
- $this->assertCount(5, $this->settings->getSettings());
- }
-
- public function test_getSettingsForCurrentUser_shouldReturnAllSettingsIfEnoughPermissionsAndSortThemBySettingOrder()
- {
- if(\Piwik\Tests\IntegrationTestCase::isPhpVersion53()) {
- $this->markTestSkipped('does not pass on PHP 5.3.3');
- }
- $this->setSuperUser();
-
- $this->addSystemSetting('mysystemsetting1', 'mytitle1');
- $this->addSystemSetting('mysystemsetting2', 'mytitle2');
- $this->addUserSetting('myusersetting2', 'mytitle6');
- $this->addSystemSetting('mysystemsetting3', 'mytitle3');
- $this->addSystemSetting('mysystemsetting4', 'mytitle4');
- $this->addUserSetting('myusersetting1', 'mytitle5');
-
- $expected = array('myusersetting2', 'myusersetting1', 'mysystemsetting1', 'mysystemsetting2', 'mysystemsetting3', 'mysystemsetting4');
- $this->assertEquals($expected, array_keys($this->settings->getSettingsForCurrentUser()));
- }
-
- public function test_save_shouldSaveAllValues()
- {
- $this->setSuperUser();
-
- $this->addSystemSetting('mysystemsetting2', 'mytitle2');
- $this->settings->setSettingValue($this->addSystemSetting('mysystemsetting1', 'mytitle1'), '111');
- $this->settings->setSettingValue($this->addSystemSetting('mysystemsetting4', 'mytitle4'), '4444');
- $this->settings->setSettingValue($this->addUserSetting('myusersetting1', 'mytitle5'), '55555');
- $this->addSystemSetting('mysystemsetting3', 'mytitle3');
- $this->settings->save();
-
- $verifySettings = $this->createSettingsInstance();
-
- $setting1 = $this->buildSystemSetting('mysystemsetting1', 'mytitle1');
- $setting2 = $this->buildSystemSetting('mysystemsetting2', 'mytitle2');
- $setting3 = $this->buildSystemSetting('mysystemsetting3', 'mytitle3');
- $setting4 = $this->buildSystemSetting('mysystemsetting4', 'mytitle4');
- $setting5 = $this->buildUserSetting('myusersetting1', 'mytitle5');
-
- $verifySettings->addSetting($setting1);
- $verifySettings->addSetting($setting2);
- $verifySettings->addSetting($setting3);
- $verifySettings->addSetting($setting4);
- $verifySettings->addSetting($setting5);
-
- $this->assertEquals('111', $verifySettings->getSettingValue($setting1));
- $this->assertEquals(null, $verifySettings->getSettingValue($setting2));
- $this->assertEquals(null, $verifySettings->getSettingValue($setting3));
- $this->assertEquals('4444', $verifySettings->getSettingValue($setting4));
- $this->assertEquals('55555', $verifySettings->getSettingValue($setting5));
- }
-
- public function test_removeAllPluginSettings_shouldRemoveAllSettings()
- {
- $this->setSuperUser();
-
- $this->addSystemSetting('mysystemsetting3', 'mytitle3');
- $this->addSystemSetting('mysystemsetting4', 'mytitle4');
- $this->settings->setSettingValue($this->addSystemSetting('mysystemsetting1', 'mytitle1'), '111');
- $this->settings->setSettingValue($this->addSystemSetting('mysystemsetting2', 'mytitle2'), '4444');
- $this->settings->setSettingValue($this->addUserSetting('myusersetting1', 'mytitle5'), '55555');
- $this->settings->save();
-
- $this->settings->removeAllPluginSettings();
-
- $verifySettings = $this->createSettingsInstance();
-
- $setting1 = $this->buildSystemSetting('mysystemsetting1', 'mytitle1');
- $setting2 = $this->buildSystemSetting('mysystemsetting2', 'mytitle2');
- $setting3 = $this->buildSystemSetting('mysystemsetting3', 'mytitle3');
- $setting4 = $this->buildSystemSetting('mysystemsetting4', 'mytitle4');
- $setting5 = $this->buildUserSetting('myusersetting1', 'mytitle5');
-
- $verifySettings->addSetting($setting1);
- $verifySettings->addSetting($setting2);
- $verifySettings->addSetting($setting3);
- $verifySettings->addSetting($setting4);
- $verifySettings->addSetting($setting5);
-
- $this->assertEquals(null, $verifySettings->getSettingValue($setting1));
- $this->assertEquals(null, $verifySettings->getSettingValue($setting2));
- $this->assertEquals(null, $verifySettings->getSettingValue($setting3));
- $this->assertEquals(null, $verifySettings->getSettingValue($setting4));
- $this->assertEquals(null, $verifySettings->getSettingValue($setting5));
- }
-
- /**
- * @expectedException \Exception
- * @expectedExceptionMessage checkUserHasSuperUserAccess Fake exception
- */
- public function test_removeAllPluginSettings_shouldThrowException_InCaseUserIsNotSuperUser()
- {
- $this->setUser();
-
- $this->settings->removeAllPluginSettings();
- }
-
- public function test_userSetting_shouldGenerateDifferentKey_ThenSystemSetting()
- {
- $this->setSuperUser();
-
- $user = $this->buildUserSetting('myname', 'mytitle');
- $system = $this->buildSystemSetting('myname', 'mytitle');
-
- $this->assertNotEquals($user->getKey(), $system->getKey());
- $this->assertEquals('myname', $system->getKey());
- $this->assertEquals('myname#superUserLogin#', $user->getKey());
- }
-
- public function test_userSetting_shouldGenerateDifferentKey_ForDifferentUsers()
- {
- $this->setSuperUser();
-
- $user1 = $this->buildUserSetting('myname', 'mytitle', 'user1');
- $user2 = $this->buildUserSetting('myname', 'mytitle', '_user2_');
- $user3 = $this->buildUserSetting('myname', 'mytitle');
-
- $this->assertEquals('myname#user1#', $user1->getKey());
- $this->assertEquals('myname#_user2_#', $user2->getKey());
- $this->assertEquals('myname#superUserLogin#', $user3->getKey());
- }
-
- public function test_userSetting_shouldSaveValuesPerUser()
- {
- $this->setSuperUser();
- $user1Login = 'user1';
- $user2Login = '_user2_';
- $user3Login = null; // current loggged in user
-
- $user = $this->buildUserSetting('myuser', 'mytitle', $user1Login);
-
- $this->settings->addSetting($user);
-
- $this->settings->setSettingValue($user, '111');
- $user->setUserLogin($user2Login);
- $this->settings->setSettingValue($user, '222');
- $user->setUserLogin($user3Login);
- $this->settings->setSettingValue($user, '333');
-
- $user->setUserLogin($user1Login);
- $this->assertSettingHasValue($user, '111');
- $user->setUserLogin($user2Login);
- $this->assertSettingHasValue($user, '222');
- $user->setUserLogin($user3Login);
- $this->assertSettingHasValue($user, '333');
-
- $user->setUserLogin($user2Login);
- $this->settings->removeSettingValue($user);
-
- $user->setUserLogin($user1Login);
- $this->assertSettingHasValue($user, '111');
- $user->setUserLogin($user2Login);
- $this->assertSettingHasValue($user, null);
- $user->setUserLogin($user3Login);
- $this->assertSettingHasValue($user, '333');
-
- $this->settings->removeAllPluginSettings();
-
- $user->setUserLogin($user1Login);
- $this->assertSettingHasValue($user, null);
- $user->setUserLogin($user2Login);
- $this->assertSettingHasValue($user, null);
- $user->setUserLogin($user3Login);
- $this->assertSettingHasValue($user, null);
- }
-
- /**
- * @expectedException \Exception
- * @expectedExceptionMessage You do not have the permission to read the settings of a different user
- */
- public function test_userSetting_shouldThrowException_IfSomeoneTriesToReadSettingsFromAnotherUserAndIsNotSuperuser()
- {
- $this->setUser();
-
- $this->buildUserSetting('myname', 'mytitle', 'myRandomName');
- }
-
- public function test_userSetting_shouldBeAbleToSetLoginAndChangeValues_IfUserHasSuperUserAccess()
- {
- $this->setSuperUser();
-
- $setting = $this->buildUserSetting('myname', 'mytitle', 'myRandomName');
- $this->settings->addSetting($setting);
-
- $this->settings->setSettingValue($setting, 5);
- $this->assertSettingHasValue($setting, 5);
-
- $this->settings->removeSettingValue($setting);
- $this->assertSettingHasValue($setting, null);
- }
-
- public function test_construct_shouldDetectTheNameOfThePluginAutomatically_IfPluginNameNotGiven()
- {
- $setting = new Piwik\Plugins\ExampleSettingsPlugin\Settings();
-
- $this->assertEquals('ExampleSettingsPlugin', $setting->getPluginName());
- }
-
- private function buildUserSetting($name, $title, $userLogin = null)
- {
- return new \Piwik\Settings\UserSetting($name, $title, $userLogin);
- }
-
- private function buildSystemSetting($name, $title)
- {
- return new \Piwik\Settings\SystemSetting($name, $title);
- }
-
- private function setSuperUser()
- {
- $pseudoMockAccess = new FakeAccess;
- FakeAccess::$superUser = true;
- Access::setSingletonInstance($pseudoMockAccess);
- }
-
- private function setUser()
- {
- $pseudoMockAccess = new FakeAccess;
- FakeAccess::$idSitesView = array(1);
- Access::setSingletonInstance($pseudoMockAccess);
- }
-
- private function addSystemSetting($name, $title)
- {
- $setting = $this->buildSystemSetting($name, $title);
- $this->settings->addSetting($setting);
- return $setting;
- }
-
- private function addUserSetting($name, $title)
- {
- $setting = $this->buildUserSetting($name, $title);
- $this->settings->addSetting($setting);
- return $setting;
- }
-
- private function assertSettingHasValue($setting, $expectedValue, $expectedType = null)
- {
- $value = $this->settings->getSettingValue($setting);
- $this->assertEquals($expectedValue, $value);
-
- if (!is_null($expectedType)) {
- $this->assertInternalType($expectedType, $value);
- }
- }
-
- private function assertSettingIsNotSavedInTheDb($settingName, $expectedValue)
- {
- // by creating a new instance...
- $setting = $this->buildSystemSetting($settingName, 'mytitle');
- $verifySettings = $this->createSettingsInstance();
- $verifySettings->addSetting($setting);
-
- $this->assertEquals($expectedValue, $verifySettings->getSettingValue($setting));
- }
-
- private function createSettingsInstance()
- {
- return new CorePluginSettingsTest('ExampleSettingsPlugin');
- }
-} \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/Core/ReportTest.php b/tests/PHPUnit/Integration/Core/ReportTest.php
deleted file mode 100644
index f935416675..0000000000
--- a/tests/PHPUnit/Integration/Core/ReportTest.php
+++ /dev/null
@@ -1,542 +0,0 @@
-<?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\API\Proxy;
-use Piwik\Plugin\Report;
-use Piwik\Plugins\ExampleReport\Reports\GetExampleReport;
-use Piwik\Plugins\Actions\Columns\ExitPageUrl;
-use Piwik\Piwik;
-use Piwik\Metrics;
-use Piwik\Plugins\ExampleTracker\Columns\ExampleDimension;
-use Piwik\Plugins\Referrers\Columns\Keyword;
-use Piwik\WidgetsList;
-use Piwik\Translate;
-use Piwik\Menu\MenuReporting;
-use Piwik\Plugin\Manager as PluginManager;
-use Piwik\Tests\Fixture;
-
-class GetBasicReport extends Report
-{
- protected function init()
- {
- parent::init();
-
- $this->name = 'My Custom Report Name';
- $this->order = 20;
- $this->module = 'TestPlugin';
- $this->action = 'getBasicReport';
- $this->category = 'Goals_Goals';
- $this->actionToLoadSubTables = 'invalidReport';
- }
-}
-
-class GetAdvancedReport extends GetBasicReport
-{
- protected function init()
- {
- parent::init();
-
- $this->action = 'getAdvancedReport';
- $this->widgetTitle = 'Actions_WidgetPageTitlesFollowingSearch';
- $this->menuTitle = 'Actions_SubmenuPageTitles';
- $this->documentation = Piwik::translate('ExampleReportDocumentation');
- $this->dimension = new ExitPageUrl();
- $this->metrics = array('nb_actions', 'nb_visits');
- $this->processedMetrics = array('conversion_rate', 'bounce_rate');
- $this->parameters = array('idGoal' => 1);
- $this->isSubtableReport = true;
- $this->actionToLoadSubTables = 'GetBasicReport';
- $this->constantRowsCount = true;
- }
-
- public function set($param, $value)
- {
- $this->$param = $value;
- }
-}
-
-class GetDisabledReport extends GetBasicReport
-{
- public function isEnabled()
- {
- return false;
- }
-}
-
-/**
- * @group Core
- */
-class Plugin_ReportTest extends DatabaseTestCase
-{
- /**
- * @var Report
- */
- private $exampleReport;
-
- /**
- * @var GetDisabledReport
- */
- private $disabledReport;
-
- /**
- * @var GetBasicReport
- */
- private $basicReport;
-
- /**
- * @var GetAdvancedReport
- */
- private $advancedReport;
-
- public function setUp()
- {
- parent::setUp();
-
- Fixture::createWebsite('2014-01-01 00:00:00');
- $this->unloadAllPlugins();
- $_GET['idSite'] = 1;
-
- $this->exampleReport = new GetExampleReport();
- $this->disabledReport = new GetDisabledReport();
- $this->basicReport = new GetBasicReport();
- $this->advancedReport = new GetAdvancedReport();
-
- Proxy::unsetInstance();
- }
-
- public function tearDown()
- {
- WidgetsList::getInstance()->_reset();
- MenuReporting::getInstance()->unsetInstance();
- Translate::unloadEnglishTranslation();
- unset($_GET['idSite']);
- parent::tearDown();
- }
-
- public function test_shouldDetectTheModuleOfTheReportAutomatically()
- {
- $this->assertEquals('ExampleReport', $this->exampleReport->getModule());
- }
-
- public function test_shouldDetectTheActionOfTheReportAutomatiacally()
- {
- $this->assertEquals('getExampleReport', $this->exampleReport->getAction());
- }
-
- public function test_getName_shouldReturnTheNameOfTheReport()
- {
- $this->assertEquals('My Custom Report Name', $this->basicReport->getName());
- }
-
- public function test_isEnabled_shouldBeEnabledByDefault()
- {
- $this->assertTrue($this->basicReport->isEnabled());
- }
-
- /**
- * @expectedException \Exception
- * @expectedExceptionMessage General_ExceptionReportNotEnabled
- */
- public function test_checkIsEnabled_shouldThrowAnExceptionIfReportIsNotEnabled()
- {
- $this->disabledReport->checkIsEnabled();
- }
-
- public function test_getWidgetTitle_shouldReturnNullIfNoTitleIsSet()
- {
- $this->assertNull($this->basicReport->getWidgetTitle());
- }
-
- public function test_getWidgetTitle_shouldReturnTranslatedTitleIfSet()
- {
- $this->loadEnglishTranslation();
- $this->assertEquals('Page Titles Following a Site Search', $this->advancedReport->getWidgetTitle());
- }
-
- public function test_getCategory_shouldReturnTranslatedCategory()
- {
- $this->loadEnglishTranslation();
- $this->assertEquals('Goals', $this->advancedReport->getCategory());
- }
-
- public function test_configureWidget_shouldNotAddAWidgetIfNoWidgetTitleIsSet()
- {
- $widgets = WidgetsList::get();
- $this->assertCount(0, $widgets);
-
- $this->basicReport->configureWidget(WidgetsList::getInstance());
-
- $widgets = WidgetsList::get();
- $this->assertCount(0, $widgets);
- }
-
- public function test_configureWidget_shouldAddAWidgetIfAWidgetTitleIsSet()
- {
- $widgets = WidgetsList::get();
- $this->assertCount(0, $widgets);
-
- $this->advancedReport->configureWidget(WidgetsList::getInstance());
-
- $widgets = WidgetsList::get();
- $this->assertCount(1, $widgets);
- $this->assertEquals(array(array(
- 'name' => 'Actions_WidgetPageTitlesFollowingSearch',
- 'uniqueId' => 'widgetTestPlugingetAdvancedReport',
- 'parameters' => array('module' => 'TestPlugin', 'action' => 'getAdvancedReport')
- )), $widgets['Goals_Goals']);
- }
-
- public function test_configureWidget_shouldMixinWidgetParametersIfSet()
- {
- $widgets = WidgetsList::get();
- $this->assertCount(0, $widgets);
-
- $this->advancedReport->set('widgetParams', array('foo' => 'bar'));
- $this->advancedReport->configureWidget(WidgetsList::getInstance());
-
- $widgets = WidgetsList::get();
- $this->assertCount(1, $widgets);
- $this->assertEquals(array('module' => 'TestPlugin', 'action' => 'getAdvancedReport', 'foo' => 'bar'),
- $widgets['Goals_Goals'][0]['parameters']);
- }
-
- public function test_configureReportingMenu_shouldNotAddAMenuIfNoWidgetTitleIsSet()
- {
- $menu = MenuReporting::getInstance();
- $menuItems = $menu->getMenu();
- $this->assertNull($menuItems);
-
- $this->basicReport->configureReportingMenu($menu);
-
- $menuItems = $menu->getMenu();
- $this->assertNull($menuItems);
- }
-
- public function test_configureReportingMenu_shouldAddAMenuIfATitleIsSet()
- {
- $menu = MenuReporting::getInstance();
- $menuItems = $menu->getMenu();
- $this->assertNull($menuItems);
-
- $this->advancedReport->configureReportingMenu($menu);
-
- $menuItems = $menu->getMenu();
-
- $expected = array(
- '_tooltip' => false,
- '_order' => 20,
- '_hasSubmenu' => true,
- 'Actions_SubmenuPageTitles' => array(
- '_url' => array(
- 'module' => 'TestPlugin',
- 'action' => 'menuGetAdvancedReport'
- ),
- '_order' => 20,
- '_name' => 'Actions_SubmenuPageTitles',
- '_tooltip' => false,
- ));
-
- $this->assertCount(1, $menuItems);
- $this->assertEquals($expected, $menuItems['Goals_Goals']);
- }
-
- public function test_getMetrics_shouldUseDefaultMetrics()
- {
- $this->assertEquals(Metrics::getDefaultMetrics(), $this->basicReport->getMetrics());
- }
-
- public function test_getMetrics_shouldReturnEmptyArray_IfNoMetricsDefined()
- {
- $this->advancedReport->set('metrics', array());
- $this->assertEquals(array(), $this->advancedReport->getMetrics());
- }
-
- public function test_getMetrics_shouldFindTranslationsForMetricsAndReturnOnlyTheOnesDefinedInSameOrder()
- {
- $expected = array(
- 'nb_visits' => 'General_ColumnNbVisits',
- 'nb_actions' => 'General_ColumnNbActions'
- );
- $this->assertEquals($expected, $this->advancedReport->getMetrics());
- }
-
- public function test_getProcessedMetrics_shouldReturnConfiguredValue_IfNotAnArrayGivenToPreventDefaultMetrics()
- {
- $this->advancedReport->set('processedMetrics', false);
- $this->assertEquals(false, $this->advancedReport->getProcessedMetrics());
- }
-
- public function test_getProcessedMetrics_shouldReturnEmptyArray_IfNoMetricsDefined()
- {
- $this->advancedReport->set('processedMetrics', array());
- $this->assertEquals(array(), $this->advancedReport->getProcessedMetrics());
- }
-
- public function test_getProcessedMetrics_reportShouldUseDefaultProcessedMetrics()
- {
- $this->assertEquals(Metrics::getDefaultProcessedMetrics(), $this->basicReport->getProcessedMetrics());
- }
-
- public function test_getProcessedMetrics_shouldFindTranslationsForMetricsAndReturnOnlyTheOnesDefinedInSameOrder()
- {
- $expected = array(
- 'conversion_rate' => 'General_ColumnConversionRate',
- 'bounce_rate' => 'General_ColumnBounceRate'
- );
- $this->assertEquals($expected, $this->advancedReport->getProcessedMetrics());
- }
-
- public function test_hasGoalMetrics_shouldBeDisabledByDefault()
- {
- $this->assertFalse($this->advancedReport->hasGoalMetrics());
- }
-
- public function test_hasGoalMetrics_shouldReturnGoalMetricsProperty()
- {
- $this->advancedReport->set('hasGoalMetrics', true);
- $this->assertTrue($this->advancedReport->hasGoalMetrics());
- }
-
- public function test_configureReportMetadata_shouldNotAddAReportIfReportIsDisabled()
- {
- $reports = array();
- $this->disabledReport->configureReportMetadata($reports, array());
- $this->assertEquals(array(), $reports);
- }
-
- public function test_configureReportMetadata_shouldAddAReportIfReportIsEnabled()
- {
- $reports = array();
- $this->basicReport->configureReportMetadata($reports, array());
- $this->assertCount(1, $reports);
- }
-
- public function test_configureReportMetadata_shouldBuiltStructureAndIncludeOnlyFieldsThatAreSet()
- {
- $reports = array();
- $this->basicReport->configureReportMetadata($reports, array());
- $this->assertEquals(array(
- array(
- 'category' => 'Goals_Goals',
- 'name' => 'My Custom Report Name',
- 'module' => 'TestPlugin',
- 'action' => 'getBasicReport',
- 'metrics' => array(
- 'nb_visits' => 'General_ColumnNbVisits',
- 'nb_uniq_visitors' => 'General_ColumnNbUniqVisitors',
- 'nb_actions' => 'General_ColumnNbActions',
- 'nb_users' => 'General_ColumnNbUsers'
- ),
- 'metricsDocumentation' => array(
- 'nb_visits' => 'General_ColumnNbVisitsDocumentation',
- 'nb_uniq_visitors' => 'General_ColumnNbUniqVisitorsDocumentation',
- 'nb_actions' => 'General_ColumnNbActionsDocumentation',
- 'nb_users' => 'General_ColumnNbUsersDocumentation'
- ),
- 'processedMetrics' => array(
- 'nb_actions_per_visit' => 'General_ColumnActionsPerVisit',
- 'avg_time_on_site' => 'General_ColumnAvgTimeOnSite',
- 'bounce_rate' => 'General_ColumnBounceRate',
- 'conversion_rate' => 'General_ColumnConversionRate',
- ),
- 'actionToLoadSubTables' => 'invalidReport',
- 'order' => 20
- )
- ), $reports);
- }
-
- public function test_configureReportMetadata_shouldBuiltStructureAllFieldsSet()
- {
- $reports = array();
- $this->advancedReport->configureReportMetadata($reports, array());
- $this->assertEquals(array(
- array(
- 'category' => 'Goals_Goals',
- 'name' => 'My Custom Report Name',
- 'module' => 'TestPlugin',
- 'action' => 'getAdvancedReport',
- 'parameters' => array(
- 'idGoal' => 1
- ),
- 'dimension' => 'Actions_ColumnExitPageURL',
- 'documentation' => 'ExampleReportDocumentation',
- 'isSubtableReport' => true,
- 'metrics' => array(
- 'nb_actions' => 'General_ColumnNbActions',
- 'nb_visits' => 'General_ColumnNbVisits'
- ),
- 'metricsDocumentation' => array(
- 'nb_actions' => 'General_ColumnNbActionsDocumentation',
- 'nb_visits' => 'General_ColumnNbVisitsDocumentation',
- ),
- 'processedMetrics' => array(
- 'conversion_rate' => 'General_ColumnConversionRate',
- 'bounce_rate' => 'General_ColumnBounceRate',
- ),
- 'actionToLoadSubTables' => 'GetBasicReport',
- 'constantRowsCount' => true,
- 'order' => '20'
- )
- ), $reports);
- }
-
- public function test_factory_shouldCreateReport_WhenActionNameUsed()
- {
- $this->loadExampleReportPlugin();
-
- $module = 'ExampleReport';
- $action = 'getExampleReport';
-
- $report = Report::factory($module, $action);
-
- $this->assertInstanceOf('Piwik\Plugins\ExampleReport\Reports\GetExampleReport', $report);
- $this->assertEquals($module, $report->getModule());
- $this->assertEquals($action, $report->getAction());
-
- // action ucfirst should work as well
- $report = Report::factory($module, ucfirst($action));
-
- $this->assertInstanceOf('Piwik\Plugins\ExampleReport\Reports\GetExampleReport', $report);
- $this->assertEquals($module, $report->getModule());
- $this->assertEquals($action, $report->getAction());
- }
-
- public function test_getAllReports_shouldNotFindAReport_IfNoPluginLoaded()
- {
- $this->unloadAllPlugins();
-
- $report = Report::getAllReports();
-
- $this->assertEquals(array(), $report);
- }
-
- public function test_getAllReports_ShouldFindAllAvailableReports()
- {
- $this->loadExampleReportPlugin();
- $this->loadMorePlugins();
-
- $reports = Report::getAllReports();
-
- $this->assertGreaterThan(20, count($reports));
-
- foreach ($reports as $report) {
- $this->assertInstanceOf('Piwik\Plugin\Report', $report);
- }
- }
-
- public function test_getSubtableDimension_ShouldReturnNullIfNoSubtableActionExists()
- {
- $report = new GetExampleReport();
- $this->assertNull($report->getSubtableDimension());
- }
-
- public function test_getSubtableDimension_ShouldReturnNullIfSubtableActionIsInvalid()
- {
- $report = new GetBasicReport();
- $this->assertNull($report->getSubtableDimension());
- }
-
- public function test_getSubtableDimension_ShouldReturnCorrectDimensionIfSubtableActionIsDefinedAndCorrect()
- {
- PluginManager::getInstance()->loadPlugins(array('Referrers'));
-
- $report = Report::factory('Referrers', 'getSearchEngines');
- $subtableDimension = $report->getSubtableDimension();
-
- $this->assertNotNull($subtableDimension);
- $this->assertInstanceOf("Piwik\\Plugins\\Referrers\\Columns\\Keyword", $subtableDimension);
- }
-
- public function test_fetch_ShouldUseCorrectApiUrl()
- {
- PluginManager::getInstance()->loadPlugins(array('API', 'ExampleReport'));
-
- $proxyMock = $this->getMock('stdClass', array('call', '__construct'));
- $proxyMock->expects($this->once())->method('call')->with(
- '\\Piwik\\Plugins\\ExampleReport\\API', 'getExampleReport', array(
- 'idSite' => 1,
- 'date' => '2012-01-02',
- 'format' => 'original',
- 'module' => 'API',
- 'method' => 'ExampleReport.getExampleReport'
- )
- )->willReturn("result");
- Proxy::setSingletonInstance($proxyMock);
-
- $report = new GetExampleReport();
- $result = $report->fetch(array('idSite' => 1, 'date' => '2012-01-02'));
- $this->assertEquals("result", $result);
- }
-
- public function test_fetchSubtable_ShouldUseCorrectApiUrl()
- {
- PluginManager::getInstance()->loadPlugins(array('API', 'Referrers'));
-
- $proxyMock = $this->getMock('stdClass', array('call', '__construct'));
- $proxyMock->expects($this->once())->method('call')->with(
- '\\Piwik\\Plugins\\Referrers\\API', 'getSearchEnginesFromKeywordId', array(
- 'idSubtable' => 23,
- 'idSite' => 1,
- 'date' => '2012-01-02',
- 'format' => 'original',
- 'module' => 'API',
- 'method' => 'Referrers.getSearchEnginesFromKeywordId'
- )
- )->willReturn("result");
- Proxy::setSingletonInstance($proxyMock);
-
- $report = new \Piwik\Plugins\Referrers\Reports\GetKeywords();
- $result = $report->fetchSubtable(23, array('idSite' => 1, 'date' => '2012-01-02'));
- $this->assertEquals("result", $result);
- }
-
- public function test_getForDimension_ShouldReturnCorrectInstanceTypeIfAssociatedReportExists()
- {
- PluginManager::getInstance()->loadPlugins(array('Referrers'));
-
- $report = Report::getForDimension(new Keyword());
- $this->assertInstanceOf("Piwik\\Plugins\\Referrers\\Reports\\GetKeywords", $report);
- }
-
- public function test_getForDimension_ShouldReturnNullIfNoReportExistsForDimension()
- {
- $this->loadExampleReportPlugin();
- $this->loadMorePlugins();
-
- $report = Report::getForDimension(new ExampleDimension());
- $this->assertNull($report);
- }
-
- public function test_getForDimension_ShouldReturnNullIfReportPluginNotLoaded()
- {
- PluginManager::getInstance()->loadPlugins(array());
-
- $report = Report::getForDimension(new Keyword());
- $this->assertNull($report);
- }
-
- private function loadExampleReportPlugin()
- {
- PluginManager::getInstance()->loadPlugins(array('ExampleReport'));
- }
-
- private function loadMorePlugins()
- {
- PluginManager::getInstance()->loadPlugins(array('Actions', 'DevicesDetection', 'CoreVisualizations', 'API', 'Morpheus'));
- }
-
- private function unloadAllPlugins()
- {
- PluginManager::getInstance()->unloadPlugins();
- }
-
- private function loadEnglishTranslation()
- {
- Translate::reloadLanguage('en');
- }
-} \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/Core/SegmentTest.php b/tests/PHPUnit/Integration/Core/SegmentTest.php
deleted file mode 100644
index 3fddab94b2..0000000000
--- a/tests/PHPUnit/Integration/Core/SegmentTest.php
+++ /dev/null
@@ -1,480 +0,0 @@
-<?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\Common;
-use Piwik\Segment;
-
-/**
- * @group SegmentTest
- */
-class SegmentTest extends DatabaseTestCase
-{
- public function setUp()
- {
- parent::setUp();
-
- // setup the access layer (required in Segment contrustor testing if anonymous is allowed to use segments)
- $pseudoMockAccess = new FakeAccess;
- FakeAccess::$superUser = true;
- Access::setSingletonInstance($pseudoMockAccess);
- }
-
- public function tearDown()
- {
- parent::tearDown();
- }
-
- protected function _filterWhitsSpaces($valueToFilter)
- {
- if (is_array($valueToFilter)) {
- foreach ($valueToFilter as $key => $value) {
- $valueToFilter[$key] = $this->_filterWhitsSpaces($value);
- }
- return $valueToFilter;
- } else {
- return preg_replace('/[\s]+/', ' ', $valueToFilter);
- }
- }
-
- public function getCommonTestData()
- {
- return array(
- // Normal segment
- array('countryCode==France', array(
- 'where' => ' log_visit.location_country = ? ',
- 'bind' => array('France'))),
-
- // unescape the comma please
- array('countryCode==a\,==', array(
- 'where' => ' log_visit.location_country = ? ',
- 'bind' => array('a,=='))),
-
- // AND, with 2 values rewrites
- array('countryCode==a;visitorType!=returning;visitorType==new', array(
- 'where' => ' log_visit.location_country = ? AND ( log_visit.visitor_returning IS NULL OR log_visit.visitor_returning <> ? ) AND log_visit.visitor_returning = ? ',
- 'bind' => array('a', '1', '0'))),
-
- // OR, with 2 value rewrites
- array('referrerType==search,referrerType==direct', array(
- 'where' => ' (log_visit.referer_type = ? OR log_visit.referer_type = ? )',
- 'bind' => array(Common::REFERRER_TYPE_SEARCH_ENGINE,
- Common::REFERRER_TYPE_DIRECT_ENTRY))),
-
- // IS NOT NULL
- array('browserCode==ff;referrerKeyword!=', array(
- 'where' => ' log_visit.config_browser_name = ? AND ( log_visit.referer_keyword IS NOT NULL AND (log_visit.referer_keyword <> \'\' OR log_visit.referer_keyword = 0) ) ',
- 'bind' => array('ff')
- )),
- array('referrerKeyword!=,browserCode==ff', array(
- 'where' => ' (( log_visit.referer_keyword IS NOT NULL AND (log_visit.referer_keyword <> \'\' OR log_visit.referer_keyword = 0) ) OR log_visit.config_browser_name = ? )',
- 'bind' => array('ff')
- )),
-
- // IS NULL
- array('browserCode==ff;referrerKeyword==', array(
- 'where' => ' log_visit.config_browser_name = ? AND ( log_visit.referer_keyword IS NULL OR log_visit.referer_keyword = \'\' ) ',
- 'bind' => array('ff')
- )),
- array('referrerKeyword==,browserCode==ff', array(
- 'where' => ' (( log_visit.referer_keyword IS NULL OR log_visit.referer_keyword = \'\' ) OR log_visit.config_browser_name = ? )',
- 'bind' => array('ff')
- )),
-
- );
- }
-
- /**
- * @dataProvider getCommonTestData
- * @group Core
- */
- public function testCommon($segment, $expected)
- {
- $select = 'log_visit.idvisit';
- $from = 'log_visit';
-
- $expected = array(
- 'sql' => '
- SELECT
- log_visit.idvisit
- FROM
- ' . Common::prefixTable('log_visit') . ' AS log_visit
- WHERE
- ' . $expected['where'],
- 'bind' => $expected['bind']
- );
-
- $segment = new Segment($segment, $idSites = array());
- $sql = $segment->getSelectQuery($select, $from, false);
-
- $this->assertEquals($this->_filterWhitsSpaces($expected), $this->_filterWhitsSpaces($sql));
-
- // calling twice should give same results
- $sql = $segment->getSelectQuery($select, array($from));
- $this->assertEquals($this->_filterWhitsSpaces($expected), $this->_filterWhitsSpaces($sql));
-
- $this->assertEquals(32, strlen($segment->getHash()));
- }
-
- /**
- * @group Core
- */
- public function testGetSelectQueryNoJoin()
- {
- $select = '*';
- $from = 'log_visit';
- $where = 'idsite = ?';
- $bind = array(1);
-
- $segment = 'customVariableName1==Test;visitorType==new';
- $segment = new Segment($segment, $idSites = array());
-
- $query = $segment->getSelectQuery($select, $from, $where, $bind);
-
- $expected = array(
- "sql" => "
- SELECT
- *
- FROM
- " . Common::prefixTable('log_visit') . " AS log_visit
- WHERE
- ( idsite = ? )
- AND
- ( log_visit.custom_var_k1 = ? AND log_visit.visitor_returning = ? )",
- "bind" => array(1, 'Test', 0));
-
- $this->assertEquals($this->_filterWhitsSpaces($expected), $this->_filterWhitsSpaces($query));
- }
-
- /**
- * @group Core
- */
- public function testGetSelectQueryJoinVisitOnAction()
- {
- $select = '*';
- $from = 'log_link_visit_action';
- $where = 'log_link_visit_action.idvisit = ?';
- $bind = array(1);
-
- $segment = 'customVariablePageName1==Test;visitorType==new';
- $segment = new Segment($segment, $idSites = array());
-
- $query = $segment->getSelectQuery($select, $from, $where, $bind);
-
- $expected = array(
- "sql" => "
- SELECT
- *
- FROM
- " . Common::prefixTable('log_link_visit_action') . " AS log_link_visit_action
- LEFT JOIN " . Common::prefixTable('log_visit') . " AS log_visit ON log_visit.idvisit = log_link_visit_action.idvisit
- WHERE
- ( log_link_visit_action.idvisit = ? )
- AND
- ( log_link_visit_action.custom_var_k1 = ? AND log_visit.visitor_returning = ? )",
- "bind" => array(1, 'Test', 0));
-
- $this->assertEquals($this->_filterWhitsSpaces($expected), $this->_filterWhitsSpaces($query));
- }
-
- /**
- * @group Core
- */
- public function testGetSelectQueryJoinActionOnVisit()
- {
- $select = 'sum(log_visit.visit_total_actions) as nb_actions, max(log_visit.visit_total_actions) as max_actions, sum(log_visit.visit_total_time) as sum_visit_length';
- $from = 'log_visit';
- $where = 'log_visit.idvisit = ?';
- $bind = array(1);
-
- $segment = 'customVariablePageName1==Test;visitorType==new';
- $segment = new Segment($segment, $idSites = array());
-
- $query = $segment->getSelectQuery($select, $from, $where, $bind);
-
- $expected = array(
- "sql" => "
- SELECT
- sum(log_inner.visit_total_actions) as nb_actions, max(log_inner.visit_total_actions) as max_actions, sum(log_inner.visit_total_time) as sum_visit_length
- FROM
- (
- SELECT
- log_visit.visit_total_actions,
- log_visit.visit_total_time
- FROM
- " . Common::prefixTable('log_visit') . " AS log_visit
- LEFT JOIN " . Common::prefixTable('log_link_visit_action') . " AS log_link_visit_action ON log_link_visit_action.idvisit = log_visit.idvisit
- WHERE
- ( log_visit.idvisit = ? )
- AND
- ( log_link_visit_action.custom_var_k1 = ? AND log_visit.visitor_returning = ? )
- GROUP BY log_visit.idvisit
- ) AS log_inner",
- "bind" => array(1, 'Test', 0));
-
- $this->assertEquals($this->_filterWhitsSpaces($expected), $this->_filterWhitsSpaces($query));
- }
-
- /**
- * @group Core
- */
- public function testGetSelectQueryJoinConversionOnAction()
- {
- $select = '*';
- $from = 'log_link_visit_action';
- $where = 'log_link_visit_action.idvisit = ?';
- $bind = array(1);
-
- $segment = 'customVariablePageName1==Test;visitConvertedGoalId==1;customVariablePageName2==Test2';
- $segment = new Segment($segment, $idSites = array());
-
- $query = $segment->getSelectQuery($select, $from, $where, $bind);
-
- $expected = array(
- "sql" => "
- SELECT
- *
- FROM
- " . Common::prefixTable('log_link_visit_action') . " AS log_link_visit_action
- LEFT JOIN " . Common::prefixTable('log_conversion') . " AS log_conversion ON log_conversion.idlink_va = log_link_visit_action.idlink_va AND log_conversion.idsite = log_link_visit_action.idsite
- WHERE
- ( log_link_visit_action.idvisit = ? )
- AND
- ( log_link_visit_action.custom_var_k1 = ? AND log_conversion.idgoal = ? AND log_link_visit_action.custom_var_k2 = ? )",
- "bind" => array(1, 'Test', 1, 'Test2'));
-
- $this->assertEquals($this->_filterWhitsSpaces($expected), $this->_filterWhitsSpaces($query));
- }
-
- /**
- * @group Core
- */
- public function testGetSelectQueryJoinActionOnConversion()
- {
- $select = '*';
- $from = 'log_conversion';
- $where = 'log_conversion.idvisit = ?';
- $bind = array(1);
-
- $segment = 'visitConvertedGoalId!=2;customVariablePageName1==Test;visitConvertedGoalId==1';
- $segment = new Segment($segment, $idSites = array());
-
- $query = $segment->getSelectQuery($select, $from, $where, $bind);
-
- $expected = array(
- "sql" => "
- SELECT
- *
- FROM
- " . Common::prefixTable('log_conversion') . " AS log_conversion
- LEFT JOIN " . Common::prefixTable('log_link_visit_action') . " AS log_link_visit_action ON log_conversion.idlink_va = log_link_visit_action.idlink_va
- WHERE
- ( log_conversion.idvisit = ? )
- AND
- ( ( log_conversion.idgoal IS NULL OR log_conversion.idgoal <> ? ) AND log_link_visit_action.custom_var_k1 = ? AND log_conversion.idgoal = ? )",
- "bind" => array(1, 2, 'Test', 1));
-
- $this->assertEquals($this->_filterWhitsSpaces($expected), $this->_filterWhitsSpaces($query));
- }
-
- /**
- * @group Core
- */
- public function testGetSelectQueryJoinConversionOnVisit()
- {
- $select = 'log_visit.*';
- $from = 'log_visit';
- $where = 'log_visit.idvisit = ?';
- $bind = array(1);
-
- $segment = 'visitConvertedGoalId==1';
- $segment = new Segment($segment, $idSites = array());
-
- $query = $segment->getSelectQuery($select, $from, $where, $bind);
-
- $expected = array(
- "sql" => "
- SELECT
- log_inner.*
- FROM
- (
- SELECT
- log_visit.*
- FROM
- " . Common::prefixTable('log_visit') . " AS log_visit
- LEFT JOIN " . Common::prefixTable('log_conversion') . " AS log_conversion ON log_conversion.idvisit = log_visit.idvisit
- WHERE
- ( log_visit.idvisit = ? )
- AND
- ( log_conversion.idgoal = ? )
- GROUP BY log_visit.idvisit
- ) AS log_inner",
- "bind" => array(1, 1));
-
- $this->assertEquals($this->_filterWhitsSpaces($expected), $this->_filterWhitsSpaces($query));
- }
-
- /**
- * @group Core
- */
- public function testGetSelectQueryConversionOnly()
- {
- $select = 'log_conversion.*';
- $from = 'log_conversion';
- $where = 'log_conversion.idvisit = ?';
- $bind = array(1);
-
- $segment = 'visitConvertedGoalId==1';
- $segment = new Segment($segment, $idSites = array());
-
- $query = $segment->getSelectQuery($select, $from, $where, $bind);
-
- $expected = array(
- "sql" => "
- SELECT
- log_conversion.*
- FROM
- " . Common::prefixTable('log_conversion') . " AS log_conversion
- WHERE
- ( log_conversion.idvisit = ? )
- AND
- ( log_conversion.idgoal = ? )",
- "bind" => array(1, 1));
-
- $this->assertEquals($this->_filterWhitsSpaces($expected), $this->_filterWhitsSpaces($query));
- }
-
- /**
- * @group Core
- */
- public function testGetSelectQueryJoinVisitOnConversion()
- {
- $select = '*';
- $from = 'log_conversion';
- $where = 'log_conversion.idvisit = ?';
- $bind = array(1);
-
- $segment = 'visitConvertedGoalId==1,visitServerHour==12';
- $segment = new Segment($segment, $idSites = array());
-
- $query = $segment->getSelectQuery($select, $from, $where, $bind);
-
- $expected = array(
- "sql" => "
- SELECT
- *
- FROM
- " . Common::prefixTable('log_conversion') . " AS log_conversion
- LEFT JOIN " . Common::prefixTable('log_visit') . " AS log_visit ON log_conversion.idvisit = log_visit.idvisit
- WHERE
- ( log_conversion.idvisit = ? )
- AND
- ( (log_conversion.idgoal = ? OR HOUR(log_visit.visit_last_action_time) = ? ))",
- "bind" => array(1, 1, 12));
-
- $this->assertEquals($this->_filterWhitsSpaces($expected), $this->_filterWhitsSpaces($query));
- }
-
- /**
- * visit is joined on action, then conversion is joined
- * make sure that conversion is joined on action not visit
- *
- * @group Core
- */
- public function testGetSelectQueryJoinVisitAndConversionOnAction()
- {
- $select = '*';
- $from = 'log_link_visit_action';
- $where = false;
- $bind = array();
-
- $segment = 'visitServerHour==12;visitConvertedGoalId==1';
- $segment = new Segment($segment, $idSites = array());
-
- $query = $segment->getSelectQuery($select, $from, $where, $bind);
-
- $expected = array(
- "sql" => "
- SELECT
- *
- FROM
- " . Common::prefixTable('log_link_visit_action') . " AS log_link_visit_action
- LEFT JOIN " . Common::prefixTable('log_visit') . " AS log_visit ON log_visit.idvisit = log_link_visit_action.idvisit
- LEFT JOIN " . Common::prefixTable('log_conversion') . " AS log_conversion ON log_conversion.idlink_va = log_link_visit_action.idlink_va AND log_conversion.idsite = log_link_visit_action.idsite
- WHERE
- HOUR(log_visit.visit_last_action_time) = ? AND log_conversion.idgoal = ? ",
- "bind" => array(12, 1));
-
- $this->assertEquals($this->_filterWhitsSpaces($expected), $this->_filterWhitsSpaces($query));
- }
-
- /**
- * join conversion on visit, then actions
- * make sure actions are joined before conversions
- *
- * @group Core
- */
- public function testGetSelectQueryJoinConversionAndActionOnVisit()
- {
- $select = 'log_visit.*';
- $from = 'log_visit';
- $where = false;
- $bind = array();
-
- $segment = 'visitConvertedGoalId==1;visitServerHour==12;customVariablePageName1==Test';
- $segment = new Segment($segment, $idSites = array());
-
- $query = $segment->getSelectQuery($select, $from, $where, $bind);
-
- $expected = array(
- "sql" => "
- SELECT
- log_inner.*
- FROM
- (
- SELECT
- log_visit.*
- FROM
- " . Common::prefixTable('log_visit') . " AS log_visit
- LEFT JOIN " . Common::prefixTable('log_link_visit_action') . " AS log_link_visit_action ON log_link_visit_action.idvisit = log_visit.idvisit
- LEFT JOIN " . Common::prefixTable('log_conversion') . " AS log_conversion ON log_conversion.idlink_va = log_link_visit_action.idlink_va AND log_conversion.idsite = log_link_visit_action.idsite
- WHERE
- log_conversion.idgoal = ? AND HOUR(log_visit.visit_last_action_time) = ? AND log_link_visit_action.custom_var_k1 = ?
- GROUP BY log_visit.idvisit
- ) AS log_inner",
- "bind" => array(1, 12, 'Test'));
-
- $this->assertEquals($this->_filterWhitsSpaces($expected), $this->_filterWhitsSpaces($query));
- }
-
- /**
- * Dataprovider for testBogusSegmentThrowsException
- */
- public function getBogusSegments()
- {
- return array(
- array('referrerType==not'),
- array('someRandomSegment==not'),
- array('A=B')
- );
- }
-
- /**
- * @group Core
- *
- * @dataProvider getBogusSegments
- */
- public function testBogusSegmentThrowsException($segment)
- {
- try {
- $segment = new Segment($segment, $idSites = array());
- } catch (Exception $e) {
- return;
- }
- $this->fail('Expected exception not raised');
- }
-}
diff --git a/tests/PHPUnit/Integration/Core/SqlTest.php b/tests/PHPUnit/Integration/Core/SqlTest.php
deleted file mode 100755
index 194fcc3e22..0000000000
--- a/tests/PHPUnit/Integration/Core/SqlTest.php
+++ /dev/null
@@ -1,46 +0,0 @@
-<?php
-use Piwik\Db;
-
-/**
- * Piwik - free/libre analytics platform
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- *
- * @group Core
- */
-class Core_SqlTest extends DatabaseTestCase
-{
- public function setUp()
- {
- parent::setUp();
-
- // create two myisam tables
- Db::exec("CREATE TABLE table1 (a INT) ENGINE=MYISAM");
- Db::exec("CREATE TABLE table2 (b INT) ENGINE=MYISAM");
-
- // create two innodb tables
- Db::exec("CREATE TABLE table3 (c INT) ENGINE=InnoDB");
- Db::exec("CREATE TABLE table4 (d INT) ENGINE=InnoDB");
- }
-
- public function tearDown()
- {
- parent::tearDown();
- }
-
- /**
- * @group Core
- */
- public function testOptimize()
- {
- // make sure optimizing myisam tables works
- $this->assertTrue(Db::optimizeTables(array('table1', 'table2')) !== false);
-
- // make sure optimizing both myisam & innodb results in optimizations
- $this->assertTrue(Db::optimizeTables(array('table1', 'table2', 'table3', 'table4')) !== false);
-
- // make sure innodb tables are skipped
- $this->assertTrue(Db::optimizeTables(array('table3', 'table4')) === false);
- }
-}
diff --git a/tests/PHPUnit/Integration/Core/Tracker/ActionTest.php b/tests/PHPUnit/Integration/Core/Tracker/ActionTest.php
deleted file mode 100644
index 792ccbbc3f..0000000000
--- a/tests/PHPUnit/Integration/Core/Tracker/ActionTest.php
+++ /dev/null
@@ -1,388 +0,0 @@
-<?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;
-use Piwik\Tracker\Action;
-use Piwik\Tracker\PageUrl;
-use Piwik\Tracker\Request;
-use Piwik\Translate;
-use Piwik\Plugin\Manager as PluginManager;
-/**
- * Piwik - free/libre analytics platform
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- *
- * @group Core
- * @group ActionTest
- */
-class Core_Tracker_ActionTest extends DatabaseTestCase
-{
- public function setUp()
- {
- parent::setUp();
- $config = Config::getInstance();
- $config->clear();
- $config->setTestEnvironment();
- $section = Config::getInstance()->Tracker;
- $section['default_action_url'] = '/';
- $section['campaign_var_name'] = 'campaign_param_name,piwik_campaign,utm_campaign,test_campaign_name';
- $section['action_url_category_delimiter'] = '/';
- $section['campaign_keyword_var_name'] = 'piwik_kwd,utm_term,test_piwik_kwd';
- Config::getInstance()->Tracker = $section;
-
- PluginManager::getInstance()->loadPlugins(array('SitesManager'));
-
- Translate::loadEnglishTranslation();
- }
-
- protected function setUpRootAccess()
- {
- $pseudoMockAccess = new FakeAccess;
- FakeAccess::$superUser = true;
- Access::setSingletonInstance($pseudoMockAccess);
- }
-
- public function getTestUrls()
- {
- $campaignNameParam = 'test_campaign_name';
- $campaignKwdParam = 'test_piwik_kwd';
-
- $urls = array(
- // a wrongly formatted url (parse_url returns false)
- array('http:////wrongurl',
- array(false,
- false)),
-
- // a URL with all components
- array('http://username:password@hostname:80/path?phpSESSID=value#anchor',
- array('http://username:password@hostname:80/path#anchor',
- 'http://username:password@hostname:80/path#anchor')),
-
- // a standard url with excluded campaign parameters
- array('http://a.com/index?p1=v1&' . $campaignNameParam . '=Adwords-CPC&' . $campaignKwdParam . '=My killer keyword',
- array('http://a.com/index?p1=v1',
- 'http://a.com/index?p1=v1')),
-
- // a standard url with excluded campaign parameters, GA style
- array('http://a.com/index?p1=v1&utm_campaign=Adwords-CPC&utm_term=My killer keyword',
- array('http://a.com/index?p1=v1',
- 'http://a.com/index?p1=v1')),
-
- // testing with capital parameter
- array('http://a.com/index?p1=v1&P2=v2&p3=v3',
- array('http://a.com/index?p1=v1&P2=v2&p3=v3',
- 'http://a.com/index?p1=v1&p3=v3')),
-
- // testing with array []
- array('http://a.com/index?p1=v1&p2[]=v;2a&p2[]=v2b&p2[]=v2c&p3=v3&p4=v4',
- array('http://a.com/index?p1=v1&p2[]=v;2a&p2[]=v2b&p2[]=v2c&p3=v3&p4=v4',
- 'http://a.com/index?p1=v1&p3=v3')),
-
- // testing with missing value
- array('http://a.com/index?p1=v1&p2=&p3=v3&p4',
- array('http://a.com/index?p1=v1&p2=&p3=v3&p4',
- 'http://a.com/index?p1=v1&p3=v3')),
- array('http://a.com/index?p1&p2=v2&p3=v3&p4',
- array('http://a.com/index?p1&p2=v2&p3=v3&p4',
- 'http://a.com/index?p1&p3=v3')),
-
- // testing with extra &&
- array('http://a.com/index?p1=v1&&p2=v;2&p3=v%3b3&p4=v4&&',
- array('http://a.com/index?p1=v1&p2=v;2&p3=v%3b3&p4=v4',
- 'http://a.com/index?p1=v1&p3=v%3b3')),
-
- // encode entities
- array('http://a.com/index?p1=v1&p2%5B%5D=v2&p3=v3&p4=v4',
- array('http://a.com/index?p1=v1&p2[]=v2&p3=v3&p4=v4',
- 'http://a.com/index?p1=v1&p3=v3')),
- array('http://a.com/index?var%5Bvalue%5D%5Bdate%5D=01.01.2012',
- array('http://a.com/index?var[value][date]=01.01.2012',
- 'http://a.com/index')),
-
- // matrix parameters
- array('http://a.com/index;jsessionid=value;p1=v1;p2=v2',
- array('http://a.com/index?p1=v1&p2=v2',
- 'http://a.com/index?p1=v1')),
- array('http://a.com/index;jsessionid=value?p1=v1&p2=v2',
- array('http://a.com/index?p1=v1&p2=v2',
- 'http://a.com/index?p1=v1')),
- );
-
- return $urls;
- }
-
- /**
- * No excluded query parameters specified, apart from the standard "session" parameters, always excluded
- *
- * @group Core
- * @dataProvider getTestUrls
- */
- public function testExcludeQueryParametersNone($url, $filteredUrl)
- {
- $this->setUpRootAccess();
- $idSite = API::getInstance()->addSite("site1", array('http://example.org'), $ecommerce = 0,
- $siteSearch = 1, $searchKeywordParameters = null, $searchCategoryParameters = null,
- $excludedIps = '', $excludedQueryParameters = '', $timezone = null, $currency = null,
- $group = null, $startDate = null, $excludedUserAgents = null, $keepURLFragments = 1);
- $this->assertEquals($filteredUrl[0], PageUrl::excludeQueryParametersFromUrl($url, $idSite));
- }
-
- public function getTestUrlsHashtag()
- {
- $urls = array(
- // URL, Expected URL
- array('wrongurl/#', 'http://wrongurl/'),
- array('wrongurl/#t', 'http://wrongurl/#t'),
- array('wrongurl/#test', 'http://wrongurl/#test'),
- array('wrongurl/#test=1', 'http://wrongurl/#test=1'),
- array('wrongurl/#test=1#', 'http://wrongurl/#test=1'),
- );
- return $urls;
- }
-
- /**
- * Test removing hash tag
- * @group Core
- * @dataProvider getTestUrlsHashtag
- */
- public function testRemoveTrailingHashtag($url, $expectedUrl)
- {
- $this->assertEquals(PageUrl::reconstructNormalizedUrl($url, PageUrl::$urlPrefixMap['http://']), $expectedUrl);
- }
-
- /**
- * Testing with some website specific parameters excluded
- * @group Core
- * @dataProvider getTestUrls
- */
- public function testExcludeQueryParametersSiteExcluded($url, $filteredUrl)
- {
- $excludedQueryParameters = 'p4, p2, var[value][date]';
- $this->setUpRootAccess();
- $idSite = API::getInstance()->addSite("site1", array('http://example.org'), $ecommerce = 0,
- $siteSearch = 1, $searchKeywordParameters = null, $searchCategoryParameters = null,
- $excludedIps = '', $excludedQueryParameters, $timezone = null, $currency = null,
- $group = null, $startDate = null, $excludedUserAgents = null, $keepURLFragments = 1);
- $this->assertEquals($filteredUrl[1], PageUrl::excludeQueryParametersFromUrl($url, $idSite));
- }
-
- /**
- * Testing with some website specific and some global excluded query parameters
- * @group Core
- * @dataProvider getTestUrls
- */
- public function testExcludeQueryParametersSiteAndGlobalExcluded($url, $filteredUrl)
- {
- // testing also that query parameters are case insensitive
- $excludedQueryParameters = 'P2,var[value][date]';
- $excludedGlobalParameters = 'blabla, P4';
- $this->setUpRootAccess();
- $idSite = API::getInstance()->addSite("site1", array('http://example.org'), $ecommerce = 0,
- $siteSearch = 1, $searchKeywordParameters = null, $searchCategoryParameters = null,
- $excludedIps = '', $excludedQueryParameters, $timezone = null, $currency = null,
- $group = null, $startDate = null, $excludedUserAgents = null, $keepURLFragments = 1);
- API::getInstance()->setGlobalExcludedQueryParameters($excludedGlobalParameters);
- $this->assertEquals($filteredUrl[1], PageUrl::excludeQueryParametersFromUrl($url, $idSite));
- }
-
- public function getExtractUrlData()
- {
- return array(
- // outlinks
- array(
- 'request' => array('link' => 'http://example.org'),
- 'expected' => array('name' => null,
- 'url' => 'http://example.org',
- 'type' => Action::TYPE_OUTLINK),
- ),
- // outlinks with custom name -> no custom name
- array(
- 'request' => array('link' => 'http://example.org', 'action_name' => 'Example.org'),
- 'expected' => array('name' => null,
- 'url' => 'http://example.org',
- 'type' => Action::TYPE_OUTLINK),
- ),
- // keep the case in urls, but trim
- array(
- 'request' => array('link' => ' http://example.org/Category/Test/ '),
- 'expected' => array('name' => null,
- 'url' => 'http://example.org/Category/Test/',
- 'type' => Action::TYPE_OUTLINK),
- ),
-
- // no custom name
- array(
- 'request' => array('link' => ' http://example.org/Category/Test/ ', 'action_name' => ' Example dot org '),
- 'expected' => array('name' => null,
- 'url' => 'http://example.org/Category/Test/',
- 'type' => Action::TYPE_OUTLINK),
- ),
-
- // downloads
- array(
- 'request' => array('download' => 'http://example.org/*$test.zip'),
- 'expected' => array('name' => null,
- 'url' => 'http://example.org/*$test.zip',
- 'type' => Action::TYPE_DOWNLOAD),
- ),
-
- // downloads with custom name -> no custom name
- array(
- 'request' => array('download' => 'http://example.org/*$test.zip', 'action_name' => 'Download test.zip'),
- 'expected' => array('name' => null,
- 'url' => 'http://example.org/*$test.zip',
- 'type' => Action::TYPE_DOWNLOAD),
- ),
-
- // keep the case and multiple / in urls
- array(
- 'request' => array('download' => 'http://example.org/CATEGORY/test///test.pdf'),
- 'expected' => array('name' => null,
- 'url' => 'http://example.org/CATEGORY/test///test.pdf',
- 'type' => Action::TYPE_DOWNLOAD),
- ),
-
- // page view
- array(
- 'request' => array('url' => 'http://example.org/'),
- 'expected' => array('name' => null,
- 'url' => 'http://example.org/',
- 'type' => Action::TYPE_PAGE_URL),
- ),
- array(
- 'request' => array('url' => 'http://example.org/', 'action_name' => 'Example.org Website'),
- 'expected' => array('name' => 'Example.org Website',
- 'url' => 'http://example.org/',
- 'type' => Action::TYPE_PAGE_URL),
- ),
- array(
- 'request' => array('url' => 'http://example.org/CATEGORY/'),
- 'expected' => array('name' => null,
- 'url' => 'http://example.org/CATEGORY/',
- 'type' => Action::TYPE_PAGE_URL),
- ),
- array(
- 'request' => array('url' => 'http://example.org/CATEGORY/TEST', 'action_name' => 'Example.org / Category / test /'),
- 'expected' => array('name' => 'Example.org/Category/test',
- 'url' => 'http://example.org/CATEGORY/TEST',
- 'type' => Action::TYPE_PAGE_URL),
- ),
- array(
- 'request' => array('url' => 'http://example.org/?2,123'),
- 'expected' => array('name' => null,
- 'url' => 'http://example.org/?2,123',
- 'type' => Action::TYPE_PAGE_URL),
- ),
-
- // empty request
- array(
- 'request' => array(),
- 'expected' => array('name' => null, 'url' => '',
- 'type' => Action::TYPE_PAGE_URL),
- ),
- array(
- 'request' => array('name' => null, 'url' => "\n"),
- 'expected' => array('name' => null, 'url' => '',
- 'type' => Action::TYPE_PAGE_URL),
- ),
- array(
- 'request' => array('url' => 'http://example.org/category/',
- 'action_name' => 'custom name with/one delimiter/two delimiters/'),
- 'expected' => array('name' => 'custom name with/one delimiter/two delimiters',
- 'url' => 'http://example.org/category/',
- 'type' => Action::TYPE_PAGE_URL),
- ),
- array(
- 'request' => array('url' => 'http://example.org/category/',
- 'action_name' => 'http://custom action name look like url/'),
- 'expected' => array('name' => 'http:/custom action name look like url',
- 'url' => 'http://example.org/category/',
- 'type' => Action::TYPE_PAGE_URL),
- ),
- // testing: delete tab, trimmed, not strtolowered
- array(
- 'request' => array('url' => "http://example.org/category/test///test wOw "),
- 'expected' => array('name' => null,
- 'url' => 'http://example.org/category/test///test wOw',
- 'type' => Action::TYPE_PAGE_URL),
- ),
- // testing: inclusion of zero values in action name
- array(
- 'request' => array('url' => "http://example.org/category/1/0/t/test"),
- 'expected' => array('name' => null,
- 'url' => 'http://example.org/category/1/0/t/test',
- 'type' => Action::TYPE_PAGE_URL),
- ),
- // testing: action name ("Test &hellip;") - expect decoding of some html entities
- array(
- 'request' => array('url' => 'http://example.org/ACTION/URL',
- 'action_name' => "Test &hellip;"),
- 'expected' => array('name' => 'Test …',
- 'url' => 'http://example.org/ACTION/URL',
- 'type' => Action::TYPE_PAGE_URL),
- ),
- // testing: action name ("Special &amp; chars") - expect no conversion of html special chars
- array(
- 'request' => array('url' => 'http://example.org/ACTION/URL',
- 'action_name' => "Special &amp; chars"),
- 'expected' => array('name' => 'Special &amp; chars',
- 'url' => 'http://example.org/ACTION/URL',
- 'type' => Action::TYPE_PAGE_URL),
- ),
- // testing: action name ("Tést") - handle wide character
- array(
- 'request' => array('url' => 'http://example.org/ACTION/URL',
- 'action_name' => "Tést"),
- 'expected' => array('name' => 'Tést',
- 'url' => 'http://example.org/ACTION/URL',
- 'type' => Action::TYPE_PAGE_URL),
- ),
- // testing: action name ("Tést") - handle UTF-8 byte sequence
- array(
- 'request' => array('url' => 'http://example.org/ACTION/URL',
- 'action_name' => "T\xc3\xa9st"),
- 'expected' => array('name' => 'Tést',
- 'url' => 'http://example.org/ACTION/URL',
- 'type' => Action::TYPE_PAGE_URL),
- ),
- // testing: action name ("Tést") - invalid UTF-8 (e.g., ISO-8859-1) is not handled
- array(
- 'request' => array('url' => 'http://example.org/ACTION/URL',
- 'action_name' => "T\xe9st"),
- 'expected' => array('name' => version_compare(PHP_VERSION, '5.2.5') === -1 ? 'T\xe9st' : 'Tést',
- 'url' => 'http://example.org/ACTION/URL',
- 'type' => Action::TYPE_PAGE_URL),
- ),
- );
- }
-
- /**
- * @dataProvider getExtractUrlData
- * @group Core
- */
- public function testExtractUrlAndActionNameFromRequest($request, $expected)
- {
- PluginManager::getInstance()->loadPlugins(array('Actions', 'SitesManager'));
- $this->setUpRootAccess();
- $idSite = API::getInstance()->addSite("site1", array('http://example.org'));
- $request['idsite'] = $idSite;
- $request = new Request($request);
-
- $action = Action::factory($request);
-
- $processed = array(
- 'name' => $action->getActionName(),
- 'url' => $action->getActionUrl(),
- 'type' => $action->getActionType(),
- );
-
- $this->assertEquals($processed, $expected);
- }
-}
diff --git a/tests/PHPUnit/Integration/Core/Tracker/DbTest.php b/tests/PHPUnit/Integration/Core/Tracker/DbTest.php
deleted file mode 100644
index ef738d5515..0000000000
--- a/tests/PHPUnit/Integration/Core/Tracker/DbTest.php
+++ /dev/null
@@ -1,42 +0,0 @@
-<?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\Common;
-use Piwik\Db;
-
-/**
- * Tracker DB test
- *
- * @group Core
- * @group TrackerDbTest
- */
-class Core_Tracker_DbTest extends DatabaseTestCase
-{
- public function test_rowCount_whenUpdating_returnsAllMatchedRowsNotOnlyUpdatedRows()
- {
- $db = \Piwik\Tracker::getDatabase();
- // insert one record
- $db->query("INSERT INTO `" . Common::prefixTable('option') . "` VALUES ('rowid', '1', false)");
-
- // We will now UPDATE this table and check rowCount() value
- $sqlUpdate = "UPDATE `" . Common::prefixTable('option') . "` SET option_value = 2";
-
- // when no record was updated, return 0
- $result = $db->query($sqlUpdate . " WHERE option_name = 'NOT FOUND'");
- $this->assertSame(0, $db->rowCount($result));
-
- // when one record was found and updated, returns 1
- $result = $db->query($sqlUpdate . " WHERE option_name = 'rowid'");
- $this->assertSame(1, $db->rowCount($result));
-
- // when one record was found but NOT actually updated (as values have not changed), we make sure to return 1
- // testing for MYSQLI_CLIENT_FOUND_ROWS and MYSQL_ATTR_FOUND_ROWS
- $result = $db->query($sqlUpdate . " WHERE option_name = 'rowid'");
- $this->assertSame(1, $db->rowCount($result));
- }
-
-} \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/Core/Tracker/Visit2Test.php b/tests/PHPUnit/Integration/Core/Tracker/Visit2Test.php
deleted file mode 100644
index de9d0810ec..0000000000
--- a/tests/PHPUnit/Integration/Core/Tracker/Visit2Test.php
+++ /dev/null
@@ -1,238 +0,0 @@
-<?php
-/**
- * Piwik - free/libre analytics platform
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- */
-
-
-// Tests Visits and Dimensions behavior which is a lot of logic so not in VisitTest
-
-use Piwik\Plugin\Dimension\VisitDimension;
-use Piwik\Tracker\Request;
-use Piwik\Tracker\Visitor;
-use Piwik\Piwik;
-use Piwik\EventDispatcher;
-use Piwik\Tests\Fixture;
-
-class FakeTrackerVisitDimension1 extends VisitDimension
-{
- protected $columnName = 'custom_dimension_1';
-
- public function onNewVisit(Request $request, Visitor $visitor, $action)
- {
- return false;
- }
-
- public function onExistingVisit(Request $request, Visitor $visitor, $action)
- {
- return 'existing1';
- }
-}
-
-class FakeTrackerVisitDimension2 extends VisitDimension
-{
- protected $columnName = 'custom_dimension_2';
-
- public function onNewVisit(Request $request, Visitor $visitor, $action)
- {
- return 'onNew2';
- }
-
- public function onExistingVisit(Request $request, Visitor $visitor, $action)
- {
- return false;
- }
-
- public function onConvertedVisit(Request $request, Visitor $visitor, $action)
- {
- return false;
- }
-}
-
-class FakeTrackerVisitDimension3 extends VisitDimension
-{
- protected $columnName = 'custom_dimension_3';
-
- public function onNewVisit(Request $request, Visitor $visitor, $action)
- {
- return 'onNew3';
- }
-
- public function onExistingVisit(Request $request, Visitor $visitor, $action)
- {
- return 'existing3';
- }
-
- public function onConvertedVisit(Request $request, Visitor $visitor, $action)
- {
- return 'converted3';
- }
-}
-
-class FakeTrackerVisitDimension4 extends VisitDimension
-{
- protected $columnName = 'custom_dimension_4';
-
- public function onExistingVisit(Request $request, Visitor $visitor, $action)
- {
- return $visitor->getVisitorColumn('custom_dimension_3') . 'extended';
- }
-
- public function getRequiredFields()
- {
- return array('custom_dimension_3');
- }
-}
-
-
-class FakeTrackerVisit extends \Piwik\Tracker\Visit
-{
- public function __construct($request)
- {
- $this->request = $request;
- $this->visitorInfo['location_ip'] = $request->getIp();
- $this->visitorInfo['idvisitor'] = 1;
- }
-
- public function handleExistingVisit($visitor, $action, $visitIsConverted)
- {
- parent::handleExistingVisit($visitor, $action, $visitIsConverted);
- }
-
- public function handleNewVisit($visitor, $action, $visitIsConverted)
- {
- parent::handleNewVisit($visitor, $action, $visitIsConverted);
- }
-
- public function getAllVisitDimensions()
- {
- return array(
- new FakeTrackerVisitDimension1(),
- new FakeTrackerVisitDimension2(),
- new FakeTrackerVisitDimension3(),
- new FakeTrackerVisitDimension4(),
- );
- }
-
- public function getVisitorInfo()
- {
- return $this->visitorInfo;
- }
-
- protected function insertNewVisit($visit)
- {
-
- }
-
- protected function updateExistingVisit($valuesToUpdate)
- {
-
- }
-}
-
-/**
- * @group Core
- * @group VisitTest
- */
-class VisitTest extends DatabaseTestCase
-{
-
- public function setUp()
- {
- parent::setUp();
- Fixture::createWebsite('2014-01-01 00:00:00');
- Piwik::addAction('Tracker.Request.getIdSite', function (&$idSite) {
- $idSite = 1;
- });
- }
-
- public function tearDown()
- {
- EventDispatcher::getInstance()->clearObservers('Tracker.Request.getIdSite');
- parent::tearDown();
- }
-
- public function test_handleNewVisitWithoutConversion_shouldTriggerDimensions()
- {
- $request = new \Piwik\Tracker\Request(array());
- $visitor = new \Piwik\Tracker\Visitor($request, '');
-
- $visit = new FakeTrackerVisit($request);
- $visit->handleNewVisit($visitor, null, false);
-
- $info = $visit->getVisitorInfo();
-
- $this->assertEquals('onNew2', $info['custom_dimension_2']);
- $this->assertEquals('onNew3', $info['custom_dimension_3']);
- $this->assertArrayNotHasKey('custom_dimension_1', $info); // on new visit returns false and should be ignored
- $this->assertArrayNotHasKey('custom_dimension_4', $info); // on new visit not defined
-
- // make sure visitor gets updated as well
- $this->assertEquals('onNew2', $visitor->getVisitorColumn('custom_dimension_2'));
- $this->assertEquals('onNew3', $visitor->getVisitorColumn('custom_dimension_3'));
- $this->assertFalse($visitor->getVisitorColumn('custom_dimension_1'));
- $this->assertFalse($visitor->getVisitorColumn('custom_dimension_4'));
- }
-
- public function test_handleNewVisitWithConversion_shouldTriggerDimensions()
- {
- $request = new \Piwik\Tracker\Request(array());
- $visitor = new \Piwik\Tracker\Visitor($request, '');
-
- $visit = new FakeTrackerVisit($request);
- $visit->handleNewVisit($visitor, null, true);
-
- $info = $visit->getVisitorInfo();
-
- $this->assertEquals('onNew2', $info['custom_dimension_2']); // on converted visit returns false and should be ignored
- $this->assertEquals('converted3', $info['custom_dimension_3']); // a conversion should overwrite an existing value
- $this->assertArrayNotHasKey('custom_dimension_1', $info);
- $this->assertArrayNotHasKey('custom_dimension_4', $info);
-
- $this->assertEquals('converted3', $visitor->getVisitorColumn('custom_dimension_3'));
- }
-
- public function test_handleExistingVisitWithoutConversion_shouldTriggerDimensions()
- {
- $request = new \Piwik\Tracker\Request(array());
- $visitor = new \Piwik\Tracker\Visitor($request, '');
-
- $visit = new FakeTrackerVisit($request);
- $visit->handleNewVisit($visitor, null, false);
- $visit->handleExistingVisit($visitor, null, false);
-
- $info = $visit->getVisitorInfo();
-
- $this->assertEquals('existing1', $info['custom_dimension_1']);
- $this->assertEquals('onNew2', $info['custom_dimension_2']); // on existing visit returns false and should be ignored/ not overwrite on new value
- $this->assertEquals('existing3', $info['custom_dimension_3']);
- $this->assertEquals('existing3extended', $info['custom_dimension_4']); // accesses a previously set column
-
- // make sure visitor gets updated as well
- $this->assertEquals('existing1', $visitor->getVisitorColumn('custom_dimension_1'));
- $this->assertEquals('onNew2', $visitor->getVisitorColumn('custom_dimension_2'));
- $this->assertEquals('existing3', $visitor->getVisitorColumn('custom_dimension_3'));
- $this->assertEquals('existing3extended', $visitor->getVisitorColumn('custom_dimension_4'));
- }
-
- public function test_handleExistingVisitWithConversion_shouldTriggerDimensions()
- {
- $request = new \Piwik\Tracker\Request(array());
- $visitor = new \Piwik\Tracker\Visitor($request, '');
-
- $visit = new FakeTrackerVisit($request);
- $visit->handleNewVisit($visitor, null, false);
- $visit->handleExistingVisit($visitor, null, true);
-
- $info = $visit->getVisitorInfo();
-
- $this->assertEquals('existing1', $info['custom_dimension_1']);
- $this->assertEquals('onNew2', $info['custom_dimension_2']); // on converted visit returns false and should be ignored
- $this->assertEquals('converted3', $info['custom_dimension_3']); // a conversion should overwrite an existing value
- $this->assertEquals('existing3extended', $info['custom_dimension_4']);
-
- $this->assertEquals('converted3', $visitor->getVisitorColumn('custom_dimension_3'));
- }
-} \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/Core/Tracker/VisitTest.php b/tests/PHPUnit/Integration/Core/Tracker/VisitTest.php
deleted file mode 100644
index c748b4ddb7..0000000000
--- a/tests/PHPUnit/Integration/Core/Tracker/VisitTest.php
+++ /dev/null
@@ -1,274 +0,0 @@
-<?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\IP;
-use Piwik\Plugins\SitesManager\API;
-use Piwik\Tracker\Request;
-use Piwik\Tracker\VisitExcluded;
-
-/**
- * Class Core_Tracker_VisitTest
- *
- * @group Core
- */
-class Core_Tracker_VisitTest extends DatabaseTestCase
-{
- public function setUp()
- {
- parent::setUp();
-
- // setup the access layer
- $pseudoMockAccess = new FakeAccess;
- FakeAccess::$superUser = true;
- Access::setSingletonInstance($pseudoMockAccess);
-
- \Piwik\Plugin\Manager::getInstance()->loadPlugins(array('SitesManager'));
- }
-
- /**
- * Dataprovider
- */
- public function getExcludedIpTestData()
- {
- return array(
- array('12.12.12.12', array(
- '12.12.12.12' => true,
- '12.12.12.11' => false,
- '12.12.12.13' => false,
- '0.0.0.0' => false,
- '255.255.255.255' => false
- )),
- array('12.12.12.12/32', array(
- '12.12.12.12' => true,
- '12.12.12.11' => false,
- '12.12.12.13' => false,
- '0.0.0.0' => false,
- '255.255.255.255' => false
- )),
- array('12.12.12.*', array(
- '12.12.12.0' => true,
- '12.12.12.255' => true,
- '12.12.12.12' => true,
- '12.12.11.255' => false,
- '12.12.13.0' => false,
- '0.0.0.0' => false,
- '255.255.255.255' => false,
- )),
- array('12.12.12.0/24', array(
- '12.12.12.0' => true,
- '12.12.12.255' => true,
- '12.12.12.12' => true,
- '12.12.11.255' => false,
- '12.12.13.0' => false,
- '0.0.0.0' => false,
- '255.255.255.255' => false,
- )),
- // add some ipv6 addresses!
- );
- }
-
- /**
- * @group Core
- * @dataProvider getExcludedIpTestData
- */
- public function testIsVisitorIpExcluded($excludedIp, $tests)
- {
- $idsite = API::getInstance()->addSite("name", "http://piwik.net/", $ecommerce = 0,
- $siteSearch = 1, $searchKeywordParameters = null, $searchCategoryParameters = null, $excludedIp);
-
- $request = new Request(array('idsite' => $idsite));
-
- // test that IPs within the range, or the given IP, are excluded
- foreach ($tests as $ip => $expected) {
- $testIpIsExcluded = IP::P2N($ip);
-
- $excluded = new VisitExcluded_public($request, $testIpIsExcluded);
- $this->assertSame($expected, $excluded->public_isVisitorIpExcluded($testIpIsExcluded));
- }
- }
-
- /**
- * Dataprovider for testIsVisitorUserAgentExcluded.
- */
- public function getExcludedUserAgentTestData()
- {
- return array(
- array('', array(
- 'whatever' => false,
- '' => false,
- 'nlksdjfsldkjfsa' => false,
- )),
- array('mozilla', array(
- 'this has mozilla in it' => true,
- 'this doesn\'t' => false,
- 'partial presence: mozi' => false,
- )),
- array('cHrOmE,notinthere,&^%', array(
- 'chrome is here' => true,
- 'CHROME is here' => true,
- '12&^%345' => true,
- 'sfasdf' => false,
- )),
- );
- }
-
- /**
- * @group Core
- * @dataProvider getExcludedUserAgentTestData
- */
- public function testIsVisitorUserAgentExcluded($excludedUserAgent, $tests)
- {
- API::getInstance()->setSiteSpecificUserAgentExcludeEnabled(true);
-
- $idsite = API::getInstance()->addSite("name", "http://piwik.net/", $ecommerce = 0,
- $siteSearch = 1, $searchKeywordParameters = null, $searchCategoryParameters = null, $excludedIp = null,
- $excludedQueryParameters = null, $timezone = null, $currency = null, $group = null, $startDate = null,
- $excludedUserAgent);
-
- $request = new Request(array('idsite' => $idsite));
-
- // test that user agents that contain excluded user agent strings are excluded
- foreach ($tests as $ua => $expected) {
- $excluded = new VisitExcluded_public($request, $ip = false, $ua);
-
- $this->assertSame($expected, $excluded->public_isUserAgentExcluded(), "Result if isUserAgentExcluded('$ua') was not " . ($expected ? 'true' : 'false') . ".");
- }
- }
-
- /**
- * @group Core
- * @group referrerIsKnownSpam
- */
- public function testIsVisitor_referrerIsKnownSpam()
- {
- $knownSpammers = array(
- 'http://semalt.com' => true,
- 'http://semalt.com/random/sub/page' => true,
- 'http://semalt.com/out/of/here?mate' => true,
- 'http://valid.domain/' => false,
- 'http://valid.domain/page' => false,
- );
- API::getInstance()->setSiteSpecificUserAgentExcludeEnabled(true);
-
- $idsite = API::getInstance()->addSite("name", "http://piwik.net/");
-
- // test that user agents that contain excluded user agent strings are excluded
- foreach ($knownSpammers as $spamUrl => $expectedIsReferrerSpam) {
- $spamUrl = urlencode($spamUrl);
- $request = new Request(array(
- 'idsite' => $idsite,
- 'urlref' => $spamUrl
- ));
- $excluded = new VisitExcluded_public($request);
-
- $this->assertSame($expectedIsReferrerSpam, $excluded->public_isReferrerSpamExcluded(), $spamUrl);
- }
- }
-
- /**
- * @group Core
- * @group IpIsKnownBot
- */
- public function testIsVisitor_ipIsKnownBot()
- {
- $isIpBot = array(
- // Source: http://forum.piwik.org/read.php?3,108926
- '66.249.85.36' => true,
- '66.249.91.150' => true,
- '64.233.172.1' => true,
-
- // ddos bot
- '1.202.218.8' => true,
-
- // Not bots
- '66.248.91.150' => false,
- '66.250.91.150' => false,
- );
-
- $idsite = API::getInstance()->addSite("name", "http://piwik.net/");
- $request = new Request(array('idsite' => $idsite, 'bots' => 0));
-
- foreach ($isIpBot as $ip => $isBot) {
- $excluded = new VisitExcluded_public($request, IP::P2N($ip));
-
- $this->assertSame($isBot, $excluded->public_isNonHumanBot(), $ip);
- }
- }
-
- /**
- * @group Core
- * @group UserAgentIsKnownBot
- */
- public function testIsVisitor_userAgentIsKnownBot()
- {
- $isUserAgentBot = array(
- 'baiduspider' => true,
- 'bingbot' => true,
- 'BINGBOT' => true,
- 'x BingBot x' => true,
- 'BingPreview' => true,
- 'facebookexternalhit' => true,
- 'YottaaMonitor' => true,
- 'Mozilla/5.0 (compatible; CloudFlare-AlwaysOnline/1.0; +http://www.cloudflare.com/always-online) XXXX' => true,
- 'Pingdom.com_bot_version_1.4_(http://www.pingdom.com/)' => true,
- 'Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)' => true,
- 'Exabot/2.0' => true,
- 'sogou spider' => true,
- 'Mozilla/5.0(compatible;Sosospider/2.0;+http://help.soso.com/webspider.htm)' => true,
-
- 'AdsBot-Google (+http://www.google.com/adsbot.html)' => true,
- 'Google Page Speed Insights' => true,
- // Web snippets
- 'Mozilla/5.0 (Windows NT 6.1; rv:6.0) Gecko/20110814 Firefox/6.0 Google (+https://developers.google.com/+/web/snippet/)' => true,
- // Google Web Preview
- 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/534.51 (KHTML, like Gecko; Google Web Preview) Chrome/12.0.742 Safari/534.51' => true,
- 'Googlebot-Video/1.0' => true,
- 'Googlebot' => true,
-
- 'random' => false,
- 'hello world' => false,
- 'this is a user agent' => false,
- 'Mozilla' => false,
- );
-
- $idsite = API::getInstance()->addSite("name", "http://piwik.net/");
-
- foreach ($isUserAgentBot as $userAgent => $isBot) {
- $request = new Request(array(
- 'idsite' => $idsite,
- 'bots' => 0,
- 'ua' => $userAgent,
- ));
-
- $excluded = new VisitExcluded_public($request);
-
- $this->assertSame($isBot, $excluded->public_isNonHumanBot(), $userAgent);
- }
- }
-}
-
-class VisitExcluded_public extends VisitExcluded
-{
- public function public_isVisitorIpExcluded($ip)
- {
- return $this->isVisitorIpExcluded($ip);
- }
-
- public function public_isUserAgentExcluded()
- {
- return $this->isUserAgentExcluded();
- }
- public function public_isReferrerSpamExcluded()
- {
- return $this->isReferrerSpamExcluded();
- }
- public function public_isNonHumanBot()
- {
- return $this->isNonHumanBot();
- }
-}
diff --git a/tests/PHPUnit/Integration/Core/TrackerTest.php b/tests/PHPUnit/Integration/Core/TrackerTest.php
deleted file mode 100644
index a5eb8cbcb8..0000000000
--- a/tests/PHPUnit/Integration/Core/TrackerTest.php
+++ /dev/null
@@ -1,67 +0,0 @@
-<?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\Tests\Fixture;
-
-/**
- * @group Core
- */
-class Core_TrackerTest extends DatabaseTestCase
-{
- public function setUp()
- {
- parent::setUp();
- Fixture::createWebsite('2014-02-04');
- }
-
- protected static function configureFixture($fixture)
- {
- $fixture->createSuperUser = true;
- }
-
- /**
- * Test the Bulk tracking API as documented in: http://developer.piwik.org/api-reference/tracking-api#bulk-tracking
- *
- * With invalid token_auth the request would still work
- */
- public function test_trackingApiWithBulkRequests_viaCurl_withWrongTokenAuth()
- {
- $token_auth = '33dc3f2536d3025974cccb4b4d2d98f4';
- $this->issueBulkTrackingRequest($token_auth, $expectTrackingToSucceed = true);
- }
-
- public function test_trackingApiWithBulkRequests_viaCurl_withCorrectTokenAuth()
- {
- $token_auth = Fixture::getTokenAuth();
- \Piwik\Filesystem::deleteAllCacheOnUpdate();
- $this->issueBulkTrackingRequest($token_auth, $expectTrackingToSucceed = true);
- }
-
- protected function issueBulkTrackingRequest($token_auth, $expectTrackingToSucceed)
- {
- $piwikHost = Fixture::getRootUrl() . 'tests/PHPUnit/proxy/piwik.php';
-
- $command = 'curl -s -X POST -d \'{"requests":["?idsite=1&url=http://example.org&action_name=Test bulk log Pageview&rec=1","?idsite=1&url=http://example.net/test.htm&action_name=Another bulk page view&rec=1"],"token_auth":"' . $token_auth . '"}\' ' . $piwikHost;
-
- exec($command, $output, $result);
- if ($result !== 0) {
- throw new Exception("tracking bulk failed: " . implode("\n", $output) . "\n\ncommand used: $command");
- }
- $output = implode("", $output);
- $this->assertStringStartsWith('{"status":', $output);
-
- if($expectTrackingToSucceed) {
- $this->assertNotContains('error', $output);
- $this->assertContains('success', $output);
- } else {
- $this->assertContains('error', $output);
- $this->assertNotContains('success', $output);
- }
-
- }
-}
diff --git a/tests/PHPUnit/Integration/Core/TravisEnvironmentTest.php b/tests/PHPUnit/Integration/Core/TravisEnvironmentTest.php
deleted file mode 100644
index 7549dac8a9..0000000000
--- a/tests/PHPUnit/Integration/Core/TravisEnvironmentTest.php
+++ /dev/null
@@ -1,35 +0,0 @@
-<?php
-
-use Piwik\Translate;
-
-/**
- * Class TravisEnvironmentTest
- *
- * @group Core
- */
-class Core_TravisEnvironmentTest extends DatabaseTestCase
-{
- public function testUsageOfCorrectMysqlAdapter()
- {
- $mysqlAdapter = getenv('MYSQL_ADAPTER');
-
- if (empty($mysqlAdapter)) {
- return;
- }
-
- $this->assertTrue(in_array($mysqlAdapter, array('PDO_MYSQL', 'PDO\MYSQL', 'MYSQLI')));
-
- $db = Piwik\Db::get();
-
- switch ($mysqlAdapter) {
- case 'PDO_MYSQL':
- case 'PDO\MYSQL':
- $this->assertInstanceOf('\Piwik\Db\Adapter\Pdo\Mysql', $db);
- break;
- case 'MYSQLI':
- $this->assertInstanceOf('\Piwik\Db\Adapter\Mysqli', $db);
- break;
- }
-
- }
-} \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/Core/UpdaterTest.php b/tests/PHPUnit/Integration/Core/UpdaterTest.php
deleted file mode 100644
index 6745a3fe1d..0000000000
--- a/tests/PHPUnit/Integration/Core/UpdaterTest.php
+++ /dev/null
@@ -1,77 +0,0 @@
-<?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\Core;
-
-use DatabaseTestCase;
-use Piwik\Updater;
-use Piwik\Tests\Fixture;
-
-/**
- * Class Core_UpdaterTest
- *
- * @group Core
- * @group Core_UpdaterTest
- */
-class UpdaterTest extends DatabaseTestCase
-{
- public function testUpdaterChecksCoreVersionAndDetectsUpdateFile()
- {
- $updater = new Updater();
- $updater->pathUpdateFileCore = PIWIK_INCLUDE_PATH . '/tests/resources/Updater/core/';
- $updater->recordComponentSuccessfullyUpdated('core', '0.1');
- $updater->addComponentToCheck('core', '0.3');
- $componentsWithUpdateFile = $updater->getComponentsWithUpdateFile();
- $this->assertEquals(1, count($componentsWithUpdateFile));
- }
-
- public function testUpdaterChecksGivenPluginVersionAndDetectsMultipleUpdateFileInOrder()
- {
- $updater = new Updater();
- $updater->pathUpdateFilePlugins = PIWIK_INCLUDE_PATH . '/tests/resources/Updater/%s/';
- $updater->recordComponentSuccessfullyUpdated('testpluginUpdates', '0.1beta');
- $updater->addComponentToCheck('testpluginUpdates', '0.1');
- $componentsWithUpdateFile = $updater->getComponentsWithUpdateFile();
-
- $this->assertEquals(1, count($componentsWithUpdateFile));
- $updateFiles = $componentsWithUpdateFile['testpluginUpdates'];
- $this->assertEquals(2, count($updateFiles));
-
- $path = PIWIK_INCLUDE_PATH . '/tests/resources/Updater/testpluginUpdates/';
- $expectedInOrder = array(
- $path . '0.1beta2.php' => '0.1beta2',
- $path . '0.1.php' => '0.1'
- );
- $this->assertEquals($expectedInOrder, array_map("basename", $updateFiles));
- }
-
- public function testUpdaterChecksCoreAndPluginCheckThatCoreIsRanFirst()
- {
- $updater = new Updater();
- $updater->pathUpdateFilePlugins = PIWIK_INCLUDE_PATH . '/tests/resources/Updater/%s/';
- $updater->pathUpdateFileCore = PIWIK_INCLUDE_PATH . '/tests/resources/Updater/core/';
-
- $updater->recordComponentSuccessfullyUpdated('testpluginUpdates', '0.1beta');
- $updater->addComponentToCheck('testpluginUpdates', '0.1');
-
- $updater->recordComponentSuccessfullyUpdated('core', '0.1');
- $updater->addComponentToCheck('core', '0.3');
-
- $componentsWithUpdateFile = $updater->getComponentsWithUpdateFile();
- $this->assertEquals(2, count($componentsWithUpdateFile));
- 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/ViewDataTable/ManagerTest.php b/tests/PHPUnit/Integration/Core/ViewDataTable/ManagerTest.php
deleted file mode 100644
index 65cdf9abe8..0000000000
--- a/tests/PHPUnit/Integration/Core/ViewDataTable/ManagerTest.php
+++ /dev/null
@@ -1,105 +0,0 @@
-<?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\ViewDataTable\Manager as ViewDataTableManager;
-
-/**
- * Class Core_Plugin_SettingsTest
- * @group Core
- * @group ViewDataTable
- */
-class Core_Plugin_ViewDataTable_ManagerTest extends DatabaseTestCase
-{
-
- public function setUp()
- {
- parent::setUp();
- Access::setSingletonInstance(null);
- }
-
- public function test_getViewDataTableParameters_shouldReturnEmptyArray_IfNothingPersisted()
- {
- $login = 'mylogin';
- $method = 'API.get';
- $storedParams = ViewDataTableManager::getViewDataTableParameters($login, $method);
-
- $this->assertEquals(array(), $storedParams);
- }
-
- public function test_getViewDataTableParameters_shouldOnlyReturnParams_IfLoginAndActionMatches()
- {
- $params = $this->addParameters();
-
- $storedParams = ViewDataTableManager::getViewDataTableParameters('WroNgLogIn', $params['method']);
- $this->assertEquals(array(), $storedParams);
-
- $storedParams = ViewDataTableManager::getViewDataTableParameters($params['login'], 'API.wRoNg');
- $this->assertEquals(array(), $storedParams);
-
- $storedParams = ViewDataTableManager::getViewDataTableParameters($params['login'], $params['method']);
- $this->assertEquals($params['params'], $storedParams);
- }
-
- public function test_clearAllViewDataTableParameters_shouldRemoveAllPersistedParameters()
- {
- ViewDataTableManager::saveViewDataTableParameters('mylogin1', 'API.get1', array('flat' => 1));
- ViewDataTableManager::saveViewDataTableParameters('mylogin1', 'API.get2', array('flat' => 1));
- ViewDataTableManager::saveViewDataTableParameters('mylogin2', 'API.get3', array('flat' => 1));
- ViewDataTableManager::saveViewDataTableParameters('mylogin1', 'API.get4', array('flat' => 1));
- ViewDataTableManager::saveViewDataTableParameters('mylogin3', 'API.get5', array('flat' => 1));
-
- $this->assertNotEmpty(ViewDataTableManager::getViewDataTableParameters('mylogin1', 'API.get1'));
- $this->assertNotEmpty(ViewDataTableManager::getViewDataTableParameters('mylogin1', 'API.get2'));
- $this->assertNotEmpty(ViewDataTableManager::getViewDataTableParameters('mylogin2', 'API.get3'));
- $this->assertNotEmpty(ViewDataTableManager::getViewDataTableParameters('mylogin1', 'API.get4'));
- $this->assertNotEmpty(ViewDataTableManager::getViewDataTableParameters('mylogin3', 'API.get5'));
-
- ViewDataTableManager::clearAllViewDataTableParameters();
-
- $this->assertEmpty(ViewDataTableManager::getViewDataTableParameters('mylogin1', 'API.get1'));
- $this->assertEmpty(ViewDataTableManager::getViewDataTableParameters('mylogin1', 'API.get2'));
- $this->assertEmpty(ViewDataTableManager::getViewDataTableParameters('mylogin2', 'API.get3'));
- $this->assertEmpty(ViewDataTableManager::getViewDataTableParameters('mylogin1', 'API.get4'));
- $this->assertEmpty(ViewDataTableManager::getViewDataTableParameters('mylogin3', 'API.get5'));
- }
-
- public function test_clearUserViewDataTableParameters_shouldOnlyRemoveAUsersParameters()
- {
- ViewDataTableManager::saveViewDataTableParameters('mylogin1', 'API.get1', array('flat' => 1));
- ViewDataTableManager::saveViewDataTableParameters('mylogin1', 'API.get2', array('flat' => 1));
- ViewDataTableManager::saveViewDataTableParameters('mylogin2', 'API.get3', array('flat' => 1));
- ViewDataTableManager::saveViewDataTableParameters('mylogin1', 'API.get4', array('flat' => 1));
- ViewDataTableManager::saveViewDataTableParameters('mylogin3', 'API.get5', array('flat' => 1));
-
- $this->assertNotEmpty(ViewDataTableManager::getViewDataTableParameters('mylogin1', 'API.get1'));
- $this->assertNotEmpty(ViewDataTableManager::getViewDataTableParameters('mylogin1', 'API.get2'));
- $this->assertNotEmpty(ViewDataTableManager::getViewDataTableParameters('mylogin2', 'API.get3'));
- $this->assertNotEmpty(ViewDataTableManager::getViewDataTableParameters('mylogin1', 'API.get4'));
- $this->assertNotEmpty(ViewDataTableManager::getViewDataTableParameters('mylogin3', 'API.get5'));
-
- ViewDataTableManager::clearUserViewDataTableParameters('mylogin1');
-
- $this->assertEmpty(ViewDataTableManager::getViewDataTableParameters('mylogin1', 'API.get1'));
- $this->assertEmpty(ViewDataTableManager::getViewDataTableParameters('mylogin1', 'API.get2'));
- $this->assertEmpty(ViewDataTableManager::getViewDataTableParameters('mylogin1', 'API.get4'));
- $this->assertNotEmpty(ViewDataTableManager::getViewDataTableParameters('mylogin2', 'API.get3'));
- $this->assertNotEmpty(ViewDataTableManager::getViewDataTableParameters('mylogin3', 'API.get5'));
- }
-
- private function addParameters()
- {
- $login = 'mylogin';
- $method = 'API.get';
- $params = array('flat' => '0', 'expanded' => 1, 'viewDataTable' => 'tableAllColumns');
-
- ViewDataTableManager::saveViewDataTableParameters($login, $method, $params);
-
- return array('login' => $login, 'method' => $method, 'params' => $params);
- }
-} \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/Core/WidgetsListTest.php b/tests/PHPUnit/Integration/Core/WidgetsListTest.php
deleted file mode 100644
index 8f529ae9d8..0000000000
--- a/tests/PHPUnit/Integration/Core/WidgetsListTest.php
+++ /dev/null
@@ -1,191 +0,0 @@
-<?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\Goals\API;
-use Piwik\WidgetsList;
-use Piwik\Tests\Fixture;
-
-/**
- * Class Core_WidgetsListTest
- *
- * @group Core
- */
-class Core_WidgetsListTest extends DatabaseTestCase
-{
- /**
- * @group Core
- */
- public function testGet()
- {
- // setup the access layer
- $pseudoMockAccess = new FakeAccess;
- FakeAccess::$superUser = true;
- Access::setSingletonInstance($pseudoMockAccess);
-
- Fixture::createWebsite('2009-01-04 00:11:42');
-
- $_GET['idSite'] = 1;
-
- WidgetsList::_reset();
- $widgets = WidgetsList::get();
- WidgetsList::_reset();
-
- // check if each category has the right number of widgets
- $numberOfWidgets = array(
- 'VisitsSummary_VisitsSummary' => 6,
- 'Live!' => 4,
- 'General_Visitors' => 12,
- 'UserSettings_VisitorSettings' => 11,
- 'General_Actions' => 10,
- 'Events_Events' => 3,
- 'Actions_SubmenuSitesearch' => 5,
- 'Referrers_Referrers' => 7,
- 'Goals_Goals' => 1,
- 'SEO' => 2,
- 'Example Widgets' => 4,
- 'DevicesDetection_DevicesDetection' => 8,
- 'Insights_WidgetCategory' => 2
- );
-
- // number of main categories
- $this->assertEquals(count($numberOfWidgets), count($widgets));
-
- foreach ($numberOfWidgets as $category => $widgetCount) {
- $this->assertEquals($widgetCount, count($widgets[$category]), sprintf("Widget: %s", $category));
- }
- }
-
- /**
- * @group Core
- */
- public function testGetWithGoals()
- {
- // setup the access layer
- $pseudoMockAccess = new FakeAccess;
- FakeAccess::$superUser = true;
- Access::setSingletonInstance($pseudoMockAccess);
-
- Fixture::createWebsite('2009-01-04 00:11:42');
- API::getInstance()->addGoal(1, 'Goal 1 - Thank you', 'title', 'Thank you', 'contains', $caseSensitive = false, $revenue = 10, $allowMultipleConversions = 1);
-
- $_GET['idSite'] = 1;
-
- WidgetsList::_reset();
- $widgets = WidgetsList::get();
- WidgetsList::_reset();
-
- // number of main categories
- $this->assertEquals(13, count($widgets));
-
- // check that the goal widget was added
- $numberOfWidgets = array(
- 'Goals_Goals' => 2,
- );
-
- foreach ($numberOfWidgets as $category => $widgetCount) {
- $this->assertEquals($widgetCount, count($widgets[$category]));
- }
- }
-
- /**
- * @group Core
- */
- public function testGetWithGoalsAndEcommerce()
- {
- // setup the access layer
- $pseudoMockAccess = new FakeAccess;
- FakeAccess::$superUser = true;
- Access::setSingletonInstance($pseudoMockAccess);
-
- Fixture::createWebsite('2009-01-04 00:11:42', true);
- API::getInstance()->addGoal(1, 'Goal 1 - Thank you', 'title', 'Thank you', 'contains', $caseSensitive = false, $revenue = 10, $allowMultipleConversions = 1);
-
- $_GET['idSite'] = 1;
-
- WidgetsList::_reset();
- $widgets = WidgetsList::get();
- WidgetsList::_reset();
-
- // number of main categories
- $this->assertEquals(14, count($widgets));
-
- // check if each category has the right number of widgets
- $numberOfWidgets = array(
- 'Goals_Goals' => 2,
- 'Goals_Ecommerce' => 5,
- );
-
- foreach ($numberOfWidgets as $category => $widgetCount) {
- $this->assertEquals($widgetCount, count($widgets[$category]));
- }
- }
-
- /**
- * @group Core
- */
- public function testRemove()
- {
- // setup the access layer
- $pseudoMockAccess = new FakeAccess;
- FakeAccess::$superUser = true;
- Access::setSingletonInstance($pseudoMockAccess);
-
- Fixture::createWebsite('2009-01-04 00:11:42', true);
- API::getInstance()->addGoal(1, 'Goal 1 - Thank you', 'title', 'Thank you', 'contains', $caseSensitive = false, $revenue = 10, $allowMultipleConversions = 1);
-
- $_GET['idSite'] = 1;
-
- WidgetsList::_reset();
- $widgets = WidgetsList::get();
-
- $this->assertCount(14, $widgets);
- WidgetsList::remove('SEO', 'NoTeXiStInG');
-
- $widgets = WidgetsList::get();
- $this->assertCount(14, $widgets);
-
- $this->assertArrayHasKey('SEO', $widgets);
- $this->assertCount(2, $widgets['SEO']);
-
- WidgetsList::remove('SEO', 'SEO_SeoRankings');
- $widgets = WidgetsList::get();
-
- $this->assertCount(1, $widgets['SEO']);
-
- WidgetsList::remove('SEO');
- $widgets = WidgetsList::get();
-
- $this->assertArrayNotHasKey('SEO', $widgets);
-
- WidgetsList::_reset();
- }
-
- /**
- * @group Core
- */
- public function testIsDefined()
- {
- // setup the access layer
- $pseudoMockAccess = new FakeAccess;
- FakeAccess::$superUser = true;
- Access::setSingletonInstance($pseudoMockAccess);
-
- \Piwik\Translate::loadEnglishTranslation();
-
- Fixture::createWebsite('2009-01-04 00:11:42', true);
-
- $_GET['idSite'] = 1;
-
- WidgetsList::_reset();
- WidgetsList::add('Actions', 'Pages', 'Actions', 'getPageUrls');
-
- $this->assertTrue(WidgetsList::isDefined('Actions', 'getPageUrls'));
- $this->assertFalse(WidgetsList::isDefined('Actions', 'inValiD'));
- }
-}
diff --git a/tests/PHPUnit/Integration/Core/CronArchive/FixedSiteIdsTest.php b/tests/PHPUnit/Integration/CronArchive/FixedSiteIdsTest.php
index 259df6fc9e..259df6fc9e 100644
--- a/tests/PHPUnit/Integration/Core/CronArchive/FixedSiteIdsTest.php
+++ b/tests/PHPUnit/Integration/CronArchive/FixedSiteIdsTest.php
diff --git a/tests/PHPUnit/Integration/CronArchive/SharedSiteIdsTest.php b/tests/PHPUnit/Integration/CronArchive/SharedSiteIdsTest.php
new file mode 100644
index 0000000000..4fcba84352
--- /dev/null
+++ b/tests/PHPUnit/Integration/CronArchive/SharedSiteIdsTest.php
@@ -0,0 +1,115 @@
+<?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\CronArchive\SharedSiteIds;
+use Piwik\Tests\Impl\IntegrationTestCase;
+
+/**
+ * @group Core
+ * @group SharedSiteIdsTest
+ */
+class SharedSiteIdsTest extends IntegrationTestCase
+{
+ /**
+ * @var SharedSiteIds
+ */
+ private $sharedSiteIds;
+
+ public function setUp()
+ {
+ parent::setUp();
+
+ $this->sharedSiteIds = new SharedSiteIds(array(1,2,5,9));
+ }
+
+ public function tearDown()
+ {
+ $siteIdsToCleanup = new SharedSiteIds(array());
+ $siteIdsToCleanup->setSiteIdsToArchive(array());
+
+ parent::tearDown();
+ }
+
+ public function test_construct_withEmptyValue()
+ {
+ $this->sharedSiteIds->setSiteIdsToArchive(array());
+
+ $siteIds = new SharedSiteIds(null);
+ $this->assertEquals(0, $siteIds->getNumSites());
+ $this->assertNull($siteIds->getNextSiteId());
+ }
+
+ public function test_isSupported()
+ {
+ $this->assertTrue(SharedSiteIds::isSupported());
+ }
+
+ public function test_getNumSites()
+ {
+ $this->assertEquals(4, $this->sharedSiteIds->getNumSites());
+ }
+
+ public function test_getAllSiteIdsToArchive()
+ {
+ $this->assertEquals(array(1,2,5,9), $this->sharedSiteIds->getAllSiteIdsToArchive());
+ }
+
+ public function test_getNumProcessedWebsites_getNextSiteId()
+ {
+ $this->assertEquals(0, $this->sharedSiteIds->getNumProcessedWebsites());
+
+ $this->assertEquals(1, $this->sharedSiteIds->getNextSiteId());
+ $this->assertEquals(1, $this->sharedSiteIds->getNumProcessedWebsites());
+
+ $this->assertEquals(2, $this->sharedSiteIds->getNextSiteId());
+ $this->assertEquals(2, $this->sharedSiteIds->getNumProcessedWebsites());
+
+ $this->assertEquals(5, $this->sharedSiteIds->getNextSiteId());
+ $this->assertEquals(3, $this->sharedSiteIds->getNumProcessedWebsites());
+
+ $this->assertEquals(9, $this->sharedSiteIds->getNextSiteId());
+ $this->assertEquals(4, $this->sharedSiteIds->getNumProcessedWebsites());
+
+ $this->assertNull($this->sharedSiteIds->getNextSiteId());
+ $this->assertEquals(4, $this->sharedSiteIds->getNumProcessedWebsites());
+ }
+
+ public function test_usingMultipleSharedSiteIds()
+ {
+ $second = new SharedSiteIds(array(7,9,11,6,1,2));
+
+ // should ignore his queue and help processing the existing queue
+ $this->assertEquals(4, $second->getNumSites());
+ $this->assertEquals(4, $this->sharedSiteIds->getNumSites());
+
+ $this->assertEquals(array(1,2,5,9), $second->getAllSiteIdsToArchive());
+ $this->assertEquals(1, $second->getNextSiteId());
+ $this->assertEquals(1, $second->getNumProcessedWebsites());
+
+ $this->assertEquals(array(2,5,9), $this->sharedSiteIds->getAllSiteIdsToArchive());
+ $this->assertEquals(2, $this->sharedSiteIds->getNextSiteId());
+ $this->assertEquals(2, $this->sharedSiteIds->getNumProcessedWebsites());
+
+ $this->assertEquals(array(5,9), $second->getAllSiteIdsToArchive());
+ $this->assertEquals(5, $second->getNextSiteId());
+ $this->assertEquals(3, $second->getNumProcessedWebsites());
+
+ $this->assertEquals(array(9), $this->sharedSiteIds->getAllSiteIdsToArchive());
+ $this->assertEquals(9, $this->sharedSiteIds->getNextSiteId());
+ $this->assertEquals(4, $this->sharedSiteIds->getNumProcessedWebsites());
+
+ $this->assertNull($second->getNextSiteId());
+ $this->assertEquals(4, $second->getNumProcessedWebsites());
+ $this->assertEquals(array(), $second->getAllSiteIdsToArchive());
+
+ $this->assertNull($this->sharedSiteIds->getNextSiteId());
+ $this->assertEquals(4, $this->sharedSiteIds->getNumProcessedWebsites());
+ $this->assertEquals(array(), $this->sharedSiteIds->getAllSiteIdsToArchive());
+ }
+
+} \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/CsvExportTest.php b/tests/PHPUnit/Integration/CsvExportTest.php
deleted file mode 100755
index 371875fa0b..0000000000
--- a/tests/PHPUnit/Integration/CsvExportTest.php
+++ /dev/null
@@ -1,84 +0,0 @@
-<?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\TwoVisitsWithCustomVariables;
-
-/**
- * Test CSV export with Expanded rows, Translated labels, Different languages
- *
- * @group CsvExportTest
- * @group Integration
- */
-class CsvExportTest extends IntegrationTestCase
-{
- public static $fixture = null; // initialized below class definition
-
- public function getApiForTesting()
- {
- $idSite = self::$fixture->idSite;
- $dateTime = self::$fixture->dateTime;
-
- $apiToCall = array('VisitsSummary.get', 'CustomVariables.getCustomVariables');
-
- $enExtraParam = array('expanded' => 0, 'flat' => 1, 'include_aggregate_rows' => 0, 'translateColumnNames' => 1);
-
- $deExtraParam = array('expanded' => 0, 'flat' => 1, 'include_aggregate_rows' => 1, 'translateColumnNames' => 1);
-
- return array(
- array($apiToCall, array('idSite' => $idSite,
- 'date' => $dateTime,
- 'format' => 'csv',
- 'otherRequestParameters' => array('expanded' => 0, 'flat' => 0),
- 'testSuffix' => '_xp0')),
-
- array($apiToCall, array('idSite' => $idSite,
- 'date' => $dateTime,
- 'format' => 'csv',
- 'otherRequestParameters' => $enExtraParam,
- 'language' => 'en',
- 'testSuffix' => '_xp1_inner0_trans-en')),
-
- array($apiToCall, array('idSite' => $idSite,
- 'date' => $dateTime,
- 'format' => 'csv',
- 'otherRequestParameters' => $deExtraParam,
- 'language' => 'de',
- 'testSuffix' => '_xp1_inner1_trans-de')),
-
- array('Live.getLastVisitsDetails', array('idSite' => $idSite,
- 'date' => $dateTime,
- 'format' => 'csv',
- 'otherRequestParameters' => array(
- 'hideColumns' => 'serverDate,actionDetails,serverTimestamp,serverTimePretty,'
- . 'serverDatePretty,serverDatePrettyFirstAction,serverTimePrettyFirstAction,'
- . 'goalTimePretty,serverTimePretty,visitorId,visitServerHour,date,'
- . 'prettyDate,serverDateTimePrettyFirstAction'
- )))
- );
- }
-
- /**
- * @dataProvider getApiForTesting
- */
- public function testApi($api, $params)
- {
- $this->runApiTests($api, $params);
- }
-
- public static function getOutputPrefix()
- {
- return 'csvExport';
- }
-}
-
-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
deleted file mode 100644
index 542e0b852b..0000000000
--- a/tests/PHPUnit/Integration/CustomEventsTest.php
+++ /dev/null
@@ -1,141 +0,0 @@
-<?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\TwoVisitsWithCustomEvents;
-
-/**
- * Testing Custom Events
- *
- * @group CustomEventsTest
- * @group Integration
- */
-class CustomEventsTest extends IntegrationTestCase
-{
- public static $fixture = null; // initialized below class definition
-
- /**
- * @dataProvider getApiForTesting
- */
- public function testApi($api, $params)
- {
- $this->runApiTests($api, $params);
- }
-
- protected function getApiToCall()
- {
- return array(
- 'Events.getCategory',
- 'Events.getAction',
- 'Events.getName',
- 'Actions.get',
- 'Live.getLastVisitsDetails',
- 'Actions.getPageUrls',
- );
- }
-
- protected function tearDown()
- {
- parent::tearDown();
- }
-
- public function getApiForTesting()
- {
- $dateTime = self::$fixture->dateTime;
- $idSite1 = self::$fixture->idSite;
-
- $apiToCallProcessedReportMetadata = $this->getApiToCall();
-
- $dayPeriod = 'day';
- $periods = array($dayPeriod, 'month');
-
- $apiEventAndAction = array('Events', 'Actions.getPageUrls');
- $result = array(
- array($apiToCallProcessedReportMetadata, array(
- 'idSite' => $idSite1,
- 'date' => $dateTime,
- 'periods' => $periods,
- 'setDateLastN' => false,
- 'testSuffix' => '')),
-
- array($apiEventAndAction, array(
- 'idSite' => $idSite1,
- 'date' => $dateTime,
- 'periods' => $dayPeriod,
- 'segment' => "eventCategory==Movie,eventName==".urlencode('La fiancée de l\'eau'),
- 'setDateLastN' => false,
- 'testSuffix' => '_eventCategoryOrNameMatch')
- ),
-
- // eventAction should not match any page view
- array($apiEventAndAction, array(
- 'idSite' => $idSite1,
- 'date' => $dateTime,
- 'periods' => $dayPeriod,
- 'segment' => "eventAction=@play",
- 'setDateLastN' => false,
- 'testSuffix' => '_segmentMatchesEventActionPlay')
- ),
-
- // eventValue should not match any page view
-// array('Actions.getPageUrls', array(
-// 'idSite' => $idSite1,
-// 'date' => $dateTime,
-// 'periods' => $dayPeriod,
-// 'segment' => "eventValue>0",
-// 'setDateLastN' => false,
-// 'testSuffix' => '_eventSegmentMatchNoAction')
-// ),
- );
-
- $apiToCallProcessedReportMetadata = array(
- 'Events.getCategory',
- 'Events.getAction',
- 'Events.getName',
- );
- // testing metadata API for Events reports
- foreach ($apiToCallProcessedReportMetadata as $api) {
- list($apiModule, $apiAction) = explode(".", $api);
-
- $result[] = array(
- 'API.getProcessedReport', array('idSite' => $idSite1,
- 'date' => $dateTime,
- 'periods' => $dayPeriod,
- 'setDateLastN' => true,
- 'apiModule' => $apiModule,
- 'apiAction' => $apiAction,
- 'testSuffix' => '_' . $api . '_lastN')
- );
- }
-
- // Test secondary dimensions
- $secondaryDimensions = array('eventCategory', 'eventAction', 'eventName');
- foreach($secondaryDimensions as $secondaryDimension) {
- $result[] = array(array('Events'), array(
- 'idSite' => $idSite1,
- 'date' => $dateTime,
- 'periods' => $periods,
- 'otherRequestParameters' => array(
- 'secondaryDimension' => $secondaryDimension
- ),
- 'setDateLastN' => false,
- 'testSuffix' => '_secondaryDimensionIs' . ucfirst($secondaryDimension))
- );
- }
-
- return $result;
- }
-
- public static function getOutputPrefix()
- {
- return 'CustomEvents';
- }
-}
-
-CustomEventsTest::$fixture = new TwoVisitsWithCustomEvents();
diff --git a/tests/PHPUnit/Integration/DbTest.php b/tests/PHPUnit/Integration/DbTest.php
new file mode 100644
index 0000000000..562e8f9a35
--- /dev/null
+++ b/tests/PHPUnit/Integration/DbTest.php
@@ -0,0 +1,33 @@
+<?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\Common;
+use Piwik\Db;
+use Piwik\Tests\Impl\IntegrationTestCase;
+
+/**
+ * Class Core_DbTest
+ *
+ * @group Core
+ */
+class Core_DbTest extends IntegrationTestCase
+{
+
+ public function test_getColumnNamesFromTable()
+ {
+ $this->assertColumnNames('access', array('login', 'idsite', 'access'));
+ $this->assertColumnNames('option', array('option_name', 'option_value', 'autoload'));
+ }
+
+ private function assertColumnNames($tableName, $expectedColumnNames)
+ {
+ $colmuns = Db::getColumnNamesFromTable(Common::prefixTable($tableName));
+
+ $this->assertEquals($expectedColumnNames, $colmuns);
+ }
+
+} \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/EcommerceOrderWithItemsTest.php b/tests/PHPUnit/Integration/EcommerceOrderWithItemsTest.php
deleted file mode 100755
index cd0fe79f73..0000000000
--- a/tests/PHPUnit/Integration/EcommerceOrderWithItemsTest.php
+++ /dev/null
@@ -1,259 +0,0 @@
-<?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\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 EcommerceOrderWithItemsTest extends IntegrationTestCase
-{
- public static $fixture = null; // initialized below class definition
-
- public function testImagesIncludedInTests()
- {
- $this->alertWhenImagesExcludedFromTests();
- }
-
- /**
- * @dataProvider getApiForTesting
- */
- public function testApi($api, $params)
- {
- $this->runApiTests($api, $params);
- }
-
- public function getApiForTesting()
- {
- $idSite = self::$fixture->idSite;
- $idSite2 = self::$fixture->idSite2;
- $dateTime = self::$fixture->dateTime;
-
- $dayApi = array('VisitsSummary.get', 'VisitTime', 'CustomVariables.getCustomVariables',
- 'Live.getLastVisitsDetails', 'UserCountry', 'API.getProcessedReport', 'Goals.get',
- 'Goals.getConversions', 'Goals.getItemsSku', 'Goals.getItemsName', 'Goals.getItemsCategory');
-
- $goalWeekApi = array('Goals.get', 'Goals.getItemsSku', 'Goals.getItemsName', 'Goals.getItemsCategory');
-
- $goalItemApi = array('Goals.getItemsSku', 'Goals.getItemsName', 'Goals.getItemsCategory');
-
- $processedReportApi = array('API.getProcessedReport');
-
- $apiWithSegments = array(
- 'Goals.getItemsSku', 'Goals.getItemsName', 'Goals.getItemsCategory'
- );
-
- // Normal standard goal
- $apiWithSegments_visitConvertedGoal = array_merge($apiWithSegments , array('Goals.get', 'VisitsSummary.get'));
- return array_merge(array(
-
- // Segment: This will match the first visit of the fixture only
- array(
- $apiWithSegments,
- array(
- 'idSite' => $idSite,
- 'date' => $dateTime,
- 'periods' => array('day', 'week'),
- 'otherRequestParameters' => array('_leavePiwikCoreVariables' => 1),
- 'segment' => 'pageUrl=@Another%20Product%20page',
- 'testSuffix' => '_SegmentPageUrlContains'
- )
- ),
-
- // Segment: This will match the first visit of the fixture only
- array(
- $apiWithSegments,
- array(
- 'idSite' => $idSite,
- 'date' => $dateTime,
- 'periods' => array('day', 'week'),
- 'otherRequestParameters' => array('_leavePiwikCoreVariables' => 1),
- 'segment' => 'countryCode==fr',
- 'testSuffix' => '_SegmentCountryIsFr'
- )
- ),
-
- // day tests
- array($dayApi, array('idSite' => $idSite, 'date' => $dateTime, 'periods' => array('day'),
- 'otherRequestParameters' => array('_leavePiwikCoreVariables' => 1))),
-
- // goals API week tests
- array($goalWeekApi, array('idSite' => $idSite, 'date' => $dateTime, 'periods' => array('week'))),
-
- // abandoned carts tests
- array($goalItemApi, array('idSite' => $idSite, 'date' => $dateTime,
- 'periods' => array('day', 'week'),
- 'testSuffix' => '_AbandonedCarts',
- 'otherRequestParameters' => array(
- 'abandonedCarts' => 1
- ))),
-
- // multiple periods tests
- array($goalItemApi, array('idSite' => $idSite, 'date' => $dateTime, 'periods' => array('day'),
- 'setDateLastN' => true, 'testSuffix' => 'multipleDates')),
-
- // multiple periods & multiple websites tests
- array($goalItemApi, array('idSite' => sprintf("%u,%u", $idSite, $idSite2), 'date' => $dateTime,
- 'periods' => array('day'), 'setDateLastN' => true,
- 'testSuffix' => 'multipleDates_andMultipleWebsites')),
-
- // test metadata products
- array($processedReportApi, array('idSite' => $idSite, 'date' => $dateTime,
- 'periods' => array('day'), 'apiModule' => 'Goals',
- 'apiAction' => 'getItemsSku', 'testSuffix' => '_Metadata_ItemsSku')),
- array($processedReportApi, array('idSite' => $idSite, 'date' => $dateTime,
- 'periods' => array('day'), 'apiModule' => 'Goals',
- 'apiAction' => 'getItemsCategory', 'testSuffix' => '_Metadata_ItemsCategory')),
-
- // test metadata Goals.get for Ecommerce orders & Carts
- array($processedReportApi, array('idSite' => $idSite, 'date' => $dateTime,
- 'periods' => array('day'), 'apiModule' => 'Goals', 'apiAction' => 'get',
- 'idGoal' => Piwik::LABEL_ID_GOAL_IS_ECOMMERCE_ORDER,
- 'testSuffix' => '_Metadata_Goals.Get_Order')),
- array($processedReportApi, array('idSite' => $idSite, 'date' => $dateTime,
- 'periods' => array('day'), 'apiModule' => 'Goals', 'apiAction' => 'get',
- 'idGoal' => Piwik::LABEL_ID_GOAL_IS_ECOMMERCE_CART,
- 'testSuffix' => '_Metadata_Goals.Get_AbandonedCart')),
-
- // normal standard goal test
- array($processedReportApi, array('idSite' => $idSite, 'date' => $dateTime,
- 'periods' => array('day'), 'apiModule' => 'Goals', 'apiAction' => 'get',
- 'idGoal' => self::$fixture->idGoalStandard,
- 'testSuffix' => '_Metadata_Goals.Get_NormalGoal')),
-
- // non-existant goal test
- array($processedReportApi, array('idSite' => $idSite, 'date' => $dateTime,
- 'periods' => array('day'), 'apiModule' => 'Goals', 'apiAction' => 'get',
- 'idGoal' => 'FAKE IDGOAL',
- 'testSuffix' => '_Metadata_Goals.Get_NotExistingGoal')),
-
- // While we're at it, test for a standard Metadata report with zero entries
- array($processedReportApi, array('idSite' => $idSite, 'date' => $dateTime,
- 'periods' => array('day'), 'apiModule' => 'VisitTime',
- 'apiAction' => 'getVisitInformationPerServerTime',
- 'testSuffix' => '_Metadata_VisitTime.getVisitInformationPerServerTime')),
-
- // Standard non metadata Goals.get
- // test Goals.get with idGoal=ecommerceOrder and ecommerceAbandonedCart
- array('Goals.get', array('idSite' => $idSite, 'date' => $dateTime,
- 'periods' => array('day', 'week'), 'idGoal' => Piwik::LABEL_ID_GOAL_IS_ECOMMERCE_CART,
- 'testSuffix' => '_GoalAbandonedCart')),
- array('Goals.get', array('idSite' => $idSite, 'date' => $dateTime,
- 'periods' => array('day', 'week'), 'idGoal' => Piwik::LABEL_ID_GOAL_IS_ECOMMERCE_ORDER,
- 'testSuffix' => '_GoalOrder')),
- array('Goals.get', array('idSite' => $idSite, 'date' => $dateTime,
- 'periods' => array('day', 'week'), 'idGoal' => 1, 'testSuffix' => '_GoalMatchTitle')),
- array('Goals.get', array('idSite' => $idSite, 'date' => $dateTime,
- 'periods' => array('day', 'week'), 'idGoal' => '', 'testSuffix' => '_GoalOverall')),
-
- array('VisitsSummary.get', array('idSite' => $idSite, 'date' => $dateTime,
- 'periods' => array('day'), 'segment' => 'visitEcommerceStatus==none',
- 'testSuffix' => '_SegmentNoEcommerce')),
- array('VisitsSummary.get', array('idSite' => $idSite, 'date' => $dateTime,
- 'periods' => array('day'), 'testSuffix' => '_SegmentOrderedSomething',
- 'segment' => 'visitEcommerceStatus==ordered,visitEcommerceStatus==orderedThenAbandonedCart')),
- array('VisitsSummary.get', array('idSite' => $idSite, 'date' => $dateTime,
- 'periods' => array('day'), 'testSuffix' => '_SegmentAbandonedCart',
- 'segment' => 'visitEcommerceStatus==abandonedCart,visitEcommerceStatus==orderedThenAbandonedCart')),
-
- // test segment visitConvertedGoalId
- array('VisitsSummary.get', array('idSite' => $idSite, 'date' => $dateTime,
- 'periods' => array('day', 'week'), 'testSuffix' => '_SegmentConvertedGoalId1',
- 'segment' => "visitConvertedGoalId==" . self::$fixture->idGoalStandard)),
- array('VisitsSummary.get', array('idSite' => $idSite, 'date' => $dateTime,
- 'periods' => array('day'), 'testSuffix' => '_SegmentDidNotConvertGoalId1',
- 'segment' => "visitConvertedGoalId!=" . self::$fixture->idGoalStandard)),
-
- // test segment visitorType
- array('VisitsSummary.get', array('idSite' => $idSite, 'date' => $dateTime,
- 'periods' => array('week'), 'segment' => 'visitorType==new',
- 'testSuffix' => '_SegmentNewVisitors')),
- array('VisitsSummary.get', array('idSite' => $idSite, 'date' => $dateTime,
- 'periods' => array('week'), 'segment' => 'visitorType==returning',
- 'testSuffix' => '_SegmentReturningVisitors')),
- array('VisitsSummary.get', array('idSite' => $idSite, 'date' => $dateTime,
- 'periods' => array('week'), 'segment' => 'visitorType==returningCustomer',
- 'testSuffix' => '_SegmentReturningCustomers')),
-
- // test segment visitConvertedGoalId with Ecommerce APIs
- array($apiWithSegments_visitConvertedGoal,
- array(
- 'idSite' => $idSite,
- 'date' => $dateTime,
- 'periods' => array('week'),
- 'segment' => 'visitConvertedGoalId==1;visitConvertedGoalId!=2',
- 'testSuffix' => '_SegmentVisitHasConvertedGoal')),
-
- // Different segment will yield same result, so we keep same testSuffix
- array($apiWithSegments_visitConvertedGoal,
- array(
- 'idSite' => $idSite,
- 'date' => $dateTime,
- 'periods' => array('week'),
- 'segment' => 'visitConvertedGoalId==1;visitConvertedGoalId!=2;countryCode!=xx;deviceType!=tv',
- 'testSuffix' => '_SegmentVisitHasConvertedGoal')),
-
- // testing a segment on log_conversion matching no visit
- array($apiWithSegments_visitConvertedGoal,
- array(
- 'idSite' => $idSite,
- 'date' => $dateTime,
- 'periods' => array('week'),
- 'segment' => 'visitConvertedGoalId==666',
- 'testSuffix' => '_SegmentNoVisit_HaveConvertedNonExistingGoal')),
-
- // test segment visitEcommerceStatus and visitConvertedGoalId
- array($apiWithSegments_visitConvertedGoal,
- array(
- 'idSite' => $idSite,
- 'date' => $dateTime,
- 'periods' => array('week'),
- 'segment' => 'visitEcommerceStatus!=ordered;visitConvertedGoalId==1',
- 'testSuffix' => '_SegmentVisitHasNotOrderedAndConvertedGoal')),
-
- // test segment pageTitle
- array('VisitsSummary.get', array('idSite' => $idSite,
- 'date' => $dateTime,
- 'periods' => array('day'),
- 'segment' => 'pageTitle==incredible title!',
- 'testSuffix' => '_SegmentPageTitleMatch')),
-
- // test Live! output is OK also for the visit that just bought something (other visits leave an abandoned cart)
- array('Live.getLastVisitsDetails', array('idSite' => $idSite,
- 'date' => Date::factory($dateTime)->addHour(30.65)->getDatetime(),
- 'periods' => array('day'), 'testSuffix' => '_LiveEcommerceStatusOrdered')),
-
- // test API.get method
- array('API.get', array('idSite' => $idSite, 'date' => $dateTime, 'periods' => array('day', 'week'),
- 'otherRequestParameters' => array(
- 'columns' => 'nb_pageviews,nb_visits,avg_time_on_site,nb_visits_converted'),
- 'testSuffix' => '_API_get')),
-
- // Website2
- array($goalWeekApi, array('idSite' => $idSite2, 'date' => $dateTime, 'periods' => array('week'),
- 'testSuffix' => '_Website2')),
-
- ),
- self::getApiForTestingScheduledReports($dateTime, 'week')
- );
- }
-
- public static function getOutputPrefix()
- {
- return 'ecommerceOrderWithItems';
- }
-}
-
-EcommerceOrderWithItemsTest::$fixture = new TwoSitesEcommerceOrderWithItems(); \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/FlattenReportsTest.php b/tests/PHPUnit/Integration/FlattenReportsTest.php
deleted file mode 100644
index 389f3c0e7b..0000000000
--- a/tests/PHPUnit/Integration/FlattenReportsTest.php
+++ /dev/null
@@ -1,128 +0,0 @@
-<?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\ManyVisitsWithSubDirReferrersAndCustomVars;
-
-/**
- * Tests the flattening of reports.
- *
- * @group FlattenReportsTest
- * @group Integration
- */
-class FlattenReportsTest extends IntegrationTestCase
-{
- public static $fixture = null; // initialized below class definition
-
- /**
- * @dataProvider getApiForTesting
- */
- public function testApi($api, $params)
- {
- $this->runApiTests($api, $params);
- }
-
- public function getApiForTesting()
- {
- $idSite = self::$fixture->idSite;
- $dateTime = self::$fixture->dateTime;
-
- $return = array();
-
- // referrers
- $return[] = array(
- 'Referrers.getWebsites',
- array(
- 'idSite' => $idSite,
- 'date' => $dateTime,
- 'otherRequestParameters' => array(
- 'flat' => '1',
- 'expanded' => '0'
- )
- ));
-
- // urls
- $return[] = array(
- 'Actions.getPageUrls',
- array(
- 'idSite' => $idSite,
- 'date' => $dateTime,
- 'period' => 'week',
- 'otherRequestParameters' => array(
- 'flat' => '1',
- 'expanded' => '0'
- )
- ));
- $return[] = array(
- 'Actions.getPageUrls',
- array(
- 'idSite' => $idSite,
- 'date' => $dateTime,
- 'period' => 'week',
- 'testSuffix' => '_withAggregate',
- 'otherRequestParameters' => array(
- 'flat' => '1',
- 'include_aggregate_rows' => '1',
- 'expanded' => '0'
- )
- ));
-
- // custom variables for multiple days
- $return[] = array('CustomVariables.getCustomVariables', array(
- 'idSite' => $idSite,
- 'date' => $dateTime,
- 'otherRequestParameters' => array(
- 'date' => '2010-03-05,2010-03-08',
- 'flat' => '1',
- 'include_aggregate_rows' => '1',
- 'expanded' => '0'
- )
- ));
-
- // test expanded=1 w/ idSubtable=X
- $return[] = array('Actions.getPageUrls', array('idSite' => $idSite,
- 'date' => $dateTime,
- 'periods' => array('week'),
- 'apiModule' => 'Actions',
- 'apiAction' => 'getPageUrls',
- 'supertableApi' => 'Actions.getPageUrls',
- 'testSuffix' => '_expandedSubtable',
- 'otherRequestParameters' => array('expanded' => '1')));
-
- // test expanded=1 & depth=1
- $return[] = array('Actions.getPageUrls', array('idSite' => $idSite,
- 'date' => $dateTime,
- 'periods' => array('week'),
- 'testSuffix' => '_expandedWithDepth',
- 'otherRequestParameters' => array('expanded' => '1',
- 'depth' => '1')));
-
- // test flat=1 w/ filter_pattern_recursive
- $return[] = array('Actions.getPageUrls', array('idSite' => $idSite,
- 'date' => $dateTime,
- 'periods' => array('week'),
- 'apiModule' => 'Actions',
- 'apiAction' => 'getPageUrls',
- 'testSuffix' => '_flatFilterPatternRecursive',
- 'otherRequestParameters' => array(
- 'flat' => '1',
- 'expanded' => '0',
- 'filter_pattern_recursive' => 'dir2/'
- )));
-
- return $return;
- }
-
- public static function getOutputPrefix()
- {
- return 'FlattenReports';
- }
-}
-
-FlattenReportsTest::$fixture = new ManyVisitsWithSubDirReferrersAndCustomVars(); \ No newline at end of file
diff --git a/tests/PHPUnit/Core/Http/fixture.zip b/tests/PHPUnit/Integration/Http/fixture.zip
index 2388859d52..2388859d52 100644
--- a/tests/PHPUnit/Core/Http/fixture.zip
+++ b/tests/PHPUnit/Integration/Http/fixture.zip
Binary files differ
diff --git a/tests/PHPUnit/Integration/HttpTest.php b/tests/PHPUnit/Integration/HttpTest.php
new file mode 100644
index 0000000000..07d7736bfd
--- /dev/null
+++ b/tests/PHPUnit/Integration/HttpTest.php
@@ -0,0 +1,123 @@
+<?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\Http;
+use Piwik\Tests\Impl\Fixture;
+
+/**
+ * @group HttpTest
+ */
+class Piwik_Test_HttpTest extends PHPUnit_Framework_TestCase
+{
+ /**
+ * Dataprovider for testFetchRemoteFile
+ */
+ public function getMethodsToTest()
+ {
+ return array(
+ 'curl' => array('curl'),
+ 'fopen' => array('fopen'),
+ 'socket' => array('socket'),
+ );
+ }
+
+ /**
+ * @group Core
+ *
+ * @dataProvider getMethodsToTest
+ */
+ public function testFetchRemoteFile($method)
+ {
+ $this->assertNotNull(Http::getTransportMethod());
+ $result = Http::sendHttpRequestBy($method, Fixture::getRootUrl() . 'piwik.js', 30);
+ $this->assertTrue(strpos($result, 'Piwik') !== false);
+ }
+
+ /**
+ * @group Core
+ */
+ public function testFetchApiLatestVersion()
+ {
+ $destinationPath = PIWIK_USER_PATH . '/tmp/latest/LATEST';
+ Http::fetchRemoteFile(Fixture::getRootUrl(), $destinationPath, 3);
+ $this->assertFileExists($destinationPath);
+ $this->assertGreaterThan(0, filesize($destinationPath));
+ }
+
+ /**
+ * @group Core
+ */
+ public function testFetchLatestZip()
+ {
+ $destinationPath = PIWIK_USER_PATH . '/tmp/latest/latest.zip';
+ Http::fetchRemoteFile(Fixture::getRootUrl() . 'tests/PHPUnit/Integration/Http/fixture.zip', $destinationPath, 3, 30);
+ $this->assertFileExists($destinationPath);
+ $this->assertGreaterThan(0, filesize($destinationPath));
+ }
+
+ /**
+ * @group Core
+ * @dataProvider getMethodsToTest
+ */
+ public function testCustomByteRange($method)
+ {
+ $result = Http::sendHttpRequestBy(
+ $method,
+ Fixture::getRootUrl() . '/piwik.js',
+ 30,
+ $userAgent = null,
+ $destinationPath = null,
+ $file = null,
+ $followDepth = 0,
+ $acceptLanguage = false,
+ $acceptInvalidSslCertificate = false,
+ $byteRange = array(10, 20),
+ $getExtendedInfo = true
+ );
+
+ if ($method != 'fopen') {
+ $this->assertEquals(206, $result['status']);
+ $this->assertTrue(isset($result['headers']['Content-Range']));
+ $this->assertEquals('bytes 10-20/', substr($result['headers']['Content-Range'], 0, 12));
+ $this->assertEquals('application/x-javascript', $result['headers']['Content-Type']);
+ }
+ }
+
+ /**
+ * @group Core
+ *
+ * @dataProvider getMethodsToTest
+ */
+ public function testHEADOperation($method)
+ {
+ if ($method == 'fopen') {
+ return; // not supported w/ this method
+ }
+
+ $result = Http::sendHttpRequestBy(
+ $method,
+ Fixture::getRootUrl() . 'tests/PHPUnit/Integration/Http/fixture.zip',
+ 30,
+ $userAgent = null,
+ $destinationPath = null,
+ $file = null,
+ $followDepth = 0,
+ $acceptLanguage = false,
+ $acceptInvalidSslCertificate = false,
+ $byteRange = false,
+ $getExtendedInfo = true,
+ $httpMethod = 'HEAD'
+ );
+
+ $this->assertEquals('', $result['data']);
+ $this->assertEquals(200, $result['status']);
+
+ $this->assertTrue(isset($result['headers']['Content-Length']), "Content-Length header not set!");
+ $this->assertTrue(is_numeric($result['headers']['Content-Length']), "Content-Length header not numeric!");
+ $this->assertEquals('application/zip', $result['headers']['Content-Type']);
+ }
+}
diff --git a/tests/PHPUnit/Integration/ImportLogsTest.php b/tests/PHPUnit/Integration/ImportLogsTest.php
deleted file mode 100755
index a08750d128..0000000000
--- a/tests/PHPUnit/Integration/ImportLogsTest.php
+++ /dev/null
@@ -1,105 +0,0 @@
-<?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\Access;
-use Piwik\Plugins\SitesManager\API;
-use Piwik\Tests\IntegrationTestCase;
-use Piwik\Tests\Fixtures\ManySitesImportedLogs;
-
-/**
- * Tests the log importer.
- *
- * @group ImportLogsTest
- * @group Integration
- */
-class ImportLogsTest extends IntegrationTestCase
-{
- public static $fixture = null; // initialized below class definition
-
- /**
- * @dataProvider getApiForTesting
- */
- public function testApi($api, $params)
- {
- $this->runApiTests($api, $params);
- }
-
- public function getApiForTesting()
- {
- $apis = array(
- array('all', array('idSite' => self::$fixture->idSite,
- 'date' => '2012-08-09',
- 'periods' => 'month')),
-
- array('MultiSites.getAll', array('idSite' => self::$fixture->idSite,
- 'date' => '2012-08-09',
- 'periods' => array('month'),
- 'setDateLastN' => true,
- 'otherRequestParameters' => array('enhanced' => 1),
- 'testSuffix' => '_withEnhancedAndLast7')),
-
- // report generated from custom log format including generation time
- array('Actions.getPageUrls', array('idSite' => self::$fixture->idSite,
- 'date' => '2012-09-30',
- 'periods' => 'day')),
-
- array('VisitsSummary.get', array('idSite' => self::$fixture->idSite2,
- 'date' => '2012-08-09',
- 'periods' => 'month',
- 'testSuffix' => '_siteIdTwo_TrackedUsingLogReplay')),
- );
-
- // Running a few interesting tests for Log Replay use case
- $apiMethods = array();
- if (getenv('MYSQL_ADAPTER') != 'MYSQLI') {
- // Mysqli rounds latitude/longitude
- $apiMethods = array('Live.getLastVisitsDetails');
- }
- $apiMethods[] = 'Actions';
- $apiMethods[] = 'VisitorInterest';
- $apiMethods[] = 'VisitFrequency';
- $apis[] = array($apiMethods, array(
- 'idSite' => self::$fixture->idSite,
- 'date' => '2012-08-09,2014-04-01',
- 'periods' => 'range',
- 'otherRequestParameters' => array(
- 'filter_limit' => 1000
- )));
- return $apis;
- }
-
- /**
- * NOTE: This test must be last since the new sites that get added are added in
- * random order.
- */
- public function testDynamicResolverSitesCreated()
- {
- self::$fixture->logVisitsWithDynamicResolver();
-
- // reload access so new sites are viewable
- Access::getInstance()->setSuperUserAccess(true);
-
- // make sure sites aren't created twice
- $piwikDotNet = API::getInstance()->getSitesIdFromSiteUrl('http://piwik.net');
- $this->assertEquals(1, count($piwikDotNet));
-
- $anothersiteDotCom = API::getInstance()->getSitesIdFromSiteUrl('http://anothersite.com');
- $this->assertEquals(1, count($anothersiteDotCom));
-
- $whateverDotCom = API::getInstance()->getSitesIdFromSiteUrl('http://whatever.com');
- $this->assertEquals(1, count($whateverDotCom));
- }
-
- public static function getOutputPrefix()
- {
- return 'ImportLogs';
- }
-}
-
-ImportLogsTest::$fixture = new ManySitesImportedLogs(); \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/JsProxyTest.php b/tests/PHPUnit/Integration/JsProxyTest.php
new file mode 100644
index 0000000000..dc900930cf
--- /dev/null
+++ b/tests/PHPUnit/Integration/JsProxyTest.php
@@ -0,0 +1,85 @@
+<?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\Tests\Impl\Fixture;
+
+class Test_Piwik_JsProxy extends PHPUnit_Framework_TestCase
+{
+ /**
+ * @group Core
+ */
+ function testPiwikJs()
+ {
+ $curlHandle = curl_init();
+ curl_setopt($curlHandle, CURLOPT_URL, $this->getStaticSrvUrl() . '/js/');
+ curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, true);
+ $fullResponse = curl_exec($curlHandle);
+ $responseInfo = curl_getinfo($curlHandle);
+ curl_close($curlHandle);
+
+ $this->assertEquals(200, $responseInfo["http_code"], 'Ok response');
+
+ $piwik_js = file_get_contents(PIWIK_PATH_TEST_TO_ROOT . '/piwik.js');
+ $this->assertEquals($piwik_js, $fullResponse, 'script content');
+ }
+
+ /**
+ * @group Core
+ */
+ function testPiwikJsNoComment()
+ {
+ $curlHandle = curl_init();
+ curl_setopt($curlHandle, CURLOPT_URL, $this->getStaticSrvUrl() . '/js/tracker.php');
+ curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, true);
+ $fullResponse = curl_exec($curlHandle);
+ $responseInfo = curl_getinfo($curlHandle);
+ curl_close($curlHandle);
+
+ $this->assertEquals(200, $responseInfo["http_code"], 'Ok response');
+
+ $piwikJs = file_get_contents(PIWIK_PATH_TEST_TO_ROOT . '/piwik.js');
+ $piwikNoCommentJs = substr($piwikJs, strpos($piwikJs, "*/\n") + 3);
+ $this->assertEquals($piwikNoCommentJs, $fullResponse, 'script content (if comment shows, $byteStart value in /js/tracker.php)');
+ }
+
+ /**
+ * @group Core
+ */
+ function testPiwikPhp()
+ {
+ $curlHandle = curl_init();
+ $url = $this->getStaticSrvUrl() . '/js/?idsite=1';
+ curl_setopt($curlHandle, CURLOPT_URL, $url);
+ curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, true);
+ $fullResponse = curl_exec($curlHandle);
+ $responseInfo = curl_getinfo($curlHandle);
+ curl_close($curlHandle);
+
+ $this->assertEquals($responseInfo["http_code"], 200, 'Ok response');
+ $expected = "R0lGODlhAQABAIAAAAAAAAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==";
+ $processed = base64_encode($fullResponse);
+ if ($expected != $processed) {
+ $this->markTestSkipped("testPiwikPhp invalid response content: " . $fullResponse);
+ }
+
+ $this->assertEquals(
+ $expected,
+ $processed,
+ 'checking for image content' . "\n\n\n\nRaw content: \n\n\n" . $fullResponse
+ );
+
+ }
+
+ /**
+ * Helper methods
+ */
+ private function getStaticSrvUrl()
+ {
+ return Fixture::getRootUrl();
+ }
+}
diff --git a/tests/PHPUnit/Integration/LabelFilterTest.php b/tests/PHPUnit/Integration/LabelFilterTest.php
deleted file mode 100644
index 5435809fff..0000000000
--- a/tests/PHPUnit/Integration/LabelFilterTest.php
+++ /dev/null
@@ -1,172 +0,0 @@
-<?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\OneVisitSeveralPageViews;
-
-/**
- * Tests the class LabelFilter.
- * This is not possible as unit test, since it loads data from the archive.
- *
- * @group LabelFilterTest
- * @group Integration
- */
-class LabelFilterTest extends IntegrationTestCase
-{
- public static $fixture = null; // initialized below class definition
-
- /**
- * @dataProvider getApiForTesting
- */
- public function testApi($api, $params)
- {
- $this->runApiTests($api, $params);
- }
-
- public function getApiForTesting()
- {
- $idSite = self::$fixture->idSite;
- $dateTime = self::$fixture->dateTime;
-
- $labelsToTest = array(
- // first level
- 'shouldBeNoData' => 'nonExistent',
- 'dir' => ' dir ',
- '0' => '/0',
-
- // TODO the label in the API output is ...&amp;#039;... why does it only work this way?
- 'thisiscool' => '/ééé&quot;&#039;... &lt;this is cool&gt;!',
-
- // second level
- 'dirnonExistent' => 'dir>nonExistent',
- 'dirfilephpfoobarfoo2bar' => 'dir>' . urlencode('/file.php?foo=bar&foo2=bar'),
-
- // 4 levels
- 'dir2sub0filephp' => 'dir2>sub>0>' . urlencode('/file.php'),
- );
-
- $return = array();
- foreach ($labelsToTest as $suffix => $label) {
- $return[] = array('Actions.getPageUrls', array(
- 'testSuffix' => '_' . $suffix,
- 'idSite' => $idSite,
- 'date' => $dateTime,
- 'otherRequestParameters' => array(
- 'label' => urlencode($label),
- 'expanded' => 0
- )
- ));
- }
-
- $label = 'dir';
- $return[] = array('Actions.getPageUrls', array(
- 'testSuffix' => '_' . $label . '_range',
- 'idSite' => $idSite,
- 'date' => $dateTime,
- 'otherRequestParameters' => array(
- 'date' => '2010-03-06,2010-03-08',
- 'label' => urlencode($label),
- 'expanded' => 0
- )
- ));
-
- $return[] = array('Actions.getPageTitles', array(
- 'testSuffix' => '_titles',
- 'idSite' => $idSite,
- 'date' => $dateTime,
- 'otherRequestParameters' => array(
- // note: title has no blank prefixed here. in the report it has.
- 'label' => urlencode('incredible title! <>,;'),
- 'expanded' => 0
- )
- ));
-
- $return[] = array('Actions.getPageTitles', array(
- 'testSuffix' => '_titlesRecursive',
- 'idSite' => $idSite,
- 'date' => $dateTime,
- 'otherRequestParameters' => array(
- 'label' => urlencode(
- ' ' . // test trimming
- urlencode('incredible parent title! <>,;') .
- '>' .
- urlencode('subtitle <>,;')),
- 'expanded' => 0
- )
- ));
-
- $keyword = '&lt;&gt;&amp;\&quot;the pdo extension is required for this adapter but the extension is not loaded';
- $searchEngineTest = array(
- 'testSuffix' => '_keywords_html',
- 'idSite' => $idSite,
- 'date' => $dateTime,
- 'otherRequestParameters' => array(
- 'label' => urlencode('Google>' . urlencode($keyword)),
- 'expanded' => 0
- )
- );
- $return[] = array('Referrers.getSearchEngines', $searchEngineTest);
-
- $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;
- }
-
- public static function getOutputPrefix()
- {
- return 'LabelFilter';
- }
-}
-
-LabelFilterTest::$fixture = new OneVisitSeveralPageViews(); \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/LogTest.php b/tests/PHPUnit/Integration/LogTest.php
new file mode 100644
index 0000000000..6e453fa858
--- /dev/null
+++ b/tests/PHPUnit/Integration/LogTest.php
@@ -0,0 +1,304 @@
+<?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\Common;
+use Piwik\Config;
+use Piwik\Db;
+use Piwik\Error;
+use Piwik\ExceptionHandler;
+use Piwik\Log;
+use Piwik\Plugins\TestPlugin\TestLoggingUtility;
+use Piwik\Tests\Impl\IntegrationTestCase;
+
+require_once PIWIK_INCLUDE_PATH . '/tests/resources/TestPluginLogClass.php';
+
+/**
+ * Class Core_LogTest
+ *
+ * @group Core
+ * @group Core_LogTest
+ */
+class Core_LogTest extends IntegrationTestCase
+{
+ const TESTMESSAGE = 'test%smessage';
+ const STRING_MESSAGE_FORMAT = '[%tag%] %message%';
+ const STRING_MESSAGE_FORMAT_SPRINTF = "[%s] %s";
+
+ public static $expectedExceptionOutput = array(
+ 'screen' => 'dummy error message<br />
+ <br />
+ --&gt; To temporarily debug this error further, set const PIWIK_PRINT_ERROR_BACKTRACE=true; in index.php',
+ 'file' => '[Core_LogTest] LogTest.php(166): dummy error message
+ dummy backtrace',
+ 'database' => '[Core_LogTest] LogTest.php(166): dummy error message
+dummy backtrace'
+ );
+
+ public static $expectedErrorOutput = array(
+ 'screen' => '<div style=\'word-wrap: break-word; border: 3px solid red; padding:4px; width:70%; background-color:#FFFF96;\'>
+ <strong>There is an error. Please report the message (Piwik 2.0)
+ and full backtrace in the <a href=\'?module=Proxy&action=redirect&url=http://forum.piwik.org\' target=\'_blank\'>Piwik forums</a> (please do a Search first as it might have been reported already!).<br /><br/>
+ Unknown error (102):</strong> <em>dummy error string</em> in <strong>dummyerrorfile.php</strong> on line <strong>145</strong>
+<br /><br />Backtrace --&gt;<div style="font-family:Courier;font-size:10pt"><br />
+dummy backtrace</div><br />
+ </pre></div><br />',
+ 'file' => '[Core_LogTest] dummyerrorfile.php(145): Unknown error (102) - dummy error string
+ dummy backtrace',
+ 'database' => '[Core_LogTest] dummyerrorfile.php(145): Unknown error (102) - dummy error string
+dummy backtrace'
+ );
+
+ private $screenOutput;
+
+ public static function setUpBeforeClass()
+ {
+ parent::setUpBeforeClass();
+
+ Error::setErrorHandler();
+ ExceptionHandler::setUp();
+ }
+
+ public static function tearDownAfterClass()
+ {
+ restore_error_handler();
+ restore_exception_handler();
+
+ parent::tearDownAfterClass();
+ }
+
+ public function setUp()
+ {
+ parent::setUp();
+
+ Config::getInstance()->log['string_message_format'] = self::STRING_MESSAGE_FORMAT;
+ Config::getInstance()->log['logger_file_path'] = self::getDefaultLogFileLocation();
+ @unlink(self::getLogFileLocation());
+ Log::unsetInstance();
+ Error::$debugBacktraceForTests = ExceptionHandler::$debugBacktraceForTests = "dummy backtrace";
+ }
+
+ public function tearDown()
+ {
+ parent::tearDown();
+
+ Log::unsetInstance();
+ @unlink(self::getLogFileLocation());
+ Error::$debugBacktraceForTests = ExceptionHandler::$debugBacktraceForTests = null;
+ }
+
+ /**
+ * Data provider for every test.
+ */
+ public function getBackendsToTest()
+ {
+ return array(array('screen'),
+ array('file'),
+ array('database'));
+ }
+
+ /**
+ * @group Core
+ *
+ * @dataProvider getBackendsToTest
+ */
+ public function testLoggingWorksWhenMessageIsString($backend)
+ {
+ Config::getInstance()->log['log_writers'] = array($backend);
+
+ ob_start();
+ Log::warning(self::TESTMESSAGE);
+ $this->screenOutput = ob_get_contents();
+ ob_end_clean();
+
+ $this->checkBackend($backend, self::TESTMESSAGE, $formatMessage = true, $tag = 'Core_LogTest');
+ }
+
+ /**
+ * @group Core
+ *
+ * @dataProvider getBackendsToTest
+ */
+ public function testLoggingWorksWhenMessageIsSprintfString($backend)
+ {
+ Config::getInstance()->log['log_writers'] = array($backend);
+
+ ob_start();
+ Log::warning(self::TESTMESSAGE, " subst ");
+ $this->screenOutput = ob_get_contents();
+ ob_end_clean();
+
+ $this->checkBackend($backend, sprintf(self::TESTMESSAGE, " subst "), $formatMessage = true, $tag = 'Core_LogTest');
+ }
+
+ /**
+ * @group Core
+ *
+ * @dataProvider getBackendsToTest
+ */
+ public function testLoggingWorksWhenMessageIsError($backend)
+ {
+ Config::getInstance()->log['log_writers'] = array($backend);
+
+ ob_start();
+ $error = new Error(102, "dummy error string", "dummyerrorfile.php", 145, "dummy backtrace");
+ Log::error($error);
+ $this->screenOutput = ob_get_contents();
+ ob_end_clean();
+
+ $this->checkBackend($backend, self::$expectedErrorOutput[$backend], $formatMessage = false, $tag = 'Core_LogTest');
+ $this->checkBackend('screen', self::$expectedErrorOutput['screen']); // errors should always written to the screen
+ }
+
+ /**
+ * @group Core
+ *
+ * @dataProvider getBackendsToTest
+ */
+ public function testLoggingWorksWhenMessageIsException($backend)
+ {
+ Config::getInstance()->log['log_writers'] = array($backend);
+
+ ob_start();
+ $exception = new Exception("dummy error message");
+ Log::error($exception);
+ $this->screenOutput = ob_get_contents();
+ ob_end_clean();
+
+ $this->checkBackend($backend, self::$expectedExceptionOutput[$backend], $formatMessage = false, $tag = 'Core_LogTest');
+ $this->checkBackend('screen', self::$expectedExceptionOutput['screen']); // errors should always written to the screen
+ }
+
+ /**
+ * @group Core
+ *
+ * @dataProvider getBackendsToTest
+ */
+ public function testLoggingCorrectlyIdentifiesPlugin($backend)
+ {
+ Config::getInstance()->log['log_writers'] = array($backend);
+
+ ob_start();
+ TestLoggingUtility::doLog(self::TESTMESSAGE);
+ $this->screenOutput = ob_get_contents();
+ ob_end_clean();
+
+ $this->checkBackend($backend, self::TESTMESSAGE, $formatMessage = true, $tag = 'TestPlugin');
+ }
+
+ /**
+ * @group Core
+ *
+ * @dataProvider getBackendsToTest
+ */
+ public function testLogMessagesIgnoredWhenNotWithinLevel($backend)
+ {
+ Config::getInstance()->log['log_writers'] = array($backend);
+ Config::getInstance()->log['log_level'] = 'ERROR';
+
+ ob_start();
+ Log::info(self::TESTMESSAGE);
+ $this->screenOutput = ob_get_contents();
+ ob_end_clean();
+
+ $this->checkNoMessagesLogged($backend);
+ }
+
+ /**
+ * @group Core
+ * @dataProvider getBackendsToTest
+ */
+ public function testLogMessagesAreTrimmed($backend)
+ {
+ Config::getInstance()->log['log_writers'] = array($backend);
+
+ ob_start();
+ TestLoggingUtility::doLog(" \n ".self::TESTMESSAGE."\n\n\n \n");
+ $this->screenOutput = ob_get_contents();
+ ob_end_clean();
+
+ $this->checkBackend($backend, self::TESTMESSAGE, $formatMessage = true, $tag = 'TestPlugin');
+ }
+
+ private function checkBackend($backend, $expectedMessage, $formatMessage = false, $tag = false)
+ {
+ if ($formatMessage) {
+ $expectedMessage = sprintf(self::STRING_MESSAGE_FORMAT_SPRINTF, $tag, $expectedMessage);
+ }
+
+ // remove version number from message
+ $expectedMessage = str_replace("(Piwik 2.0)", "", $expectedMessage);
+ $this->screenOutput = str_replace("(Piwik ". \Piwik\Version::VERSION.")", "", $this->screenOutput);
+
+ if ($backend == 'screen') {
+ if ($formatMessage
+ && !Common::isPhpCliMode()) {
+ $expectedMessage = '<pre>' . $expectedMessage . '</pre>';
+ }
+
+ $this->screenOutput = $this->removePathsFromBacktrace($this->screenOutput);
+
+ $this->assertEquals($expectedMessage . "\n", $this->screenOutput, "unexpected output: ".$this->screenOutput);
+ } else if ($backend == 'file') {
+ $this->assertTrue(file_exists(self::getLogFileLocation()));
+
+ $fileContents = file_get_contents(self::getLogFileLocation());
+ $fileContents = $this->removePathsFromBacktrace($fileContents);
+
+ $this->assertEquals($expectedMessage . "\n", $fileContents);
+ } else if ($backend == 'database') {
+ $count = Db::fetchOne("SELECT COUNT(*) FROM " . Common::prefixTable('logger_message'));
+ $this->assertEquals(1, $count);
+
+ $message = Db::fetchOne("SELECT message FROM " . Common::prefixTable('logger_message') . " LIMIT 1");
+ $message = $this->removePathsFromBacktrace($message);
+ $this->assertEquals($expectedMessage, $message);
+
+ $tagInDb = Db::fetchOne("SELECT tag FROM " . Common::prefixTable('logger_message') . " LIMIT 1");
+ if ($tag === false) {
+ $this->assertEmpty($tagInDb);
+ } else {
+ $this->assertEquals($tag, $tagInDb);
+ }
+ }
+ }
+
+ private function checkNoMessagesLogged($backend)
+ {
+ if ($backend == 'screen') {
+ $this->assertEmpty($this->screenOutput, "Output not empty: ".$this->screenOutput);
+ } else if ($backend == 'file') {
+ $this->assertFalse(file_exists(self::getLogFileLocation()));
+ } else if ($backend == 'database') {
+ $this->assertEquals(0, Db::fetchOne("SELECT COUNT(*) FROM " . Common::prefixTable('logger_message')));
+ }
+ }
+
+ private function removePathsFromBacktrace($content)
+ {
+ return preg_replace_callback("/(?:\/[^\s(<>]+)*\//", function ($matches) {
+ if ($matches[0] == '/') {
+ return '/';
+ } else {
+ return '';
+ }
+ }, $content);
+ }
+
+ public static function getLogFileLocation()
+ {
+ $path = self::getDefaultLogFileLocation();
+ $path = \Piwik\SettingsPiwik::rewriteTmpPathWithInstanceId($path);
+ return $path;
+ }
+
+ protected static function getDefaultLogFileLocation()
+ {
+ $path = PIWIK_INCLUDE_PATH . '/tmp/logs/piwik.test.log';
+ return $path;
+ }
+
+} \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/ManyVisitorsOneWebsiteTest.php b/tests/PHPUnit/Integration/ManyVisitorsOneWebsiteTest.php
deleted file mode 100755
index c7f3d9ca00..0000000000
--- a/tests/PHPUnit/Integration/ManyVisitorsOneWebsiteTest.php
+++ /dev/null
@@ -1,165 +0,0 @@
-<?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;
-
-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.
- * Uses geoip location provider to test city/region reports.
- *
- * 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 ManyVisitorsOneWebsiteTest extends IntegrationTestCase
-{
- public static $fixture = null; // initialized below class definition
-
- /**
- * @dataProvider getApiForTesting
- */
- public function testApi($api, $params)
- {
- $this->runApiTests($api, $params);
- }
-
- public function getApiForTesting()
- {
- $idSite = self::$fixture->idSite;
- $dateTime = self::$fixture->dateTime;
-
- $dateString = Date::factory($dateTime)->toString();
-
- // Note: we must set 'UserCountry.getLocationFromIP' since it's "excluded" by default in setApiNotToCall
- $apiToCall = array('UserCountry');
-
- $apiToTest = array(
- array($apiToCall,
- array('idSite' => $idSite,
- 'date' => $dateTime,
- 'periods' => array('month'))),
-
- array($apiToCall, array('idSite' => $idSite,
- 'date' => $dateTime,
- 'periods' => array('month'),
- 'testSuffix' => '_segment_region',
- 'segment' => 'regionCode==P3;countryCode==gb')),
-
- array($apiToCall, array('idSite' => $idSite,
- 'date' => $dateTime,
- 'periods' => array('month'),
- 'testSuffix' => '_segment_city',
- 'segment' => 'city==Stratford-upon-Avon;regionCode==P3;countryCode==gb')),
-
- array($apiToCall, array('idSite' => $idSite,
- 'date' => $dateTime,
- 'periods' => array('month'),
- 'testSuffix' => '_segment_lat_long',
- 'segment' => 'latitude>45;latitude<49.3;longitude>-125;longitude<-122')),
-
- array('UserCountry.getCountry', array('idSite' => $idSite,
- 'date' => $dateTime,
- 'periods' => array('month'),
- 'testSuffix' => '_segment_continent',
- 'segment' => 'continentCode==eur')),
-
- // make sure it is possible to sort getProcessedReport by a processed metric
- array('API.getProcessedReport', array('idSite' => $idSite,
- 'date' => $dateTime,
- 'periods' => 'day',
- 'apiModule' => 'Actions',
- 'apiAction' => 'getPageUrls',
- 'testSuffix' => '_sortByProcessedMetric',
- 'otherRequestParameters' => array(
- 'filter_sort_column' => 'nb_actions_per_visit'
- ))),
-
- // make sure it is possible to sort getProcessedReport by a processed metric
- // it should not remove empty rows if report has constant rows count
- array('API.getProcessedReport', array('idSite' => $idSite,
- 'date' => $dateTime,
- 'periods' => 'day',
- 'apiModule' => 'VisitTime',
- 'apiAction' => 'getVisitInformationPerServerTime',
- 'testSuffix' => '_sortByProcessedMetric_constantRowsCountShouldKeepEmptyRows',
- 'otherRequestParameters' => array(
- 'filter_sort_column' => 'nb_actions_per_visit'
- ))),
-
- array(array('UserCountry.getLocationFromIP', 'Live.getLastVisitsDetails'), array(
- 'idSite' => $idSite,
- 'date' => $dateTime,
- 'periods' => array('month'),
- 'otherRequestParameters' => array('ip' => '194.57.91.215')
- )),
- );
-
- // Randomly fails on 5.3
- if(!self::isPhpVersion53()) {
-
- $apiToTest[] = array('Live.getLastVisitsDetails', array(
- 'idSite' => $idSite,
- 'date' => $dateString,
- 'periods' => 'month',
- 'testSuffix' => '_Live.getLastVisitsDetails_sortDesc',
- 'otherRequestParameters' => array('filter_sort_order' => 'desc', 'filter_limit' => 7)
- ));
-
- // #5950
- $apiToTest[] = array('Live.getLastVisitsDetails', array(
- 'idSite' => $idSite,
- 'date' => $dateString,
- 'periods' => 'month',
- 'testSuffix' => '_Live.getLastVisitsDetails_sortByVisitCount',
- 'otherRequestParameters' => array('filter_sort_order' => 'desc', 'filter_sort_column' => 'visitCount', 'filter_limit' => 7)
- ));
-
- // #5950
- $apiToTest[] = array('Live.getLastVisitsDetails', array(
- 'idSite' => $idSite,
- 'date' => $dateString,
- 'periods' => 'month',
- 'testSuffix' => '_Live.getLastVisitsDetails_sortByIdVisit',
- 'otherRequestParameters' => array('filter_sort_order' => 'desc', 'filter_sort_column' => 'idVisit', 'filter_limit' => 7)
- ));
-
- // #5950
- $apiToTest[] = array('Live.getLastVisitsDetails', array(
- 'idSite' => $idSite,
- 'date' => $dateString,
- 'periods' => 'month',
- 'testSuffix' => '_Live.getLastVisitsDetails_sortByIdVisitAsc',
- 'otherRequestParameters' => array('filter_sort_order' => 'asc',
- 'filter_sort_column' => 'idVisit',
- 'filter_limit' => 7,
- 'hideColumns' => 'latitude,longitude' // Mysqli has troubles with lat/long rounding
- )
- ));
- }
-
- // this also fails on all PHP versions, it seems randomly.
-// $apiToTest[] = array('Live.getLastVisitsDetails', array(
-// 'idSite' => $idSite,
-// 'date' => $dateString,
-// 'periods' => 'month',
-// 'testSuffix' => '_Live.getLastVisitsDetails_sortAsc',
-// 'otherRequestParameters' => array('filter_sort_order' => 'asc', 'filter_limit' => 7)
-// ));
-
- return $apiToTest;
- }
-}
-
-ManyVisitorsOneWebsiteTest::$fixture = new ManyVisitsWithGeoIP(); \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/MultipleSitesArchivingTest.php b/tests/PHPUnit/Integration/MultipleSitesArchivingTest.php
deleted file mode 100644
index 67289069b3..0000000000
--- a/tests/PHPUnit/Integration/MultipleSitesArchivingTest.php
+++ /dev/null
@@ -1,60 +0,0 @@
-<?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\Config;
-use Piwik\Piwik;
-use Piwik\Tests\Fixture;
-use Piwik\Tests\Fixtures\ThreeSitesWithSharedVisitors;
-use Piwik\Tests\IntegrationTestCase;
-
-/**
- * @group Integration
- * @group MultipleSitesArchivingTest
- */
-class MultipleSitesArchivingTest extends IntegrationTestCase
-{
- public static $fixture = null; // initialized below class definition
-
- public static function setUpBeforeClass()
- {
- parent::setUpBeforeClass();
-
- $extraSite = Fixture::createWebsite(self::$fixture->dateTime, $ecommerce = 1, "the site");
-
- Piwik::addAction("ArchiveProcessor.Parameters.getIdSites", function (&$sites, $period) use ($extraSite) {
- if (reset($sites) == $extraSite) {
- $sites = array(1, 2, 3);
- }
- });
-
- Config::getInstance()->General['enable_processing_unique_visitors_multiple_sites'] = 1;
- }
-
- public function getApiForTesting()
- {
- $dateTime = self::$fixture->dateTime;
-
- return array(
- array('VisitsSummary.get', array('idSite' => 4,
- 'date' => $dateTime,
- 'periods' => array('day', 'month'),
- 'testSuffix' => '_sitesGroup')),
- );
- }
-
- /**
- * @dataProvider getApiForTesting
- */
- public function testApi($api, $params)
- {
- $this->runApiTests($api, $params);
- }
-}
-
-MultipleSitesArchivingTest::$fixture = new ThreeSitesWithSharedVisitors(); \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/NoVisitTest.php b/tests/PHPUnit/Integration/NoVisitTest.php
deleted file mode 100755
index 19a09a45f9..0000000000
--- a/tests/PHPUnit/Integration/NoVisitTest.php
+++ /dev/null
@@ -1,53 +0,0 @@
-<?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\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 NoVisitTest extends IntegrationTestCase
-{
- public static $fixture = null; // initialized below class definition
-
- /**
- * @dataProvider getApiForTesting
- */
- public function testApi($api, $params)
- {
- $this->runApiTests($api, $params);
- }
-
- public function getApiForTesting()
- {
- // this will output empty XML result sets as no visit was tracked
- return array(
- array('all', array('idSite' => self::$fixture->idSite,
- 'date' => self::$fixture->dateTime)),
- array('all', array('idSite' => self::$fixture->idSite,
- 'date' => self::$fixture->dateTime,
- 'periods' => array('day', 'week'),
- 'setDateLastN' => true,
- 'testSuffix' => '_PeriodIsLast')),
- );
- }
-
- public static function getOutputPrefix()
- {
- return 'noVisit';
- }
-}
-
-NoVisitTest::$fixture = new InvalidVisits(); \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/NonUnicodeTest.php b/tests/PHPUnit/Integration/NonUnicodeTest.php
deleted file mode 100755
index cb9153a0ba..0000000000
--- a/tests/PHPUnit/Integration/NonUnicodeTest.php
+++ /dev/null
@@ -1,55 +0,0 @@
-<?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\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 NonUnicodeTest extends IntegrationTestCase
-{
- public static $fixture = null; // initialized below class definition
-
- /**
- * @dataProvider getApiForTesting
- */
- public function testApi($api, $params)
- {
- $this->runApiTests($api, $params);
- }
-
- public function getApiForTesting()
- {
- $apiToCall = array(
- 'Actions.getSiteSearchKeywords',
- 'Actions.getPageTitles',
- 'Actions.getPageUrls',
- 'Referrers.getWebsites',
- );
-
- return array(
- array($apiToCall, array('idSite' => self::$fixture->idSite1,
- 'date' => self::$fixture->dateTime,
- 'periods' => 'day'))
- );
- }
-
- public static function getOutputPrefix()
- {
- return 'NonUnicode';
- }
-
-}
-
-NonUnicodeTest::$fixture = new SomeVisitsWithNonUnicodePageTitles(); \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/OneVisitorLongUrlsTruncatedTest.php b/tests/PHPUnit/Integration/OneVisitorLongUrlsTruncatedTest.php
deleted file mode 100644
index 62b94edcea..0000000000
--- a/tests/PHPUnit/Integration/OneVisitorLongUrlsTruncatedTest.php
+++ /dev/null
@@ -1,54 +0,0 @@
-<?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\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 OneVisitorLongUrlsTruncatedTest extends IntegrationTestCase
-{
- public static $fixture = null; // initialized below class definition
-
- /**
- * @dataProvider getApiForTesting
- */
- public function testApi($api, $params)
- {
- $this->runApiTests($api, $params);
- }
-
- public function getApiForTesting()
- {
- $apiToCall = array(
- 'Referrers.getKeywords',
- 'Actions.getPageUrls',
-
- // Specifically testing getPlugin filter_truncate works
- 'UserSettings.getPlugin');
-
- return array(
- array($apiToCall, array('idSite' => self::$fixture->idSite,
- 'date' => self::$fixture->dateTime,
- 'language' => 'fr',
- 'otherRequestParameters' => array('expanded' => 1, 'filter_truncate' => 2)))
- );
- }
-
- public static function getOutputPrefix()
- {
- return 'OneVisitor_LongUrlsTruncated';
- }
-}
-
-OneVisitorLongUrlsTruncatedTest::$fixture = new SomeVisitsWithLongUrls(); \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/OneVisitorNoKeywordSpecifiedTest.php b/tests/PHPUnit/Integration/OneVisitorNoKeywordSpecifiedTest.php
deleted file mode 100755
index c2d8ba430b..0000000000
--- a/tests/PHPUnit/Integration/OneVisitorNoKeywordSpecifiedTest.php
+++ /dev/null
@@ -1,56 +0,0 @@
-<?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\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 OneVisitorNoKeywordSpecifiedTest extends IntegrationTestCase
-{
- public static $fixture = null; // initialized below class definition
-
- /**
- * @dataProvider getApiForTesting
- */
- public function testApi($api, $params)
- {
- $this->runApiTests($api, $params);
- }
-
- public function getApiForTesting()
- {
- $apiToCall = array('Referrers.getKeywords');
-
- // test started failing after bc19503 and I cannot understand why
- if(!self::isTravisCI()) {
- $apiToCall[] = 'Live.getLastVisitsDetails';
- }
-
- return array(
- array($apiToCall, array('idSite' => self::$fixture->idSite,
- 'date' => self::$fixture->dateTime,
- 'language' => 'fr'))
- );
- }
-
- public static function getOutputPrefix()
- {
- return 'OneVisitor_NoKeywordSpecified';
- }
-}
-
-OneVisitorNoKeywordSpecifiedTest::$fixture = new TwoVisitsNoKeywordWithBot(); \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/OneVisitorOneWebsiteSeveralDaysDateRangeArchivingTestsTest.php b/tests/PHPUnit/Integration/OneVisitorOneWebsiteSeveralDaysDateRangeArchivingTestsTest.php
deleted file mode 100755
index 99c6da7e90..0000000000
--- a/tests/PHPUnit/Integration/OneVisitorOneWebsiteSeveralDaysDateRangeArchivingTestsTest.php
+++ /dev/null
@@ -1,185 +0,0 @@
-<?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\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 OneVisitorOneWebsiteSeveralDaysDateRangeArchivingTest extends IntegrationTestCase
-{
- public static $fixture = null; // initialized below test definition
-
- public static function getOutputPrefix()
- {
- return 'oneVisitor_oneWebsite_severalDays_DateRange';
- }
-
- /**
- * @dataProvider getApiForTesting
- */
- public function testApi($api, $params)
- {
- $this->runApiTests($api, $params);
- }
-
- public function getApiForTesting()
- {
- $idSite = self::$fixture->idSite;
-
- $apiToCall = array('Actions.getPageUrls',
- 'VisitsSummary.get',
- 'UserSettings.getResolution',
- 'VisitFrequency.get',
- 'VisitTime.getVisitInformationPerServerTime');
-
- // 2 segments: ALL and another way of expressing ALL but triggering the Segment code path
- $segments = array(
- false,
- 'countryCode!=aa',
- 'pageUrl!=ThisIsNotKnownPageUrl',
- );
-
- // Running twice just as health check that second call also works
- $result = array();
- for ($i = 0; $i <= 1; $i++) {
- foreach ($segments as $segment) {
- $result[] = array($apiToCall, array('idSite' => $idSite, 'date' => '2010-12-15,2011-01-15',
- 'periods' => array('range'),
- 'segment' => $segment,
- 'otherRequestParameters' => array(
- 'flat' => '0',
- 'expanded' => '0'
- ),
- ));
- }
- }
-
- // Testing Date range in January only
- // Because of flat=1, this test will archive all sub-tables
- $result[] = array('Actions.getPageUrls', array('idSite' => $idSite, 'date' => '2011-01-01,2011-02-01',
- 'periods' => array('range'),
- 'otherRequestParameters' => array(
- 'flat' => '1',
- 'expanded' => '0'
- ),
- 'testSuffix' => '_periodIsRange_flattened_')
- );
- // testing the same with expanded=1 should not create new archive records
- $result[] = array('Actions.getPageUrls', array('idSite' => $idSite, 'date' => '2011-01-01,2011-02-01',
- 'periods' => array('range'),
- 'otherRequestParameters' => array(
- 'flat' => '0',
- 'expanded' => '1'
- ),
- 'testSuffix' => '_periodIsRange_expanded_')
- );
- return $result;
- }
-
- /**
- * Check that requesting period "Range" means only processing
- * the requested Plugin blob (Actions in this case), not all Plugins blobs
- *
- * @depends testApi
- */
- public function test_checkArchiveRecords_whenPeriodIsRange()
- {
- // we expect 5 blobs for Actions plugins, because flat=1 or expanded=1 was not set
- // so we only archived the parent table
- $expectedActionsBlobs = 5;
-
- // When flat=1, Actions plugin will process 5 + 3 extra blobs (URL = 'http://example.org/sub1/sub2/sub3/news')
- $expectedActionsBlobsWhenFlattened = $expectedActionsBlobs + 3;
-
- $tests = array(
- // TODO Implement fix, then remove the +3 below
- 'archive_blob_2010_12' => ( ($expectedActionsBlobs+3) /*Actions*/
- + 7 /* UserSettings */
- + 2 /* VisitTime */) * 3,
-
- /**
- * In Each "Period=range" Archive, we expect following non zero numeric entries:
- * 5 metrics + 1 flag // VisitsSummary
- * + 2 metrics + 1 flag // Actions
- * + 1 flag // UserSettings
- * + 1 flag // VisitTime
- * = 11
- *
- * because we call VisitFrequency.get, this creates an archive for the visitorType==returning segment.
- * -> There are two archives for each segment (one for "countryCode!=aa"
- * and VisitFrequency creates one for "countryCode!=aa;visitorType==returning")
- *
- * So each period=range will have = 11 records + (5 metrics + 1 flag // VisitsSummary)
- * = 17
- *
- * Total expected records = count unique archives * records per archive
- * = 3 * 17
- * = 51
- */
- 'archive_numeric_2010_12' => 17 * 3,
-
- /**
- * In the January date range,
- * we archive only Actions plugins.
- * It is flattened so all 3 sub-tables should be archived.
- */
- 'archive_blob_2011_01' => $expectedActionsBlobsWhenFlattened,
-
- /**
- * 5 metrics + 1 flag // VisitsSummary
- * + 2 metrics + 1 flag // Actions
- */
- 'archive_numeric_2011_01' => (6 + 3),
-
- // nothing in Feb
- 'archive_blob_2011_02' => 0,
- 'archive_numeric_2011_02' => 0,
- );
- foreach ($tests as $table => $expectedRows) {
- $sql = "SELECT count(*) FROM " . Common::prefixTable($table) . " WHERE period = " . Piwik::$idPeriods['range'];
- $countBlobs = Db::get()->fetchOne($sql);
-
- if($expectedRows != $countBlobs) {
- $this->printDebugWhenTestFails($table);
- }
- $this->assertEquals($expectedRows, $countBlobs, "$table expected $expectedRows, got $countBlobs");
- }
- }
-
- /**
- * @param $table
- */
- protected function printDebugWhenTestFails($table)
- {
- $data = Db::get()->fetchAll("SELECT * FROM " . Common::prefixTable($table) . " WHERE period = " . Piwik::$idPeriods['range'] . " ORDER BY idarchive ASC");
- var_export($data);
-
- $idArchives = array();
- foreach ($data as $row) {
- $idArchives[] = $row['idarchive'];
- }
- $idArchives = array_unique($idArchives);
- foreach ($idArchives as $idArchive) {
- $numericTable = str_replace("blob", "numeric", Common::prefixTable($table));
- var_export(Db::get()->fetchAll("SELECT idarchive, name FROM " . $numericTable . " WHERE idarchive = ? AND name LIKE 'done%' LIMIT 1 ", $idArchive));
- }
- }
-
-}
-
-OneVisitorOneWebsiteSeveralDaysDateRangeArchivingTest::$fixture = new VisitsOverSeveralDays(); \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/OneVisitorOneWebsiteSeveralDaysDateRangeTest.php b/tests/PHPUnit/Integration/OneVisitorOneWebsiteSeveralDaysDateRangeTest.php
deleted file mode 100755
index e877166a25..0000000000
--- a/tests/PHPUnit/Integration/OneVisitorOneWebsiteSeveralDaysDateRangeTest.php
+++ /dev/null
@@ -1,103 +0,0 @@
-<?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\VisitsOverSeveralDays;
-
-/**
- * Use case testing various important features:
- * - Test Multisites API use cases
- * - 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 OneVisitorOneWebsiteSeveralDaysDateRangeTest extends IntegrationTestCase
-{
- public static $fixture = null; // initialized below class definition
-
- /**
- * @dataProvider getApiForTesting
- */
- public function testApi($api, $params)
- {
- $this->runApiTests($api, $params);
- }
-
- public function getApiForTesting()
- {
- $idSite = self::$fixture->idSite;
-
- return array(
- // FIRST some MultiSites API goodness!
-
- // range test
- array('MultiSites.getAll', array('date' => '2010-12-15,2011-01-15',
- 'periods' => array('range')
- // Testing without &pattern= so should return all sites
- )),
-
- // test several dates (tests use of IndexedByDate w/ 'date1,date2,etc.')
- array('MultiSites.getAll', array('date' => '2010-12-15',
- 'periods' => array('day'),
- 'testSuffix' => '_IndexedByDate',
- // Testing the pattern to getAll restrict websites using name matching
- 'otherRequestParameters' => array('pattern' => 'aAa')
- )),
-
- // test getOne call used in MobileMessaging SMS reports
- array('MultiSites.getOne', array('date' => '2010-12-15,2011-01-15',
- 'periods' => array('range'),
- 'idSite' => $idSite,
- // Testing without &pattern= so should return all sites
- )),
-
- // test that multiple periods are not supported
- array('MultiSites.getAll', array('date' => '2010-12-15,2011-01-15',
- 'periods' => array('day'),
- 'testSuffix' => '_MultipleDatesNotSupported',
- )),
-
- //---------------------------------------
- // THEN some Socials tests. Share these...
- array('Referrers.getSocials', array('idSite' => 'all',
- 'date' => '2010-12-13,2011-01-18',
- 'periods' => array('range'))),
-
- array('Referrers.getSocials', array('idSite' => 'all',
- 'date' => '2010-12-10',
- 'periods' => array('day'),
- 'setDateLastN' => true,
- 'testSuffix' => '_IndexedByDate')),
-
- array('Referrers.getUrlsForSocial', array('idSite' => 'all', // test w/o idSubtable
- 'date' => '2010-12-13,2011-01-18',
- 'periods' => 'range',
- 'testSuffix' => '_noIdSubtable')),
-
- array('Referrers.getUrlsForSocial', array('idSite' => 1, // test w/ idSubtable
- 'date' => '2010-12-13,2011-01-18',
- 'periods' => 'range',
- 'supertableApi' => 'Referrers.getSocials')),
-
- array('UserCountry.getCountry', array('idSite' => $idSite,
- 'date' => '2010-12-01,2011-01-15',
- 'periods' => array('range'))),
- );
- }
-
- public static function getOutputPrefix()
- {
- return 'oneVisitor_oneWebsite_severalDays_DateRange';
- }
-}
-
-OneVisitorOneWebsiteSeveralDaysDateRangeTest::$fixture = new VisitsOverSeveralDays(); \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/OneVisitorSeveralDaysImportedInRandomOrderTest.php b/tests/PHPUnit/Integration/OneVisitorSeveralDaysImportedInRandomOrderTest.php
deleted file mode 100644
index 675f4cef06..0000000000
--- a/tests/PHPUnit/Integration/OneVisitorSeveralDaysImportedInRandomOrderTest.php
+++ /dev/null
@@ -1,51 +0,0 @@
-<?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\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
- */
- public function testApi($api, $params)
- {
- $this->runApiTests($api, $params);
- }
-
- public function getApiForTesting()
- {
- return array(
- // This should show 1 visit on 3 different days
- array('Live.getLastVisitsDetails', array(
- 'idSite' => '1',
- 'date' => self::$fixture->dateTime,
- 'periods' => 'month',
- 'testSuffix' => '_shouldShowOneVisit_InEachOfThreeDays',
- 'otherRequestParameters' => array('hideColumns' => 'visitorId'),
- 'keepLiveDates' => true
-
- )),
- );
- }
-}
-
-OneVisitorSeveralDaysImportedInRandomOrderTest::$fixture = new VisitOverSeveralDaysImportedLogs();
diff --git a/tests/PHPUnit/Integration/OneVisitorTwoVisitsTest.php b/tests/PHPUnit/Integration/OneVisitorTwoVisitsTest.php
deleted file mode 100755
index d8b211e6f9..0000000000
--- a/tests/PHPUnit/Integration/OneVisitorTwoVisitsTest.php
+++ /dev/null
@@ -1,238 +0,0 @@
-<?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\API\Proxy;
-use Piwik\Archive;
-use Piwik\Tests\IntegrationTestCase;
-use Piwik\Tests\Fixtures\OneVisitorTwoVisits;
-use Exception;
-
-/**
- * This use case covers many simple tracking features.
- * - Tracking Goal by manual trigger, and URL matching, with custom revenue
- * - Tracking the same Goal twice only records it once
- * - Tracks 4 page views: 3 clicks and a file download
- * - URLs parameters exclude is tested
- * - In a returning visit, tracks a Goal conversion
- * URL matching, with custom referrer and keyword
- * NO cookie support
- *
- * @group Integration
- * @group OneVisitorTwoVisitsTest
- */
-class OneVisitorTwoVisitsTest extends IntegrationTestCase
-{
- /**
- * @var Test_Piwik_Fixture_OneVisitorTwoVisits
- */
- public static $fixture = null; // initialized below class
-
- public function setUp()
- {
- Proxy::getInstance()->setHideIgnoredFunctions(false);
- }
-
- public function tearDown()
- {
- Proxy::getInstance()->setHideIgnoredFunctions(true);
- }
-
- public static function getOutputPrefix()
- {
- return "OneVisitorTwoVisits";
- }
-
- /**
- * @dataProvider getApiForTesting
- */
- public function testApi($api, $params)
- {
- $this->runApiTests($api, $params);
- }
-
- public function getApiForTesting()
- {
- $idSite = self::$fixture->idSite;
- $idSiteBis = self::$fixture->idSiteEmptyBis;
- $idSiteTer = self::$fixture->idSiteEmptyTer;
-
- $dateTime = self::$fixture->dateTime;
-
- $enExtraParam = array('expanded' => 1,
- 'flat' => 1,
- 'include_aggregate_rows' => 0,
- 'translateColumnNames' => 1,
- );
- $bulkUrls = array(
- // Testing with several days
- "idSite=" . $idSite . "&date=2010-03-06,2010-03-07&expanded=1&period=day&method=VisitsSummary.get",
- "idSite=" . $idSite . ",$idSiteBis,$idSiteTer&date=2010-03-06,2010-03-07&expanded=1&period=day&method=VisitsSummary.get",
- "idSite=" . $idSite . "&date=2010-03-06&expanded=1&period=day&method=VisitorInterest.getNumberOfVisitsPerVisitDuration"
- );
- foreach ($bulkUrls as &$url) {
- $url = urlencode($url);
- }
- return array(
- array('all', array('idSite' => $idSite,
- 'date' => $dateTime,
- 'otherRequestParameters' => array(
- 'hideColumns' => 'nb_users',
- )
- )),
-
- // test API.get (for bug that incorrectly reorders columns of CSV output)
- // note: bug only affects rows after first
- array('API.get', array('idSite' => $idSite,
- 'date' => '2009-10-01',
- 'format' => 'csv',
- 'periods' => array('month'),
- 'setDateLastN' => true,
- 'otherRequestParameters' => $enExtraParam,
- 'language' => 'en',
- 'testSuffix' => '_csv')),
-
- array('API.getBulkRequest', array('format' => 'xml',
- 'testSuffix' => '_bulk_xml',
- 'otherRequestParameters' => array('urls' => $bulkUrls))),
-
- array('API.getBulkRequest', array('format' => 'json',
- 'testSuffix' => '_bulk_json',
- 'otherRequestParameters' => array('urls' => $bulkUrls))),
-
- // test API.getProcessedReport w/ report that is its own 'actionToLoadSubTables'
- array('API.getProcessedReport', array('idSite' => $idSite,
- 'date' => $dateTime,
- 'periods' => array('week'),
- 'apiModule' => 'Actions',
- 'apiAction' => 'getPageUrls',
- 'supertableApi' => 'Actions.getPageUrls',
- 'testSuffix' => '__subtable')),
-
- // test hideColumns && showColumns parameters
- array('VisitsSummary.get', array('idSite' => $idSite, 'date' => $dateTime, 'periods' => 'day',
- 'testSuffix' => '_hideColumns_',
- 'otherRequestParameters' => array(
- 'hideColumns' => 'nb_visits_converted,max_actions,bounce_count,nb_hits,'
- . 'nb_visits,nb_actions,sum_visit_length,avg_time_on_site'
- ))),
- array('VisitsSummary.get', array('idSite' => $idSite, 'date' => $dateTime, 'periods' => 'day',
- 'testSuffix' => '_showColumns_',
- 'otherRequestParameters' => array(
- 'showColumns' => 'nb_visits,nb_actions,nb_hits'
- ))),
- array('VisitsSummary.get', array('idSite' => $idSite, 'date' => $dateTime, 'periods' => 'day',
- 'testSuffix' => '_hideAllColumns_',
- 'otherRequestParameters' => array(
- 'hideColumns' => 'nb_visits_converted,max_actions,bounce_count,nb_hits,'
- . 'nb_visits,nb_actions,sum_visit_length,avg_time_on_site,'
- . 'bounce_rate,nb_uniq_visitors,nb_actions_per_visit,'
- ))),
-
- // test hideColumns w/ API.getProcessedReport
- array('API.getProcessedReport', array('idSite' => $idSite, 'date' => $dateTime,
- 'periods' => 'day', 'apiModule' => 'Actions',
- 'apiAction' => 'getPageTitles', 'testSuffix' => '_hideColumns_',
- 'otherRequestParameters' => array(
- 'hideColumns' => 'nb_visits_converted,xyzaug,entry_nb_visits,' .
- 'bounce_rate,nb_hits,nb_visits,avg_time_on_page,' .
- 'avg_time_generation,nb_hits_with_time_generation'
- ))),
-
- array('API.getProcessedReport', array('idSite' => $idSite, 'date' => $dateTime,
- 'periods' => 'day', 'apiModule' => 'Actions',
- 'apiAction' => 'getPageTitles', 'testSuffix' => '_showColumns_',
- 'otherRequestParameters' => array(
- 'showColumns' => 'nb_visits_converted,xuena,entry_nb_visits,' .
- 'bounce_rate,nb_hits'
- ))),
- array('API.getProcessedReport', array('idSite' => $idSite, 'date' => $dateTime,
- 'periods' => 'day', 'apiModule' => 'VisitTime',
- 'apiAction' => 'getVisitInformationPerServerTime',
- 'testSuffix' => '_showColumnsWithProcessedMetrics_',
- 'otherRequestParameters' => array(
- 'showColumns' => 'nb_visits,revenue'
- ))),
-
- // showColumns with only one column and report having no dimension
- array('API.getProcessedReport', array('idSite' => $idSite, 'date' => $dateTime,
- 'periods' => 'day', 'apiModule' => 'VisitsSummary',
- 'apiAction' => 'get',
- 'testSuffix' => '_showColumns_onlyOne',
- 'otherRequestParameters' => array(
- 'showColumns' => 'nb_visits'
- ))),
-
- // test hideColumns w/ expanded=1
- array('Actions.getPageTitles', array('idSite' => $idSite, 'date' => $dateTime,
- 'periods' => 'day', 'testSuffix' => '_hideColumns_',
- 'otherRequestParameters' => array(
- 'hideColumns' => 'nb_visits_converted,entry_nb_visits,' .
- 'bounce_rate,nb_hits,nb_visits,sum_time_spent,' .
- 'entry_sum_visit_length,entry_bounce_count,exit_nb_visits,' .
- 'entry_nb_uniq_visitors,exit_nb_uniq_visitors,entry_nb_actions,' .
- 'avg_time_generation,nb_hits_with_time_generation',
- 'expanded' => '1'
- ))),
-
- // test showColumns on API.get
- array('API.get', array(
- 'idSite' => $idSite,
- 'date' => $dateTime,
- 'periods' => 'day',
- 'testSuffix' => '_showColumns',
- 'otherRequestParameters' => array(
- 'showColumns' => 'nb_uniq_visitors,nb_pageviews,bounce_rate'
- )
- )),
- );
- }
-
- /**
- * Test that Archive::getBlob won't fetch extra unnecessary blobs.
- */
- public function testArchiveSingleGetBlob()
- {
- $archive = Archive::build(self::$fixture->idSite, 'day', self::$fixture->dateTime);
- $cache = $archive->getBlob('Actions_actions', 'all');
-
- $foundSubtable = false;
-
- $this->assertTrue(count($cache) > 0, "empty blob cache");
- foreach ($cache as $name => $value) {
- $this->assertTrue(strpos($name, "Actions_actions_url") === false, "found blob w/ name '$name'");
-
- if (strpos($name, "Actions_actions_") !== false) {
- $foundSubtable = true;
- }
- }
-
- $this->assertTrue($foundSubtable, "Actions_actions subtable was not loaded");
- }
-
- /**
- * Test that restricting the number of sites to those viewable to another login
- * works when building an archive query object.
- */
- public function testArchiveSitesWhenRestrictingToLogin()
- {
- try
- {
- Archive::build(
- 'all', 'day', self::$fixture->dateTime, $segment = false, $_restrictToLogin = 'anotherLogin');
- $this->fail("Restricting sites to invalid login did not return 0 sites.");
- }
- catch (Exception $ex)
- {
- // pass
- }
- }
-}
-
-OneVisitorTwoVisitsTest::$fixture = new OneVisitorTwoVisits();
-OneVisitorTwoVisitsTest::$fixture->excludeMozilla = true;
diff --git a/tests/PHPUnit/Integration/OneVisitorTwoVisitsWithCookieSupportTest.php b/tests/PHPUnit/Integration/OneVisitorTwoVisitsWithCookieSupportTest.php
deleted file mode 100755
index a266118018..0000000000
--- a/tests/PHPUnit/Integration/OneVisitorTwoVisitsWithCookieSupportTest.php
+++ /dev/null
@@ -1,53 +0,0 @@
-<?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\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 OneVisitorTwoVisitsWithCookieSupportTest extends IntegrationTestCase
-{
- public static $fixture = null; // initialized below class
-
- /**
- * @dataProvider getApiForTesting
- */
- public function testApi($api, $params)
- {
- $this->runApiTests($api, $params);
-
- }
-
- public function getApiForTesting()
- {
- $apiToCall = array(
- 'VisitTime', 'VisitsSummary', 'VisitorInterest', 'VisitFrequency', 'UserSettings',
- 'UserCountry', 'Referrers', 'Provider', 'Goals', 'CustomVariables', 'CoreAdminHome',
- 'Actions', 'Live.getLastVisitsDetails');
-
- return array(
- array($apiToCall, array('idSite' => self::$fixture->idSite, 'date' => self::$fixture->dateTime))
- );
- }
-
- public static function getOutputPrefix()
- {
- return 'OneVisitorTwoVisits_withCookieSupport';
- }
-}
-
-OneVisitorTwoVisitsWithCookieSupportTest::$fixture = new OneVisitorTwoVisits();
-OneVisitorTwoVisitsWithCookieSupportTest::$fixture->useThirdPartyCookies = true;
-OneVisitorTwoVisitsWithCookieSupportTest::$fixture->useSiteSearch = true; \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/OptionTest.php b/tests/PHPUnit/Integration/OptionTest.php
new file mode 100644
index 0000000000..42c8418e12
--- /dev/null
+++ b/tests/PHPUnit/Integration/OptionTest.php
@@ -0,0 +1,192 @@
+<?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\Common;
+use Piwik\Db;
+use Piwik\Option;
+use Piwik\Tests\Impl\IntegrationTestCase;
+
+/**
+ * Class Core_OptionTest
+ *
+ * @group Core
+ * @group Core_OptionTest
+ */
+class Core_OptionTest extends IntegrationTestCase
+{
+ /**
+ * @group Core
+ */
+ public function testGet()
+ {
+ // empty table, expect false (i.e., not found)
+ $this->assertFalse(Option::get('anonymous_defaultReport'));
+
+ // populate table, expect '1' (i.e., found)
+ Db::query("INSERT INTO `" . Common::prefixTable('option') . "` VALUES ('anonymous_defaultReport', '1', false)");
+ $this->assertSame('1', Option::get('anonymous_defaultReport'));
+
+ // delete row (bypassing API), expect '1' (i.e., from cache)
+ Db::query("DELETE FROM `" . Common::prefixTable('option') . "` WHERE option_name = ?", array('anonymous_defaultReport'));
+ $this->assertSame('1', Option::get('anonymous_defaultReport'));
+
+ // force cache reload, expect false (i.e., not found)
+ Option::clearCache();
+ $this->assertFalse(Option::get('anonymous_defaultReport'));
+ }
+
+ /**
+ * @group Core
+ */
+ public function testGetOption()
+ {
+ // empty table, expect false (i.e., not found)
+ $this->assertFalse(Option::get('anonymous_defaultReport'));
+
+ // populate table, expect '1' (i.e., found)
+ Db::query("INSERT INTO `" . Common::prefixTable('option') . "` VALUES ('anonymous_defaultReport', '1',true)");
+ $this->assertSame('1', Option::get('anonymous_defaultReport'));
+
+ // delete row (bypassing API), expect '1' (i.e., from cache)
+ Db::query("DELETE FROM `" . Common::prefixTable('option') . "` WHERE option_name = ?", array('anonymous_defaultReport'));
+ $this->assertSame('1', Option::get('anonymous_defaultReport'));
+
+ // force cache reload, expect false (i.e., not found)
+ Option::clearCache();
+ $this->assertFalse(Option::get('anonymous_defaultReport'));
+ }
+
+ /**
+ * @group Core
+ */
+ public function testSet()
+ {
+ // empty table, expect false (i.e., not found)
+ $this->assertFalse(Option::get('anonymous_defaultReport'));
+
+ // populate table, expect '1'
+ Option::set('anonymous_defaultReport', '1', true);
+ $this->assertSame('1', Option::get('anonymous_defaultReport'));
+ }
+
+ /**
+ * @group Core
+ */
+ public function testSetOption()
+ {
+ // empty table, expect false (i.e., not found)
+ $this->assertFalse(Option::get('anonymous_defaultReport'));
+
+ // populate table, expect '1'
+ Option::set('anonymous_defaultReport', '1', false);
+ $this->assertSame('1', Option::get('anonymous_defaultReport'));
+ }
+
+ /**
+ * @group Core
+ */
+ public function testDelete()
+ {
+ // empty table, expect false (i.e., not found)
+ $this->assertFalse(Option::get('anonymous_defaultReport'));
+ $this->assertFalse(Option::get('admin_defaultReport'));
+
+ // populate table, expect '1'
+ Option::set('anonymous_defaultReport', '1', true);
+ Option::delete('_defaultReport');
+ $this->assertSame('1', Option::get('anonymous_defaultReport'));
+
+ // populate table, expect '2'
+ Option::set('admin_defaultReport', '2', false);
+ Option::delete('_defaultReport');
+ $this->assertSame('2', Option::get('admin_defaultReport'));
+
+ // delete with non-matching value, expect '1'
+ Option::delete('anonymous_defaultReport', '2');
+ $this->assertSame('1', Option::get('anonymous_defaultReport'));
+
+ // delete with matching value, expect false
+ Option::delete('anonymous_defaultReport', '1');
+ $this->assertFalse(Option::get('anonymous_defaultReport'));
+
+ // this shouldn't have been deleted, expect '2'
+ $this->assertSame('2', Option::get('admin_defaultReport'));
+
+ // deleted, expect false
+ Option::delete('admin_defaultReport');
+ $this->assertFalse(Option::get('admin_defaultReport'));
+ }
+
+ /**
+ * @group Core
+ */
+ public function testDeleteLike()
+ {
+ // empty table, expect false (i.e., not found)
+ $this->assertFalse(Option::get('anonymous_defaultReport'));
+ $this->assertFalse(Option::get('admin_defaultReport'));
+ $this->assertFalse(Option::get('visitor_defaultReport'));
+
+ // insert guard - to test unescaped underscore
+ Option::set('adefaultReport', '0', true);
+ $this->assertTrue(Option::get('adefaultReport') === '0');
+
+ // populate table, expect '1'
+ Option::set('anonymous_defaultReport', '1', true);
+ Option::deleteLike('\_defaultReport');
+ $this->assertSame('1', Option::get('anonymous_defaultReport'));
+ $this->assertSame('0', Option::get('adefaultReport'));
+
+ // populate table, expect '2'
+ Option::set('admin_defaultReport', '2', false);
+ Option::deleteLike('\_defaultReport');
+ $this->assertSame('2', Option::get('admin_defaultReport'));
+ $this->assertSame('0', Option::get('adefaultReport'));
+
+ // populate table, expect '3'
+ Option::set('visitor_defaultReport', '3', false);
+ Option::deleteLike('\_defaultReport');
+ $this->assertSame('3', Option::get('visitor_defaultReport'));
+ $this->assertSame('0', Option::get('adefaultReport'));
+
+ // delete with non-matching value, expect '1'
+ Option::deleteLike('%\_defaultReport', '4');
+ $this->assertSame('1', Option::get('anonymous_defaultReport'));
+ $this->assertSame('0', Option::get('adefaultReport'));
+
+ // delete with matching pattern, expect false
+ Option::deleteLike('%\_defaultReport', '1');
+ $this->assertFalse(Option::get('anonymous_defaultReport'));
+ $this->assertSame('0', Option::get('adefaultReport'));
+
+ // this shouldn't have been deleted, expect '2' and '3'
+ $this->assertSame('2', Option::get('admin_defaultReport'));
+ $this->assertSame('3', Option::get('visitor_defaultReport'));
+ $this->assertSame('0', Option::get('adefaultReport'));
+
+ // deleted, expect false (except for the guard)
+ Option::deleteLike('%\_defaultReport');
+ $this->assertFalse(Option::get('admin_defaultReport'));
+ $this->assertFalse(Option::get('visitor_defaultReport'));
+
+ // unescaped backslash (single quotes)
+ Option::deleteLike('%\_defaultReport');
+ $this->assertSame('0', Option::get('adefaultReport'));
+
+ // escaped backslash (single quotes)
+ Option::deleteLike('%\\_defaultReport');
+ $this->assertSame('0', Option::get('adefaultReport'));
+
+ // unescaped backslash (double quotes)
+ Option::deleteLike("%\_defaultReport");
+ $this->assertSame('0', Option::get('adefaultReport'));
+
+ // escaped backslash (double quotes)
+ Option::deleteLike("%\\_defaultReport");
+ $this->assertSame('0', Option::get('adefaultReport'));
+ }
+}
diff --git a/tests/PHPUnit/Integration/PeriodIsRangeDateIsLastNMetadataAndNormalAPITest.php b/tests/PHPUnit/Integration/PeriodIsRangeDateIsLastNMetadataAndNormalAPITest.php
deleted file mode 100755
index c5847cdbfc..0000000000
--- a/tests/PHPUnit/Integration/PeriodIsRangeDateIsLastNMetadataAndNormalAPITest.php
+++ /dev/null
@@ -1,89 +0,0 @@
-<?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\Date;
-use Piwik\Tests\IntegrationTestCase;
-use Piwik\Tests\Fixtures\TwoVisitsWithCustomVariables;
-
-/**
- * test Metadata API + period=range&date=lastN
- *
- * @group PeriodIsRangeDateIsLastNMetadataAndNormalAPITest
- * @group Integration
- */
-class PeriodIsRangeDateIsLastNMetadataAndNormalAPITest extends IntegrationTestCase
-{
- public static $fixture = null;
-
- public static function setUpBeforeClass()
- {
- self::$fixture->dateTime = Date::factory('today')->getDateTime();
- parent::setUpBeforeClass();
- }
-
- /**
- * @dataProvider getApiForTesting
- */
- public function testApi($api, $params)
- {
- $this->runApiTests($api, $params);
- }
-
- public function getApiForTesting()
- {
- $idSite = self::$fixture->idSite;
- $visitorId = self::$fixture->visitorId;
-
- $apiToCall = array(
- 'API.getProcessedReport',
- 'Actions.getPageUrls',
- 'Goals.get',
- 'CustomVariables.getCustomVariables',
- 'Referrers.getCampaigns',
- 'Referrers.getKeywords',
- 'VisitsSummary.get',
- 'Live');
-
- $segments = array(
- false,
- 'daysSinceFirstVisit!=50',
- 'visitorId!=33c31e01394bdc63',
- 'visitorId!=33c31e01394bdc63;daysSinceFirstVisit!=50',
- // testing segment on Actions table
- 'pageUrl!=http://unknown/not/viewed',
- );
- $dates = array(
- 'last7',
- Date::factory('now')->subDay(6)->toString() . ',today',
- Date::factory('now')->subDay(6)->toString() . ',now',
- );
-
- $result = array();
- foreach ($segments as $segment) {
- foreach ($dates as $date) {
- $result[] = array($apiToCall, array('idSite' => $idSite, 'date' => $date,
- 'periods' => array('range'), 'segment' => $segment,
- 'otherRequestParameters' => array(
- 'lastMinutes' => 60 * 24,
- 'visitorId' => $visitorId // testing getLastVisitsForVisitor requires a visitor ID
- )));
- }
- }
-
- return $result;
- }
-
- public static function getOutputPrefix()
- {
- return 'periodIsRange_dateIsLastN_MetadataAndNormalAPI';
- }
-}
-
-PeriodIsRangeDateIsLastNMetadataAndNormalAPITest::$fixture = new TwoVisitsWithCustomVariables();
-PeriodIsRangeDateIsLastNMetadataAndNormalAPITest::$fixture->doExtraQuoteTests = false; \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/PivotByQueryParamTest.php b/tests/PHPUnit/Integration/PivotByQueryParamTest.php
deleted file mode 100644
index 7e579f4b5e..0000000000
--- a/tests/PHPUnit/Integration/PivotByQueryParamTest.php
+++ /dev/null
@@ -1,189 +0,0 @@
-<?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\Config;
-use Piwik\Date;
-use Piwik\Tests\Fixtures\ManyVisitsWithMockLocationProvider;
-use Piwik\Tests\IntegrationTestCase;
-
-/**
- * @group Integration
- * @group PivotByQueryParamTest
- */
-class PivotByQueryParamTest extends IntegrationTestCase
-{
- /**
- * @var ManyVisitsWithMockLocationProvider
- */
- public static $fixture = null;
-
- public static function setUpBeforeClass()
- {
- parent::setUpBeforeClass();
-
- Config::getInstance()->General['pivot_by_filter_enable_fetch_by_segment'] = 1;
- }
-
- public function test_PivotBySubtableDimension_CreatesCorrectPivotTable()
- {
- $this->assertApiResponseEqualsExpected("Referrers.getKeywords", array(
- 'idSite' => self::$fixture->idSite,
- 'date' => Date::factory(self::$fixture->dateTime)->toString(),
- 'period' => 'week',
- 'pivotBy' => 'Referrers.SearchEngine',
- 'pivotByColumn' => 'nb_visits',
- 'pivotByColumnLimit' => -1,
- 'disable_queued_filters' => 1 // test that prepending doesn't happen w/ this
- ));
- }
-
- public function test_PivotBySubtableDimension_WhenEntireHirearchyIsNotLoaded()
- {
- $this->assertApiResponseEqualsExpected("Referrers.getKeywords", array(
- 'idSite' => self::$fixture->idSite,
- 'date' => Date::factory(self::$fixture->dateTime)->toString(),
- 'period' => 'week',
- 'pivotBy' => 'Referrers.SearchEngine',
- 'pivotByColumn' => '', // also test default pivot column
- 'pivotByColumnLimit' => -1,
- 'expanded' => 0
- ));
- }
-
- public function test_PivotBySegment_CreatesCorrectPivotTable()
- {
- $this->assertApiResponseEqualsExpected("Referrers.getKeywords", array(
- 'idSite' => self::$fixture->idSite,
- 'date' => Date::factory(self::$fixture->dateTime)->toString(),
- 'period' => 'week',
- 'pivotBy' => 'UserCountry.City',
- 'pivotByColumn' => 'nb_visits',
- 'pivotByColumnLimit' => -1
- ));
- }
-
- public function test_PivotBySegment_CreatesCorrectPivotTable_WhenSegmentUsedInRequest()
- {
- $this->assertApiResponseEqualsExpected("Referrers.getKeywords", array(
- 'idSite' => self::$fixture->idSite,
- 'date' => Date::factory(self::$fixture->dateTime)->toString(),
- 'period' => 'week',
- 'segment' => 'browserCode==FF',
- 'pivotBy' => 'UserCountry.City',
- 'pivotByColumn' => 'nb_visits',
- 'pivotByColumnLimit' => -1
- ));
- }
-
- public function test_PivotByParam_PlaysNiceWithOtherQueryParams()
- {
- $this->assertApiResponseEqualsExpected("Referrers.getKeywords", array(
- 'idSite' => self::$fixture->idSite,
- 'date' => Date::factory(self::$fixture->dateTime)->toString(),
- 'period' => 'week',
- 'pivotBy' => 'Referrers.SearchEngine',
- 'pivotByColumn' => 'nb_visits',
- 'pivotByColumnLimit' => -1,
- 'flat' => 1,
- 'totals' => 1,
- 'disable_queued_filters' => 1,
- 'disable_generic_filters' => 1,
- 'showColumns' => 'Google,Bing'
- ));
- }
-
- public function test_PivotByParam_PlaysNiceWithQueuedFilters()
- {
- // TODO: known issue: some segment/report relationships are more complicated; for example, UserCountry.GetCity labels are combinations
- // of city, region & country dimensions, so the segment to get an intersected table needs all 3 of those.
-
- $this->markTestSkipped("Not working right now.");
-
- $this->assertApiResponseEqualsExpected("UserSettings.getBrowser", array( // should have logo metadata in output
- 'idSite' => self::$fixture->idSite,
- 'date' => Date::factory(self::$fixture->dateTime)->toString(),
- 'period' => 'week',
- 'pivotBy' => 'UserCountry.City', // testing w/ report that has no subtable report
- 'pivotByColumn' => 'nb_visits',
- 'pivotByColumnLimit' => -1
- ));
- }
-
- public function test_PivotByParam_WorksWithReportWhoseSubtableIsSelf()
- {
- $this->assertApiResponseEqualsExpected("Actions.getPageUrls", array(
- 'idSite' => self::$fixture->idSite,
- 'date' => Date::factory(self::$fixture->dateTime)->toString(),
- 'period' => 'week',
- 'pivotBy' => 'Actions.PageUrl',
- 'pivotByColumn' => 'nb_hits',
- 'pivotByColumnLimit' => -1
- ));
- }
-
- public function test_PivotByParam_WorksWithColumnLimiting()
- {
- $this->assertApiResponseEqualsExpected("Referrers.getKeywords", array(
- 'idSite' => self::$fixture->idSite,
- 'date' => Date::factory(self::$fixture->dateTime)->toString(),
- 'period' => 'week',
- 'pivotBy' => 'UserCountry.City',
- 'pivotByColumn' => 'nb_visits',
- 'pivotByColumnLimit' => 2
- ));
- }
-
- public function test_PivotByParam_WorksWithJsonOutput()
- {
- $this->assertApiResponseEqualsExpected("Referrers.getKeywords", array(
- 'idSite' => self::$fixture->idSite,
- 'date' => Date::factory(self::$fixture->dateTime)->toString(),
- 'period' => 'week',
- 'format' => 'json',
- 'pivotBy' => 'UserCountry.City',
- 'pivotByColumn' => 'nb_visits',
- 'pivotByColumnLimit' => -1
- ));
- }
-
- public function test_PivotByParam_WorksWithCsvOutput()
- {
- $this->assertApiResponseEqualsExpected("Referrers.getKeywords", array(
- 'idSite' => self::$fixture->idSite,
- 'date' => Date::factory(self::$fixture->dateTime)->toString(),
- 'period' => 'week',
- 'format' => 'csv',
- 'pivotBy' => 'UserCountry.City',
- 'pivotByColumn' => 'nb_visits',
- 'pivotByColumnLimit' => -1
- ));
- }
-
- public function test_PivotByParam_PlaysNiceWithDataTableMaps()
- {
- $this->assertApiResponseEqualsExpected("Referrers.getKeywords", array(
- 'idSite' => 'all',
- 'date' => '2010-01-01,2010-01-07',
- 'period' => 'day',
- 'pivotBy' => 'UserCountry.City',
- 'pivotByColumn' => 'nb_visits',
- 'pivotByColumnLimit' => -1
- ));
- }
- public function assertApiResponseEqualsExpected($apiMethod, $queryParams)
- {
- if(self::isPhpVersion53()) {
- // 5.3.3 space encoding fail eg. https://travis-ci.org/piwik/piwik/jobs/35920420
- $this->markTestSkipped();
- }
- parent::assertApiResponseEqualsExpected($apiMethod, $queryParams);
- }
-}
-
-PivotByQueryParamTest::$fixture = new ManyVisitsWithMockLocationProvider();
diff --git a/tests/PHPUnit/Integration/PiwikTest.php b/tests/PHPUnit/Integration/PiwikTest.php
new file mode 100644
index 0000000000..c73f8bb0b4
--- /dev/null
+++ b/tests/PHPUnit/Integration/PiwikTest.php
@@ -0,0 +1,387 @@
+<?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\Filesystem;
+use Piwik\MetricsFormatter;
+use Piwik\Piwik;
+use Piwik\Plugins\SitesManager\API;
+use Piwik\Translate;
+use Piwik\Tests\Impl\IntegrationTestCase;
+
+/**
+ * Class Core_PiwikTest
+ *
+ * @group Core
+ */
+class Core_PiwikTest extends IntegrationTestCase
+{
+ public function setUp()
+ {
+ parent::setUp();
+ }
+
+ /**
+ * Tests the generated JS code
+ * @group Core
+ */
+ public function testJavascriptTrackingCode_withAllOptions()
+ {
+ $jsTag = Piwik::getJavascriptCode($idSite = 1, $piwikUrl = 'http://localhost/piwik',
+ $mergeSubdomains = true, $groupPageTitlesByDomain = true, $mergeAliasUrls = true,
+ $visitorCustomVariables = array( array("name", "value"), array("name 2", "value 2") ),
+ $pageCustomVariables = array( array("page cvar", "page cvar value") ),
+ $customCampaignNameQueryParam = "campaignKey", $customCampaignKeywordParam = "keywordKey",
+ $doNotTrack = true);
+
+ $expected = "&lt;!-- Piwik --&gt;
+&lt;script type=&quot;text/javascript&quot;&gt;
+ var _paq = _paq || [];
+ _paq.push([\"setDocumentTitle\", document.domain + \"/\" + document.title]);
+ // you can set up to 5 custom variables for each visitor
+ _paq.push([\"setCustomVariable\", 1, \"name\", \"value\", \"visit\"]);
+ _paq.push([\"setCustomVariable\", 2, \"name 2\", \"value 2\", \"visit\"]);
+ // you can set up to 5 custom variables for each action (page view, download, click, site search)
+ _paq.push([\"setCustomVariable\", 1, \"page cvar\", \"page cvar value\", \"page\"]);
+ _paq.push([\"setCampaignNameKey\", \"campaignKey\"]);
+ _paq.push([\"setCampaignKeywordKey\", \"keywordKey\"]);
+ _paq.push([\"setDoNotTrack\", true]);
+ _paq.push(['trackPageView']);
+ _paq.push(['enableLinkTracking']);
+ (function() {
+ var u=&quot;//localhost/piwik/&quot;;
+ _paq.push(['setTrackerUrl', u+'piwik.php']);
+ _paq.push(['setSiteId', 1]);
+ var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
+ g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
+ })();
+&lt;/script&gt;
+&lt;noscript&gt;&lt;p&gt;&lt;img src=&quot;//localhost/piwik/piwik.php?idsite=1&quot; style=&quot;border:0;&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;&lt;/noscript&gt;
+&lt;!-- End Piwik Code --&gt;
+";
+
+ $this->assertEquals($expected, $jsTag);
+ }
+
+ /**
+ * Tests the generated JS code with protocol overwrite
+ * @group Core
+ */
+ public function testJavascriptTrackingCode_withAllOptionsAndProtocolOverwrite()
+ {
+ Piwik::addAction('Piwik.getJavascriptCode', function (&$codeImpl) {
+ $codeImpl['protocol'] = 'https://';
+ });
+
+ $jsTag = Piwik::getJavascriptCode($idSite = 1, $piwikUrl = 'http://localhost/piwik',
+ $mergeSubdomains = true, $groupPageTitlesByDomain = true, $mergeAliasUrls = true,
+ $visitorCustomVariables = array( array("name", "value"), array("name 2", "value 2") ),
+ $pageCustomVariables = array( array("page cvar", "page cvar value") ),
+ $customCampaignNameQueryParam = "campaignKey", $customCampaignKeywordParam = "keywordKey",
+ $doNotTrack = true);
+
+ $expected = "&lt;!-- Piwik --&gt;
+&lt;script type=&quot;text/javascript&quot;&gt;
+ var _paq = _paq || [];
+ _paq.push([\"setDocumentTitle\", document.domain + \"/\" + document.title]);
+ // you can set up to 5 custom variables for each visitor
+ _paq.push([\"setCustomVariable\", 1, \"name\", \"value\", \"visit\"]);
+ _paq.push([\"setCustomVariable\", 2, \"name 2\", \"value 2\", \"visit\"]);
+ // you can set up to 5 custom variables for each action (page view, download, click, site search)
+ _paq.push([\"setCustomVariable\", 1, \"page cvar\", \"page cvar value\", \"page\"]);
+ _paq.push([\"setCampaignNameKey\", \"campaignKey\"]);
+ _paq.push([\"setCampaignKeywordKey\", \"keywordKey\"]);
+ _paq.push([\"setDoNotTrack\", true]);
+ _paq.push(['trackPageView']);
+ _paq.push(['enableLinkTracking']);
+ (function() {
+ var u=&quot;https://localhost/piwik/&quot;;
+ _paq.push(['setTrackerUrl', u+'piwik.php']);
+ _paq.push(['setSiteId', 1]);
+ var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
+ g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
+ })();
+&lt;/script&gt;
+&lt;noscript&gt;&lt;p&gt;&lt;img src=&quot;https://localhost/piwik/piwik.php?idsite=1&quot; style=&quot;border:0;&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;&lt;/noscript&gt;
+&lt;!-- End Piwik Code --&gt;
+";
+
+ $this->assertEquals($expected, $jsTag);
+ }
+
+ /**
+ * Tests the generated JS code with options before tracker url
+ * @group Core
+ */
+ public function testJavascriptTrackingCode_withAllOptionsAndOptionsBeforeTrackerUrl()
+ {
+ Piwik::addAction('Piwik.getJavascriptCode', function (&$codeImpl) {
+ $codeImpl['optionsBeforeTrackerUrl'] .= "_paq.push(['setAPIUrl', 'http://localhost/statistics']);\n ";
+ });
+
+ $jsTag = Piwik::getJavascriptCode($idSite = 1, $piwikUrl = 'http://localhost/piwik',
+ $mergeSubdomains = true, $groupPageTitlesByDomain = true, $mergeAliasUrls = true,
+ $visitorCustomVariables = array( array("name", "value"), array("name 2", "value 2") ),
+ $pageCustomVariables = array( array("page cvar", "page cvar value") ),
+ $customCampaignNameQueryParam = "campaignKey", $customCampaignKeywordParam = "keywordKey",
+ $doNotTrack = true);
+
+ $expected = "&lt;!-- Piwik --&gt;
+&lt;script type=&quot;text/javascript&quot;&gt;
+ var _paq = _paq || [];
+ _paq.push([\"setDocumentTitle\", document.domain + \"/\" + document.title]);
+ // you can set up to 5 custom variables for each visitor
+ _paq.push([\"setCustomVariable\", 1, \"name\", \"value\", \"visit\"]);
+ _paq.push([\"setCustomVariable\", 2, \"name 2\", \"value 2\", \"visit\"]);
+ // you can set up to 5 custom variables for each action (page view, download, click, site search)
+ _paq.push([\"setCustomVariable\", 1, \"page cvar\", \"page cvar value\", \"page\"]);
+ _paq.push([\"setCampaignNameKey\", \"campaignKey\"]);
+ _paq.push([\"setCampaignKeywordKey\", \"keywordKey\"]);
+ _paq.push([\"setDoNotTrack\", true]);
+ _paq.push(['trackPageView']);
+ _paq.push(['enableLinkTracking']);
+ (function() {
+ var u=&quot;//localhost/piwik/&quot;;
+ _paq.push(['setAPIUrl', 'http://localhost/statistics']);
+ _paq.push(['setTrackerUrl', u+'piwik.php']);
+ _paq.push(['setSiteId', 1]);
+ var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
+ g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
+ })();
+&lt;/script&gt;
+&lt;noscript&gt;&lt;p&gt;&lt;img src=&quot;//localhost/piwik/piwik.php?idsite=1&quot; style=&quot;border:0;&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;&lt;/noscript&gt;
+&lt;!-- End Piwik Code --&gt;
+";
+
+ $this->assertEquals($expected, $jsTag);
+ }
+
+ /**
+ * Dataprovider for testIsNumericValid
+ */
+ public function getValidNumeric()
+ {
+ $valid = array(
+ -1, 0, 1, 1.5, -1.5, 21111, 89898, 99999999999, -4565656,
+ (float)-1, (float)0, (float)1, (float)1.5, (float)-1.5, (float)21111, (float)89898, (float)99999999999, (float)-4565656,
+ (int)-1, (int)0, (int)1, (int)1.5, (int)-1.5, (int)21111, (int)89898, (int)99999999999, (int)-4565656,
+ '-1', '0', '1', '1.5', '-1.5', '21111', '89898', '99999999999', '-4565656',
+ '1e3', '0x123', "-1e-2",
+ );
+ foreach ($valid as $key => $value) {
+ $valid[$key] = array($value);
+ }
+ return $valid;
+ }
+
+ /**
+ * @dataProvider getValidNumeric
+ */
+ public function testIsNumericValid($toTest)
+ {
+ $this->assertTrue(is_numeric($toTest), $toTest . " not valid but should!");
+ }
+
+ /**
+ * Dataprovider for testIsNumericNotValid
+ */
+ public function getInvalidNumeric()
+ {
+ $notValid = array(
+ '-1.0.0', '1,2', '--1', '-.', '- 1', '1-',
+ );
+ foreach ($notValid as $key => $value) {
+ $notValid[$key] = array($value);
+ }
+ return $notValid;
+ }
+
+ /**
+ * @dataProvider getInvalidNumeric
+ */
+ public function testIsNumericNotValid($toTest)
+ {
+ $this->assertFalse(is_numeric($toTest), $toTest . " valid but shouldn't!");
+ }
+
+ public function testSecureDiv()
+ {
+ $this->assertSame(3, Piwik::secureDiv(9, 3));
+ $this->assertSame(0, Piwik::secureDiv(9, 0));
+ $this->assertSame(10, Piwik::secureDiv(10, 1));
+ $this->assertSame(10.0, Piwik::secureDiv(10.0, 1.0));
+ $this->assertSame(5.5, Piwik::secureDiv(11.0, 2));
+ $this->assertSame(0, Piwik::secureDiv(11.0, 'a'));
+ }
+
+ /**
+ * Dataprovider for testGetPrettyTimeFromSeconds
+ */
+ public function getPrettyTimeFromSecondsData()
+ {
+ return array(
+ array(30, array('30s', '00:00:30')),
+ array(60, array('1 min 0s', '00:01:00')),
+ array(100, array('1 min 40s', '00:01:40')),
+ array(3600, array('1 hours 0 min', '01:00:00')),
+ array(3700, array('1 hours 1 min', '01:01:40')),
+ array(86400 + 3600 * 10, array('1 days 10 hours', '34:00:00')),
+ array(86400 * 365, array('365 days 0 hours', '8760:00:00')),
+ array((86400 * (365.25 + 10)), array('1 years 10 days', '9006:00:00')),
+ array(1.342, array('1.34s', '00:00:01.34')),
+ array(.342, array('0.34s', '00:00:00.34')),
+ array(.02, array('0.02s', '00:00:00.02')),
+ array(.002, array('0.002s', '00:00:00')),
+ array(1.002, array('1s', '00:00:01')),
+ array(1.02, array('1.02s', '00:00:01.02')),
+ array(1.2, array('1.2s', '00:00:01.20')),
+ array(122.1, array('2 min 2.1s', '00:02:02.10')),
+ array(-122.1, array('-2 min 2.1s', '-00:02:02.10')),
+ array(86400 * -365, array('-365 days 0 hours', '-8760:00:00'))
+ );
+ }
+
+ /**
+ * @dataProvider getPrettyTimeFromSecondsData
+ */
+ public function testGetPrettyTimeFromSeconds($seconds, $expected)
+ {
+ if (($seconds * 100) > PHP_INT_MAX) {
+ $this->markTestSkipped("Will not pass on 32-bit machine.");
+ }
+
+ Translate::loadEnglishTranslation();
+
+ $sentenceExpected = str_replace(' ', '&nbsp;', $expected[0]);
+ $numericExpected = $expected[1];
+ $this->assertEquals($sentenceExpected, MetricsFormatter::getPrettyTimeFromSeconds($seconds, $sentence = true));
+ $this->assertEquals($numericExpected, MetricsFormatter::getPrettyTimeFromSeconds($seconds, $sentence = false));
+
+ Translate::unloadEnglishTranslation();
+ }
+
+ /**
+ * Dataprovider for testCheckValidLoginString
+ */
+ public function getInvalidLoginStringData()
+ {
+ $notValid = array(
+ '',
+ ' ',
+ 'a',
+ 'aa',
+ 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
+ 'alpha/beta',
+ 'alpha:beta',
+ 'alpha;beta',
+ 'alpha<beta',
+ 'alpha=beta',
+ 'alpha>beta',
+ 'alpha?beta',
+ );
+ foreach ($notValid as $key => $value) {
+ $notValid[$key] = array($value);
+ }
+ return $notValid;
+ }
+
+ /**
+ * @dataProvider getInvalidLoginStringData
+ * @expectedException \Exception
+ */
+ public function testCheckInvalidLoginString($toTest)
+ {
+ Piwik::checkValidLoginString($toTest);
+ }
+
+ /**
+ * Dataprovider for testCheckValidLoginString
+ */
+ public function getValidLoginStringData()
+ {
+ $valid = array(
+ 'aaa',
+ 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
+ 'shoot_puck@the-goal.com',
+ );
+ foreach ($valid as $key => $value) {
+ $valid[$key] = array($value);
+ }
+ return $valid;
+ }
+
+ /**
+ * @dataProvider getValidLoginStringData
+ */
+ public function testCheckValidLoginString($toTest)
+ {
+ $this->assertNull(Piwik::checkValidLoginString($toTest));
+ }
+
+ /**
+ * Dataprovider for testGetPrettyValue
+ */
+ public function getGetPrettyValueTestCases()
+ {
+ return array(
+ array('revenue', 12, '$ 12'),
+ array('revenue_evolution', '100 %', '100 %'),
+ array('avg_time_generation', '3.333', '3.33s'),
+ array('avg_time_generation', '333.333', '5&nbsp;min&nbsp;33.33s'),
+ array('avg_time_on_page', '3', '00:00:03'),
+ array('avg_time_on_page', '333', '00:05:33'),
+ );
+ }
+
+ /**
+ * @dataProvider getGetPrettyValueTestCases
+ */
+ public function testGetPrettyValue($columnName, $value, $expected)
+ {
+ Translate::loadEnglishTranslation();
+
+ $access = Access::getInstance();
+ $access->setSuperUserAccess(true);
+
+ $idsite = API::getInstance()->addSite("test", "http://test");
+
+ $this->assertEquals(
+ $expected,
+ MetricsFormatter::getPrettyValue($idsite, $columnName, $value, false, false)
+ );
+
+ Translate::unloadEnglishTranslation();
+ }
+
+ /**
+ * Data provider for testIsAssociativeArray.
+ */
+ public function getIsAssociativeArrayTestCases()
+ {
+ return array(
+ array(array(0 => 'a', 1 => 'b', 2 => 'c', 3 => 'd', 4 => 'e', 5 => 'f'), false),
+ array(array(-1 => 'a', 0 => 'a', 1 => 'a', 2 => 'a', 3 => 'a'), true),
+ array(array(4 => 'a', 5 => 'a', 6 => 'a', 7 => 'a', 8 => 'a'), true),
+ array(array(0 => 'a', 2 => 'a', 3 => 'a', 4 => 'a', 5 => 'a'), true),
+ array(array('abc' => 'a', 0 => 'b', 'sdfds' => 'd'), true),
+ array(array('abc' => 'def'), true)
+ );
+ }
+
+ /**
+ * @dataProvider getIsAssociativeArrayTestCases
+ */
+ public function testIsAssociativeArray($array, $expected)
+ {
+ $this->assertEquals($expected, Piwik::isAssociativeArray($array));
+ }
+
+ public function testCheckIfFileSystemIsNFSOnNonNFS()
+ {
+ $this->assertFalse(Filesystem::checkIfFileSystemIsNFS());
+ }
+}
diff --git a/tests/PHPUnit/Integration/Plugin/SettingsTest.php b/tests/PHPUnit/Integration/Plugin/SettingsTest.php
new file mode 100644
index 0000000000..29b4cb3b39
--- /dev/null
+++ b/tests/PHPUnit/Integration/Plugin/SettingsTest.php
@@ -0,0 +1,674 @@
+<?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\Plugin\Settings as PluginSettings;
+use Piwik\Settings\Setting;
+use Piwik\Tests\Impl\IntegrationTestCase;
+
+class CorePluginSettingsTest extends \Piwik\Plugins\ExampleSettingsPlugin\Settings {
+
+ public function init()
+ {
+
+ }
+
+ public function addSetting(Setting $setting)
+ {
+ parent::addSetting($setting);
+ }
+}
+
+/**
+ * Class Core_Plugin_SettingsTest
+ * @group Core
+ * @group PluginSettings
+ */
+class Core_Plugin_SettingsTest extends IntegrationTestCase
+{
+ /**
+ * @var CorePluginSettingsTest
+ */
+ private $settings;
+
+ public function setUp()
+ {
+ parent::setUp();
+ Access::setSingletonInstance(null);
+
+ $this->settings = $this->createSettingsInstance();
+ }
+
+ public function tearDown()
+ {
+ $this->setSuperUser();
+ if ($this->settings) {
+ $this->settings->removeAllPluginSettings();
+ }
+
+ parent::tearDown();
+ }
+
+ /**
+ * @expectedException \Exception
+ * @expectedExceptionMessage A setting with name "myname" does already exist for plugin "ExampleSettingsPlugin"
+ */
+ public function test_addSetting_shouldThrowException_InCaseTwoSettingsHaveTheSameName()
+ {
+ $this->addUserSetting('myname', 'mytitle');
+
+ $setting = $this->buildUserSetting('myname', 'mytitle2');
+ $this->settings->addSetting($setting);
+ }
+
+ /**
+ * @expectedException \Exception
+ * @expectedExceptionMessage The setting name "myname_" in plugin "ExampleSettingsPlugin" is not valid. Only alpha and numerical characters are allowed
+ */
+ public function test_addSetting_shouldThrowException_IfTheSettingNameIsNotValid()
+ {
+ $setting = $this->buildUserSetting('myname_', 'mytitle');
+ $this->settings->addSetting($setting);
+ }
+
+ public function test_addSetting_shouldAssignDefaultType_IfFieldIsGivenButNoType()
+ {
+ $setting = $this->buildUserSetting('myname', 'mytitle');
+ $setting->uiControlType = CorePluginSettingsTest::CONTROL_MULTI_SELECT;
+
+ $this->settings->addSetting($setting);
+
+ $this->assertEquals(CorePluginSettingsTest::TYPE_ARRAY, $setting->type);
+ }
+
+ public function test_addSetting_shouldAssignDefaultField_IfTypeIsGivenButNoField()
+ {
+ $setting = $this->buildUserSetting('myname', 'mytitle');
+ $setting->type = CorePluginSettingsTest::TYPE_ARRAY;
+
+ $this->settings->addSetting($setting);
+
+ $this->assertEquals(CorePluginSettingsTest::CONTROL_MULTI_SELECT, $setting->uiControlType);
+ }
+
+ public function test_addSetting_shouldAddAValidator_IfFieldOptionsAreGiven()
+ {
+ $setting = $this->buildUserSetting('myname', 'mytitle');
+ $setting->availableValues = array('allowedval' => 'DisplayName', 'allowedval2' => 'Name 2');
+
+ $this->settings->addSetting($setting);
+
+ $this->assertInstanceOf('\Closure', $setting->validate);
+ }
+
+ public function test_addSetting_shouldAddTheSettings_IfValid()
+ {
+ $setting = $this->addUserSetting('myname', 'mytitle');
+
+ $this->assertEquals(array('myname' => $setting), $this->settings->getSettings());
+ }
+
+ public function test_addSetting_shouldPassTheStorage_ToTheSetting()
+ {
+ $this->setSuperUser();
+
+ $setting = $this->buildUserSetting('myname', 'mytitle', 'myRandomName');
+ $this->settings->addSetting($setting);
+
+ $this->settings->setSettingValue($setting, 5);
+ $this->assertSettingHasValue($setting, 5);
+
+ $this->assertEquals($setting->getValue(), 5);
+
+ $this->settings->setSettingValue($setting, 'test3434');
+ $this->assertEquals($setting->getValue(), 'test3434');
+ }
+
+ /**
+ * @expectedException \Exception
+ * @expectedExceptionMessage The setting myname2 does not exist
+ */
+ public function test_setSettingValue_shouldThrowException_IfTryingToSetAValueForNotAvailableSetting()
+ {
+ $this->addUserSetting('myname', 'mytitle');
+
+ $setting = $this->buildUserSetting('myname2', 'mytitle2');
+ $this->settings->setSettingValue($setting, 2);
+ }
+
+ /**
+ * @expectedException \Exception
+ * @expectedExceptionMessage CoreAdminHome_PluginSettingChangeNotAllowed
+ */
+ public function test_setSettingValue_shouldThrowException_IfAUserIsTryingToSetASettingWhichNeedsSuperUserPermission()
+ {
+ $this->setUser();
+ $setting = $this->addSystemSetting('mysystem', 'mytitle');
+
+ $this->settings->setSettingValue($setting, 2);
+ }
+
+ /**
+ * @expectedException \Exception
+ * @expectedExceptionMessage CoreAdminHome_PluginSettingChangeNotAllowed
+ */
+ public function test_setSettingValue_shouldThrowException_IfAnonymousIsTryingToSetASettingWhichNeedsUserPermission()
+ {
+ $setting = $this->addUserSetting('mysystem', 'mytitle');
+
+ $this->settings->setSettingValue($setting, 2);
+ }
+
+ public function test_setSettingValue_shouldSucceed_IfUserIsTryingToSetASettingWhichNeedsUserPermission()
+ {
+ $this->setUser();
+ $setting = $this->addUserSetting('mysystem', 'mytitle');
+
+ $this->settings->setSettingValue($setting, 2);
+
+ $this->assertSettingHasValue($setting, 2);
+ }
+
+ public function test_setSettingValue_shouldSucceed_IfSuperUserTriesToSaveASettingWhichRequiresSuperUserPermission()
+ {
+ $this->setSuperUser();
+
+ $setting = $this->addSystemSetting('mysystem', 'mytitle');
+
+ $this->settings->setSettingValue($setting, 2);
+
+ $this->assertSettingHasValue($setting, 2);
+ }
+
+ public function test_setSettingValue_shouldNotPersistValueInDatabase_OnSuccess()
+ {
+ $this->setSuperUser();
+
+ $setting = $this->buildSystemSetting('mysystem', 'mytitle');
+ $this->settings->addSetting($setting);
+ $this->settings->setSettingValue($setting, 2);
+
+ // make sure stored on the instance
+ $this->assertSettingHasValue($setting, 2);
+ $this->assertSettingIsNotSavedInTheDb('mysystem', null);
+ }
+
+ /**
+ * @expectedException \Exception
+ * @expectedExceptionMessage CoreAdminHome_PluginSettingsValueNotAllowed
+ */
+ public function test_setSettingValue_shouldApplyValidationAndFail_IfOptionsAreSet()
+ {
+ $this->setUser();
+ $setting = $this->buildUserSetting('mysystem', 'mytitle');
+ $setting->availableValues = array('allowed' => 'text', 'allowed2' => 'text2');
+
+ $this->settings->addSetting($setting);
+
+ $this->settings->setSettingValue($setting, 'notallowed');
+ }
+
+ /**
+ * @expectedException \Exception
+ * @expectedExceptionMessage CoreAdminHome_PluginSettingsValueNotAllowed
+ */
+ public function test_setSettingValue_shouldApplyValidationAndFail_IfOptionsAreSetAndValueIsAnArray()
+ {
+ $this->setUser();
+ $setting = $this->buildUserSetting('mysystem', 'mytitle');
+ $setting->availableValues = array('allowed' => 'text', 'allowed2' => 'text2');
+ $setting->uiControlType = PluginSettings::CONTROL_MULTI_SELECT;
+
+ $this->settings->addSetting($setting);
+
+ $this->settings->setSettingValue($setting, array('allowed', 'notallowed'));
+ }
+
+ public function test_setSettingValue_shouldApplyValidationAndSucceed_IfOptionsAreSet()
+ {
+ $this->setUser();
+ $setting = $this->buildUserSetting('mysystem', 'mytitle');
+ $setting->availableValues = array('allowed' => 'text', 'allowed2' => 'text2');
+ $setting->uiControlType = PluginSettings::CONTROL_MULTI_SELECT;
+
+ $this->settings->addSetting($setting);
+
+ $this->settings->setSettingValue($setting, array('allowed', 'allowed2'));
+ $this->assertSettingHasValue($setting, array('allowed', 'allowed2'));
+
+ $setting->type = PluginSettings::TYPE_STRING;
+ $this->settings->setSettingValue($setting, 'allowed');
+ $this->assertSettingHasValue($setting, 'allowed');
+ }
+
+ public function test_setSettingValue_shouldCastValue_IfTypeIsSetButNoFilter()
+ {
+ $this->setUser();
+
+ // cast to INT
+ $setting = $this->addUserSetting('mysystem', 'mytitle');
+ $setting->type = PluginSettings::TYPE_INT;
+ $this->settings->setSettingValue($setting, '31xm42');
+ $this->assertSettingHasValue($setting, 31, 'integer');
+
+ // ARRAY
+ $setting->type = PluginSettings::TYPE_ARRAY;
+ $this->settings->setSettingValue($setting, '31xm42');
+ $this->assertSettingHasValue($setting, array('31xm42'), 'array');
+
+ // BOOL
+ $setting->type = PluginSettings::TYPE_BOOL;
+ $this->settings->setSettingValue($setting, '1');
+ $this->assertSettingHasValue($setting, true, 'boolean');
+
+ // FLOAT
+ $setting->type = PluginSettings::TYPE_FLOAT;
+ $this->settings->setSettingValue($setting, '1.21');
+ $this->assertSettingHasValue($setting, 1.21, 'float');
+
+ // STRING
+ $setting->type = PluginSettings::TYPE_STRING;
+ $this->settings->setSettingValue($setting, '31xm42');
+ $this->assertSettingHasValue($setting, '31xm42');
+ }
+
+ public function test_setSettingValue_shouldApplyFilterAndNotCast_IfAFilterIsSet()
+ {
+ $this->setUser();
+
+ $setting = $this->buildUserSetting('mysystem', 'mytitle');
+ $setting->type = PluginSettings::TYPE_INT;
+
+ $self = $this;
+ $setting->transform = function ($value, $userSetting) use ($self, $setting) {
+ $self->assertEquals('31xm42', $value);
+ $self->assertEquals($setting, $userSetting);
+
+ return '43939kmf3m3';
+ };
+
+ $this->settings->addSetting($setting);
+ $this->settings->setSettingValue($setting, '31xm42');
+
+ // should not be casted to int
+ $this->assertSettingHasValue($setting, '43939kmf3m3', 'string');
+ }
+
+ public function test_getSettingValue_shouldReturnUncastedDefaultValue_IfNoValueIsSet()
+ {
+ $this->setUser();
+
+ $setting = $this->addUserSetting('mydefaultsystem', 'mytitle');
+ $setting->type = PluginSettings::TYPE_INT;
+ $setting->defaultValue ='mytestvalue';
+
+ // should not be casted to int
+ $this->assertSettingHasValue($setting, 'mytestvalue', 'string');
+ }
+
+ /**
+ * @expectedException \Exception
+ * @expectedExceptionMessage The setting myusersetting does not exist
+ */
+ public function test_getSettingValue_shouldThrowException_IfGivenSettingDoesNotExist()
+ {
+ $setting = $this->buildUserSetting('myusersetting', 'mytitle');
+
+ $this->settings->getSettingValue($setting);
+ }
+
+ /**
+ * @expectedException \Exception
+ * @expectedExceptionMessage CoreAdminHome_PluginSettingReadNotAllowed
+ */
+ public function test_getSettingValue_shouldThrowException_IfUserHasNotEnoughPermissionToReadValue()
+ {
+ $this->setUser();
+ $setting = $this->addSystemSetting('myusersetting', 'mytitle');
+ $this->settings->getSettingValue($setting);
+ }
+
+ public function test_getSettingValue_shouldReturnValue_IfReadbleByCurrentUserIsAllowed()
+ {
+ $this->setUser();
+ $setting = $this->addSystemSetting('myusersetting', 'mytitle');
+ $setting->readableByCurrentUser = true;
+
+ $this->assertEquals('', $this->settings->getSettingValue($setting));
+ }
+
+ public function test_getSettingValue_shouldReturnValue_IfValueExistsAndUserHasPermission()
+ {
+ $this->setUser();
+ $setting = $this->addUserSetting('myusersetting', 'mytitle');
+ $setting->type = PluginSettings::TYPE_ARRAY;
+ $this->settings->setSettingValue($setting, array(2,3,4));
+
+ $this->assertSettingHasValue($setting, array(2,3,4));
+ }
+
+ /**
+ * @expectedException \Exception
+ * @expectedExceptionMessage CoreAdminHome_PluginSettingChangeNotAllowed
+ */
+ public function test_removeSettingValue_shouldThrowException_IfUserHasNotEnoughUserPermissions()
+ {
+ $setting = $this->addUserSetting('myusersetting', 'mytitle');
+ $this->settings->removeSettingValue($setting);
+ }
+
+ /**
+ * @expectedException \Exception
+ * @expectedExceptionMessage CoreAdminHome_PluginSettingChangeNotAllowed
+ */
+ public function test_removeSettingValue_shouldThrowException_IfUserHasNotEnoughAdminPermissions()
+ {
+ $this->setUser();
+ $setting = $this->addSystemSetting('mysystemsetting', 'mytitle');
+ $this->settings->removeSettingValue($setting);
+ }
+
+ public function test_removeSettingValue_shouldRemoveValue_IfValueExistsAndHasEnoughPermissions()
+ {
+ $this->setUser();
+ $setting = $this->addUserSetting('myusersetting', 'mytitle');
+ $this->settings->setSettingValue($setting, '12345657');
+ $this->assertSettingHasValue($setting, '12345657');
+
+ $this->settings->removeSettingValue($setting);
+ $this->assertSettingHasValue($setting, null);
+ }
+
+ public function test_removeSettingValue_shouldRemoveValue_ShouldNotSaveValueInDb()
+ {
+ $this->setSuperUser();
+
+ $setting = $this->addSystemSetting('myusersetting', 'mytitle');
+ $this->settings->setSettingValue($setting, '12345657');
+ $this->settings->save();
+
+ $this->settings->removeSettingValue($setting);
+ $this->assertSettingHasValue($setting, null);
+
+ // should still have same value
+ $this->assertSettingIsNotSavedInTheDb('myusersetting', '12345657');
+ }
+
+ public function test_getSettingsForCurrentUser_shouldOnlyReturnSettingsHavingEnoughAdminPermissions()
+ {
+ $this->setUser();
+
+ $this->addSystemSetting('mysystemsetting1', 'mytitle1');
+ $this->addSystemSetting('mysystemsetting2', 'mytitle2');
+ $this->addSystemSetting('mysystemsetting3', 'mytitle3');
+ $this->addSystemSetting('mysystemsetting4', 'mytitle4');
+ $userSetting = $this->addUserSetting('myusersetting1', 'mytitle5');
+
+ $this->assertEquals(array('myusersetting1' => $userSetting), $this->settings->getSettingsForCurrentUser());
+
+ // but all of them should be available via getSettings()
+ $this->assertCount(5, $this->settings->getSettings());
+ }
+
+ public function test_getSettingsForCurrentUser_shouldReturnAllSettingsIfEnoughPermissionsAndSortThemBySettingOrder()
+ {
+ $this->skipWhenPhp53();
+ $this->setSuperUser();
+
+ $this->addSystemSetting('mysystemsetting1', 'mytitle1');
+ $this->addSystemSetting('mysystemsetting2', 'mytitle2');
+ $this->addUserSetting('myusersetting2', 'mytitle6');
+ $this->addSystemSetting('mysystemsetting3', 'mytitle3');
+ $this->addSystemSetting('mysystemsetting4', 'mytitle4');
+ $this->addUserSetting('myusersetting1', 'mytitle5');
+
+ $expected = array('myusersetting2', 'myusersetting1', 'mysystemsetting1', 'mysystemsetting2', 'mysystemsetting3', 'mysystemsetting4');
+ $this->assertEquals($expected, array_keys($this->settings->getSettingsForCurrentUser()));
+ }
+
+ public function test_save_shouldSaveAllValues()
+ {
+ $this->setSuperUser();
+
+ $this->addSystemSetting('mysystemsetting2', 'mytitle2');
+ $this->settings->setSettingValue($this->addSystemSetting('mysystemsetting1', 'mytitle1'), '111');
+ $this->settings->setSettingValue($this->addSystemSetting('mysystemsetting4', 'mytitle4'), '4444');
+ $this->settings->setSettingValue($this->addUserSetting('myusersetting1', 'mytitle5'), '55555');
+ $this->addSystemSetting('mysystemsetting3', 'mytitle3');
+ $this->settings->save();
+
+ $verifySettings = $this->createSettingsInstance();
+
+ $setting1 = $this->buildSystemSetting('mysystemsetting1', 'mytitle1');
+ $setting2 = $this->buildSystemSetting('mysystemsetting2', 'mytitle2');
+ $setting3 = $this->buildSystemSetting('mysystemsetting3', 'mytitle3');
+ $setting4 = $this->buildSystemSetting('mysystemsetting4', 'mytitle4');
+ $setting5 = $this->buildUserSetting('myusersetting1', 'mytitle5');
+
+ $verifySettings->addSetting($setting1);
+ $verifySettings->addSetting($setting2);
+ $verifySettings->addSetting($setting3);
+ $verifySettings->addSetting($setting4);
+ $verifySettings->addSetting($setting5);
+
+ $this->assertEquals('111', $verifySettings->getSettingValue($setting1));
+ $this->assertEquals(null, $verifySettings->getSettingValue($setting2));
+ $this->assertEquals(null, $verifySettings->getSettingValue($setting3));
+ $this->assertEquals('4444', $verifySettings->getSettingValue($setting4));
+ $this->assertEquals('55555', $verifySettings->getSettingValue($setting5));
+ }
+
+ public function test_removeAllPluginSettings_shouldRemoveAllSettings()
+ {
+ $this->setSuperUser();
+
+ $this->addSystemSetting('mysystemsetting3', 'mytitle3');
+ $this->addSystemSetting('mysystemsetting4', 'mytitle4');
+ $this->settings->setSettingValue($this->addSystemSetting('mysystemsetting1', 'mytitle1'), '111');
+ $this->settings->setSettingValue($this->addSystemSetting('mysystemsetting2', 'mytitle2'), '4444');
+ $this->settings->setSettingValue($this->addUserSetting('myusersetting1', 'mytitle5'), '55555');
+ $this->settings->save();
+
+ $this->settings->removeAllPluginSettings();
+
+ $verifySettings = $this->createSettingsInstance();
+
+ $setting1 = $this->buildSystemSetting('mysystemsetting1', 'mytitle1');
+ $setting2 = $this->buildSystemSetting('mysystemsetting2', 'mytitle2');
+ $setting3 = $this->buildSystemSetting('mysystemsetting3', 'mytitle3');
+ $setting4 = $this->buildSystemSetting('mysystemsetting4', 'mytitle4');
+ $setting5 = $this->buildUserSetting('myusersetting1', 'mytitle5');
+
+ $verifySettings->addSetting($setting1);
+ $verifySettings->addSetting($setting2);
+ $verifySettings->addSetting($setting3);
+ $verifySettings->addSetting($setting4);
+ $verifySettings->addSetting($setting5);
+
+ $this->assertEquals(null, $verifySettings->getSettingValue($setting1));
+ $this->assertEquals(null, $verifySettings->getSettingValue($setting2));
+ $this->assertEquals(null, $verifySettings->getSettingValue($setting3));
+ $this->assertEquals(null, $verifySettings->getSettingValue($setting4));
+ $this->assertEquals(null, $verifySettings->getSettingValue($setting5));
+ }
+
+ /**
+ * @expectedException \Exception
+ * @expectedExceptionMessage checkUserHasSuperUserAccess Fake exception
+ */
+ public function test_removeAllPluginSettings_shouldThrowException_InCaseUserIsNotSuperUser()
+ {
+ $this->setUser();
+
+ $this->settings->removeAllPluginSettings();
+ }
+
+ public function test_userSetting_shouldGenerateDifferentKey_ThenSystemSetting()
+ {
+ $this->setSuperUser();
+
+ $user = $this->buildUserSetting('myname', 'mytitle');
+ $system = $this->buildSystemSetting('myname', 'mytitle');
+
+ $this->assertNotEquals($user->getKey(), $system->getKey());
+ $this->assertEquals('myname', $system->getKey());
+ $this->assertEquals('myname#superUserLogin#', $user->getKey());
+ }
+
+ public function test_userSetting_shouldGenerateDifferentKey_ForDifferentUsers()
+ {
+ $this->setSuperUser();
+
+ $user1 = $this->buildUserSetting('myname', 'mytitle', 'user1');
+ $user2 = $this->buildUserSetting('myname', 'mytitle', '_user2_');
+ $user3 = $this->buildUserSetting('myname', 'mytitle');
+
+ $this->assertEquals('myname#user1#', $user1->getKey());
+ $this->assertEquals('myname#_user2_#', $user2->getKey());
+ $this->assertEquals('myname#superUserLogin#', $user3->getKey());
+ }
+
+ public function test_userSetting_shouldSaveValuesPerUser()
+ {
+ $this->setSuperUser();
+ $user1Login = 'user1';
+ $user2Login = '_user2_';
+ $user3Login = null; // current loggged in user
+
+ $user = $this->buildUserSetting('myuser', 'mytitle', $user1Login);
+
+ $this->settings->addSetting($user);
+
+ $this->settings->setSettingValue($user, '111');
+ $user->setUserLogin($user2Login);
+ $this->settings->setSettingValue($user, '222');
+ $user->setUserLogin($user3Login);
+ $this->settings->setSettingValue($user, '333');
+
+ $user->setUserLogin($user1Login);
+ $this->assertSettingHasValue($user, '111');
+ $user->setUserLogin($user2Login);
+ $this->assertSettingHasValue($user, '222');
+ $user->setUserLogin($user3Login);
+ $this->assertSettingHasValue($user, '333');
+
+ $user->setUserLogin($user2Login);
+ $this->settings->removeSettingValue($user);
+
+ $user->setUserLogin($user1Login);
+ $this->assertSettingHasValue($user, '111');
+ $user->setUserLogin($user2Login);
+ $this->assertSettingHasValue($user, null);
+ $user->setUserLogin($user3Login);
+ $this->assertSettingHasValue($user, '333');
+
+ $this->settings->removeAllPluginSettings();
+
+ $user->setUserLogin($user1Login);
+ $this->assertSettingHasValue($user, null);
+ $user->setUserLogin($user2Login);
+ $this->assertSettingHasValue($user, null);
+ $user->setUserLogin($user3Login);
+ $this->assertSettingHasValue($user, null);
+ }
+
+ /**
+ * @expectedException \Exception
+ * @expectedExceptionMessage You do not have the permission to read the settings of a different user
+ */
+ public function test_userSetting_shouldThrowException_IfSomeoneTriesToReadSettingsFromAnotherUserAndIsNotSuperuser()
+ {
+ $this->setUser();
+
+ $this->buildUserSetting('myname', 'mytitle', 'myRandomName');
+ }
+
+ public function test_userSetting_shouldBeAbleToSetLoginAndChangeValues_IfUserHasSuperUserAccess()
+ {
+ $this->setSuperUser();
+
+ $setting = $this->buildUserSetting('myname', 'mytitle', 'myRandomName');
+ $this->settings->addSetting($setting);
+
+ $this->settings->setSettingValue($setting, 5);
+ $this->assertSettingHasValue($setting, 5);
+
+ $this->settings->removeSettingValue($setting);
+ $this->assertSettingHasValue($setting, null);
+ }
+
+ public function test_construct_shouldDetectTheNameOfThePluginAutomatically_IfPluginNameNotGiven()
+ {
+ $setting = new Piwik\Plugins\ExampleSettingsPlugin\Settings();
+
+ $this->assertEquals('ExampleSettingsPlugin', $setting->getPluginName());
+ }
+
+ private function buildUserSetting($name, $title, $userLogin = null)
+ {
+ return new \Piwik\Settings\UserSetting($name, $title, $userLogin);
+ }
+
+ private function buildSystemSetting($name, $title)
+ {
+ return new \Piwik\Settings\SystemSetting($name, $title);
+ }
+
+ private function setSuperUser()
+ {
+ $pseudoMockAccess = new FakeAccess;
+ FakeAccess::$superUser = true;
+ Access::setSingletonInstance($pseudoMockAccess);
+ }
+
+ private function setUser()
+ {
+ $pseudoMockAccess = new FakeAccess;
+ FakeAccess::$idSitesView = array(1);
+ Access::setSingletonInstance($pseudoMockAccess);
+ }
+
+ private function addSystemSetting($name, $title)
+ {
+ $setting = $this->buildSystemSetting($name, $title);
+ $this->settings->addSetting($setting);
+ return $setting;
+ }
+
+ private function addUserSetting($name, $title)
+ {
+ $setting = $this->buildUserSetting($name, $title);
+ $this->settings->addSetting($setting);
+ return $setting;
+ }
+
+ private function assertSettingHasValue($setting, $expectedValue, $expectedType = null)
+ {
+ $value = $this->settings->getSettingValue($setting);
+ $this->assertEquals($expectedValue, $value);
+
+ if (!is_null($expectedType)) {
+ $this->assertInternalType($expectedType, $value);
+ }
+ }
+
+ private function assertSettingIsNotSavedInTheDb($settingName, $expectedValue)
+ {
+ // by creating a new instance...
+ $setting = $this->buildSystemSetting($settingName, 'mytitle');
+ $verifySettings = $this->createSettingsInstance();
+ $verifySettings->addSetting($setting);
+
+ $this->assertEquals($expectedValue, $verifySettings->getSettingValue($setting));
+ }
+
+ private function createSettingsInstance()
+ {
+ return new CorePluginSettingsTest('ExampleSettingsPlugin');
+ }
+} \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/Plugins/CorePluginsAdmin/UpdateCommunicationTest.php b/tests/PHPUnit/Integration/Plugins/CorePluginsAdmin/UpdateCommunicationTest.php
deleted file mode 100644
index 42ec5753b4..0000000000
--- a/tests/PHPUnit/Integration/Plugins/CorePluginsAdmin/UpdateCommunicationTest.php
+++ /dev/null
@@ -1,183 +0,0 @@
-<?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\Config;
-use Piwik\Option;
-use Piwik\Plugins\CorePluginsAdmin\UpdateCommunication;
-
-/**
- * Class Plugins_CorePluginsAdmin_UpdateCommunicationTest
- *
- * @group Plugins
- */
-class Plugins_CorePluginsAdmin_UpdateCommunicationTest extends DatabaseTestCase
-{
- /**
- * @var UpdateCommunication
- */
- private $updateCommunication;
-
- public function setUp()
- {
- parent::setUp();
-
- $this->updateCommunication = new UpdateCommunication();
- $this->updateCommunication->enable();
- }
-
- public function test_canBeEnabled()
- {
- $this->assertTrue($this->updateCommunication->canBeEnabled());
-
- Config::getInstance()->General['enable_update_communication'] = 0;
- $this->assertFalse($this->updateCommunication->canBeEnabled());
-
- Config::getInstance()->General['enable_update_communication'] = 1;
- $this->assertTrue($this->updateCommunication->canBeEnabled());
- }
-
- public function test_enable()
- {
- $this->updateCommunication->enable();
- $this->assertTrue($this->updateCommunication->isEnabled());
- }
-
- public function test_disable()
- {
- $this->assertTrue($this->updateCommunication->isEnabled());
-
- $this->updateCommunication->disable();
- $this->assertFalse($this->updateCommunication->isEnabled());
- }
-
- public function test_isEnabled_shouldReturnFalse_IfCannotBeEnabled()
- {
- $this->assertTrue($this->updateCommunication->isEnabled());
-
- Config::getInstance()->General['enable_update_communication'] = 0;
- $this->assertFalse($this->updateCommunication->isEnabled());
- }
-
- public function test_sendNotificationIfUpdatesAvailable_shouldNotSendNotification_IfNoUpdateAvailable()
- {
- $mock = $this->getCommunicationMock(array());
- $mock->expects($this->never())->method('sendEmailNotification');
- $mock->sendNotificationIfUpdatesAvailable();
- }
-
- /**
- * @dataProvider provideSendNotificationData
- */
- public function test_sendNotificationIfUpdatesAvailable($latestVersion, $lastSentVersion, $expects, $expectedLastSentVersion)
- {
- $pluginsHavingUpdate = array(
- array('name' => 'MyTest', 'latestVersion' => $latestVersion, 'isTheme' => false)
- );
- $this->setLastSentVersion('MyTest', $lastSentVersion);
-
- $mock = $this->getCommunicationMock($pluginsHavingUpdate);
- $mock->expects($expects)->method('sendEmailNotification');
- $mock->sendNotificationIfUpdatesAvailable();
-
- $this->assertEquals($expectedLastSentVersion, $this->getLastSentVersion('MyTest'));
- }
-
- public function provideSendNotificationData()
- {
- return array(
- array('33.0.0', '33.0.0', $this->never(), '33.0.0'), // shouldNotSend_IfAlreadyNotified
- array('31.0.0', '33.0.0', $this->never(), '33.0.0'), // shouldNotSend_IfAlreadyNotifiedAboutLaterRelease
- array('33.0.0', false, $this->once(), '33.0.0'), // shouldSend_IfUpdateAvailableAndNeverSentAnyBefore
- array('33.0.0', '31.0.0', $this->once(), '33.0.0'), // shouldSend_IfUpdateAvailable,
- );
- }
-
- public function test_sendNotificationIfUpdatesAvailable_ShouldSendOnlyOneEmail_IfMultipleUpdatesAreAvailable()
- {
- $mock = $this->getCommunicationMockHavingManyUpdates();
- $mock->expects($this->once())->method('sendEmailNotification');
- $mock->sendNotificationIfUpdatesAvailable();
- }
-
- public function test_sendNotificationIfUpdatesAvailable_ShouldUpdateAllSentVersions_IfMultipleUpdatesAreAvailable()
- {
- $mock = $this->getCommunicationMockHavingManyUpdates();
- $mock->expects($this->once())->method('sendEmailNotification');
- $mock->sendNotificationIfUpdatesAvailable();
-
- $this->assertEquals('33.0.0', $this->getLastSentVersion('MyTest1'));
- $this->assertEquals('32.0.0', $this->getLastSentVersion('MyTest2'));
- $this->assertEquals('31.0.0', $this->getLastSentVersion('MyTest3'));
- }
-
- public function test_sendNotificationIfUpdatesAvailable_ShouldSendCorrectText()
- {
- $subject = 'CoreUpdater_NotificationSubjectAvailablePluginUpdate';
- $message = 'ScheduledReports_EmailHello
-
-CoreUpdater_ThereIsNewPluginVersionAvailableForUpdate
-
- * MyTest1 33.0.0
- * MyTest2 32.0.0
- * MyTest3 31.0.0
-
-CoreUpdater_NotificationClickToUpdatePlugins
-index.php?module=CorePluginsAdmin&action=plugins
-
-Installation_HappyAnalysing';
-
- $mock = $this->getCommunicationMockHavingManyUpdates();
-
- $mock->expects($this->once())->method('sendEmailNotification')
- ->with($this->equalTo($subject), $this->equalTo($message));
-
- $mock->sendNotificationIfUpdatesAvailable();
- }
-
- private function setLastSentVersion($pluginName, $version)
- {
- Option::set('last_update_communication_sent_plugin_' . $pluginName, $version);
- }
-
- private function getLastSentVersion($pluginName)
- {
- return Option::get('last_update_communication_sent_plugin_' . $pluginName);
- }
-
- /**
- * @param array $pluginsHavingUpdate
- * @return UpdateCommunication
- */
- private function getCommunicationMock($pluginsHavingUpdate)
- {
- $mock = $this->getMock('\Piwik\Plugins\CorePluginsAdmin\UpdateCommunication', array('getPluginsHavingUpdate', 'sendEmailNotification'));
-
- $mock->expects($this->any())
- ->method('getPluginsHavingUpdate')
- ->will($this->returnValue($pluginsHavingUpdate));
-
- return $mock;
- }
-
- private function getCommunicationMockHavingManyUpdates()
- {
- $pluginsHavingUpdate = array(
- array('name' => 'MyTest1', 'latestVersion' => '33.0.0', 'isTheme' => false),
- array('name' => 'MyTest2', 'latestVersion' => '32.0.0', 'isTheme' => false),
- array('name' => 'MyTest3', 'latestVersion' => '31.0.0', 'isTheme' => false),
- );
-
- $this->setLastSentVersion('MyTest1', false);
- $this->setLastSentVersion('MyTest2', false);
- $this->setLastSentVersion('MyTest3', false);
-
- $mock = $this->getCommunicationMock($pluginsHavingUpdate);
-
- return $mock;
- }
-}
diff --git a/tests/PHPUnit/Integration/Plugins/CoreUpdater/UpdateCommunicationTest.php b/tests/PHPUnit/Integration/Plugins/CoreUpdater/UpdateCommunicationTest.php
deleted file mode 100644
index 2ecccd2bf5..0000000000
--- a/tests/PHPUnit/Integration/Plugins/CoreUpdater/UpdateCommunicationTest.php
+++ /dev/null
@@ -1,119 +0,0 @@
-<?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\Config;
-use Piwik\Option;
-use Piwik\Plugins\CoreUpdater\UpdateCommunication;
-use Piwik\UpdateCheck;
-use Piwik\Version;
-
-/**
- * Class Plugins_CoreUpdater_UpdateCommunicationTest
- *
- * @group Plugins
- */
-class Plugins_CoreUpdater_UpdateCommunicationTest extends DatabaseTestCase
-{
- public function setUp()
- {
- parent::setUp();
- }
-
- public function test_isEnabled()
- {
- $updateCommunication = new UpdateCommunication();
-
- $this->assertTrue($updateCommunication->isEnabled());
-
- Config::getInstance()->General['enable_update_communication'] = 0;
- $this->assertFalse($updateCommunication->isEnabled());
-
- Config::getInstance()->General['enable_update_communication'] = 1;
- $this->assertTrue($updateCommunication->isEnabled());
- }
-
- /**
- * @dataProvider provideSendNotificationData
- */
- public function test_sendNotificationIfUpdateAvailable($latestVersion, $lastSentVersion, $expects, $expectedLastSentVersion)
- {
- $this->setLatestVersion($latestVersion);
- $this->setLastSentVersion($lastSentVersion);
-
- $mock = $this->getCommunicationMock(array('sendNotifications'));
- $mock->expects($expects)->method('sendNotifications');
- $mock->sendNotificationIfUpdateAvailable();
-
- $this->assertEquals($expectedLastSentVersion, $this->getLastSentVersion());
- }
-
- public function provideSendNotificationData()
- {
- return array(
- array(Version::VERSION, false, $this->never(), false), // shouldNotSend_IfNoUpdateAvailable
- array('33.0.0', '33.0.0', $this->never(), '33.0.0'), // shouldNotSend_IfAlreadyNotified
- array('31.0.0', '33.0.0', $this->never(), '33.0.0'), // shouldNotSend_IfAlreadyNotifiedAboutLaterRelease
- array('3333.3333.3333-beta10', '31.0.0', $this->never(), '31.0.0'), // shouldNotSend_IfLatestVersionIsNotVersionLike,
- array('33.0.0', false, $this->once(), '33.0.0'), // shouldSend_IfUpdateAvailableAndNeverSentAnyBefore
- array('33.0.0', '31.0.0', $this->once(), '33.0.0'), // shouldSend_IfUpdateAvailable
- );
- }
-
- public function test_sendNotifications_shouldSentCorrectEmail()
- {
- $this->setLatestVersion('33.0.0');
-
- $subject = 'CoreUpdater_NotificationSubjectAvailableCoreUpdate';
- $message = 'ScheduledReports_EmailHello
-
-CoreUpdater_ThereIsNewVersionAvailableForUpdate
-
-CoreUpdater_YouCanUpgradeAutomaticallyOrDownloadPackage
-
-index.php?module=CoreUpdater&action=newVersionAvailable
-
-CoreUpdater_FeedbackRequest
-http://piwik.org/contact/';
-
- $mock = $this->getCommunicationMock(array('sendEmailNotification'));
- $mock->expects($this->once())
- ->method('sendEmailNotification')
- ->with($this->equalTo($subject), $this->equalTo($message));
- $mock->sendNotificationIfUpdateAvailable();
- }
-
- private function setLastSentVersion($value)
- {
- Option::set('last_update_communication_sent_core', $value);
- }
-
- private function getLastSentVersion()
- {
- return Option::get('last_update_communication_sent_core');
- }
-
- private function setLatestVersion($value)
- {
- $this->preventVersionIsOverwrittenByActualVersionCheck();
- Option::set(UpdateCheck::LATEST_VERSION, $value);
- }
-
- private function preventVersionIsOverwrittenByActualVersionCheck()
- {
- Config::getInstance()->General['enable_auto_update'] = false;
- }
-
- /**
- * @param array $methodsToOverwrite
- * @return UpdateCommunication
- */
- private function getCommunicationMock($methodsToOverwrite)
- {
- return $this->getMock('\Piwik\Plugins\CoreUpdater\UpdateCommunication', $methodsToOverwrite);
- }
-}
diff --git a/tests/PHPUnit/Integration/Plugins/LoginTest.php b/tests/PHPUnit/Integration/Plugins/LoginTest.php
deleted file mode 100644
index d2404e49c2..0000000000
--- a/tests/PHPUnit/Integration/Plugins/LoginTest.php
+++ /dev/null
@@ -1,399 +0,0 @@
-<?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\AuthResult;
-use Piwik\DbHelper;
-use Piwik\Plugins\Login\Auth;
-use Piwik\Plugins\UsersManager\API;
-
-require_once 'Login/Auth.php';
-
-/**
- * Class Plugins_LoginTest
- *
- * @group Plugins
- * @group Plugins_LoginTest
- */
-class Plugins_LoginTest extends DatabaseTestCase
-{
-
- /**
- * @var Auth
- */
- private $auth;
-
- public function setUp()
- {
- parent::setUp();
-
- // setup the access layer
- $pseudoMockAccess = new FakeAccess;
- FakeAccess::setIdSitesView(array(1, 2));
- FakeAccess::setIdSitesAdmin(array(3, 4));
-
- //finally we set the user as a Super User by default
- FakeAccess::$superUser = true;
- Access::setSingletonInstance($pseudoMockAccess);
-
- $this->auth = new Auth();
- }
-
- /**
- * @group Plugins
- */
- public function testAuthenticateFailureNoLoginNoTokenAuth()
- {
- // no login; no token auth
- $rc = $this->auth->authenticate();
- $this->assertFailedLogin($rc);
- }
-
- /**
- * @group Plugins
- */
- public function testAuthenticateFailureEmptyLoginNoTokenAuth()
- {
- // empty login; no token auth
- $this->auth->setLogin('');
- $rc = $this->auth->authenticate();
- $this->assertFailedLogin($rc);
- }
-
- /**
- * @group Plugins
- */
- public function testAuthenticateFailureNonExistentUser()
- {
- // non-existent user
- $this->auth->setLogin('nobody');
- $rc = $this->auth->authenticate();
- $this->assertFailedLogin($rc);
- }
-
- /**
- * @group Plugins
- */
- public function testAuthenticateFailureAnonymousNotExisting()
- {
- // anonymous user doesn't exist yet
- $rc = $this->authenticate($login = 'anonymous', $authToken = '');
- $this->assertFailedLogin($rc);
- }
-
- /**
- * @group Plugins
- */
- public function testAuthenticateFailureAnonymousNotExistentEmptyLogin()
- {
- // empty login; anonymous user doesn't exist yet
- $rc = $this->authenticate($login = '', $authToken = 'anonymous');
-
- $this->assertFailedLogin($rc);
- }
-
- /**
- * @group Plugins
- */
- public function testAuthenticateFailureAnonymousNotExistentEmptyLoginWithTokenAuth()
- {
- // API authentication; anonymous user doesn't exist yet
- $rc = $this->authenticate($login = null, $authToken = 'anonymous');
- $this->assertFailedLogin($rc);
- }
-
- /**
- * @group Plugins
- */
- public function testAuthenticateFailureAnonymousNotExistentWithLoginAndTokenAuth()
- {
- // anonymous user doesn't exist yet
- $rc = $this->authenticate($login = 'anonymous', $authToken = 'anonymous');
- $this->assertFailedLogin($rc);
- }
-
- /**
- * @group Plugins
- */
- public function testAuthenticateFailureAnonymousWithLogin()
- {
- DbHelper::createAnonymousUser();
-
- // missing token_auth
- $rc = $this->authenticate($login = 'anonymous', $authToken = '');
- $this->assertFailedLogin($rc);
- }
-
- /**
- * @group Plugins
- */
- public function testAuthenticateFailureAnonymousEmptyLoginWithTokenAuth()
- {
- DbHelper::createAnonymousUser();
-
- // empty login
- $rc = $this->authenticate($login = '', $authToken = 'anonymous');
- $this->assertFailedLogin($rc);
- }
-
- /**
- * @group Plugins
- */
- public function testAuthenticateFailureAnonymousLoginTokenAuthMissmatch()
- {
- DbHelper::createAnonymousUser();
-
- // not equal
- $rc = $this->authenticate($login = 'anonymous', $authToken = 0);
- $this->assertFailedLogin($rc);
- }
-
- /**
- * @group Plugins
- */
- public function testAuthenticateSuccessAnonymousWithTokenAuth()
- {
- DbHelper::createAnonymousUser();
-
- // API authentication
- $rc = $this->authenticate($login = null, $authToken = 'anonymous');
- $this->assertUserLogin($rc, $login = 'anonymous', $tokenLength = 9);
- }
-
- /**
- * @group Plugins
- */
- public function testAuthenticateSuccessAnonymous()
- {
- DbHelper::createAnonymousUser();
-
- // valid login & token auth
- $rc = $this->authenticate($login = 'anonymous', $authToken = 'anonymous');
- $this->assertUserLogin($rc, $login = 'anonymous', $tokenLength = 9);
- }
-
- /**
- * @group Plugins
- */
- public function testAuthenticateFailureUserEmptyTokenAuth()
- {
- $user = $this->_setUpUser();
-
- // empty token auth
- $rc = $this->authenticate($login = $user['login'], $authToken = '');
- $this->assertFailedLogin($rc);
- }
-
- /**
- * @group Plugins
- */
- public function testAuthenticateFailureUserInvalidTokenAuth()
- {
- $user = $this->_setUpUser();
-
- // not a token auth
- $rc = $this->authenticate($login = $user['login'], $authToken = $user['password']);
- $this->assertFailedLogin($rc);
- }
-
- /**
- * @group Plugins
- */
- public function testAuthenticateFailureUserInvalidTokenAuth2()
- {
- $user = $this->_setUpUser();
-
- // not a token auth
- $rc = $this->authenticate($login = $user['login'], $authToken = md5($user['password']));
- $this->assertFailedLogin($rc);
- }
-
- /**
- * @group Plugins
- */
- public function testAuthenticateFailureUserEmptyLogin()
- {
- $user = $this->_setUpUser();
-
- // empty login
- $rc = $this->authenticate($login = '', $user['tokenAuth']);
- $this->assertFailedLogin($rc);
- }
-
- /**
- * @group Plugins
- */
- public function testAuthenticateFailureUserWithSuperUserAccessEmptyLogin()
- {
- $user = $this->_setUpUser();
- $this->_setUpSuperUserAccessViaDb();
-
- // empty login
- $rc = $this->authenticate($login = '', $user['tokenAuth']);
- $this->assertFailedLogin($rc);
- }
-
- /**
- * @group Plugins
- */
- public function testAuthenticateFailureUserLoginTokenAuthMissmatch()
- {
- $this->_setUpUser();
-
- // not equal
- $rc = $this->authenticate($login = 0, $authToken = 0);
- $this->assertFailedLogin($rc);
- }
-
- /**
- * @group Plugins
- */
- public function testAuthenticateFailureUserLoginTokenAuthMissmatch2()
- {
- $user = $this->_setUpUser();
-
- // not equal
- $rc = $this->authenticate($login = 0, $user['tokenAuth']);
- $this->assertFailedLogin($rc);
- }
-
- /**
- * @group Plugins
- */
- public function testAuthenticateFailureUserLoginTokenAuthMissmatch3()
- {
- $user = $this->_setUpUser();
-
- // not equal
- $rc = $this->authenticate($user['login'], $authToken = 0);
- $this->assertFailedLogin($rc);
- }
-
- /**
- * @group Plugins
- */
- public function testAuthenticateFailureUserWithSuperUserAccessLoginTokenAuthMissmatch()
- {
- $user = $this->_setUpUser();
- $this->_setUpSuperUserAccessViaDb();
-
- // not equal
- $rc = $this->authenticate($login = null, $authToken = $user['password']);
- $this->assertFailedLogin($rc);
- }
-
- /**
- * @group Plugins
- */
- public function testAuthenticateSuccessUserTokenAuth()
- {
- $user = $this->_setUpUser();
-
- // API authentication
- $rc = $this->authenticate($login = null, $user['tokenAuth']);
- $this->assertUserLogin($rc);
- }
-
- /**
- * @group Plugins
- */
- public function testAuthenticateSuccessUserWithSuperUserAccessByTokenAuth()
- {
- $user = $this->_setUpUser();
- $this->_setUpSuperUserAccessViaDb();
-
- // API authentication
- $rc = $this->authenticate($login = null, $user['tokenAuth']);
- $this->assertSuperUserLogin($rc, 'user');
- }
-
- /**
- * @group Plugins
- */
- public function testAuthenticateSuccessUserLoginAndTokenAuth()
- {
- $user = $this->_setUpUser();
-
- // valid login & token auth
- $rc = $this->authenticate($user['login'], $user['tokenAuth']);
- $this->assertUserLogin($rc);
- }
-
- /**
- * @group Plugins
- */
- public function testAuthenticateSuccessUserWithSuperUserAccessLoginAndTokenAuth()
- {
- $user = $this->_setUpUser();
- $this->_setUpSuperUserAccessViaDb();
-
- // valid login & token auth
- $rc = $this->authenticate($user['login'], $user['tokenAuth']);
- $this->assertSuperUserLogin($rc, 'user');
- }
-
- /**
- * @group Plugins
- */
- public function testAuthenticateSuccessLoginAndHashedTokenAuth()
- {
- $user = $this->_setUpUser();
- $hash = \Piwik\Plugins\Login\SessionInitializer::getHashTokenAuth($user['login'], $user['tokenAuth']);
-
- // valid login & hashed token auth
- $rc = $this->authenticate($user['login'], $tokenAuth = $hash);
- $this->assertUserLogin($rc);
- }
-
- protected function _setUpUser()
- {
- $user = array('login' => 'user',
- 'password' => 'geqgeagae',
- 'email' => 'test@test.com',
- 'alias' => 'alias',
- 'superuser_access' => 0);
-
- API::getInstance()->addUser($user['login'], $user['password'], $user['email'], $user['alias']);
-
- $user['tokenAuth'] = API::getInstance()->getTokenAuth($user['login'], md5($user['password']));
-
- return $user;
- }
-
- private function _setUpSuperUserAccessViaDb()
- {
- API::getInstance()->setSuperUserAccess('user', true);
- }
-
- private function authenticate($login, $tokenAuth)
- {
- $this->auth->setLogin($login);
- $this->auth->setTokenAuth($tokenAuth);
-
- return $this->auth->authenticate();
- }
-
- private function assertFailedLogin(AuthResult $authResult)
- {
- $this->assertEquals(AuthResult::FAILURE, $authResult->getCode());
- }
-
- private function assertSuperUserLogin(AuthResult $authResult, $login = 'superUserLogin', $tokenLength = 32)
- {
- $this->assertEquals(AuthResult::SUCCESS_SUPERUSER_AUTH_CODE, $authResult->getCode());
- $this->assertEquals($login, $authResult->getIdentity());
- $this->assertEquals($tokenLength, strlen($authResult->getTokenAuth()));
- }
-
- private function assertUserLogin(AuthResult $authResult, $login = 'user', $tokenLength = 32)
- {
- $this->assertEquals(AuthResult::SUCCESS, $authResult->getCode());
- $this->assertEquals($login, $authResult->getIdentity());
- $this->assertEquals($tokenLength, strlen($authResult->getTokenAuth()));
- }
-
-}
diff --git a/tests/PHPUnit/Integration/Plugins/MobileMessagingTest.php b/tests/PHPUnit/Integration/Plugins/MobileMessagingTest.php
deleted file mode 100644
index 7ad88934e0..0000000000
--- a/tests/PHPUnit/Integration/Plugins/MobileMessagingTest.php
+++ /dev/null
@@ -1,258 +0,0 @@
-<?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\MobileMessaging\API as APIMobileMessaging;
-use Piwik\Plugins\MobileMessaging\MobileMessaging;
-use Piwik\Plugins\MobileMessaging\SMSProvider;
-use Piwik\Plugins\ScheduledReports\API as APIScheduledReports;
-use Piwik\Plugins\SitesManager\API as APISitesManager;
-
-/**
- * Class Plugins_MobileMessagingTest
- *
- * @group Plugins
- */
-class Plugins_MobileMessagingTest extends DatabaseTestCase
-{
- protected $idSiteAccess;
-
- public function setUp()
- {
- parent::setUp();
-
- // setup the access layer
- $pseudoMockAccess = new FakeAccess;
- FakeAccess::$superUser = true;
- //finally we set the user as a Super User by default
- Access::setSingletonInstance($pseudoMockAccess);
-
- $this->idSiteAccess = APISitesManager::getInstance()->addSite("test", "http://test");
-
- \Piwik\Plugin\Manager::getInstance()->loadPlugins(array('ScheduledReports', 'MobileMessaging', 'MultiSites'));
- \Piwik\Plugin\Manager::getInstance()->installLoadedPlugins();
- }
-
- /**
- * When the MultiSites plugin is not activated, the SMS content should invite the user to activate it back
- *
- * @group Plugins
- */
- public function testWarnUserViaSMSMultiSitesDeactivated()
- {
- // safety net
- \Piwik\Plugin\Manager::getInstance()->loadPlugins(array('ScheduledReports', 'MobileMessaging'));
- $this->assertFalse(\Piwik\Plugin\Manager::getInstance()->isPluginActivated('MultiSites'));
-
- $APIScheduledReports = APIScheduledReports::getInstance();
- $reportId = $APIScheduledReports->addReport(
- $this->idSiteAccess,
- 'description',
- 'month',
- 0,
- 'mobile',
- 'sms',
- array(),
- array("phoneNumbers" => array('33698896656'))
- );
-
- list($outputFilename, $prettyDate, $websiteName, $additionalFiles) =
- $APIScheduledReports->generateReport(
- $reportId,
- '01-01-2010',
- 'en',
- 2
- );
-
- $handle = fopen($outputFilename, "r");
- $contents = fread($handle, filesize($outputFilename));
- fclose($handle);
-
- $this->assertEquals(
- \Piwik\Piwik::translate('MobileMessaging_MultiSites_Must_Be_Activated'),
- $contents
- );
- }
-
- /**
- * Dataprovider for testTruncate
- */
- public function getTruncateTestCases()
- {
-
- $stdGSMx459 = str_repeat('a', 459);
-
- $extGSMx229 = str_repeat('€', 229);
-
- $alternatedGSMx153 = str_repeat('a€', 153);
-
- $GSMWithRegExpSpecialChars = $stdGSMx459 . '[\^$.|?*/+()';
-
- $UCS2x201 = str_repeat('控', 201);
-
- // appended strings
- $stdGSMAppendedString = 'too long';
- $extGSMAppendedString = '[too long]';
- $UCS2AppendedString = '[控控]';
-
- return array(
-
- // maximum number of standard GSM characters
- array($stdGSMx459, $stdGSMx459, 3, 'N/A'),
-
- // maximum number of extended GSM characters
- array($extGSMx229, $extGSMx229, 3, 'N/A'),
-
- // maximum number of alternated GSM characters
- array($alternatedGSMx153, $alternatedGSMx153, 3, 'N/A'),
-
- // standard GSM, one 'a' too many, appended with standard GSM characters
- array(str_repeat('a', 451) . $stdGSMAppendedString, $stdGSMx459 . 'a', 3, $stdGSMAppendedString),
-
- // standard GSM, one 'a' too many, appended with extended GSM characters
- array(str_repeat('a', 447) . $extGSMAppendedString, $stdGSMx459 . 'a', 3, $extGSMAppendedString),
-
- // standard GSM, one 'a' too many, appended with UCS2 characters
- array(str_repeat('a', 197) . $UCS2AppendedString, $stdGSMx459 . 'a', 3, $UCS2AppendedString),
-
- // extended GSM, one '€' too many, appended with standard GSM characters
- array(str_repeat('€', 225) . $stdGSMAppendedString, $extGSMx229 . '€', 3, $stdGSMAppendedString),
-
- // extended GSM, one '€' too many, appended with extended GSM characters
- array(str_repeat('€', 223) . $extGSMAppendedString, $extGSMx229 . '€', 3, $extGSMAppendedString),
-
- // extended GSM, one '€' too many, appended with UCS2 characters
- array(str_repeat('€', 197) . $UCS2AppendedString, $extGSMx229 . '€', 3, $UCS2AppendedString),
-
- // alternated GSM, one 'a' too many, appended with standard GSM characters
- array(str_repeat('a€', 150) . 'a' . $stdGSMAppendedString, $alternatedGSMx153 . 'a', 3, $stdGSMAppendedString),
-
- // alternated GSM, one 'a' too many, appended with extended GSM characters
- array(str_repeat('a€', 149) . $extGSMAppendedString, $alternatedGSMx153 . 'a', 3, $extGSMAppendedString),
-
- // alternated GSM, one 'a' too many, appended with UCS2 characters
- array(str_repeat('a€', 98) . 'a' . $UCS2AppendedString, $alternatedGSMx153 . 'a', 3, $UCS2AppendedString),
-
- // alternated GSM, one '€' too many, appended with standard GSM characters
- array(str_repeat('a€', 150) . 'a' . $stdGSMAppendedString, $alternatedGSMx153 . '€', 3, $stdGSMAppendedString),
-
- // alternated GSM, one '€' too many, appended with extended GSM characters
- array(str_repeat('a€', 149) . $extGSMAppendedString, $alternatedGSMx153 . '€', 3, $extGSMAppendedString),
-
- // alternated GSM, one '€' too many, appended with UCS2 characters
- array(str_repeat('a€', 98) . 'a' . $UCS2AppendedString, $alternatedGSMx153 . '€', 3, $UCS2AppendedString),
-
- // GSM with RegExp reserved special chars
- array(str_repeat('a', 451) . $stdGSMAppendedString, $GSMWithRegExpSpecialChars, 3, $stdGSMAppendedString),
-
- // maximum number of UCS-2 characters
- array($UCS2x201, $UCS2x201, 3, 'N/A'),
-
- // UCS-2, one '控' too many, appended with UCS2 characters
- array(str_repeat('控', 197) . $UCS2AppendedString, $UCS2x201 . '控', 3, $UCS2AppendedString),
-
- // UCS-2, one '控' too many, appended with standard GSM characters
- array(str_repeat('控', 193) . $stdGSMAppendedString, $UCS2x201 . '控', 3, $stdGSMAppendedString)
- );
- }
-
- /**
- * @group Plugins
- *
- * @dataProvider getTruncateTestCases
- */
- public function testTruncate($expected, $stringToTruncate, $maximumNumberOfConcatenatedSMS, $appendedString)
- {
- $this->assertEquals(
- $expected,
- SMSProvider::truncate($stringToTruncate, $maximumNumberOfConcatenatedSMS, $appendedString)
- );
- }
-
- /**
- * Dataprovider for testContainsUCS2Characters
- */
- public function getContainsUCS2CharactersTestCases()
- {
- return array(
- array(false, 'too long'),
- array(false, '[too long]'),
- array(false, '€'),
- array(true, '[控控]'),
- );
- }
-
- /**
- * @group Plugins
- *
- * @dataProvider getContainsUCS2CharactersTestCases
- */
- public function testContainsUCS2Characters($expected, $stringToTest)
- {
- $this->assertEquals(
- $expected,
- SMSProvider::containsUCS2Characters($stringToTest)
- );
- }
-
- /**
- * @group Plugins
- */
- public function testSanitizePhoneNumber()
- {
- $this->assertEquals('676932647', APIMobileMessaging::sanitizePhoneNumber(' 6 76 93 26 47'));
- }
-
- /**
- * @group Plugins
- */
- public function testPhoneNumberIsSanitized()
- {
- $mobileMessagingAPI = APIMobileMessaging::getInstance();
- $mobileMessagingAPI->setSMSAPICredential('StubbedProvider', '');
- $mobileMessagingAPI->addPhoneNumber(' 6 76 93 26 47');
- $this->assertEquals('676932647', key($mobileMessagingAPI->getPhoneNumbers()));
- }
-
- /**
- * Dataprovider for testSendReport
- */
- public function getSendReportTestCases()
- {
- return array(
- array('reportContent', '0101010101', 'Piwik.org', 'reportContent', '0101010101', 'Piwik.org'),
- array('reportContent', '0101010101', 'General_Reports', 'reportContent', '0101010101', 'General_MultiSitesSummary'),
- );
- }
-
- /**
- * @group Plugins
- *
- * @dataProvider getSendReportTestCases
- */
- public function testSendReport($expectedReportContent, $expectedPhoneNumber, $expectedFrom, $reportContent, $phoneNumber, $reportSubject)
- {
- $report = array(
- 'parameters' => array(MobileMessaging::PHONE_NUMBERS_PARAMETER => array($phoneNumber)),
- );
-
- $stubbedAPIMobileMessaging = $this->getMock('\\Piwik\\Plugins\\MobileMessaging\\API', array('sendSMS', 'getInstance'), $arguments = array(), $mockClassName = '', $callOriginalConstructor = false);
- $stubbedAPIMobileMessaging->expects($this->once())->method('sendSMS')->with(
- $this->equalTo($expectedReportContent, 0),
- $this->equalTo($expectedPhoneNumber, 1),
- $this->equalTo($expectedFrom, 2)
- );
-
- \Piwik\Plugins\MobileMessaging\API::setSingletonInstance($stubbedAPIMobileMessaging);
-
- $mobileMessaging = new MobileMessaging();
- $mobileMessaging->sendReport(MobileMessaging::MOBILE_TYPE, $report, $reportContent, null, null, $reportSubject, null, null, null, false);
-
- \Piwik\Plugins\MobileMessaging\API::unsetInstance();
- }
-}
diff --git a/tests/PHPUnit/Integration/Plugins/MultiSitesTest.php b/tests/PHPUnit/Integration/Plugins/MultiSitesTest.php
deleted file mode 100644
index 4b30d562c8..0000000000
--- a/tests/PHPUnit/Integration/Plugins/MultiSitesTest.php
+++ /dev/null
@@ -1,49 +0,0 @@
-<?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\MultiSites\API as APIMultiSites;
-use Piwik\Plugins\SitesManager\API as APISitesManager;
-
-/**
- * Class Plugins_MultiSitesTest
- *
- * @group Plugins
- */
-class Plugins_MultiSitesTest extends DatabaseTestCase
-{
- protected $idSiteAccess;
-
- public function setUp()
- {
- parent::setUp();
-
- $access = Access::getInstance();
- $access->setSuperUserAccess(true);
-
- $this->idSiteAccess = APISitesManager::getInstance()->addSite("test", "http://test");
-
- \Piwik\Plugin\Manager::getInstance()->loadPlugins(array('MultiSites', 'VisitsSummary', 'Actions'));
- \Piwik\Plugin\Manager::getInstance()->installLoadedPlugins();
- }
-
- /**
- * Testing that getOne returns a row even when there are no data
- * This is necessary otherwise ResponseBuilder throws 'Call to a member function getColumns() on a non-object'
- *
- * @group Plugins
- */
- public function testWhenNoDataGetOneReturnsRow()
- {
- $dataTable = APIMultiSites::getInstance()->getOne($this->idSiteAccess, 'month', '01-01-2010');
- $this->assertEquals(1, $dataTable->getRowsCount());
-
- // safety net
- $this->assertEquals(0, $dataTable->getFirstRow()->getColumn('nb_visits'));
- }
-}
diff --git a/tests/PHPUnit/Integration/Plugins/PrivacyManagerConfigTest.php b/tests/PHPUnit/Integration/Plugins/PrivacyManagerConfigTest.php
deleted file mode 100644
index fb2ad94a40..0000000000
--- a/tests/PHPUnit/Integration/Plugins/PrivacyManagerConfigTest.php
+++ /dev/null
@@ -1,99 +0,0 @@
-<?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\Option;
-use Piwik\Plugins\PrivacyManager\Config as PrivacyManagerConfig;
-
-/**
- * Class Plugins_SitesManagerTest
- *
- * @group Plugins
- */
-class Plugins_PrivacyManagerConfigTest extends DatabaseTestCase
-{
- /**
- * @var PrivacyManagerConfig
- */
- private $config;
-
- public function setUp()
- {
- parent::setUp();
-
- $this->config = new PrivacyManagerConfig();
- }
-
- public function test_useAnonymizedIpForVisitEnrichment()
- {
- $this->assertTrue($this->config->useAnonymizedIpForVisitEnrichment);
-
- $this->config->useAnonymizedIpForVisitEnrichment = false;
-
- $this->assertFalse($this->config->useAnonymizedIpForVisitEnrichment);
-
- $this->config->useAnonymizedIpForVisitEnrichment = true;
-
- $this->assertTrue($this->config->useAnonymizedIpForVisitEnrichment);
- }
-
- public function test_doNotTrackEnabled()
- {
- $this->assertTrue($this->config->doNotTrackEnabled);
-
- $this->config->doNotTrackEnabled = true;
-
- $this->assertTrue($this->config->doNotTrackEnabled);
-
- $this->config->doNotTrackEnabled = false;
-
- $this->assertFalse($this->config->doNotTrackEnabled);
- }
-
- public function test_ipAnonymizerEnabled()
- {
- $this->assertFalse($this->config->ipAnonymizerEnabled);
-
- $this->config->ipAnonymizerEnabled = true;
-
- $this->assertTrue($this->config->ipAnonymizerEnabled);
- }
-
- public function test_ipAddressMaskLength()
- {
- $this->assertSame(1, $this->config->ipAddressMaskLength);
-
- $this->config->ipAddressMaskLength = '19';
-
- $this->assertSame(19, $this->config->ipAddressMaskLength);
- }
-
- public function test_setTrackerCacheContent()
- {
- $content = $this->config->setTrackerCacheGeneral(array('existingEntry' => 'test'));
-
- $expected = array(
- 'existingEntry' => 'test',
- 'PrivacyManager.ipAddressMaskLength' => 1,
- 'PrivacyManager.ipAnonymizerEnabled' => false,
- 'PrivacyManager.doNotTrackEnabled' => true,
- 'PrivacyManager.useAnonymizedIpForVisitEnrichment' => true,
- );
-
- $this->assertEquals($expected, $content);
- }
-
- public function test_setTrackerCacheContent_ShouldGetValuesFromConfig()
- {
- Option::set('PrivacyManager.ipAddressMaskLength', '232');
-
- $content = $this->config->setTrackerCacheGeneral(array('existingEntry' => 'test'));
-
- $this->assertEquals(232, $content['PrivacyManager.ipAddressMaskLength']);
- }
-
-}
diff --git a/tests/PHPUnit/Integration/Plugins/PrivacyManagerTest.php b/tests/PHPUnit/Integration/Plugins/PrivacyManagerTest.php
deleted file mode 100644
index 7b1836c850..0000000000
--- a/tests/PHPUnit/Integration/Plugins/PrivacyManagerTest.php
+++ /dev/null
@@ -1,83 +0,0 @@
-<?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\Plugins\PrivacyManager\PrivacyManager;
-
-/**
- * Class Plugins_SitesManagerTest
- *
- * @group Plugins
- */
-class Plugins_PrivacyManagerTest extends DatabaseTestCase
-{
- /**
- * @var PrivacyManager
- */
- private $manager;
-
- public function setUp()
- {
- parent::setUp();
-
- $this->manager = new PrivacyManager();
- \Piwik\Option::set('delete_logs_enable', 1);
- \Piwik\Option::set('delete_logs_older_than', 270);
- \Piwik\Option::set('delete_reports_keep_week_reports', 1);
- }
-
- public function test_getPurgeDataSettings_shouldUseOnlyConfigValuesIfUIisDisabled()
- {
- $this->setUIEnabled(false);
-
- $settings = $this->manager->getPurgeDataSettings();
- $expected = $this->getDefaultPurgeSettings();
-
- $this->assertEquals($expected, $settings);
- }
-
- public function test_getPurgeDataSettings_shouldAlsoUseOptionValuesIfUIisEnabled()
- {
- $this->setUIEnabled(true);
-
- $settings = $this->manager->getPurgeDataSettings();
- $expected = $this->getDefaultPurgeSettings();
-
- $expected['delete_logs_enable'] = 1;
- $expected['delete_logs_older_than'] = 270;
- $expected['delete_reports_keep_week_reports'] = 1;
-
- $this->assertEquals($expected, $settings);
- }
-
- private function setUIEnabled($enabled)
- {
- \Piwik\Config::getInstance()->General['enable_delete_old_data_settings_admin'] = $enabled;
- }
-
- private function getDefaultPurgeSettings()
- {
- $expected = array(
- 'delete_logs_enable' => 0,
- 'delete_logs_schedule_lowest_interval' => 7,
- 'delete_logs_older_than' => 180,
- 'delete_logs_max_rows_per_query' => 100000,
- 'enable_auto_database_size_estimate' => 1,
- 'delete_reports_enable' => 0,
- 'delete_reports_older_than' => 12,
- 'delete_reports_keep_basic_metrics' => 1,
- 'delete_reports_keep_day_reports' => 0,
- 'delete_reports_keep_week_reports' => 0,
- 'delete_reports_keep_month_reports' => 1,
- 'delete_reports_keep_year_reports' => 1,
- 'delete_reports_keep_range_reports' => 0,
- 'delete_reports_keep_segment_reports' => 0,
- );
- return $expected;
- }
-
-}
diff --git a/tests/PHPUnit/Integration/Plugins/ScheduledReportsTest.php b/tests/PHPUnit/Integration/Plugins/ScheduledReportsTest.php
deleted file mode 100644
index 676f8f9cf1..0000000000
--- a/tests/PHPUnit/Integration/Plugins/ScheduledReportsTest.php
+++ /dev/null
@@ -1,508 +0,0 @@
-<?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\MobileMessaging\API as APIMobileMessaging;
-use Piwik\Plugins\MobileMessaging\MobileMessaging;
-use Piwik\Plugins\ScheduledReports\API as APIScheduledReports;
-use Piwik\Plugins\ScheduledReports\Menu;
-use Piwik\Plugins\ScheduledReports\Tasks;
-use Piwik\Plugins\ScheduledReports\ScheduledReports;
-use Piwik\Plugins\SitesManager\API as APISitesManager;
-use Piwik\ScheduledTask;
-use Piwik\ScheduledTime\Monthly;
-use Piwik\ScheduledTime;
-use Piwik\Site;
-
-require_once 'ScheduledReports/ScheduledReports.php';
-
-/**
- * Class Plugins_ScheduledReportsTest
- *
- * @group Plugins
- * @group ScheduledReportsTest
- */
-class Plugins_ScheduledReportsTest extends DatabaseTestCase
-{
- private $idSite = 1;
-
- public function setUp()
- {
- parent::setUp();
-
- // setup the access layer
- self::setSuperUser();
- \Piwik\Plugin\Manager::getInstance()->loadPlugins(array('API', 'UserCountry', 'ScheduledReports', 'MobileMessaging'));
- \Piwik\Plugin\Manager::getInstance()->installLoadedPlugins();
-
- APISitesManager::getInstance()->addSite("Test", array("http://piwik.net"));
-
- APISitesManager::getInstance()->addSite("Test", array("http://piwik.net"));
- FakeAccess::setIdSitesView(array($this->idSite, 2));
- APIScheduledReports::$cache = array();
- }
-
- /**
- * @group Plugins
- */
- public function testAddReportGetReports()
- {
- $data = array(
- 'idsite' => $this->idSite,
- 'description' => 'test description"',
- 'type' => 'email',
- 'period' => ScheduledTime::PERIOD_DAY,
- 'hour' => '4',
- 'format' => 'pdf',
- 'reports' => array('UserCountry_getCountry'),
- 'parameters' => array(
- 'displayFormat' => '1',
- 'emailMe' => true,
- 'additionalEmails' => array('test@test.com', 't2@test.com'),
- 'evolutionGraph' => true
- )
- );
-
- $dataWebsiteTwo = $data;
- $dataWebsiteTwo['idsite'] = 2;
- $dataWebsiteTwo['period'] = ScheduledTime::PERIOD_MONTH;
-
- self::addReport($dataWebsiteTwo);
-
- // Testing getReports without parameters
- $tmp = APIScheduledReports::getInstance()->getReports();
- $report = reset($tmp);
- $this->assertReportsEqual($report, $dataWebsiteTwo);
-
- $idReport = self::addReport($data);
-
- // Passing 3 parameters
- $tmp = APIScheduledReports::getInstance()->getReports($this->idSite, $data['period'], $idReport);
- $report = reset($tmp);
- $this->assertReportsEqual($report, $data);
-
- // Passing only idsite
- $tmp = APIScheduledReports::getInstance()->getReports($this->idSite);
- $report = reset($tmp);
- $this->assertReportsEqual($report, $data);
-
- // Passing only period
- $tmp = APIScheduledReports::getInstance()->getReports($idSite = false, $data['period']);
- $report = reset($tmp);
- $this->assertReportsEqual($report, $data);
-
- // Passing only idreport
- $tmp = APIScheduledReports::getInstance()->getReports($idSite = false, $period = false, $idReport);
- $report = reset($tmp);
- $this->assertReportsEqual($report, $data);
- }
-
- /**
- * @group Plugins
- */
- public function testGetReportsIdReportNotFound()
- {
- try {
- APIScheduledReports::getInstance()->getReports($idSite = false, $period = false, $idReport = 1);
- } catch (Exception $e) {
- return;
- }
- $this->fail('Expected exception not raised');
- }
-
- /**
- * @group Plugins
- */
- public function testGetReportsInvalidPermission()
- {
- try {
- APIScheduledReports::getInstance()->getReports(
- $idSite = 44,
- $period = false,
- self::addReport(self::getDailyPDFReportData($this->idSite))
- );
-
- } catch (Exception $e) {
- return;
- }
- $this->fail('Expected exception not raised');
- }
-
- /**
- * @group Plugins
- */
- public function testAddReportInvalidWebsite()
- {
- try {
- self::addReport(self::getDailyPDFReportData(33));
- } catch (Exception $e) {
- return;
- }
- $this->fail('Expected exception not raised');
- }
-
- /**
- * @group Plugins
- */
- public function testAddReportInvalidPeriod()
- {
- try {
- $data = self::getDailyPDFReportData($this->idSite);
- $data['period'] = 'dx';
- self::addReport($data);
- } catch (Exception $e) {
- return;
- }
- $this->fail('Expected exception not raised');
- }
-
- /**
- * @group Plugins
- */
- public function testUpdateReport()
- {
- $idReport = self::addReport(self::getDailyPDFReportData($this->idSite));
- $dataAfter = self::getMonthlyEmailReportData($this->idSite);
-
- self::updateReport($idReport, $dataAfter);
-
- $reports = APIScheduledReports::getInstance()->getReports($idSite = false, $period = false, $idReport);
-
- $this->assertReportsEqual(
- reset($reports),
- $dataAfter
- );
- }
-
- /**
- * @group Plugins
- */
- public function testDeleteReport()
- {
- // Deletes non existing report throws exception
- try {
- APIScheduledReports::getInstance()->deleteReport($idReport = 1);
- $this->fail('Exception not raised');
- } catch (Exception $e) {
- }
-
- $idReport = self::addReport(self::getMonthlyEmailReportData($this->idSite));
- $this->assertEquals(1, count(APIScheduledReports::getInstance()->getReports()));
- APIScheduledReports::getInstance()->deleteReport($idReport);
- $this->assertEquals(0, count(APIScheduledReports::getInstance()->getReports()));
- }
-
- /**
- * @group Plugins
- */
- public function testGetTopMenuTranslationKeyMobileMessagingInactive()
- {
- // unload MobileMessaging plugin
- \Piwik\Plugin\Manager::getInstance()->loadPlugins(array('ScheduledReports'));
-
- $pdfReportPlugin = new Menu();
- $this->assertEquals(
- Menu::PDF_REPORTS_TOP_MENU_TRANSLATION_KEY,
- $pdfReportPlugin->getTopMenuTranslationKey()
- );
- }
-
- /**
- * @group Plugins
- */
- public function testGetTopMenuTranslationKeyUserIsAnonymous()
- {
- $anonymousAccess = new FakeAccess;
- FakeAccess::$identity = 'anonymous';
- Access::setSingletonInstance($anonymousAccess);
-
- $pdfReportPlugin = new Menu();
- $this->assertEquals(
- Menu::MOBILE_MESSAGING_TOP_MENU_TRANSLATION_KEY,
- $pdfReportPlugin->getTopMenuTranslationKey()
- );
- }
-
- /**
- * top menu should display 'Email & SMS reports' when the user has set-up a valid mobile provider account
- * even though there is no sms reports configured
- *
- * @group Plugins
- */
- public function testGetTopMenuTranslationKeyNoReportMobileAccountOK()
- {
- // set mobile provider account
- self::setSuperUser();
- APIMobileMessaging::getInstance()->setSMSAPICredential('StubbedProvider', '');
-
- $pdfReportPlugin = new Menu();
- $this->assertEquals(
- Menu::MOBILE_MESSAGING_TOP_MENU_TRANSLATION_KEY,
- $pdfReportPlugin->getTopMenuTranslationKey()
- );
- }
-
- /**
- * top menu should display 'Email reports' when the user has not set-up a valid mobile provider account
- * and no reports at all have been configured
- *
- * @group Plugins
- */
- public function testGetTopMenuTranslationKeyNoReportMobileAccountKO()
- {
- $pdfReportPlugin = new Menu();
- $this->assertEquals(
- Menu::PDF_REPORTS_TOP_MENU_TRANSLATION_KEY,
- $pdfReportPlugin->getTopMenuTranslationKey()
- );
- }
-
- /**
- * top menu should display 'Email & SMS reports' if there is at least one sms report
- * whatever the status of the mobile provider account
- *
- * @group Plugins
- */
- public function testGetTopMenuTranslationKeyOneSMSReportMobileAccountKO()
- {
- APIScheduledReports::getInstance()->addReport(
- 1,
- '',
- ScheduledTime::PERIOD_DAY,
- 0,
- MobileMessaging::MOBILE_TYPE,
- MobileMessaging::SMS_FORMAT,
- array(),
- array(
- MobileMessaging::PHONE_NUMBERS_PARAMETER => array()
- )
- );
-
- $pdfReportPlugin = new Menu();
- $this->assertEquals(
- Menu::MOBILE_MESSAGING_TOP_MENU_TRANSLATION_KEY,
- $pdfReportPlugin->getTopMenuTranslationKey()
- );
- }
-
- /**
- * top menu should display 'Email reports' if there are no SMS reports and at least one email report
- * whatever the status of the mobile provider account
- *
- * @group Plugins
- */
- public function testGetTopMenuTranslationKeyNoSMSReportAccountOK()
- {
- // set mobile provider account
- self::setSuperUser();
- APIMobileMessaging::getInstance()->setSMSAPICredential('StubbedProvider', '');
-
- self::addReport(self::getMonthlyEmailReportData($this->idSite));
-
- $pdfReportPlugin = new Menu();
- $this->assertEquals(
- Menu::PDF_REPORTS_TOP_MENU_TRANSLATION_KEY,
- $pdfReportPlugin->getTopMenuTranslationKey()
- );
- }
-
- /**
- * @group Plugins
- */
- public function testGetScheduledTasks()
- {
- // stub API to control getReports() return values
- $report1 = self::getDailyPDFReportData($this->idSite);
- $report1['idreport'] = 1;
- $report1['hour'] = 0;
- $report1['deleted'] = 0;
-
- $report2 = self::getMonthlyEmailReportData($this->idSite);
- $report2['idreport'] = 2;
- $report2['idsite'] = 2;
- $report2['hour'] = 0;
- $report2['deleted'] = 0;
-
- $report3 = self::getMonthlyEmailReportData($this->idSite);
- $report3['idreport'] = 3;
- $report3['deleted'] = 1; // should not be scheduled
-
- $report4 = self::getMonthlyEmailReportData($this->idSite);
- $report4['idreport'] = 4;
- $report4['idsite'] = 1;
- $report4['hour'] = 8;
- $report4['deleted'] = 0;
-
- $report5 = self::getMonthlyEmailReportData($this->idSite);
- $report5['idreport'] = 5;
- $report5['idsite'] = 2;
- $report5['hour'] = 8;
- $report5['deleted'] = 0;
-
- // test no exception is raised when a scheduled report is set to never send
- $report6 = self::getMonthlyEmailReportData($this->idSite);
- $report6['idreport'] = 6;
- $report6['period'] = ScheduledTime::PERIOD_NEVER;
- $report6['deleted'] = 0;
-
- $stubbedAPIScheduledReports = $this->getMock('\\Piwik\\Plugins\\ScheduledReports\\API', array('getReports', 'getInstance'), $arguments = array(), $mockClassName = '', $callOriginalConstructor = false);
- $stubbedAPIScheduledReports->expects($this->any())->method('getReports')->will($this->returnValue(
- array($report1, $report2, $report3, $report4, $report5, $report6))
- );
- \Piwik\Plugins\ScheduledReports\API::setSingletonInstance($stubbedAPIScheduledReports);
-
- // initialize sites 1 and 2
- Site::setSites( array(
- 1 => array('timezone' => 'Europe/Paris'),
- 2 => array('timezone' => 'UTC-6.5'),
- ));
-
- // expected tasks
- $scheduleTask1 = ScheduledTime::factory('daily');
- $scheduleTask1->setHour(0); // paris is UTC-1, period ends at 23h UTC
- $scheduleTask1->setTimezone('Europe/Paris');
-
- $scheduleTask2 = new Monthly();
- $scheduleTask2->setHour(0); // site is UTC-6.5, period ends at 6h30 UTC, smallest resolution is hour
- $scheduleTask2->setTimezone('UTC-6.5');
-
- $scheduleTask3 = new Monthly();
- $scheduleTask3->setHour(8); // paris is UTC-1, configured to be sent at 8h
- $scheduleTask3->setTimezone('Europe/Paris');
-
- $scheduleTask4 = new Monthly();
- $scheduleTask4->setHour(8); // site is UTC-6.5, configured to be sent at 8h
- $scheduleTask4->setTimezone('UTC-6.5');
-
- $expectedTasks = array(
- new ScheduledTask (APIScheduledReports::getInstance(), 'sendReport', 1, $scheduleTask1),
- new ScheduledTask (APIScheduledReports::getInstance(), 'sendReport', 2, $scheduleTask2),
- new ScheduledTask (APIScheduledReports::getInstance(), 'sendReport', 4, $scheduleTask3),
- new ScheduledTask (APIScheduledReports::getInstance(), 'sendReport', 5, $scheduleTask4),
- );
-
- $pdfReportPlugin = new Tasks();
- $pdfReportPlugin->schedule();
- $tasks = $pdfReportPlugin->getScheduledTasks();
- $this->assertEquals($expectedTasks, $tasks);
-
- \Piwik\Plugins\ScheduledReports\API::unsetInstance();
-
- }
-
- /**
- * Dataprovider for testGetReportSubjectAndReportTitle
- */
- public function getGetReportSubjectAndReportTitleTestCases()
- {
- return array(
- array('<Piwik.org>', '<Piwik.org>', '<Piwik.org>', array('UserSettings_getBrowserType')),
- array('Piwik.org', 'Piwik.org', 'Piwik.org', array('MultiSites_getAll', 'UserSettings_getBrowserType')),
- array('General_MultiSitesSummary', 'General_MultiSitesSummary', 'Piwik.org', array('MultiSites_getAll')),
- );
- }
-
- /**
- * @group Plugins
- *
- * @dataProvider getGetReportSubjectAndReportTitleTestCases
- */
- public function testGetReportSubjectAndReportTitle($expectedReportSubject, $expectedReportTitle, $websiteName, $reports)
- {
- $getReportSubjectAndReportTitle = new ReflectionMethod(
- '\\Piwik\\Plugins\\ScheduledReports\\API', 'getReportSubjectAndReportTitle'
- );
- $getReportSubjectAndReportTitle->setAccessible(true);
-
- list($reportSubject, $reportTitle) = $getReportSubjectAndReportTitle->invoke( APIScheduledReports::getInstance(), $websiteName, $reports);
- $this->assertEquals($expectedReportSubject, $reportSubject);
- $this->assertEquals($expectedReportTitle, $reportTitle);
- }
-
- private function assertReportsEqual($report, $data)
- {
- foreach ($data as $key => $value) {
- if ($key == 'description') $value = substr($value, 0, 250);
- $this->assertEquals($value, $report[$key], "Error for $key for report " . var_export($report, true) . " and data " . var_export($data, true));
- }
- }
-
- private static function addReport($data)
- {
- $idReport = APIScheduledReports::getInstance()->addReport(
- $data['idsite'],
- $data['description'],
- $data['period'],
- $data['hour'],
- $data['type'],
- $data['format'],
- $data['reports'],
- $data['parameters']
- );
- return $idReport;
- }
-
- private static function getDailyPDFReportData($idSite)
- {
- return array(
- 'idsite' => $idSite,
- 'description' => 'test description"',
- 'period' => ScheduledTime::PERIOD_DAY,
- 'hour' => '7',
- 'type' => 'email',
- 'format' => 'pdf',
- 'reports' => array('UserCountry_getCountry'),
- 'parameters' => array(
- 'displayFormat' => '1',
- 'emailMe' => true,
- 'additionalEmails' => array('test@test.com', 't2@test.com'),
- 'evolutionGraph' => false
- )
- );
- }
-
- private static function getMonthlyEmailReportData($idSite)
- {
- return array(
- 'idsite' => $idSite,
- 'description' => 'very very long and possibly truncated description. very very long and possibly truncated description. very very long and possibly truncated description. very very long and possibly truncated description. very very long and possibly truncated description. ',
- 'period' => ScheduledTime::PERIOD_MONTH,
- 'hour' => '0',
- 'type' => 'email',
- 'format' => 'pdf',
- 'reports' => array('UserCountry_getContinent'),
- 'parameters' => array(
- 'displayFormat' => '1',
- 'emailMe' => false,
- 'additionalEmails' => array('blabla@ec.fr'),
- 'evolutionGraph' => false
- )
- );
- }
-
- private static function updateReport($idReport, $data)
- {
- $idReport = APIScheduledReports::getInstance()->updateReport(
- $idReport,
- $data['idsite'],
- $data['description'],
- $data['period'],
- $data['hour'],
- $data['type'],
- $data['format'],
- $data['reports'],
- $data['parameters']);
- return $idReport;
- }
-
- private static function setSuperUser()
- {
- $pseudoMockAccess = new FakeAccess;
- FakeAccess::$superUser = true;
- Access::setSingletonInstance($pseudoMockAccess);
- }
-}
diff --git a/tests/PHPUnit/Integration/Plugins/SegmentEditorTest.php b/tests/PHPUnit/Integration/Plugins/SegmentEditorTest.php
deleted file mode 100644
index 666b042bad..0000000000
--- a/tests/PHPUnit/Integration/Plugins/SegmentEditorTest.php
+++ /dev/null
@@ -1,204 +0,0 @@
-<?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\Date;
-use Piwik\Piwik;
-use Piwik\Plugins\SegmentEditor\API;
-use Piwik\Plugins\SegmentEditor\Model;
-use Piwik\Plugins\SitesManager\API as APISitesManager;
-
-/**
- * Class Plugins_SegmentEditorTest
- *
- * @group Plugins
- */
-class Plugins_SegmentEditorTest extends DatabaseTestCase
-{
- public function setUp()
- {
- parent::setUp();
-
- \Piwik\Plugin\Manager::getInstance()->loadPlugin('SegmentEditor');
- \Piwik\Plugin\Manager::getInstance()->installLoadedPlugins();
-
- // setup the access layer
- $pseudoMockAccess = new FakeAccess;
- FakeAccess::setIdSitesView(array(1, 2));
- FakeAccess::setIdSitesAdmin(array(3, 4));
-
- //finally we set the user as a Super User by default
- FakeAccess::$superUser = true;
- FakeAccess::$superUserLogin = 'superusertest';
- Access::setSingletonInstance($pseudoMockAccess);
-
- APISitesManager::getInstance()->addSite('test', 'http://example.org');
- }
-
- /**
- * @group Plugins
- */
- public function testAddInvalidSegment_ShouldThrow()
- {
- try {
- API::getInstance()->add('name', 'test==test2');
- $this->fail("Exception not raised.");
- } catch (Exception $expected) {
- }
- try {
- API::getInstance()->add('name', 'test');
- $this->fail("Exception not raised.");
- } catch (Exception $expected) {
- }
- }
-
- /**
- * @group Plugins
- */
- public function test_AddAndGet_SimpleSegment()
- {
- $name = 'name';
- $definition = 'searches>1,visitIp!=127.0.0.1';
- $idSegment = API::getInstance()->add($name, $definition);
- $this->assertEquals($idSegment, 1);
- $segment = API::getInstance()->get($idSegment);
- unset($segment['ts_created']);
- $expected = array(
- 'idsegment' => 1,
- 'name' => $name,
- 'definition' => $definition,
- 'login' => 'superUserLogin',
- 'enable_all_users' => '0',
- 'enable_only_idsite' => '0',
- 'auto_archive' => '0',
- 'ts_last_edit' => null,
- 'deleted' => '0',
- );
-
- $this->assertEquals($segment, $expected);
- }
-
- /**
- * @group Plugins
- */
- public function test_AddAndGet_AnotherSegment()
- {
- $name = 'name';
- $definition = 'searches>1,visitIp!=127.0.0.1';
- $idSegment = API::getInstance()->add($name, $definition, $idSite = 1, $autoArchive = 1, $enabledAllUsers = 1);
- $this->assertEquals($idSegment, 1);
-
- // Testing get()
- $segment = API::getInstance()->get($idSegment);
- $expected = array(
- 'idsegment' => '1',
- 'name' => $name,
- 'definition' => $definition,
- 'login' => 'superUserLogin',
- 'enable_all_users' => '1',
- 'enable_only_idsite' => '1',
- 'auto_archive' => '1',
- 'ts_last_edit' => null,
- 'deleted' => '0',
- );
- unset($segment['ts_created']);
- $this->assertEquals($segment, $expected);
-
- // There is a segment to process for this particular site
- $model = new Model();
- $segments = $model->getSegmentsToAutoArchive($idSite);
- unset($segments[0]['ts_created']);
- $this->assertEquals($segments, array($expected));
-
- // There is no segment to process for a non existing site
- try {
- $segments = $model->getSegmentsToAutoArchive(33);
- $this->fail();
- } catch(Exception $e) {
- // expected
- }
-
- // There is no segment to process across all sites
- $segments = $model->getSegmentsToAutoArchive($idSite = false);
- $this->assertEquals($segments, array());
- }
-
- /**
- * @group Plugins
- */
- public function test_UpdateSegment()
- {
- $name = 'name"';
- $definition = 'searches>1,visitIp!=127.0.0.1';
- $nameSegment1 = 'hello';
- $idSegment1 = API::getInstance()->add($nameSegment1, 'searches==0', $idSite = 1, $autoArchive = 1, $enabledAllUsers = 1);
- $idSegment2 = API::getInstance()->add($name, $definition, $idSite = 1, $autoArchive = 1, $enabledAllUsers = 1);
-
- $updatedSegment = array(
- 'idsegment' => $idSegment2,
- 'name' => 'NEW name',
- 'definition' => 'searches==0',
- 'enable_only_idsite' => '0',
- 'enable_all_users' => '0',
- 'auto_archive' => '0',
- 'ts_last_edit' => Date::now()->getDatetime(),
- 'ts_created' => Date::now()->getDatetime(),
- 'login' => Piwik::getCurrentUserLogin(),
- 'deleted' => '0',
- );
- API::getInstance()->update($idSegment2,
- $updatedSegment['name'],
- $updatedSegment['definition'],
- $updatedSegment['enable_only_idsite'],
- $updatedSegment['auto_archive'],
- $updatedSegment['enable_all_users']
- );
-
- $newSegment = API::getInstance()->get($idSegment2);
-
- // avoid test failures for when ts_created/ts_last_edit are different by between 1/2 secs
- $this->removeSecondsFromSegmentInfo($updatedSegment);
- $this->removeSecondsFromSegmentInfo($newSegment);
-
- $this->assertEquals($newSegment, $updatedSegment);
-
- // Check the other segmenet was not updated
- $newSegment = API::getInstance()->get($idSegment1);
- $this->assertEquals($newSegment['name'], $nameSegment1);
- }
-
- /**
- * @group Plugins
- */
- public function test_deleteSegment()
- {
- $idSegment1 = API::getInstance()->add('name 1', 'searches==0', $idSite = 1, $autoArchive = 1, $enabledAllUsers = 1);
- $idSegment2 = API::getInstance()->add('name 2', 'searches>1,visitIp!=127.0.0.1', $idSite = 1, $autoArchive = 1, $enabledAllUsers = 1);
-
- $deleted = API::getInstance()->delete($idSegment2);
- $this->assertTrue($deleted);
- try {
- API::getInstance()->get($idSegment2);
- $this->fail("getting deleted segment should have failed");
- } catch(Exception $e) {
- // expected
- }
-
- // and this should work
- API::getInstance()->get($idSegment1);
- }
-
- private function removeSecondsFromSegmentInfo(&$segmentInfo)
- {
- $timestampProperties = array('ts_last_edit', 'ts_created');
- foreach ($timestampProperties as $propertyName) {
- if (isset($segmentInfo[$propertyName])) {
- $segmentInfo[$propertyName] = substr($segmentInfo[$propertyName], 0, strlen($segmentInfo[$propertyName] - 2));
- }
- }
- }
-}
diff --git a/tests/PHPUnit/Integration/Plugins/SitesManagerTest.php b/tests/PHPUnit/Integration/Plugins/SitesManagerTest.php
deleted file mode 100644
index ff5b68989f..0000000000
--- a/tests/PHPUnit/Integration/Plugins/SitesManagerTest.php
+++ /dev/null
@@ -1,993 +0,0 @@
-<?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;
-use Piwik\Plugins\UsersManager\API as APIUsersManager;
-use Piwik\Site;
-
-/**
- * Class Plugins_SitesManagerTest
- *
- * @group Plugins
- */
-class Plugins_SitesManagerTest extends DatabaseTestCase
-{
- public function setUp()
- {
- parent::setUp();
-
- // setup the access layer
- $pseudoMockAccess = new FakeAccess;
- FakeAccess::$superUser = true;
- Access::setSingletonInstance($pseudoMockAccess);
- }
-
- /**
- * empty name -> exception
- *
- * @group Plugins
- */
- public function testAddSiteEmptyName()
- {
- try {
- API::getInstance()->addSite("", array("http://piwik.net"));
- } catch (Exception $e) {
- return;
- }
- $this->fail('Expected exception not raised');
- }
-
- /**
- * DataProvider for testAddSiteWrongUrls
- */
- public function getInvalidUrlData()
- {
- return array(
- array(array()), // no urls
- array(array("")),
- array(""),
- array("httpww://piwik.net"),
- array("httpww://piwik.net/gqg~#"),
- );
- }
-
- /**
- * wrong urls -> exception
- *
- * @dataProvider getInvalidUrlData
- * @group Plugins
- */
- public function testAddSiteWrongUrls($url)
- {
- try {
- API::getInstance()->addSite("name", $url);
- } catch (Exception $e) {
- return;
- }
- $this->fail('Expected exception not raised');
- }
-
- /**
- * Test with valid IPs
- *
- * @group Plugins
- */
- public function testAddSiteExcludedIpsAndtimezoneAndCurrencyAndExcludedQueryParametersValid()
- {
- $ips = '1.2.3.4,1.1.1.*,1.2.*.*,1.*.*.*';
- $timezone = 'Europe/Paris';
- $currency = 'EUR';
- $excludedQueryParameters = 'p1,P2, P33333';
- $expectedExcludedQueryParameters = 'p1,P2,P33333';
- $excludedUserAgents = " p1,P2, \nP3333 ";
- $expectedExcludedUserAgents = "p1,P2,P3333";
- $expectedWebsiteType = 'mobile-\'app';
- $keepUrlFragment = 1;
- $idsite = API::getInstance()->addSite("name", "http://piwik.net/", $ecommerce = 1,
- $siteSearch = 1, $searchKeywordParameters = 'search,param', $searchCategoryParameters = 'cat,category',
- $ips, $excludedQueryParameters, $timezone, $currency, $group = null, $startDate = null, $excludedUserAgents,
- $keepUrlFragment, $expectedWebsiteType);
- $siteInfo = API::getInstance()->getSiteFromId($idsite);
- $this->assertEquals($ips, $siteInfo['excluded_ips']);
- $this->assertEquals($timezone, $siteInfo['timezone']);
- $this->assertEquals($currency, $siteInfo['currency']);
- $this->assertEquals($ecommerce, $siteInfo['ecommerce']);
- $this->assertTrue(Site::isEcommerceEnabledFor($idsite));
- $this->assertEquals($siteSearch, $siteInfo['sitesearch']);
- $this->assertTrue(Site::isSiteSearchEnabledFor($idsite));
- $this->assertEquals($expectedWebsiteType, $siteInfo['type']);
- $this->assertEquals($expectedWebsiteType, Site::getTypeFor($idsite));
-
- $this->assertEquals($searchKeywordParameters, $siteInfo['sitesearch_keyword_parameters']);
- $this->assertEquals($searchCategoryParameters, $siteInfo['sitesearch_category_parameters']);
- $this->assertEquals($expectedExcludedQueryParameters, $siteInfo['excluded_parameters']);
- $this->assertEquals($expectedExcludedUserAgents, $siteInfo['excluded_user_agents']);
- }
-
- /**
- * dataProvider for testAddSiteExcludedIpsNotValid
- */
- public function getInvalidIPsData()
- {
- return array(
- array('35817587341'),
- array('ieagieha'),
- array('1.2.3'),
- array('*.1.1.1'),
- array('*.*.1.1'),
- array('*.*.*.1'),
- array('1.1.1.1.1'),
- );
- }
-
- /**
- * Test with invalid IPs
- *
- * @dataProvider getInvalidIPsData
- * @group Plugins
- */
- public function testAddSiteExcludedIpsNotValid($ip)
- {
- try {
- API::getInstance()->addSite("name", "http://piwik.net/", $ecommerce = 0,
- $siteSearch = 1, $searchKeywordParameters = null, $searchCategoryParameters = null, $ip);
- } catch (Exception $e) {
- return;
- }
- $this->fail('Expected exception not raised');
- }
-
- /**
- * one url -> one main_url and nothing inserted as alias urls
- *
- * @group Plugins
- */
- public function testAddSiteOneUrl()
- {
- $url = "http://piwik.net/";
- $urlOK = "http://piwik.net";
- $idsite = API::getInstance()->addSite("name", $url);
- $this->assertInternalType(PHPUnit_Framework_Constraint_IsType::TYPE_INT, $idsite);
-
- $siteInfo = API::getInstance()->getSiteFromId($idsite);
- $this->assertEquals($urlOK, $siteInfo['main_url']);
- $this->assertEquals(date('Y-m-d'), date('Y-m-d', strtotime($siteInfo['ts_created'])));
-
- $siteUrls = API::getInstance()->getSiteUrlsFromId($idsite);
- $this->assertEquals(1, count($siteUrls));
- }
-
- /**
- * several urls -> one main_url and others as alias urls
- *
- * @group Plugins
- */
- public function testAddSiteSeveralUrls()
- {
- $urls = array("http://piwik.net/", "http://piwik.com", "https://piwik.net/test/");
- $urlsOK = array("http://piwik.net", "http://piwik.com", "https://piwik.net/test");
- $idsite = API::getInstance()->addSite("super website", $urls);
- $this->assertInternalType(PHPUnit_Framework_Constraint_IsType::TYPE_INT, $idsite);
-
- $siteInfo = API::getInstance()->getSiteFromId($idsite);
- $this->assertEquals($urlsOK[0], $siteInfo['main_url']);
-
- $siteUrls = API::getInstance()->getSiteUrlsFromId($idsite);
- $this->assertEquals($urlsOK, $siteUrls);
- }
-
- /**
- * strange name
- *
- * @group Plugins
- */
- public function testAddSiteStrangeName()
- {
- $name = "supertest(); ~@@()''!£\$'%%^'!£ போ";
- $idsite = API::getInstance()->addSite($name, "http://piwik.net");
- $this->assertInternalType(PHPUnit_Framework_Constraint_IsType::TYPE_INT, $idsite);
-
- $siteInfo = API::getInstance()->getSiteFromId($idsite);
- $this->assertEquals($name, $siteInfo['name']);
-
- }
-
- /**
- * adds a site
- * use by several other unit tests
- */
- protected function _addSite()
- {
- $name = "website ";
- $idsite = API::getInstance()->addSite($name, array("http://piwik.net", "http://piwik.com/test/"));
- $this->assertInternalType(PHPUnit_Framework_Constraint_IsType::TYPE_INT, $idsite);
-
- $siteInfo = API::getInstance()->getSiteFromId($idsite);
- $this->assertEquals($name, $siteInfo['name']);
- $this->assertEquals("http://piwik.net", $siteInfo['main_url']);
-
- $siteUrls = API::getInstance()->getSiteUrlsFromId($idsite);
- $this->assertEquals(array("http://piwik.net", "http://piwik.com/test"), $siteUrls);
-
- return $idsite;
- }
-
- /**
- * no duplicate -> all the urls are saved
- *
- * @group Plugins
- */
- public function testAddSiteUrlsnoDuplicate()
- {
- $idsite = $this->_addSite();
-
- $siteUrlsBefore = API::getInstance()->getSiteUrlsFromId($idsite);
-
- $toAdd = array("http://piwik1.net",
- "http://piwik2.net",
- "http://piwik3.net/test/",
- "http://localhost/test",
- "http://localho5.st/test",
- "http://l42578gqege.f4",
- "http://super.com/test/test/atqata675675/te"
- );
- $toAddValid = array("http://piwik1.net",
- "http://piwik2.net",
- "http://piwik3.net/test",
- "http://localhost/test",
- "http://localho5.st/test",
- "http://l42578gqege.f4",
- "http://super.com/test/test/atqata675675/te");
-
- $insertedUrls = API::getInstance()->addSiteAliasUrls($idsite, $toAdd);
- $this->assertEquals(count($toAdd), $insertedUrls);
-
- $siteUrlsAfter = API::getInstance()->getSiteUrlsFromId($idsite);
-
- $shouldHave = array_merge($siteUrlsBefore, $toAddValid);
- sort($shouldHave);
-
- sort($siteUrlsAfter);
-
- $this->assertEquals($shouldHave, $siteUrlsAfter);
- }
-
- /**
- * duplicate -> don't save the already existing URLs
- *
- * @group Plugins
- */
- public function testAddSiteUrlsDuplicate()
- {
- $idsite = $this->_addSite();
-
- $siteUrlsBefore = API::getInstance()->getSiteUrlsFromId($idsite);
-
- $toAdd = array_merge($siteUrlsBefore, array("http://piwik1.net", "http://piwik2.net"));
-
- $insertedUrls = API::getInstance()->addSiteAliasUrls($idsite, $toAdd);
- $this->assertEquals(count($toAdd) - count($siteUrlsBefore), $insertedUrls);
-
- $siteUrlsAfter = API::getInstance()->getSiteUrlsFromId($idsite);
-
- $shouldHave = $toAdd;
- sort($shouldHave);
-
- sort($siteUrlsAfter);
-
- $this->assertEquals($shouldHave, $siteUrlsAfter);
- }
-
- /**
- * case empty array => nothing happens
- *
- * @group Plugins
- */
- public function testAddSiteUrlsNoUrlsToAdd1()
- {
- $idsite = $this->_addSite();
-
- $siteUrlsBefore = API::getInstance()->getSiteUrlsFromId($idsite);
-
- $toAdd = array();
-
- $insertedUrls = API::getInstance()->addSiteAliasUrls($idsite, $toAdd);
- $this->assertEquals(count($toAdd), $insertedUrls);
-
- $siteUrlsAfter = API::getInstance()->getSiteUrlsFromId($idsite);
-
- $shouldHave = $siteUrlsBefore;
- sort($shouldHave);
-
- sort($siteUrlsAfter);
-
- $this->assertEquals($shouldHave, $siteUrlsAfter);
- }
-
- /**
- * case array only duplicate => nothing happens
- *
- * @group Plugins
- */
- public function testAddSiteUrlsNoUrlsToAdd2()
- {
- $idsite = $this->_addSite();
-
- $siteUrlsBefore = API::getInstance()->getSiteUrlsFromId($idsite);
-
- $toAdd = $siteUrlsBefore;
-
- $insertedUrls = API::getInstance()->addSiteAliasUrls($idsite, $toAdd);
- $this->assertEquals(0, $insertedUrls);
-
- $siteUrlsAfter = API::getInstance()->getSiteUrlsFromId($idsite);
-
- $shouldHave = $siteUrlsBefore;
- sort($shouldHave);
-
- sort($siteUrlsAfter);
-
- $this->assertEquals($shouldHave, $siteUrlsAfter);
- }
-
- /**
- * wrong format urls => exception
- *
- * @group Plugins
- */
- public function testAddSiteUrlsWrongUrlsFormat3()
- {
- try {
- $idsite = $this->_addSite();
- $toAdd = array("http:mpigeq");
- API::getInstance()->addSiteAliasUrls($idsite, $toAdd);
- } catch (Exception $e) {
- return;
- }
- $this->fail('Expected exception not raised');
- }
-
- /**
- * wrong idsite => no exception because simply no access to this resource
- *
- * @group Plugins
- */
- public function testAddSiteUrlsWrongIdSite1()
- {
- try {
- $toAdd = array("http://pigeq.com/test");
- API::getInstance()->addSiteAliasUrls(-1, $toAdd);
- } catch (Exception $e) {
- return;
- }
- $this->fail('Expected exception not raised');
- }
-
- /**
- * wrong idsite => exception
- *
- * @group Plugins
- */
- public function testAddSiteUrlsWrongIdSite2()
- {
- try {
- $toAdd = array("http://pigeq.com/test");
- API::getInstance()->addSiteAliasUrls(155, $toAdd);
- } catch (Exception $e) {
- return;
- }
- $this->fail('Expected exception not raised');
- }
-
- /**
- * no Id -> empty array
- *
- * @group Plugins
- */
- public function testGetAllSitesIdNoId()
- {
- $ids = API::getInstance()->getAllSitesId();
- $this->assertEquals(array(), $ids);
- }
-
- /**
- * several Id -> normal array
- *
- * @group Plugins
- */
- public function testGetAllSitesIdSeveralId()
- {
- $name = "tetq";
- $idsites = array(
- API::getInstance()->addSite($name, array("http://piwik.net", "http://piwik.com/test/")),
- API::getInstance()->addSite($name, array("http://piwik.net", "http://piwik.com/test/")),
- API::getInstance()->addSite($name, array("http://piwik.net", "http://piwik.com/test/")),
- API::getInstance()->addSite($name, array("http://piwik.net", "http://piwik.com/test/")),
- API::getInstance()->addSite($name, array("http://piwik.net", "http://piwik.com/test/")),
- );
-
- $ids = API::getInstance()->getAllSitesId();
- $this->assertEquals($idsites, $ids);
- }
-
- /**
- * wrong id => exception
- *
- * @group Plugins
- */
- public function testGetSiteFromIdWrongId1()
- {
- try {
- API::getInstance()->getSiteFromId(0);
- } catch (Exception $e) {
- return;
- }
- $this->fail('Expected exception not raised');
- }
-
- /**
- * wrong id => exception
- *
- * @group Plugins
- */
- public function testGetSiteFromIdWrongId2()
- {
- try {
- API::getInstance()->getSiteFromId("x1");
- } catch (Exception $e) {
- return;
- }
- $this->fail('Expected exception not raised');
- }
-
- /**
- * wrong id : no access => exception
- *
- * @group Plugins
- */
- public function testGetSiteFromIdWrongId3()
- {
- $idsite = API::getInstance()->addSite("site", array("http://piwik.net", "http://piwik.com/test/"));
- $this->assertEquals(1, $idsite);
-
- // set noaccess to site 1
- FakeAccess::setIdSitesView(array(2));
- FakeAccess::setIdSitesAdmin(array());
-
- try {
- API::getInstance()->getSiteFromId(1);
- } catch (Exception $e) {
- return;
- }
- $this->fail('Expected exception not raised');
- }
-
- /**
- * normal case
- *
- * @group Plugins
- */
- public function testGetSiteFromIdNormalId()
- {
- $name = "website ''";
- $idsite = API::getInstance()->addSite($name, array("http://piwik.net", "http://piwik.com/test/"));
- $this->assertInternalType(PHPUnit_Framework_Constraint_IsType::TYPE_INT, $idsite);
-
- $siteInfo = API::getInstance()->getSiteFromId($idsite);
- $this->assertEquals($name, $siteInfo['name']);
- $this->assertEquals("http://piwik.net", $siteInfo['main_url']);
- }
-
- /**
- * there is no admin site available -> array()
- *
- * @group Plugins
- */
- public function testGetSitesWithAdminAccessNoResult()
- {
- FakeAccess::setIdSitesAdmin(array());
-
- $sites = API::getInstance()->getSitesWithAdminAccess();
- $this->assertEquals(array(), $sites);
- }
-
- /**
- * normal case, admin and view and noaccess website => return only admin
- *
- * @group Plugins
- */
- public function testGetSitesWithAdminAccess()
- {
- API::getInstance()->addSite("site1", array("http://piwik.net", "http://piwik.com/test/"));
- API::getInstance()->addSite("site2", array("http://piwik.com/test/"));
- API::getInstance()->addSite("site3", array("http://piwik.org"));
-
- $resultWanted = array(
- 0 => array("idsite" => 1, "name" => "site1", "main_url" => "http://piwik.net", "ecommerce" => 0, "excluded_ips" => "", 'sitesearch' => 1, 'sitesearch_keyword_parameters' => '', 'sitesearch_category_parameters' => '', 'excluded_parameters' => '', 'excluded_user_agents' => '', 'timezone' => 'UTC', 'currency' => 'USD', 'group' => '', 'keep_url_fragment' => 0, 'type' => 'website'),
- 1 => array("idsite" => 3, "name" => "site3", "main_url" => "http://piwik.org", "ecommerce" => 0, "excluded_ips" => "", 'sitesearch' => 1, 'sitesearch_keyword_parameters' => '', 'sitesearch_category_parameters' => '', 'excluded_parameters' => '', 'excluded_user_agents' => '', 'timezone' => 'UTC', 'currency' => 'USD', 'group' => '', 'keep_url_fragment' => 0, 'type' => 'website'),
- );
-
- FakeAccess::setIdSitesAdmin(array(1, 3));
-
- $sites = API::getInstance()->getSitesWithAdminAccess();
-
- // we dont test the ts_created
- unset($sites[0]['ts_created']);
- unset($sites[1]['ts_created']);
- $this->assertEquals($resultWanted, $sites);
- }
-
- /**
- * there is no admin site available -> array()
- *
- * @group Plugins
- */
- public function testGetSitesWithViewAccessNoResult()
- {
- FakeAccess::setIdSitesView(array());
- FakeAccess::setIdSitesAdmin(array());
-
- $sites = API::getInstance()->getSitesWithViewAccess();
- $this->assertEquals(array(), $sites);
- }
-
- /**
- * normal case, admin and view and noaccess website => return only admin
- *
- * @group Plugins
- */
- public function testGetSitesWithViewAccess()
- {
- API::getInstance()->addSite("site1", array("http://piwik.net", "http://piwik.com/test/"));
- API::getInstance()->addSite("site2", array("http://piwik.com/test/"));
- API::getInstance()->addSite("site3", array("http://piwik.org"));
-
- $resultWanted = array(
- 0 => array("idsite" => 1, "name" => "site1", "main_url" => "http://piwik.net", "ecommerce" => 0, 'sitesearch' => 1, 'sitesearch_keyword_parameters' => '', 'sitesearch_category_parameters' => '', "excluded_ips" => "", 'excluded_parameters' => '', 'excluded_user_agents' => '', 'timezone' => 'UTC', 'currency' => 'USD', 'group' => '', 'keep_url_fragment' => 0, 'type' => 'website'),
- 1 => array("idsite" => 3, "name" => "site3", "main_url" => "http://piwik.org", "ecommerce" => 0, 'sitesearch' => 1, 'sitesearch_keyword_parameters' => '', 'sitesearch_category_parameters' => '', "excluded_ips" => "", 'excluded_parameters' => '', 'excluded_user_agents' => '', 'timezone' => 'UTC', 'currency' => 'USD', 'group' => '', 'keep_url_fragment' => 0, 'type' => 'website'),
- );
-
- FakeAccess::setIdSitesView(array(1, 3));
- FakeAccess::setIdSitesAdmin(array());
-
- $sites = API::getInstance()->getSitesWithViewAccess();
- // we dont test the ts_created
- unset($sites[0]['ts_created']);
- unset($sites[1]['ts_created']);
- $this->assertEquals($resultWanted, $sites);
- }
-
- /**
- * there is no admin site available -> array()
- *
- * @group Plugins
- */
- public function testGetSitesWithAtLeastViewAccessNoResult()
- {
- FakeAccess::setIdSitesView(array());
- FakeAccess::setIdSitesAdmin(array());
-
- $sites = API::getInstance()->getSitesWithAtLeastViewAccess();
- $this->assertEquals(array(), $sites);
- }
-
- /**
- * normal case, admin and view and noaccess website => return only admin
- *
- * @group Plugins
- */
- public function testGetSitesWithAtLeastViewAccess()
- {
- API::getInstance()->addSite("site1", array("http://piwik.net", "http://piwik.com/test/"), $ecommerce = 1);
- API::getInstance()->addSite("site2", array("http://piwik.com/test/"));
- API::getInstance()->addSite("site3", array("http://piwik.org"));
-
- $resultWanted = array(
- 0 => array("idsite" => 1, "name" => "site1", "main_url" => "http://piwik.net", "ecommerce" => 1, "excluded_ips" => "", 'sitesearch' => 1, 'sitesearch_keyword_parameters' => '', 'sitesearch_category_parameters' => '', 'excluded_parameters' => '', 'excluded_user_agents' => '', 'timezone' => 'UTC', 'currency' => 'USD', 'group' => '', 'keep_url_fragment' => 0, 'type' => 'website'),
- 1 => array("idsite" => 3, "name" => "site3", "main_url" => "http://piwik.org", "ecommerce" => 0, "excluded_ips" => "", 'sitesearch' => 1, 'sitesearch_keyword_parameters' => '', 'sitesearch_category_parameters' => '', 'excluded_parameters' => '', 'excluded_user_agents' => '', 'timezone' => 'UTC', 'currency' => 'USD', 'group' => '', 'keep_url_fragment' => 0, 'type' => 'website'),
- );
-
- FakeAccess::setIdSitesView(array(1, 3));
- FakeAccess::setIdSitesAdmin(array());
-
- $sites = API::getInstance()->getSitesWithAtLeastViewAccess();
- // we dont test the ts_created
- unset($sites[0]['ts_created']);
- unset($sites[1]['ts_created']);
- $this->assertEquals($resultWanted, $sites);
- }
-
- /**
- * no urls for this site => array()
- *
- * @group Plugins
- */
- public function testGetSiteUrlsFromIdNoUrls()
- {
- $idsite = API::getInstance()->addSite("site1", array("http://piwik.net"));
-
- $urls = API::getInstance()->getSiteUrlsFromId($idsite);
- $this->assertEquals(array("http://piwik.net"), $urls);
- }
-
- /**
- * normal case
- *
- * @group Plugins
- */
- public function testGetSiteUrlsFromIdManyUrls()
- {
- $site = array("http://piwik.net",
- "http://piwik.org",
- "http://piwik.org",
- "http://piwik.com");
- sort($site);
-
- $idsite = API::getInstance()->addSite("site1", $site);
-
- $siteWanted = array("http://piwik.net",
- "http://piwik.org",
- "http://piwik.com");
- sort($siteWanted);
- $urls = API::getInstance()->getSiteUrlsFromId($idsite);
-
- $this->assertEquals($siteWanted, $urls);
- }
-
- /**
- * wrongId => exception
- *
- * @group Plugins
- */
- public function testGetSiteUrlsFromIdWrongId()
- {
- try {
- FakeAccess::setIdSitesView(array(3));
- FakeAccess::setIdSitesAdmin(array());
- API::getInstance()->getSiteUrlsFromId(1);
- } catch (Exception $e) {
- return;
- }
- $this->fail('Expected exception not raised');
- }
-
- /**
- * one url => no change to alias urls
- *
- * @group Plugins
- */
- public function testUpdateSiteOneUrl()
- {
- $urls = array("http://piwiknew.com",
- "http://piwiknew.net",
- "http://piwiknew.org",
- "http://piwiknew.fr");
- $idsite = API::getInstance()->addSite("site1", $urls);
-
- $newMainUrl = "http://main.url";
-
- // Also test that the group was set to empty, and is searchable
- $websites = API::getInstance()->getSitesFromGroup('');
- $this->assertEquals(1, count($websites));
-
- // the Update doesn't change the group field
- API::getInstance()->updateSite($idsite, "test toto@{}", $newMainUrl);
- $websites = API::getInstance()->getSitesFromGroup('');
- $this->assertEquals(1, count($websites));
-
- // Updating the group to something
- $group = 'something';
- API::getInstance()->updateSite($idsite, "test toto@{}", $newMainUrl, $ecommerce = 0, $ss = true, $ss_kwd = null, $ss_cat = '', $ips = null, $parametersExclude = null, $timezone = null, $currency = null, $group);
- $websites = API::getInstance()->getSitesFromGroup($group);
- $this->assertEquals(1, count($websites));
- $this->assertEquals(date('Y-m-d'), date('Y-m-d', strtotime($websites[0]['ts_created'])));
-
- // Updating the group to nothing
- $group = '';
- $type = 'mobileAppTest';
- API::getInstance()->updateSite($idsite, "test toto@{}", $newMainUrl, $ecommerce = 0, $ss = false, $ss_kwd = '', $ss_cat = null, $ips = null, $parametersExclude = null, $timezone = null, $currency = null, $group, $startDate = '2010-01-01', $excludedUserAgent = null, $keepUrlFragment = 1, $type);
- $websites = API::getInstance()->getSitesFromGroup($group);
- $this->assertEquals(1, count($websites));
- $this->assertEquals('2010-01-01', date('Y-m-d', strtotime($websites[0]['ts_created'])));
-
- // Test setting the website type
- $this->assertEquals($type, Site::getTypeFor($idsite));
-
- // Check Alias URLs contain only main url
- $allUrls = API::getInstance()->getSiteUrlsFromId($idsite);
- $this->assertEquals($newMainUrl, $allUrls[0]);
- $aliasUrls = array_slice($allUrls, 1);
- $this->assertEquals(array(), $aliasUrls);
-
- }
-
- /**
- * strange name and NO URL => name ok, main_url not updated
- *
- * @group Plugins
- */
- public function testUpdateSiteStrangeNameNoUrl()
- {
- $idsite = API::getInstance()->addSite("site1", "http://main.url");
- $newName = "test toto@{'786'}";
-
- API::getInstance()->updateSite($idsite, $newName);
-
- $site = API::getInstance()->getSiteFromId($idsite);
-
- $this->assertEquals($newName, $site['name']);
- // url didn't change because parameter url NULL in updateSite
- $this->assertEquals("http://main.url", $site['main_url']);
- }
-
- /**
- * several urls => both main and alias are updated
- * also test the update of group field
- *
- * @group Plugins
- */
- public function testUpdateSiteSeveralUrlsAndGroup()
- {
- $urls = array("http://piwiknew.com",
- "http://piwiknew.net",
- "http://piwiknew.org",
- "http://piwiknew.fr");
-
- $group = 'GROUP Before';
- $idsite = API::getInstance()->addSite("site1", $urls, $ecommerce = 1,
- $siteSearch = 1, $searchKeywordParameters = null, $searchCategoryParameters = null,
- $excludedIps = null, $excludedQueryParameters = null, $timezone = null, $currency = null, $group, $startDate = '2011-01-01');
-
- $websites = API::getInstance()->getSitesFromGroup($group);
- $this->assertEquals(1, count($websites));
-
- $newurls = array("http://piwiknew2.com",
- "http://piwiknew2.net",
- "http://piwiknew2.org",
- "http://piwiknew2.fr");
-
- $groupAfter = ' GROUP After';
- API::getInstance()->updateSite($idsite, "test toto@{}", $newurls, $ecommerce = 0,
- $siteSearch = 1, $searchKeywordParameters = null, $searchCategoryParameters = null,
- $excludedIps = null, $excludedQueryParameters = null, $timezone = null, $currency = null, $groupAfter);
-
- // no result for the group before update
- $websites = API::getInstance()->getSitesFromGroup($group);
- $this->assertEquals(0, count($websites));
-
- // Testing that the group was updated properly (and testing that the group value is trimmed before inserted/searched)
- $websites = API::getInstance()->getSitesFromGroup($groupAfter . ' ');
- $this->assertEquals(1, count($websites));
- $this->assertEquals('2011-01-01', date('Y-m-d', strtotime($websites[0]['ts_created'])));
-
- // Test fetch website groups
- $expectedGroups = array(trim($groupAfter));
- $fetched = API::getInstance()->getSitesGroups();
- $this->assertEquals($expectedGroups, $fetched);
-
- $allUrls = API::getInstance()->getSiteUrlsFromId($idsite);
- sort($allUrls);
- sort($newurls);
- $this->assertEquals($newurls, $allUrls);
- }
-
- /**
- * @group Plugins
- */
- public function testGetSitesGroups()
- {
- $groups = array('group1', ' group1 ', '', 'group2');
- $expectedGroups = array('group1', '', 'group2');
- foreach ($groups as $group) {
- API::getInstance()->addSite("test toto@{}", 'http://example.org', $ecommerce = 1, $siteSearch = null, $searchKeywordParameters = null, $searchCategoryParameters = null, $excludedIps = null, $excludedQueryParameters = null, $timezone = null, $currency = null, $group);
- }
-
- $this->assertEquals($expectedGroups, API::getInstance()->getSitesGroups());
- }
-
- public function getInvalidTimezoneData()
- {
- return array(
- array('UTC+15'),
- array('Paris'),
- );
- }
-
- /**
- *
- * @dataProvider getInvalidTimezoneData
- * @group Plugins
- */
- public function testAddSitesInvalidTimezone($timezone)
- {
- try {
- API::getInstance()->addSite("site1", array('http://example.org'), $ecommerce = 0,
- $siteSearch = 1, $searchKeywordParameters = null, $searchCategoryParameters = null, $ip = '', $params = '', $timezone);
- } catch (Exception $e) {
- return;
- }
- $this->fail('Expected exception not raised');
- }
-
- /**
- * @group Plugins
- */
- public function testAddSitesInvalidCurrency()
- {
- try {
- $invalidCurrency = '€';
- API::getInstance()->addSite("site1", array('http://example.org'), $ecommerce = 0,
- $siteSearch = 1, $searchKeywordParameters = null, $searchCategoryParameters = null, '', 'UTC', $invalidCurrency);
- } catch (Exception $e) {
- return;
- }
- $this->fail('Expected exception not raised');
- }
-
- /**
- * @group Plugins
- */
- public function testSetDefaultTimezoneAndCurrencyAndExcludedQueryParametersAndExcludedIps()
- {
- // test that they return default values
- $defaultTimezone = API::getInstance()->getDefaultTimezone();
- $this->assertEquals('UTC', $defaultTimezone);
- $defaultCurrency = API::getInstance()->getDefaultCurrency();
- $this->assertEquals('USD', $defaultCurrency);
- $excludedIps = API::getInstance()->getExcludedIpsGlobal();
- $this->assertEquals('', $excludedIps);
- $excludedQueryParameters = API::getInstance()->getExcludedQueryParametersGlobal();
- $this->assertEquals('', $excludedQueryParameters);
-
- // test that when not specified, defaults are set as expected
- $idsite = API::getInstance()->addSite("site1", array('http://example.org'));
- $site = new Site($idsite);
- $this->assertEquals('UTC', $site->getTimezone());
- $this->assertEquals('USD', $site->getCurrency());
- $this->assertEquals('', $site->getExcludedQueryParameters());
- $this->assertEquals('', $site->getExcludedIps());
- $this->assertEquals(false, $site->isEcommerceEnabled());
-
- // set the global timezone and get it
- $newDefaultTimezone = 'UTC+5.5';
- API::getInstance()->setDefaultTimezone($newDefaultTimezone);
- $defaultTimezone = API::getInstance()->getDefaultTimezone();
- $this->assertEquals($newDefaultTimezone, $defaultTimezone);
-
- // set the default currency and get it
- $newDefaultCurrency = 'EUR';
- API::getInstance()->setDefaultCurrency($newDefaultCurrency);
- $defaultCurrency = API::getInstance()->getDefaultCurrency();
- $this->assertEquals($newDefaultCurrency, $defaultCurrency);
-
- // set the global IPs to exclude and get it
- $newGlobalExcludedIps = '1.1.1.*,1.1.*.*,150.1.1.1';
- API::getInstance()->setGlobalExcludedIps($newGlobalExcludedIps);
- $globalExcludedIps = API::getInstance()->getExcludedIpsGlobal();
- $this->assertEquals($newGlobalExcludedIps, $globalExcludedIps);
-
- // set the global URL query params to exclude and get it
- $newGlobalExcludedQueryParameters = 'PHPSESSID,blabla, TesT';
- // removed the space
- $expectedGlobalExcludedQueryParameters = 'PHPSESSID,blabla,TesT';
- API::getInstance()->setGlobalExcludedQueryParameters($newGlobalExcludedQueryParameters);
- $globalExcludedQueryParameters = API::getInstance()->getExcludedQueryParametersGlobal();
- $this->assertEquals($expectedGlobalExcludedQueryParameters, $globalExcludedQueryParameters);
-
- // create a website and check that default currency and default timezone are set
- // however, excluded IPs and excluded query Params are not returned
- $idsite = API::getInstance()->addSite("site1", array('http://example.org'), $ecommerce = 0,
- $siteSearch = 0, $searchKeywordParameters = 'test1,test2', $searchCategoryParameters = 'test2,test1',
- '', '', $newDefaultTimezone);
- $site = new Site($idsite);
- $this->assertEquals($newDefaultTimezone, $site->getTimezone());
- $this->assertEquals(date('Y-m-d'), $site->getCreationDate()->toString());
- $this->assertEquals($newDefaultCurrency, $site->getCurrency());
- $this->assertEquals('', $site->getExcludedIps());
- $this->assertEquals('', $site->getExcludedQueryParameters());
- $this->assertEquals('test1,test2', $site->getSearchKeywordParameters());
- $this->assertEquals('test2,test1', $site->getSearchCategoryParameters());
- $this->assertFalse($site->isSiteSearchEnabled());
- $this->assertFalse(Site::isSiteSearchEnabledFor($idsite));
- $this->assertFalse($site->isEcommerceEnabled());
- $this->assertFalse(Site::isEcommerceEnabledFor($idsite));
- }
-
- /**
- * @group Plugins
- */
- public function testGetSitesIdFromSiteUrlSuperUser()
- {
- API::getInstance()->addSite("site1", array("http://piwik.net", "http://piwik.com"));
- API::getInstance()->addSite("site2", array("http://piwik.com", "http://piwik.net"));
- API::getInstance()->addSite("site3", array("http://piwik.com", "http://piwik.org"));
-
- $idsites = API::getInstance()->getSitesIdFromSiteUrl('http://piwik.org');
- $this->assertTrue(count($idsites) == 1);
-
- $idsites = API::getInstance()->getSitesIdFromSiteUrl('http://www.piwik.org');
- $this->assertTrue(count($idsites) == 1);
-
- $idsites = API::getInstance()->getSitesIdFromSiteUrl('http://piwik.net');
- $this->assertTrue(count($idsites) == 2);
-
- $idsites = API::getInstance()->getSitesIdFromSiteUrl('http://piwik.com');
- $this->assertTrue(count($idsites) == 3);
- }
-
- /**
- * @group Plugins
- */
- public function testGetSitesIdFromSiteUrlUser()
- {
- API::getInstance()->addSite("site1", array("http://www.piwik.net", "http://piwik.com"));
- API::getInstance()->addSite("site2", array("http://piwik.com", "http://piwik.net"));
- API::getInstance()->addSite("site3", array("http://piwik.com", "http://piwik.org"));
-
- $saveAccess = Access::getInstance();
-
- APIUsersManager::getInstance()->addUser("user1", "geqgegagae", "tegst@tesgt.com", "alias");
- APIUsersManager::getInstance()->setUserAccess("user1", "view", array(1));
-
- APIUsersManager::getInstance()->addUser("user2", "geqgegagae", "tegst2@tesgt.com", "alias");
- APIUsersManager::getInstance()->setUserAccess("user2", "view", array(1));
- APIUsersManager::getInstance()->setUserAccess("user2", "admin", array(3));
-
- APIUsersManager::getInstance()->addUser("user3", "geqgegagae", "tegst3@tesgt.com", "alias");
- APIUsersManager::getInstance()->setUserAccess("user3", "view", array(1, 2));
- APIUsersManager::getInstance()->setUserAccess("user3", "admin", array(3));
-
- $pseudoMockAccess = new FakeAccess;
- FakeAccess::$superUser = false;
- FakeAccess::$identity = 'user1';
- FakeAccess::setIdSitesView(array(1));
- FakeAccess::setIdSitesAdmin(array());
- Access::setSingletonInstance($pseudoMockAccess);
- $idsites = API::getInstance()->getSitesIdFromSiteUrl('http://piwik.com');
- $this->assertEquals(1, count($idsites));
-
- // testing URL normalization
- $idsites = API::getInstance()->getSitesIdFromSiteUrl('http://www.piwik.com');
- $this->assertEquals(1, count($idsites));
- $idsites = API::getInstance()->getSitesIdFromSiteUrl('http://piwik.net');
- $this->assertEquals(1, count($idsites));
-
- $pseudoMockAccess = new FakeAccess;
- FakeAccess::$superUser = false;
- FakeAccess::$identity = 'user2';
- FakeAccess::setIdSitesView(array(1));
- FakeAccess::setIdSitesAdmin(array(3));
- Access::setSingletonInstance($pseudoMockAccess);
- $idsites = API::getInstance()->getSitesIdFromSiteUrl('http://piwik.com');
- $this->assertEquals(2, count($idsites));
-
- $pseudoMockAccess = new FakeAccess;
- FakeAccess::$superUser = false;
- FakeAccess::$identity = 'user3';
- FakeAccess::setIdSitesView(array(1, 2));
- FakeAccess::setIdSitesAdmin(array(3));
- Access::setSingletonInstance($pseudoMockAccess);
- $idsites = API::getInstance()->getSitesIdFromSiteUrl('http://piwik.com');
- $this->assertEquals(3, count($idsites));
-
- Access::setSingletonInstance($saveAccess);
- }
-
- /**
- * @group Plugins
- */
- public function testGetSitesFromTimezones()
- {
- API::getInstance()->addSite("site3", array("http://piwik.org"), null, $siteSearch = 1, $searchKeywordParameters = null, $searchCategoryParameters = null, null, null, 'UTC');
- $idsite2 = API::getInstance()->addSite("site3", array("http://piwik.org"), null, $siteSearch = 1, $searchKeywordParameters = null, $searchCategoryParameters = null, null, null, 'Pacific/Auckland');
- $idsite3 = API::getInstance()->addSite("site3", array("http://piwik.org"), null, $siteSearch = 1, $searchKeywordParameters = null, $searchCategoryParameters = null, null, null, 'Pacific/Auckland');
- $idsite4 = API::getInstance()->addSite("site3", array("http://piwik.org"), null, $siteSearch = 1, $searchKeywordParameters = null, $searchCategoryParameters = null, null, null, 'UTC+10');
- $result = API::getInstance()->getSitesIdFromTimezones(array('UTC+10', 'Pacific/Auckland'));
- $this->assertEquals(array($idsite2, $idsite3, $idsite4), $result);
- }
-}
diff --git a/tests/PHPUnit/Integration/Plugins/UsersManagerTest.php b/tests/PHPUnit/Integration/Plugins/UsersManagerTest.php
deleted file mode 100644
index 41b4fe2ae2..0000000000
--- a/tests/PHPUnit/Integration/Plugins/UsersManagerTest.php
+++ /dev/null
@@ -1,910 +0,0 @@
-<?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;
-use Piwik\Plugins\UsersManager\Model;
-use Piwik\Translate;
-
-/**
- * Piwik - free/libre analytics platform
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- *
- * @group Plugins
- */
-class Plugins_UsersManagerTest extends DatabaseTestCase
-{
- /**
- * @var API
- */
- private $api;
-
- /**
- * @var Model
- */
- private $model;
-
- public function setUp()
- {
- parent::setUp();
-
- \Piwik\Plugin\Manager::getInstance()->loadPlugin('UsersManager');
- \Piwik\Plugin\Manager::getInstance()->installLoadedPlugins();
-
- // setup the access layer
- $pseudoMockAccess = new FakeAccess;
- FakeAccess::setIdSitesView(array(1, 2));
- FakeAccess::setIdSitesAdmin(array(3, 4));
-
- //finally we set the user as a Super User by default
- FakeAccess::$superUser = true;
- FakeAccess::$superUserLogin = 'superusertest';
- Access::setSingletonInstance($pseudoMockAccess);
-
- $this->api = API::getInstance();
- $this->model = new Model();
- }
-
- private function _flatten($sitesAccess)
- {
- $result = array();
-
- foreach ($sitesAccess as $siteAccess) {
- $result[$siteAccess['site']] = $siteAccess['access'];
- }
-
- return $result;
- }
-
- private function _checkUserHasNotChanged($user, $newPassword, $newEmail = null, $newAlias = null)
- {
- if (is_null($newEmail)) {
- $newEmail = $user['email'];
- }
- if (is_null($newAlias)) {
- $newAlias = $user['alias'];
- }
- $userAfter = $this->api->getUser($user["login"]);
- unset($userAfter['date_registered']);
-
- // we now compute what the token auth should be, it should always be a hash of the login and the current password
- // if the password has changed then the token_auth has changed!
- $user['token_auth'] = $this->api->getTokenAuth($user["login"], md5($newPassword));
- $user['password'] = md5($newPassword);
- $user['email'] = $newEmail;
- $user['alias'] = $newAlias;
- $user['superuser_access'] = 0;
- $this->assertEquals($user, $userAfter);
- }
-
- /**
- * bad password => exception#
- * @expectedException \Exception
- * @expectedExceptionMessage UsersManager_ExceptionInvalidPassword
- */
- public function testUpdateUserBadpasswd()
- {
- $login = "login";
- $user = array('login' => $login,
- 'password' => "geqgeagae",
- 'email' => "test@test.com",
- 'alias' => "alias");
-
- $this->api->addUser($user['login'], $user['password'], $user['email'], $user['alias']);
-
- try {
- $this->api->updateUser($login, "pas");
- } catch (Exception $expected) {
- $this->_checkUserHasNotChanged($user, $user['password']);
- throw $expected;
- }
- }
-
- /**
- * Dataprovider
- */
- public function getAddUserInvalidLoginData()
- {
- return array(
- array(12, "password", "email@email.com", "alias"), // wrong login / integer => exception
- array("gegag'ggea'", "password", "email@email.com", "alias"), // wrong login / too short => exception
- array("gegag11gge&", "password", "email@email.com", "alias"), // wrong login / too long => exception
- array("geg'ag11gge@", "password", "email@email.com", "alias"), // wrong login / bad characters => exception
- );
- }
-
- /**
- * @dataProvider getAddUserInvalidLoginData
- * @expectedException \Exception
- * @expectedExceptionMessage UsersManager_ExceptionInvalidLogin
- */
- public function testAddUserWrongLogin($userLogin, $password, $email, $alias)
- {
- $this->api->addUser($userLogin, $password, $email, $alias);
- }
-
- /**
- * @expectedException \Exception
- * @expectedExceptionMessage UsersManager_ExceptionLoginExists
- */
- public function testAddUserExistingLogin()
- {
- $this->api->addUser("test", "password", "email@email.com", "alias");
- $this->api->addUser("test", "password2", "em2ail@email.com", "al2ias");
- }
-
- /**
- * Dataprovider for wrong password tests
- */
- public function getWrongPasswordTestData()
- {
- return array(
- array("geggeqgeqag", "pas", "email@email.com", "alias"), // too short -> exception
- array("ghqgeggg", "gegageqqqqqqqgeqgqeg84897897897897g122", "email@email.com", "alias"), // too long -> exception
- array("geggeqgeqag", "", "email@email.com", "alias"), // empty -> exception
- );
- }
-
- /**
- * @dataProvider getWrongPasswordTestData
- * @expectedException \Exception
- * @expectedExceptionMessage UsersManager_ExceptionInvalidPassword
- */
- public function testAddUserWrongPassword($userLogin, $password, $email, $alias)
- {
- $this->api->addUser($userLogin, $password, $email, $alias);
- }
-
- /**
- * Dataprovider for wrong email tests
- */
- public function getWrongEmailTestData()
- {
- return array(
- array("geggeqgeqag", "geqgeagae", "ema'il@email.com", "alias"),
- array("geggeqgeqag", "geqgeagae", "@email.com", "alias"),
- array("geggeqgeqag", "geqgeagae", "email@.com", "alias"),
- array("geggeqgeqag", "geqgeagae", "email@4.", "alias"),
- array("geggeqgeqag", "geqgeagae", "", "alias"),
- );
- }
-
- /**
- * @dataProvider getWrongEmailTestData
- * @expectedException \Exception
- * @expectedExceptionMessage mail
- */
- public function testAddUserWrongEmail($userLogin, $password, $email, $alias)
- {
- $this->api->addUser($userLogin, $password, $email, $alias);
- }
-
- /**
- * empty alias => use login
- */
- public function testAddUserEmptyAlias()
- {
- $login = "geggeqgeqag";
- $this->api->addUser($login, "geqgeagae", "mgeagi@geq.com", "");
- $user = $this->api->getUser($login);
- $this->assertEquals($login, $user['alias']);
- $this->assertEquals($login, $user['login']);
- }
-
- /**
- * no alias => use login
- */
- public function testAddUserNoAliasSpecified()
- {
- $login = "geggeqg455eqag";
- $this->api->addUser($login, "geqgeagae", "mgeagi@geq.com");
- $user = $this->api->getUser($login);
- $this->assertEquals($login, $user['alias']);
- $this->assertEquals($login, $user['login']);
- }
-
- /**
- * normal test case
- */
- public function testAddUser()
- {
- $login = "geggeq55eqag";
- $password = "mypassword";
- $email = "mgeag4544i@geq.com";
- $alias = "her is my alias )(&|\" '£%*(&%+))";
-
- $time = time();
- $this->api->addUser($login, $password, $email, $alias);
- $user = $this->api->getUser($login);
-
- // check that the date registered is correct
- $this->assertTrue($time <= strtotime($user['date_registered']) && strtotime($user['date_registered']) <= time(),
- "the date_registered " . strtotime($user['date_registered']) . " is different from the time() " . time());
- $this->assertTrue($user['date_registered'] <= time());
-
- // check that token is 32 chars
- $this->assertEquals(32, strlen($user['password']));
-
- // that the password has been md5
- $this->assertEquals(md5($login . md5($password)), $user['token_auth']);
-
- // check that all fields are the same
- $this->assertEquals($login, $user['login']);
- $this->assertEquals(md5($password), $user['password']);
- $this->assertEquals($email, $user['email']);
- $this->assertEquals($alias, $user['alias']);
- }
-
- /**
- * @expectedException \Exception
- * @expectedExceptionMessage UsersManager_ExceptionDeleteDoesNotExist
- */
- public function testSeleteUserDoesntExist()
- {
- $this->api->addUser("geggeqgeqag", "geqgeagae", "test@test.com", "alias");
- $this->api->deleteUser("geggeqggnew");
- }
-
- /**
- * @expectedException \Exception
- * @expectedExceptionMessage UsersManager_ExceptionDeleteDoesNotExist
- */
- public function testDeleteUserEmptyUser()
- {
- $this->api->deleteUser("");
- }
-
- /**
- * @expectedException \Exception
- * @expectedExceptionMessage UsersManager_ExceptionDeleteDoesNotExist
- */
- public function testDeleteUserNullUser()
- {
- $this->api->deleteUser(null);
- }
-
- /**
- * @expectedException \Exception
- * @expectedExceptionMessage UsersManager_ExceptionDeleteOnlyUserWithSuperUserAccess
- */
- public function testDeleteUser_ShouldFail_InCaseTheUserIsTheOnlyRemainingSuperUser()
- {
- //add user and set some rights
- $this->api->addUser("regularuser", "geqgeagae1", "test1@test.com", "alias1");
- $this->api->addUser("superuser", "geqgeagae2", "test2@test.com", "alias2");
- $this->api->setSuperUserAccess('superuser', true);
-
- // delete the user
- $this->api->deleteUser("superuser");
- }
-
- /**
- * normal case, user deleted
- */
- public function testDeleteUser()
- {
- $this->addSites(3);
-
- //add user and set some rights
- $this->api->addUser("geggeqgeqag", "geqgeagae", "test@test.com", "alias");
- $this->api->setUserAccess("geggeqgeqag", "view", array(1, 2));
- $this->api->setUserAccess("geggeqgeqag", "admin", array(1, 3));
-
- // check rights are set
- $this->assertNotEquals(array(), $this->api->getSitesAccessFromUser("geggeqgeqag"));
-
- // delete the user
- $this->api->deleteUser("geggeqgeqag");
-
- // try to get it, it should raise an exception
- try {
- $this->api->getUser("geggeqgeqag");
- $this->fail("Exception not raised.");
- } catch (Exception $expected) {
- $this->assertRegExp("(UsersManager_ExceptionUserDoesNotExist)", $expected->getMessage());
- }
-
- // add the same user
- $this->api->addUser("geggeqgeqag", "geqgeagae", "test@test.com", "alias");
-
- //checks access have been deleted
- //to do so we recreate the same user login and check if the rights are still there
- $this->assertEquals(array(), $this->api->getSitesAccessFromUser("geggeqgeqag"));
- }
-
- /**
- * @expectedException \Exception
- * @expectedExceptionMessage UsersManager_ExceptionUserDoesNotExist
- */
- public function testGetUserNoUser()
- {
- // try to get it, it should raise an exception
- $this->api->getUser("geggeqgeqag");
- }
-
- /**
- * normal case
- */
- public function test_GetUser()
- {
- $login = "geggeq55eqag";
- $password = "mypassword";
- $email = "mgeag4544i@geq.com";
- $alias = "";
-
- $this->api->addUser($login, $password, $email, $alias);
- $user = $this->api->getUser($login);
-
- // check that all fields are the same
- $this->assertEquals($login, $user['login']);
- $this->assertInternalType('string', $user['password']);
- $this->assertInternalType('string', $user['date_registered']);
- $this->assertEquals($email, $user['email']);
-
- //alias shouldnt be empty even if no alias specified
- $this->assertGreaterThan(0, strlen($user['alias']));
- }
-
- /**
- * no user => empty array
- */
- public function testGetUsersNoUser()
- {
- $this->assertEquals($this->api->getUsers(), array());
- }
-
- /**
- * normal case
- * as well as selecting specific user names, comma separated
- */
- public function testGetUsers()
- {
- $this->api->addUser("gegg4564eqgeqag", "geqgegagae", "tegst@tesgt.com", "alias");
- $this->api->addUser("geggeqge632ge56a4qag", "geqgegeagae", "tesggt@tesgt.com", "alias");
- $this->api->addUser("geggeqgeqagqegg", "geqgeaggggae", "tesgggt@tesgt.com");
-
- $users = $this->api->getUsers();
- $users = $this->_removeNonTestableFieldsFromUsers($users);
- $user1 = array('login' => "gegg4564eqgeqag", 'password' => md5("geqgegagae"), 'alias' => "alias", 'email' => "tegst@tesgt.com", 'superuser_access' => 0);
- $user2 = array('login' => "geggeqge632ge56a4qag", 'password' => md5("geqgegeagae"), 'alias' => "alias", 'email' => "tesggt@tesgt.com", 'superuser_access' => 0);
- $user3 = array('login' => "geggeqgeqagqegg", 'password' => md5("geqgeaggggae"), 'alias' => 'geggeqgeqagqegg', 'email' => "tesgggt@tesgt.com", 'superuser_access' => 0);
- $expectedUsers = array($user1, $user2, $user3);
- $this->assertEquals($expectedUsers, $users);
- $this->assertEquals(array($user1), $this->_removeNonTestableFieldsFromUsers($this->api->getUsers('gegg4564eqgeqag')));
- $this->assertEquals(array($user1, $user2), $this->_removeNonTestableFieldsFromUsers($this->api->getUsers('gegg4564eqgeqag,geggeqge632ge56a4qag')));
- }
-
- protected function _removeNonTestableFieldsFromUsers($users)
- {
- foreach ($users as &$user) {
- unset($user['token_auth']);
- unset($user['date_registered']);
- }
- return $users;
- }
-
- /**
- * normal case
- */
- public function testGetUsersLogin()
- {
- $this->api->addUser('gegg4564eqgeqag', 'geqgegagae', 'tegst@tesgt.com', 'alias');
- $this->api->addUser("geggeqge632ge56a4qag", "geqgegeagae", "tesggt@tesgt.com", "alias");
- $this->api->addUser("geggeqgeqagqegg", "geqgeaggggae", "tesgggt@tesgt.com");
-
- $logins = $this->api->getUsersLogin();
-
- $this->assertEquals(array("gegg4564eqgeqag", "geggeqge632ge56a4qag", "geggeqgeqagqegg"), $logins);
- }
-
- /**
- * @expectedException \Exception
- * @expectedExceptionMessage UsersManager_ExceptionUserDoesNotExist
- */
- public function testSetUserAccessNoLogin()
- {
- $this->api->setUserAccess("nologin", "view", 1);
- }
-
- /**
- * @expectedException \Exception
- * @expectedExceptionMessage UsersManager_ExceptionAccessValues
- */
- public function testSetUserAccessWrongAccessSpecified()
- {
- $this->api->addUser("gegg4564eqgeqag", "geqgegagae", "tegst@tesgt.com", "alias");
- $this->api->setUserAccess("gegg4564eqgeqag", "viewnotknown", 1);
- }
-
- /**
- * @expectedException \Exception
- * @expectedExceptionMessage UsersManager_ExceptionAccessValues
- */
- public function testSetUserAccess_ShouldFail_SuperUserAccessIsNotAllowed()
- {
- $this->api->addUser("gegg4564eqgeqag", "geqgegagae", "tegst@tesgt.com", "alias");
- $this->api->setUserAccess("gegg4564eqgeqag", "superuser", 1);
- }
-
- /**
- * @expectedException \Exception
- * @expectedExceptionMessage UsersManager_ExceptionUserDoesNotExist
- */
- public function testSetUserAccess_ShouldFail_IfLoginIsConfigSuperUserLogin()
- {
- $this->api->setUserAccess('superusertest', 'view', 1);
- }
-
- /**
- * @expectedException \Exception
- * @expectedExceptionMessage UsersManager_ExceptionSuperUserAccess
- */
- public function testSetUserAccess_ShouldFail_IfLoginIsUserWithSuperUserAccess()
- {
- $this->api->addUser("gegg4564eqgeqag", "geqgegagae", "tegst@tesgt.com", "alias");
- $this->api->setSuperUserAccess('gegg4564eqgeqag', true);
-
- $this->api->setUserAccess('gegg4564eqgeqag', 'view', 1);
- }
-
- /**
- * idsites = all => apply access to all websites with admin access
- */
- public function testSetUserAccessIdsitesIsAll()
- {
- $this->api->addUser("gegg4564eqgeqag", "geqgegagae", "tegst@tesgt.com", "alias");
-
- FakeAccess::$superUser = false;
-
- $this->api->setUserAccess("gegg4564eqgeqag", "view", "all");
-
- FakeAccess::$superUser = true;
- $access = $this->api->getSitesAccessFromUser("gegg4564eqgeqag");
- $access = $this->_flatten($access);
-
- FakeAccess::$superUser = false;
- $this->assertEquals(array_keys($access), FakeAccess::getSitesIdWithAdminAccess());
-
- // we want to test the case for which we have actually set some rights
- // if this is not OK then change the setUp method and add some admin rights for some websites
- $this->assertGreaterThan(0, count(array_keys($access)));
- }
-
- /**
- * idsites = all AND user is superuser=> apply access to all websites
- */
- public function testSetUserAccessIdsitesIsAllSuperuser()
- {
- FakeAccess::$superUser = true;
-
- $idSites = $this->addSites(5);
-
- $this->api->addUser("gegg4564eqgeqag", "geqgegagae", "tegst@tesgt.com", "alias");
- $this->api->setUserAccess("gegg4564eqgeqag", "view", "all");
-
- $access = $this->api->getSitesAccessFromUser("gegg4564eqgeqag");
- $access = $this->_flatten($access);
- $this->assertEquals($idSites, array_keys($access));
- }
-
- /**
- * @expectedException \Exception
- */
- public function testSetUserAccess_ShouldNotBeAbleToSetAnyAccess_IfIdSitesIsEmpty()
- {
- $this->api->addUser("gegg4564eqgeqag", "geqgegagae", "tegst@tesgt.com", "alias");
-
- $this->api->setUserAccess("gegg4564eqgeqag", "view", array());
- }
-
- /**
- * normal case, access set for only one site
- */
- public function testSetUserAccessIdsitesOneSite()
- {
- $this->api->addUser("gegg4564eqgeqag", "geqgegagae", "tegst@tesgt.com", "alias");
- $idSites = $this->addSites(1);
-
- $this->api->setUserAccess("gegg4564eqgeqag", "view", $idSites);
-
- $access = $this->api->getSitesAccessFromUser("gegg4564eqgeqag");
- $access = $this->_flatten($access);
- $this->assertEquals($idSites, array_keys($access));
- }
-
- /**
- * normal case, access set for multiple sites
- */
- public function testSetUserAccessIdsitesMultipleSites()
- {
- $this->api->addUser("gegg4564eqgeqag", "geqgegagae", "tegst@tesgt.com", "alias");
- list($id1, $id2, $id3) = $this->addSites(3);
-
- $this->api->setUserAccess("gegg4564eqgeqag", "view", array($id1, $id3));
-
- $access = $this->api->getSitesAccessFromUser("gegg4564eqgeqag");
- $access = $this->_flatten($access);
- $this->assertEquals(array($id1, $id3), array_keys($access));
- }
-
- /**
- * normal case, string idSites comma separated access set for multiple sites
- */
- public function testSetUserAccessWithIdSitesIsStringCommaSeparated()
- {
- $this->api->addUser("gegg4564eqgeqag", "geqgegagae", "tegst@tesgt.com", "alias");
- list($id1, $id2, $id3) = $this->addSites(3);
-
- $this->api->setUserAccess("gegg4564eqgeqag", "view", "1,3");
-
- $access = $this->api->getSitesAccessFromUser("gegg4564eqgeqag");
- $access = $this->_flatten($access);
- $this->assertEquals(array($id1, $id3), array_keys($access));
- }
-
- /**
- * normal case, set different acccess to different websites for one user
- */
- public function testSetUserAccessMultipleCallDistinctAccessSameUser()
- {
- $this->api->addUser("gegg4564eqgeqag", "geqgegagae", "tegst@tesgt.com", "alias");
-
- list($id1, $id2) = $this->addSites(2);
-
- $this->api->setUserAccess("gegg4564eqgeqag", "view", array($id1));
- $this->api->setUserAccess("gegg4564eqgeqag", "admin", array($id2));
-
- $access = $this->api->getSitesAccessFromUser("gegg4564eqgeqag");
- $access = $this->_flatten($access);
- $this->assertEquals(array($id1 => 'view', $id2 => 'admin'), $access);
- }
-
- /**
- * normal case, set different access to different websites for multiple users
- */
- public function testSetUserAccessMultipleCallDistinctAccessMultipleUser()
- {
- $this->api->addUser("user1", "geqgegagae", "tegst@tesgt.com", "alias");
- $this->api->addUser("user2", "geqgegagae", "tegst2@tesgt.com", "alias");
-
- list($id1, $id2, $id3) = $this->addSites(3);
-
- $this->api->setUserAccess("user1", "view", array($id1, $id2));
- $this->api->setUserAccess("user2", "admin", array($id1));
- $this->api->setUserAccess("user2", "view", array($id3, $id2));
-
- $access1 = $this->api->getSitesAccessFromUser("user1");
- $access1 = $this->_flatten($access1);
- $access2 = $this->api->getSitesAccessFromUser("user2");
- $access2 = $this->_flatten($access2);
- $wanted1 = array($id1 => 'view', $id2 => 'view',);
- $wanted2 = array($id1 => 'admin', $id2 => 'view', $id3 => 'view');
-
- $this->assertEquals($wanted1, $access1);
- $this->assertEquals($wanted2, $access2);
-
- $access1 = $this->api->getUsersAccessFromSite($id1);
- $access2 = $this->api->getUsersAccessFromSite($id2);
- $access3 = $this->api->getUsersAccessFromSite($id3);
- $wanted1 = array('user1' => 'view', 'user2' => 'admin',);
- $wanted2 = array('user1' => 'view', 'user2' => 'view');
- $wanted3 = array('user2' => 'view');
-
- $this->assertEquals($wanted1, $access1);
- $this->assertEquals($wanted2, $access2);
- $this->assertEquals($wanted3, $access3);
-
- $access1 = $this->api->getUsersSitesFromAccess('view');
- $access2 = $this->api->getUsersSitesFromAccess('admin');
- $wanted1 = array('user1' => array($id1, $id2), 'user2' => array($id2, $id3));
- $wanted2 = array('user2' => array($id1));
-
- $this->assertEquals($wanted1, $access1);
- $this->assertEquals($wanted2, $access2);
-
- // Test getUsersWithSiteAccess
- $users = $this->api->getUsersWithSiteAccess($id1, $access = 'view');
- $this->assertEquals(1, count($users));
- $this->assertEquals('user1', $users[0]['login']);
- $users = $this->api->getUsersWithSiteAccess($id2, $access = 'view');
- $this->assertEquals(2, count($users));
- $users = $this->api->getUsersWithSiteAccess($id1, $access = 'admin');
- $this->assertEquals(1, count($users));
- $this->assertEquals('user2', $users[0]['login']);
- $users = $this->api->getUsersWithSiteAccess($id3, $access = 'admin');
- $this->assertEquals(0, count($users));
- }
-
- /**
- * we set access for one user for one site several times and check that it is updated
- */
- public function testSetUserAccessMultipleCallOverwriteSingleUserOneSite()
- {
- $this->api->addUser("user1", "geqgegagae", "tegst@tesgt.com", "alias");
-
- list($id1, $id2) = $this->addSites(2);
-
- $this->api->setUserAccess("user1", "view", array($id1, $id2));
- $this->api->setUserAccess("user1", "admin", array($id1));
-
- $access1 = $this->api->getSitesAccessFromUser("user1");
- $access1 = $this->_flatten($access1);
- $wanted1 = array($id1 => 'admin', $id2 => 'view',);
-
- $this->assertEquals($wanted1, $access1);
- }
-
- /**
- * @expectedException \Exception
- * @expectedExceptionMessage checkUserHasSuperUserAccess Fake exception
- */
- public function testSetSuperUserAccess_ShouldFail_IfUserHasNotSuperUserPermission()
- {
- FakeAccess::setSuperUserAccess(false);
- $this->api->setSuperUserAccess('nologin', false);
- }
-
- /**
- * @expectedException \Exception
- * @expectedExceptionMessage UsersManager_ExceptionUserDoesNotExist
- */
- public function testSetSuperUserAccess_ShouldFail_IfUserWithGivenLoginDoesNotExist()
- {
- $this->api->setSuperUserAccess('nologin', false);
- }
-
- /**
- * @expectedException \Exception
- * @expectedExceptionMessage UsersManager_ExceptionEditAnonymous
- */
- public function testSetSuperUserAccess_ShouldFail_IfUserIsAnonymous()
- {
- $this->api->setSuperUserAccess('anonymous', true);
- }
-
- /**
- * @expectedException \Exception
- * @expectedExceptionMessage UsersManager_ExceptionRemoveSuperUserAccessOnlySuperUser
- */
- public function testSetSuperUserAccess_ShouldFail_IfUserIsOnlyRemainingUserWithSuperUserAccess()
- {
- $this->api->addUser('login1', 'password1', 'test@example.com', false);
- $this->api->setSuperUserAccess('login1', true);
-
- $this->api->setSuperUserAccess('login1', false);
- }
-
- public function testSetSuperUserAccess_ShouldDeleteAllExistingAccessEntries()
- {
- list($id1, $id2) = $this->addSites(2);
- $this->api->addUser('login1', 'password1', 'test@example.com', false);
- $this->api->setUserAccess('login1', 'view', array($id1));
- $this->api->setUserAccess('login1', 'admin', array($id2));
-
- // verify user has access before setting Super User access
- $access = $this->_flatten($this->api->getSitesAccessFromUser('login1'));
- $this->assertEquals(array($id1 => 'view', $id2 => 'admin'), $access);
-
- $this->api->setSuperUserAccess('login1', true);
-
- // verify no longer any access
- $this->assertEquals(array(), $this->model->getSitesAccessFromUser('login1'));
- }
-
- public function testSetSuperUserAccess_ShouldAddAndRemoveSuperUserAccessOnlyForGivenLogin()
- {
- $this->api->addUser('login1', 'password1', 'test1@example.com', false);
- $this->api->addUser('login2', 'password2', 'test2@example.com', false);
- $this->api->addUser('login3', 'password3', 'test3@example.com', false);
-
- $this->api->setSuperUserAccess('login2', true);
-
- // test add Super User access
- $users = $this->api->getUsers();
-
- $this->assertEquals(0, $users[0]['superuser_access']);
- $this->assertEquals(1, $users[1]['superuser_access']);
- $this->assertEquals('login2', $users[1]['login']);
- $this->assertEquals(0, $users[2]['superuser_access']);
-
- // should also accept string '1' to add Super User access
- $this->api->setSuperUserAccess('login1', '1');
- // test remove Super User access
- $this->api->setSuperUserAccess('login2', false);
-
- $users = $this->api->getUsers();
- $this->assertEquals(1, $users[0]['superuser_access']);
- $this->assertEquals('login1', $users[0]['login']);
- $this->assertEquals(0, $users[1]['superuser_access']);
- $this->assertEquals(0, $users[2]['superuser_access']);
-
- $this->api->setSuperUserAccess('login3', true);
- // should also accept string '0' to remove Super User access
- $this->api->setSuperUserAccess('login1', '0');
-
- $users = $this->api->getUsers();
- $this->assertEquals(0, $users[0]['superuser_access']);
- $this->assertEquals(0, $users[1]['superuser_access']);
- $this->assertEquals('login3', $users[2]['login']);
- $this->assertEquals(1, $users[2]['superuser_access']);
- }
-
- /**
- * @expectedException \Exception
- * @expectedExceptionMessage UsersManager_ExceptionUserDoesNotExist
- */
- public function testGetSitesAccessFromUserWrongUser()
- {
- $this->api->getSitesAccessFromUser("user1");
- }
-
- /**
- * @expectedException \Exception
- */
- public function testGetUsersAccessFromSiteWrongIdSite()
- {
- $this->api->getUsersAccessFromSite(1);
- }
-
- /**
- * @expectedException \Exception
- * @expectedExceptionMessage UsersManager_ExceptionAccessValues
- */
- public function testGetUsersSitesFromAccessWrongSite()
- {
- $this->api->getUsersSitesFromAccess('unknown');
- }
-
- /**
- * @expectedException \Exception
- * @expectedExceptionMessage UsersManager_ExceptionUserDoesNotExist
- */
- public function testUpdateUserNonExistingLogin()
- {
- $this->api->updateUser("lolgin", "password");
- }
-
- /**
- * no email no alias => keep old ones
- */
- public function testUpdateUserNoEmailNoAlias()
- {
- $login = "login";
- $user = array('login' => $login,
- 'password' => "geqgeagae",
- 'email' => "test@test.com",
- 'alias' => "alias");
-
- $this->api->addUser($user['login'], $user['password'], $user['email'], $user['alias']);
- $this->api->updateUser($login, "passowordOK");
-
- $this->_checkUserHasNotChanged($user, "passowordOK");
- }
-
- /**
- * no email => keep old ones
- */
- public function testUpdateUserNoEmail()
- {
- $login = "login";
- $user = array('login' => $login,
- 'password' => "geqgeagae",
- 'email' => "test@test.com",
- 'alias' => "alias");
-
- $this->api->addUser($user['login'], $user['password'], $user['email'], $user['alias']);
- $this->api->updateUser($login, "passowordOK", null, "newalias");
-
- $this->_checkUserHasNotChanged($user, "passowordOK", null, "newalias");
- }
-
- /**
- * no alias => keep old ones
- */
- public function testUpdateUserNoAlias()
- {
- $login = "login";
- $user = array('login' => $login,
- 'password' => "geqgeagae",
- 'email' => "test@test.com",
- 'alias' => "alias");
-
- $this->api->addUser($user['login'], $user['password'], $user['email'], $user['alias']);
- $this->api->updateUser($login, "passowordOK", "email@geaga.com");
-
- $this->_checkUserHasNotChanged($user, "passowordOK", "email@geaga.com");
- }
-
- /**
- * check to modify as the user
- * @expectedException \Exception
- * @expectedExceptionMessage UsersManager_ExceptionLoginExists
- */
- public function testAddUserIAmTheUser()
- {
- FakeAccess::$identity = 'login';
- $this->testUpdateUserNoEmailNoAlias();
- }
-
- /**
- * check to modify as being another user => exception
- *
- * @expectedException \Exception
- */
- public function testUpdateUserIAmNotTheUser()
- {
- FakeAccess::$identity = 'login2';
- FakeAccess::$superUser = false;
- $this->testUpdateUserNoEmailNoAlias();
- }
-
- /**
- * normal case, reused in other tests
- */
- public function testUpdateUser()
- {
- $login = "login";
- $user = array('login' => $login,
- 'password' => "geqgeagae",
- 'email' => "test@test.com",
- 'alias' => "alias");
-
- $this->api->addUser($user['login'], $user['password'], $user['email'], $user['alias']);
- $this->api->updateUser($login, "passowordOK", "email@geaga.com", "NEW ALIAS");
-
- $this->_checkUserHasNotChanged($user, "passowordOK", "email@geaga.com", "NEW ALIAS");
- }
-
- /**
- * @expectedException \Exception
- */
- public function testGetUserByEmailInvalidMail()
- {
- $this->api->getUserByEmail('email@test.com');
- }
-
- public function testGetUserByEmail()
- {
- $user = array('login' => "login",
- 'password' => "geqgeagae",
- 'email' => "test@test.com",
- 'alias' => "alias");
-
- $this->api->addUser($user['login'], $user['password'], $user['email'], $user['alias']);
-
- $userByMail = $this->api->getUserByEmail($user['email']);
-
- $this->assertEquals($user['login'], $userByMail['login']);
- $this->assertEquals($user['email'], $userByMail['email']);
- $this->assertEquals($user['alias'], $userByMail['alias']);
- }
-
- public function testGetUserPreferenceDefault()
- {
- $this->addSites(1);
- $defaultReportPref = API::PREFERENCE_DEFAULT_REPORT;
- $defaultReportDatePref = API::PREFERENCE_DEFAULT_REPORT_DATE;
-
- $this->assertEquals(1, $this->api->getUserPreference('someUser', $defaultReportPref));
- $this->assertEquals('yesterday', $this->api->getUserPreference('someUser', $defaultReportDatePref));
- }
-
- private function addSites($numberOfSites)
- {
- $idSites = array();
-
- for ($index = 0; $index < $numberOfSites; $index++) {
- $name = "test" . ($index + 1);
- $idSites[] = APISitesManager::getInstance()->addSite($name, array("http://piwik.net", "http://piwik.com/test/"));
- }
-
- return $idSites;
- }
-}
diff --git a/tests/PHPUnit/Integration/PrivacyManagerTest.php b/tests/PHPUnit/Integration/PrivacyManagerTest.php
deleted file mode 100644
index c229f08d8c..0000000000
--- a/tests/PHPUnit/Integration/PrivacyManagerTest.php
+++ /dev/null
@@ -1,889 +0,0 @@
-<?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\Archive;
-use Piwik\ArchiveProcessor\Rules;
-use Piwik\Common;
-use Piwik\Config;
-use Piwik\DataAccess\ArchiveTableCreator;
-use Piwik\DataTable\Manager;
-use Piwik\Date;
-use Piwik\Db;
-use Piwik\Option;
-use Piwik\Plugins\Goals\API as APIGoals;
-use Piwik\Plugins\Goals\Archiver;
-use Piwik\Plugins\PrivacyManager\LogDataPurger;
-use Piwik\Plugins\PrivacyManager\PrivacyManager;
-use Piwik\Plugins\PrivacyManager\ReportsPurger;
-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.
- // 'done' entries exist for every period, even if there's no metric data, so we need the
- // total archive count for each month.
- const TOTAL_JAN_ARCHIVE_COUNT = 37; // 31 + 4 + 1 + 1;
- const TOTAL_FEB_ARCHIVE_COUNT = 34; // 29 + 4 + 1;
-
- // the number of archive entries for a single metric if no purging is done. this #
- // is dependent on the number of periods for which there were visits.
- const JAN_METRIC_ARCHIVE_COUNT = 11; // 5 days + 4 weeks + 1 month + 1 year
- const FEB_METRIC_ARCHIVE_COUNT = 11; // 6 days + 4 weeks + 1 month
-
- const JAN_DONE_FLAGS_COUNT = 43;
-
- // fake metric/report name used to make sure unwanted metrics are purged
- const GARBAGE_FIELD = 'abcdefg';
-
- private static $idSite = 1;
- private static $dateTime = '2012-02-28';
- private static $daysAgoStart = 50;
-
- // maps table names w/ array rows
- private static $dbData = null;
-
- /**
- * @var PrivacyManager
- */
- private $instance = null;
- private $settings = null;
-
- private $unusedIdAction = null;
-
- public static function setUpBeforeClass()
- {
- parent::setUpBeforeClass();
-
- self::_addLogData();
- self::_addReportData();
-
- self::$dbData = self::getDbTablesWithData();
- }
-
- public function setUp()
- {
- parent::setUp();
-
- LogDataPurger::$selectSegmentSize = 2;
- ReportsPurger::$selectSegmentSize = 2;
-
- Db::$lockPrivilegeGranted = null;
-
- self::restoreDbTables(self::$dbData);
-
- $dateTime = Date::factory(self::$dateTime);
-
- // purging depends upon today's date, so 'older_than' parts must be dependent upon today
- $today = Date::factory('today');
- $daysSinceToday = ($today->getTimestamp() - $dateTime->getTimestamp()) / (24 * 60 * 60);
-
- $monthsSinceToday = 0;
- for ($date = $today; $date->toString('Y-m') != $dateTime->toString('Y-m'); $date = $date->subMonth(1)) {
- ++$monthsSinceToday;
- }
-
- // set default config
- $settings = array();
- $settings['delete_logs_enable'] = 1;
-
- // purging log data from before 2012-01-24
- $settings['delete_logs_older_than'] = 35 + $daysSinceToday;
- $settings['delete_logs_schedule_lowest_interval'] = 7;
- $settings['delete_logs_max_rows_per_query'] = 100000;
- $settings['delete_reports_enable'] = 1;
- $settings['delete_reports_older_than'] = $monthsSinceToday;
- $settings['delete_reports_keep_basic_metrics'] = 0;
- $settings['delete_reports_keep_day_reports'] = 0;
- $settings['delete_reports_keep_week_reports'] = 0;
- $settings['delete_reports_keep_month_reports'] = 0;
- $settings['delete_reports_keep_year_reports'] = 0;
- $settings['delete_reports_keep_range_reports'] = 0;
- $settings['delete_reports_keep_segment_reports'] = 0;
- PrivacyManager::savePurgeDataSettings($settings);
- $this->settings = $settings;
- $this->instance = new PrivacyManager();
- }
-
- public function tearDown()
- {
- parent::tearDown();
- Manager::getInstance()->deleteAll();
- Option::clearCache();
- Site::clearCache();
- Cache::deleteTrackerCache();
- ArchiveTableCreator::clear();
-
- $tempTableName = Common::prefixTable(LogDataPurger::TEMP_TABLE_NAME);
- Db::query("DROP TABLE IF EXISTS " . $tempTableName);
- }
-
- /**
- * Make sure the first time deleteLogData is run, nothing happens.
- */
- public function testDeleteLogDataInitialRun()
- {
- $this->_checkNoDataChanges();
-
- // Check it does not run
- $this->assertFalse( $this->instance->deleteLogData() );
-
- // check that initial option is set
- $this->assertEquals(1, Option::get(PrivacyManager::OPTION_LAST_DELETE_PIWIK_LOGS_INITIAL));
-
- // perform other checks
- $this->_checkNoDataChanges();
- }
-
- /**
- * Make sure the first time deleteReportData is run, nothing happens.
- */
- public function testDeleteReportDataInitialRun()
- {
- $this->assertFalse($this->instance->deleteReportData() );
-
- // check that initial option is set
- $this->assertEquals(1, Option::get(PrivacyManager::OPTION_LAST_DELETE_PIWIK_LOGS_INITIAL));
-
- // perform other checks
- $this->_checkNoDataChanges();
- }
-
- /**
- * Make sure the task is not run when its scheduled for later.
- */
- public function testPurgeDataNotTimeToRun()
- {
- $yesterdaySecs = Date::factory('yesterday')->getTimestamp();
-
- Option::set(PrivacyManager::OPTION_LAST_DELETE_PIWIK_LOGS_INITIAL, 1);
- Option::set(PrivacyManager::OPTION_LAST_DELETE_PIWIK_LOGS, $yesterdaySecs);
- Option::set(PrivacyManager::OPTION_LAST_DELETE_PIWIK_REPORTS, $yesterdaySecs);
- $this->assertFalse( $this->instance->deleteLogData() );
- $this->assertFalse( $this->instance->deleteReportData() );
-
- // perform checks
- $this->_checkNoDataChanges();
- }
-
- /**
- * Make sure purging data runs when scheduled.
- */
- public function testPurgeDataNotInitialAndTimeToRun()
- {
- // get purge data prediction
- $prediction = PrivacyManager::getPurgeEstimate();
-
- // perform checks on prediction
- $events = 3; // only the event action for the three purged day, dayAgo=x are purged (others are still in use)
- $expectedPrediction = array(
- Common::prefixTable('log_conversion') => 6,
- Common::prefixTable('log_link_visit_action') => 6 + $events,
- Common::prefixTable('log_visit') => 3,
- Common::prefixTable('log_conversion_item') => 3,
- Common::prefixTable('archive_numeric_2012_01') => -1,
- Common::prefixTable('archive_blob_2012_01') => -1
- );
- $this->assertEquals($expectedPrediction, $prediction);
-
- // purge data
- $this->_setTimeToRun();
- $this->assertTrue( $this->instance->deleteLogData() );
- $this->assertTrue($this->instance->deleteReportData() );
-
- // perform checks
- $this->checkLogDataPurged();
-
- $archiveTables = self::_getArchiveTableNames();
-
- // January numeric table should be dropped
- $this->assertEquals(self::JAN_DONE_FLAGS_COUNT, $this->_getTableCount($archiveTables['numeric'][0])); // January
-
- // Check february metric count
- $febRowCount = $this->_getExpectedNumericArchiveCountFeb();
- $this->assertEquals($febRowCount, $this->_getTableCount($archiveTables['numeric'][1])); // February
-
- // January blob table should be dropped
- $this->assertEquals(0, $this->_getTableCount($archiveTables['blob'][0])); // January
-
- // Check february blob count (1 blob per period w/ visits + 1 garbage report)
- $this->assertEquals(self::FEB_METRIC_ARCHIVE_COUNT + 1, $this->_getTableCount($archiveTables['blob'][1])); // February
- }
-
- /**
- * Make sure nothing happens when deleting logs & reports are both disabled.
- */
- public function testPurgeDataBothDisabled()
- {
- PrivacyManager::savePurgeDataSettings(array(
- 'delete_logs_enable' => 0,
- 'delete_reports_enable' => 0
- ));
-
- // get purge data prediction
- $prediction = PrivacyManager::getPurgeEstimate();
-
- // perform checks on prediction
- $expectedPrediction = array();
- $this->assertEquals($expectedPrediction, $prediction);
-
- // purge data
- $this->_setTimeToRun();
- $hasDeleted = $this->instance->deleteLogData();
- $this->assertFalse($hasDeleted);
- $this->assertFalse($this->instance->deleteReportData() );
-
- // perform checks
- $this->_checkNoDataChanges();
- }
-
- /**
- * Test that purgeData works when there's no data.
- */
- public function testPurgeDataDeleteLogsNoData()
- {
- \Piwik\DbHelper::truncateAllTables();
- foreach (ArchiveTableCreator::getTablesArchivesInstalled() as $table) {
- Db::exec("DROP TABLE $table");
- }
-
- // get purge data prediction
- $prediction = PrivacyManager::getPurgeEstimate();
-
- // perform checks on prediction
- $expectedPrediction = array();
- $this->assertEquals($expectedPrediction, $prediction);
-
- // purge data
- $this->_setTimeToRun();
- $this->assertTrue( $this->instance->deleteLogData() );
-
- $this->assertTrue($this->instance->deleteReportData() );
-
- // perform checks
- $this->assertEquals(0, $this->_getTableCount('log_visit'));
- $this->assertEquals(0, $this->_getTableCount('log_conversion'));
- $this->assertEquals(0, $this->_getTableCount('log_link_visit_action'));
- $this->assertEquals(0, $this->_getTableCount('log_conversion_item'));
-
- $archiveTables = self::_getArchiveTableNames();
- $this->assertFalse($this->_tableExists($archiveTables['numeric'][0])); // January
- $this->assertFalse($this->_tableExists($archiveTables['numeric'][1])); // February
- $this->assertFalse($this->_tableExists($archiveTables['blob'][0])); // January
- $this->assertFalse($this->_tableExists($archiveTables['blob'][1])); // February
- }
-
- /**
- * Test that purgeData works correctly when the 'keep basic metrics' setting is set to true.
- */
- public function testPurgeDataDeleteReportsKeepBasicMetrics()
- {
- PrivacyManager::savePurgeDataSettings(array(
- 'delete_reports_keep_basic_metrics' => 1
- ));
-
- // get purge data prediction
- $prediction = PrivacyManager::getPurgeEstimate();
-
- // perform checks on prediction
- $events = 3; // only the event action for the three purged day, dayAgo=x are purged (others are still in use)
- $expectedPrediction = array(
- Common::prefixTable('log_conversion') => 6,
- Common::prefixTable('log_link_visit_action') => 6 + $events,
- Common::prefixTable('log_visit') => 3,
- Common::prefixTable('log_conversion_item') => 3,
- Common::prefixTable('archive_numeric_2012_01') => 1, // remove the garbage metric
- Common::prefixTable('archive_blob_2012_01') => -1
- );
- $this->assertEquals($expectedPrediction, $prediction);
-
- // purge data
- $this->_setTimeToRun();
- $this->assertTrue( $this->instance->deleteLogData() );
- $this->assertTrue($this->instance->deleteReportData() );
-
- // perform checks
- $this->checkLogDataPurged();
-
- $archiveTables = self::_getArchiveTableNames();
-
- // all numeric metrics should be saved except the garbage metric
- $janRowCount = $this->_getExpectedNumericArchiveCountJan() - 1;
- $tableName = $archiveTables['numeric'][0];
- $tableCount = $this->_getTableCount($tableName);
- $this->assertEquals($janRowCount, $tableCount); // January
-
- if ($janRowCount != $tableCount) {
- $this->dumpTable($tableName);
- }
-
- // check february numerics not deleted
- $febRowCount = $this->_getExpectedNumericArchiveCountFeb();
- $this->assertEquals($febRowCount, $this->_getTableCount($archiveTables['numeric'][1])); // February
-
- $this->assertEquals(0, $this->_getTableCount($archiveTables['blob'][0])); // January
-
- // check for no changes in the february blob table
- $this->assertEquals(self::FEB_METRIC_ARCHIVE_COUNT + 1, $this->_getTableCount($archiveTables['blob'][1])); // February
- }
-
- /**
- * Test that purgeData works correctly when the 'keep daily reports' setting is set to true.
- */
- public function testPurgeDataDeleteReportsKeepDailyReports()
- {
- PrivacyManager::savePurgeDataSettings(array(
- 'delete_reports_keep_day_reports' => 1
- ));
-
- // get purge data prediction
- $prediction = PrivacyManager::getPurgeEstimate();
-
- // perform checks on prediction
- $events = 3; // only the event action for the three purged day, dayAgo=x are purged (others are still in use)
- $expectedPrediction = array(
- Common::prefixTable('log_conversion') => 6,
- Common::prefixTable('log_link_visit_action') => 6 + $events,
- Common::prefixTable('log_visit') => 3,
- Common::prefixTable('log_conversion_item') => 3,
- Common::prefixTable('archive_numeric_2012_01') => -1,
- Common::prefixTable('archive_blob_2012_01') => 10 // removing 4 weeks, 1 month & 1 year + 1 garbage report + 2 range reports + 1 segmented report
- );
- $this->assertEquals($expectedPrediction, $prediction);
-
- // purge data
- $this->_setTimeToRun();
- $this->assertTrue( $this->instance->deleteLogData() );
- $this->assertTrue($this->instance->deleteReportData() );
-
- // perform checks
- $this->checkLogDataPurged();
- $this->_checkReportsAndMetricsPurged($janBlobsRemaining = 5, $janNumericRemaining = 68); // 5 blobs for 5 days
- }
-
- /**
- * Test that purgeData works correctly when the 'keep weekly reports' setting is set to true.
- */
- public function testPurgeDataDeleteReportsKeepWeeklyReports()
- {
- PrivacyManager::savePurgeDataSettings(array(
- 'delete_reports_keep_week_reports' => 1
- ));
-
- // get purge data prediction
- $prediction = PrivacyManager::getPurgeEstimate();
-
- // perform checks on prediction
- $events = 3; // only the event action for the three purged day, dayAgo=x are purged (others are still in use)
- $expectedPrediction = array(
- Common::prefixTable('log_conversion') => 6,
- Common::prefixTable('log_link_visit_action') => 6 + $events,
- Common::prefixTable('log_visit') => 3,
- Common::prefixTable('log_conversion_item') => 3,
- Common::prefixTable('archive_numeric_2012_01') => -1,
- Common::prefixTable('archive_blob_2012_01') => 11 // 5 days, 1 month & 1 year to remove + 1 garbage report + 2 range reports + 1 segmented report
- );
- $this->assertEquals($expectedPrediction, $prediction);
-
- // purge data
- $this->_setTimeToRun();
- $this->assertTrue( $this->instance->deleteLogData() );
- $this->assertTrue($this->instance->deleteReportData() );
-
- // perform checks
- $this->checkLogDataPurged();
- $this->_checkReportsAndMetricsPurged($janBlobsRemaining = 4, $janNumericRemaining = 63); // 4 blobs for 4 weeks
- }
-
- /**
- * Test that purgeData works correctly when the 'keep monthly reports' setting is set to true.
- */
- public function testPurgeDataDeleteReportsKeepMonthlyReports()
- {
- PrivacyManager::savePurgeDataSettings(array(
- 'delete_reports_keep_month_reports' => 1
- ));
-
- // get purge data prediction
- $prediction = PrivacyManager::getPurgeEstimate();
-
- // perform checks on prediction
- $events = 3; // only the event action for the three purged day, dayAgo=x are purged (others are still in use)
- $expectedPrediction = array(
- Common::prefixTable('log_conversion') => 6,
- Common::prefixTable('log_link_visit_action') => 6 + $events,
- Common::prefixTable('log_visit') => 3,
- Common::prefixTable('log_conversion_item') => 3,
- Common::prefixTable('archive_numeric_2012_01') => -1,
- Common::prefixTable('archive_blob_2012_01') => 14 // 5 days, 4 weeks, 1 year to remove + 1 garbage report + 2 range reports + 1 segmented report
- );
- $this->assertEquals($expectedPrediction, $prediction);
-
- // purge data
- $this->_setTimeToRun();
- $this->assertTrue( $this->instance->deleteLogData() );
- $this->assertTrue($this->instance->deleteReportData() );
-
- // perform checks
- $this->checkLogDataPurged();
- $this->_checkReportsAndMetricsPurged($janBlobsRemaining = 1, $janNumericRemaining = 48);
- }
-
- /**
- * Test that purgeData works correctly when the 'keep yearly reports' setting is set to true.
- */
- public function testPurgeDataDeleteReportsKeepYearlyReports()
- {
- PrivacyManager::savePurgeDataSettings(array(
- 'delete_reports_keep_year_reports' => 1
- ));
-
- // get purge data prediction
- $prediction = PrivacyManager::getPurgeEstimate();
-
- // perform checks on prediction
- $events = 3; // only the event action for the three purged day, dayAgo=x are purged (others are still in use)
- $expectedPrediction = array(
- Common::prefixTable('log_conversion') => 6,
- Common::prefixTable('log_link_visit_action') => 6 + $events,
- Common::prefixTable('log_visit') => 3,
- Common::prefixTable('log_conversion_item') => 3,
- Common::prefixTable('archive_numeric_2012_01') => -1,
- Common::prefixTable('archive_blob_2012_01') => 14 // 5 days, 4 weeks & 1 year to remove + 1 garbage report + 2 range reports + 1 segmented report
- );
- $this->assertEquals($expectedPrediction, $prediction);
-
- // purge data
- $this->_setTimeToRun();
- $this->assertTrue( $this->instance->deleteLogData() );
- $this->assertTrue($this->instance->deleteReportData() );
-
- // perform checks
- $this->checkLogDataPurged();
- $this->_checkReportsAndMetricsPurged($janBlobsRemaining = 1, $janNumericRemaining = 48);
- }
-
- /**
- * Test no concurrency issues when deleting log data from log_action table.
- */
- public function testPurgeLogDataConcurrency()
- {
- \Piwik\Piwik::addAction("LogDataPurger.ActionsToKeepInserted.olderThan", array($this, 'addReferenceToUnusedAction'));
-
- $purger = LogDataPurger::make($this->settings, true);
-
- $this->unusedIdAction = Db::fetchOne(
- "SELECT idaction FROM " . Common::prefixTable('log_action') . " WHERE name = ?",
- array('whatever.com/_40'));
- $this->assertTrue($this->unusedIdAction > 0);
-
- // purge data
- $purger->purgeData();
-
- // check that actions were purged
- $this->assertEquals(22 + $this->getCountEventIdsNotPurged(), $this->_getTableCount('log_action')); // January
-
- // check that the unused action still exists
- $count = Db::fetchOne(
- "SELECT COUNT(*) FROM " . Common::prefixTable('log_action') . " WHERE idaction = ?",
- array($this->unusedIdAction));
- $this->assertEquals(1, $count);
-
- $this->unusedIdAction = null; // so the hook won't get executed twice
- }
-
- /**
- * Tests that purgeData works correctly when the 'keep range reports' setting is set to true.
- */
- public function testPurgeDataDeleteReportsKeepRangeReports()
- {
- PrivacyManager::savePurgeDataSettings(array(
- 'delete_reports_keep_range_reports' => 1
- ));
-
- // get purge data prediction
- $prediction = PrivacyManager::getPurgeEstimate();
-
- // perform checks on prediction
- $events = 3; // only the event action for the three purged day, dayAgo=x are purged (others are still in use)
- $expectedPrediction = array(
- Common::prefixTable('log_conversion') => 6,
- Common::prefixTable('log_link_visit_action') => 6 + $events,
- Common::prefixTable('log_visit') => 3,
- Common::prefixTable('log_conversion_item') => 3,
- Common::prefixTable('archive_numeric_2012_01') => -1,
- Common::prefixTable('archive_blob_2012_01') => 13 // 5 days, 4 weeks, 1 month & 1 year + 1 garbage report + 1 segmented report
- );
- $this->assertEquals($expectedPrediction, $prediction);
-
- // purge data
- $this->_setTimeToRun();
- $this->assertTrue( $this->instance->deleteLogData() );
- $this->assertTrue($this->instance->deleteReportData() );
-
- // perform checks
- $this->checkLogDataPurged();
- $this->_checkReportsAndMetricsPurged($janBlobsRemaining = 2, $janNumericRemaining = 47); // 2 range blobs
- }
-
- /**
- * Tests that purgeData works correctly when the 'keep segment reports' setting is set to true.
- */
- public function testPurgeDataDeleteReportsKeepSegmentsReports()
- {
- PrivacyManager::savePurgeDataSettings(array(
- 'delete_reports_keep_day_reports' => 1,
- 'delete_reports_keep_segment_reports' => 1
- ));
-
- // get purge data prediction
- $prediction = PrivacyManager::getPurgeEstimate();
-
- // perform checks on prediction
- $events = 3; // only the event action for the three purged day, dayAgo=x are purged (others are still in use)
- $expectedPrediction = array(
- Common::prefixTable('log_conversion') => 6,
- Common::prefixTable('log_link_visit_action') => 6 + $events,
- Common::prefixTable('log_visit') => 3,
- Common::prefixTable('log_conversion_item') => 3,
- Common::prefixTable('archive_numeric_2012_01') => -1,
- Common::prefixTable('archive_blob_2012_01') => 9 // 4 weeks, 1 month & 1 year + 1 garbage report + 2 range reports
- );
- $this->assertEquals($expectedPrediction, $prediction);
-
- // purge data
- $this->_setTimeToRun();
- $this->assertTrue( $this->instance->deleteLogData() );
- $this->assertTrue($this->instance->deleteReportData() );
-
- // perform checks
- $this->checkLogDataPurged();
- $this->_checkReportsAndMetricsPurged($janBlobsRemaining = 6, $janNumericRemaining = 70); // 1 segmented blob + 5 day blobs
- }
-
- // --- utility functions follow ---
-
- protected static function _addLogData()
- {
- // tracks visits on the following days:
- // - 2012-01-09
- // - 2012-01-14
- // - 2012-01-19
- // - 2012-01-24 <--- everything before this date is to be purged
- // - 2012-01-29
- // - 2012-02-03
- // - 2012-02-08
- // - 2012-02-13
- // - 2012-02-18
- // - 2012-02-23
- // - 2012-02-28
- // 6 visits in feb, 5 in jan
-
- // following actions are created:
- // - 'First page view'
- // - 'Second page view'
- // - 'SKU2'
- // - 'Canon SLR'
- // - 'Electronics & Cameras'
- // - for every visit (11 visits total):
- // - http://whatever.com/_{$daysSinceLastVisit}
- // - http://whatever.com/42/{$daysSinceLastVisit}
-
- $start = Date::factory(self::$dateTime);
- self::$idSite = Fixture::createWebsite('2012-01-01', $ecommerce = 1);
- APIGoals::getInstance()->addGoal(self::$idSite, 'match all', 'url', 'http', 'contains');
-
- $t = Fixture::getTracker(self::$idSite, $start, $defaultInit = true);
- $t->enableBulkTracking();
- $t->setTokenAuth(Fixture::getTokenAuth());
-
- for ($daysAgo = self::$daysAgoStart; $daysAgo >= 0; $daysAgo -= 5) // one visit every 5 days
- {
- $dateTime = $start->subDay($daysAgo)->toString();
-
- $t->setForceVisitDateTime($dateTime);
- $t->setUserAgent('Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.2.6) Gecko/20100625 Firefox/3.6.6 (.NET CLR 3.5.30729)');
-
- // use $daysAgo to make sure new actions are created for every day and aren't used again.
- // when deleting visits, some of these actions will no longer be referenced in the DB.
- $t->setUrl("http://whatever.com/_$daysAgo");
- $t->doTrackPageView('First page view');
-
- $t->setForceVisitDateTime(Date::factory($dateTime)->addHour(0.05));
- $t->setUrl("http://whatever.com/42/$daysAgo");
- $t->doTrackPageView('Second page view');
-
- $t->setForceVisitDateTime(Date::factory($dateTime)->addHour(0.1));
- $t->setUrl("http://whatever.com/event");
- $t->doTrackEvent('Event action', 'event cat', 'daysAgo=' . $daysAgo, 1000);
-
- $t->setForceVisitDateTime(Date::factory($dateTime)->addHour(0.2));
- $t->addEcommerceItem($sku = 'SKU2', $name = 'Canon SLR', $category = 'Electronics & Cameras',
- $price = 1500, $quantity = 1);
- $t->doTrackEcommerceOrder($orderId = '937nsjusu ' . $dateTime, $grandTotal = 1111.11, $subTotal = 1000,
- $tax = 111, $shipping = 0.11, $discount = 666);
- }
- Fixture::checkBulkTrackingResponse($t->doBulkTrack());
- }
-
- protected static function _addReportData()
- {
- $date = Date::factory(self::$dateTime);
-
- $archive = Archive::build(self::$idSite, 'year', $date);
-
- APIVisitorInterest::getInstance()->getNumberOfVisitsPerVisitDuration(self::$idSite, 'year', $date);
-
- // months are added via the 'year' period, but weeks must be done manually
- for ($daysAgo = self::$daysAgoStart; $daysAgo > 0; $daysAgo -= 7) // every week
- {
- $dateTime = $date->subDay($daysAgo);
-
- $archive = Archive::build(self::$idSite, 'week', $dateTime);
- $archive->getNumeric('nb_visits');
-
- APIVisitorInterest::getInstance()->getNumberOfVisitsPerVisitDuration(
- self::$idSite, 'week', $dateTime);
- }
-
- // add segment for one day
- $archive = Archive::build(self::$idSite, 'day', '2012-01-14', 'browserCode==FF');
- $archive->getNumeric('nb_visits', 'nb_hits');
-
- APIVisitorInterest::getInstance()->getNumberOfVisitsPerVisitDuration(
- self::$idSite, 'day', '2012-01-14', 'browserCode==FF');
-
- // add range within January
- $rangeEnd = Date::factory('2012-01-29');
- $rangeStart = $rangeEnd->subDay(1);
- $range = $rangeStart->toString('Y-m-d') . "," . $rangeEnd->toString('Y-m-d');
-
- $rangeArchive = Archive::build(self::$idSite, 'range', $range);
- $rangeArchive->getNumeric('nb_visits', 'nb_hits');
-
- APIVisitorInterest::getInstance()->getNumberOfVisitsPerVisitDuration(self::$idSite, 'range', $range);
-
- // add range between January & February
- $rangeStart = $rangeEnd;
- $rangeEnd = $rangeStart->addDay(3);
- $range = $rangeStart->toString('Y-m-d') . "," . $rangeEnd->toString('Y-m-d');
-
- $rangeArchive = Archive::build(self::$idSite, 'range', $range);
- $rangeArchive->getNumeric('nb_visits', 'nb_hits');
-
- APIVisitorInterest::getInstance()->getNumberOfVisitsPerVisitDuration(self::$idSite, 'range', $range);
-
- // when archiving is initiated, the archive metrics & reports for EVERY loaded plugin
- // are archived. don't want this test to depend on every possible metric, so get rid of
- // the unwanted archive data now.
- $metricsToSave = array(
- 'nb_visits',
- 'nb_actions',
- Archiver::getRecordName('revenue'),
- Archiver::getRecordName('nb_conversions', 1),
- Archiver::getRecordName('revenue', GoalManager::IDGOAL_ORDER)
- );
-
- $archiveTables = self::_getArchiveTableNames();
- foreach ($archiveTables['numeric'] as $table) {
- $realTable = Common::prefixTable($table);
- $sql = "DELETE FROM $realTable WHERE name NOT IN ('" . implode("','", $metricsToSave) . "') AND name NOT LIKE 'done%'";
- Db::query($sql);
- }
- foreach ($archiveTables['blob'] as $table) {
- $realTable = Common::prefixTable($table);
- Db::query("DELETE FROM $realTable WHERE name NOT IN ('VisitorInterest_timeGap')");
- }
-
- // add garbage metrics
- $janDate1 = '2012-01-05';
- $febDate1 = '2012-02-04';
-
- $sql = "INSERT INTO %s (idarchive,name,idsite,date1,date2,period,ts_archived,value)
- VALUES (10000,?,1,?,?,?,?,?)";
-
- // one metric for jan & one for feb
- Db::query(sprintf($sql, Common::prefixTable($archiveTables['numeric'][0])),
- array(self::GARBAGE_FIELD, $janDate1, $janDate1, $janDate1, 1, 100));
- Db::query(sprintf($sql, Common::prefixTable($archiveTables['numeric'][1])),
- array(self::GARBAGE_FIELD, $febDate1, $febDate1, $febDate1, 1, 200));
-
- // add garbage reports
- Db::query(sprintf($sql, Common::prefixTable($archiveTables['blob'][0])),
- array(self::GARBAGE_FIELD, $janDate1, $janDate1, $janDate1, 10, 'blobval'));
- Db::query(sprintf($sql, Common::prefixTable($archiveTables['blob'][1])),
- array(self::GARBAGE_FIELD, $febDate1, $febDate1, $febDate1, 20, 'blobval'));
- }
-
- protected function _checkNoDataChanges()
- {
- // 11 visits total w/ 2 actions per visit & 2 conversions per visit. 1 e-commerce order per visit.
- $this->assertEquals(11, $this->_getTableCount('log_visit'));
- $this->assertEquals(22, $this->_getTableCount('log_conversion'));
- $this->assertEquals(33, $this->_getTableCount('log_link_visit_action'));
- $this->assertEquals(11, $this->_getTableCount('log_conversion_item'));
- $this->assertEquals(41, $this->_getTableCount('log_action'));
-
- $archiveTables = self::_getArchiveTableNames();
- //var_export(Db::fetchAll("SELECT * FROM " . Common::prefixTable($archiveTables['numeric'][0])));
-
- $janMetricCount = $this->_getExpectedNumericArchiveCountJan();
- $this->assertEquals($janMetricCount, $this->_getTableCount($archiveTables['numeric'][0])); // January
-
- // no range metric for february
- $febMetricCount = $this->_getExpectedNumericArchiveCountFeb();
- $this->assertEquals($febMetricCount, $this->_getTableCount($archiveTables['numeric'][1])); // February
-
- // 1 entry per period w/ visits + 1 garbage report + 2 range reports + 1 segment report
- $this->assertEquals(self::JAN_METRIC_ARCHIVE_COUNT + 1 + 2 + 1, $this->_getTableCount($archiveTables['blob'][0])); // January
- $this->assertEquals(self::FEB_METRIC_ARCHIVE_COUNT + 1, $this->_getTableCount($archiveTables['blob'][1])); // February
- }
-
- /**
- * Helper method. Performs checks after reports are purged. Checks that the january numeric table
- * was dropped, that the february metric & blob tables are unaffected, and that the january blob
- * table has a certain number of blobs.
- */
- protected function _checkReportsAndMetricsPurged($janBlobsRemaining, $janNumericRemaining)
- {
- $archiveTables = self::_getArchiveTableNames();
-
- $this->assertEquals($janNumericRemaining, $this->_getTableCount($archiveTables['numeric'][0]));
-
- // check february numerics not deleted
- $febRowCount = $this->_getExpectedNumericArchiveCountFeb();
- $this->assertEquals($febRowCount, $this->_getTableCount($archiveTables['numeric'][1])); // February
-
- // check the january blob count
- $this->assertEquals($janBlobsRemaining, $this->_getTableCount($archiveTables['blob'][0])); // January
-
- // check for no changes in the february blob table (1 blob for every period w/ visits in feb + 1 garbage report)
- $this->assertEquals(self::FEB_METRIC_ARCHIVE_COUNT + 1, $this->_getTableCount($archiveTables['blob'][1])); // February
- }
-
- private function checkLogDataPurged()
- {
- // 3 days removed by purge, so 3 visits, 6 conversions, 6 visit actions, 3 e-commerce orders
- // & 6 actions removed
- $events = 11 - 3; // 3 deleted;
- $this->assertEquals(8, $this->_getTableCount('log_visit'));
- $this->assertEquals(16, $this->_getTableCount('log_conversion'));
- $this->assertEquals(16 + $events, $this->_getTableCount('log_link_visit_action'));
- $this->assertEquals(8, $this->_getTableCount('log_conversion_item'));
-
- $eventsId = $this->getCountEventIdsNotPurged();
- $this->assertEquals(21 + $eventsId, $this->_getTableCount('log_action'));
- }
-
- /**
- * Event hook that adds a row into the DB that references unused idaction AFTER LogDataPurger
- * does the insert into the temporary table. When log_actions are deleted, this idaction should still
- * be kept. w/ the wrong strategy, it won't be and there will be a dangling reference
- * in the log_link_visit_action table.
- */
- public function addReferenceToUnusedAction()
- {
- $unusedIdAction = $this->unusedIdAction;
- if (empty($unusedIdAction)) // make sure we only do this for one test case
- {
- return;
- }
-
- $logLinkVisitActionTable = Common::prefixTable("log_link_visit_action");
-
- $sql = "INSERT INTO $logLinkVisitActionTable
- (idsite, idvisitor, server_time, idvisit, idaction_url, idaction_url_ref,
- idaction_name, idaction_name_ref, time_spent_ref_action)
- VALUES (1, 'abc', NOW(), 15, $unusedIdAction, $unusedIdAction,
- $unusedIdAction, $unusedIdAction, 1000)";
-
- Db::query($sql);
- }
-
- protected function _setTimeToRun()
- {
- $lastDateSecs = Date::factory('today')->subDay(8)->getTimestamp();
-
- Option::set(PrivacyManager::OPTION_LAST_DELETE_PIWIK_LOGS_INITIAL, 1);
- Option::set(PrivacyManager::OPTION_LAST_DELETE_PIWIK_LOGS, $lastDateSecs);
- Option::set(PrivacyManager::OPTION_LAST_DELETE_PIWIK_REPORTS, $lastDateSecs);
- }
-
- protected function _getTableCount($tableName, $where = '')
- {
- $sql = "SELECT COUNT(*) FROM " . Common::prefixTable($tableName) . " $where";
- return Db::fetchOne($sql);
- }
-
- protected function dumpTable($tableName, $where = '')
- {
- $sql = "SELECT * FROM " . Common::prefixTable($tableName) . " $where";
- var_export(Db::fetchAll($sql));
- }
-
- protected function _tableExists($tableName)
- {
- $dbName = Config::getInstance()->database['dbname'];
-
- $sql = "SELECT COUNT(*) FROM information_schema.tables WHERE table_schema = ? AND table_name = ?";
- return Db::fetchOne($sql, array($dbName, Common::prefixTable($tableName))) == 1;
- }
-
- protected static function _getArchiveTableNames()
- {
- return array(
- 'numeric' => array(
- 'archive_numeric_2012_01',
- 'archive_numeric_2012_02'
- ),
- 'blob' => array(
- 'archive_blob_2012_01',
- 'archive_blob_2012_02'
- )
- );
- }
-
- protected function _getExpectedNumericArchiveCountJan()
- {
- // 5 entries per period w/ visits
- // + 1 entry for every period in the month (the 'done' rows)
- // + 1 garbage metric
- // log_link_visit_action+ 2 entries per range period (4 total) + 2 'done...' entries per range period (4 total)
- // + 2 entries per segment (2 total) + 2 'done...' entries per segment (2 total)
- return self::JAN_METRIC_ARCHIVE_COUNT * 5 + self::TOTAL_JAN_ARCHIVE_COUNT + 1 + 8 + 4;
- }
-
- protected function _getExpectedNumericArchiveCountFeb()
- {
- // (5 metrics per period w/ visits
- // + 1 'done' archive for every period)
- // + 1 garbage metric
- return self::FEB_METRIC_ARCHIVE_COUNT * 5 + self::TOTAL_FEB_ARCHIVE_COUNT + 1;
- }
-
- /**
- * @return int
- */
- private function getCountEventIdsNotPurged()
- {
- $eventsId = 11 /* days eventAction */ + 2 /* category+name */ + 1 /* event url */ - 3 /* days deleted */
- ;
- return $eventsId;
- }
-} \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/PurgeDataTest.php b/tests/PHPUnit/Integration/PurgeDataTest.php
deleted file mode 100755
index 29d7ccc084..0000000000
--- a/tests/PHPUnit/Integration/PurgeDataTest.php
+++ /dev/null
@@ -1,194 +0,0 @@
-<?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;
-
-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 PurgeDataTest extends IntegrationTestCase
-{
- public static $fixture = null; // initialized below class definition
-
- public static function setUpBeforeClass()
- {
-
- }
- public static function tearDownBeforeClass()
- {
-
- }
-
- public function setUp()
- {
- parent::setUpBeforeClass();
- }
-
- public function tearDown()
- {
- parent::tearDownAfterClass();
- }
-
- public function test_purgeData_keepAllExceptDay()
- {
- $this->assertHasOneDownload('day');
- $this->assertHasOneDownload('week');
- $this->assertHasOneDownload('month');
- $this->assertHasOneDownload('year');
-
- $deleteReportsOlderThan = 1;
- $keepBasicMetrics = true;
- $reportPeriodsToKeep = array(2,3,4,5);
- $this->purgeData($deleteReportsOlderThan, $reportPeriodsToKeep, $keepBasicMetrics);
-
- $this->assertHasNoDownload('day');
- $this->assertHasOneDownload('week');
- $this->assertHasOneDownload('month');
- $this->assertHasOneDownload('year');
- }
-
- public function test_purgeData_keepOnlyDay()
- {
- $this->assertHasOneDownload('day');
- $this->assertHasOneDownload('week');
- $this->assertHasOneDownload('month');
- $this->assertHasOneDownload('year');
-
- $deleteReportsOlderThan = 1;
- $keepBasicMetrics = true;
- $reportPeriodsToKeep = array(1);
- $this->purgeData($deleteReportsOlderThan, $reportPeriodsToKeep, $keepBasicMetrics);
-
- $this->assertNumVisits(2, 'day');
- $this->assertNumVisits(2, 'week');
- $this->assertHasOneDownload('day');
- $this->assertHasNoDownload('week');
- $this->assertHasNoDownload('month');
- $this->assertHasNoDownload('year');
- }
-
- public function test_purgeData_shouldNotPurgeAnything_IfDeleteReportsOlderThanIsFarBackInThePast()
- {
- $this->assertHasOneDownload('day');
- $this->assertHasOneDownload('week');
- $this->assertHasOneDownload('month');
- $this->assertHasOneDownload('year');
-
- $deleteReportsOlderThan = 1000;
- $keepBasicMetrics = true;
- $reportPeriodsToKeep = array(1,2,3,4,5);
- $this->purgeData($deleteReportsOlderThan, $reportPeriodsToKeep, $keepBasicMetrics);
-
- $this->assertHasOneDownload('day');
- $this->assertHasOneDownload('week');
- $this->assertHasOneDownload('month');
- $this->assertHasOneDownload('year');
- }
-
- public function test_purgeData_shouldPurgeAllPeriodsExceptBasicMetrics_IfNoPeriodToKeepIsGiven()
- {
- $this->assertHasOneDownload('day');
- $this->assertHasOneDownload('week');
- $this->assertHasOneDownload('month');
- $this->assertHasOneDownload('year');
-
- $deleteReportsOlderThan = 1;
- $keepBasicMetrics = true;
- $reportPeriodsToKeep = array();
- $this->purgeData($deleteReportsOlderThan, $reportPeriodsToKeep, $keepBasicMetrics);
-
- $this->assertNumVisits(2, 'day');
- $this->assertNumVisits(2, 'week');
- $this->assertNumVisits(2, 'month');
- $this->assertNumVisits(2, 'year');
- $this->assertHasNoDownload('day');
- $this->assertHasNoDownload('week');
- $this->assertHasNoDownload('month');
- $this->assertHasNoDownload('year');
- }
-
- public function test_purgeData_shouldPurgeEverything_IfNoPeriodToKeepIsGivenAndBasicMetricsNotKept()
- {
- $this->assertHasOneDownload('day');
- $this->assertHasOneDownload('week');
- $this->assertHasOneDownload('month');
- $this->assertHasOneDownload('year');
-
- $deleteReportsOlderThan = 1;
- $keepBasicMetrics = false;
- $reportPeriodsToKeep = array();
- $this->purgeData($deleteReportsOlderThan, $reportPeriodsToKeep, $keepBasicMetrics);
-
- $this->assertNumVisits(0, 'day');
- $this->assertNumVisits(0, 'week');
- $this->assertNumVisits(0, 'month');
- $this->assertNumVisits(0, 'year');
- $this->assertHasNoDownload('day');
- $this->assertHasNoDownload('week');
- $this->assertHasNoDownload('month');
- $this->assertHasNoDownload('year');
- }
-
- private function assertNumVisits($expectedNumVisits, $period)
- {
- $url = 'method=VisitsSummary.getVisits'
- . '&idSite=' . self::$fixture->idSite
- . '&date=' . self::$fixture->dateTime
- . '&period='. $period
- . '&format=original';
- $api = new Request($url);
- $table = $api->process();
- $this->assertEquals($expectedNumVisits, $table->getFirstRow()->getColumn('nb_visits'));
- }
-
- private function assertHasOneDownload($period)
- {
- $api = new Request($this->getDownloadApiRequestUrl($period));
- $table = $api->process();
- $this->assertEquals(1, $table->getRowsCount(), $period . ' should have one download but has not');
- }
-
- private function assertHasNoDownload($period)
- {
- $api = new Request($this->getDownloadApiRequestUrl($period));
- $table = $api->process();
- $this->assertEquals(0, $table->getRowsCount(), $period . ' should not have a download but has one');
- }
-
- private function getDownloadApiRequestUrl($period)
- {
- return 'method=Actions.getDownloads'
- . '&idSite=' . self::$fixture->idSite
- . '&date=' . self::$fixture->dateTime
- . '&period='. $period
- . '&format=original';
- }
-
- private function purgeData($deleteReportsOlderThan, $reportPeriodsToKeep, $keepBasicMetrics)
- {
- $metricsToKeep = PrivacyManager::getAllMetricsToKeep();
- $maxRowsToDeletePerQuery = 100000;
- $keepSegmentReports = false;
-
- $purger = new ReportsPurger($deleteReportsOlderThan, $keepBasicMetrics, $reportPeriodsToKeep,
- $keepSegmentReports, $metricsToKeep, $maxRowsToDeletePerQuery);
- $purger->purgeData();
- }
-}
-
-PurgeDataTest::$fixture = new OneVisitorTwoVisits();
diff --git a/tests/PHPUnit/Integration/ReleaseCheckListTest.php b/tests/PHPUnit/Integration/ReleaseCheckListTest.php
new file mode 100644
index 0000000000..947b06a537
--- /dev/null
+++ b/tests/PHPUnit/Integration/ReleaseCheckListTest.php
@@ -0,0 +1,389 @@
+<?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\Filesystem;
+
+/**
+ * @group ReleaseCheckListTest
+ */
+class Test_Piwik_ReleaseCheckListTest extends PHPUnit_Framework_TestCase
+{
+ public function setUp()
+ {
+ $this->globalConfig = _parse_ini_file(PIWIK_PATH_TEST_TO_ROOT . '/config/global.ini.php', true);
+
+ parent::setUp();
+ }
+
+ /**
+ * @group Core
+ */
+ public function test_icoFilesIconsShouldBeInPngFormat()
+ {
+ $files = Filesystem::globr(PIWIK_INCLUDE_PATH . '/plugins', '*.ico');
+ $this->checkFilesAreInPngFormat($files);
+ $files = Filesystem::globr(PIWIK_INCLUDE_PATH . '/core', '*.ico');
+ $this->checkFilesAreInPngFormat($files);
+ }
+
+ /**
+ * @group Core
+ */
+ public function test_pngFilesIconsShouldBeInPngFormat()
+ {
+ $files = Filesystem::globr(PIWIK_INCLUDE_PATH . '/plugins', '*.png');
+ $this->checkFilesAreInPngFormat($files);
+ $files = Filesystem::globr(PIWIK_INCLUDE_PATH . '/core', '*.png');
+ $this->checkFilesAreInPngFormat($files);
+ }
+
+ /**
+ * @group Core
+ */
+ public function test_gifFilesIconsShouldBeInGifFormat()
+ {
+ $files = Filesystem::globr(PIWIK_INCLUDE_PATH . '/plugins', '*.gif');
+ $this->checkFilesAreInGifFormat($files);
+ $files = Filesystem::globr(PIWIK_INCLUDE_PATH . '/core', '*.gif');
+ $this->checkFilesAreInGifFormat($files);
+ }
+
+ /**
+ * @group Core
+ */
+ public function test_jpgImagesShouldBeInJpgFormat()
+ {
+ $files = Filesystem::globr(PIWIK_INCLUDE_PATH . '/plugins', '*.jpg');
+ $this->checkFilesAreInJpgFormat($files);
+ $files = Filesystem::globr(PIWIK_INCLUDE_PATH . '/core', '*.jpg');
+ $this->checkFilesAreInJpgFormat($files);
+ $files = Filesystem::globr(PIWIK_INCLUDE_PATH . '/plugins', '*.jpeg');
+ $this->checkFilesAreInJpgFormat($files);
+ $files = Filesystem::globr(PIWIK_INCLUDE_PATH . '/core', '*.jpeg');
+ $this->checkFilesAreInJpgFormat($files);
+ }
+
+ /**
+ * @group Core
+ */
+ public function testCheckThatConfigurationValuesAreProductionValues()
+ {
+ $this->_checkEqual(array('Debug' => 'always_archive_data_day'), '0');
+ $this->_checkEqual(array('Debug' => 'always_archive_data_period'), '0');
+ $this->_checkEqual(array('Debug' => 'enable_sql_profiler'), '0');
+ $this->_checkEqual(array('General' => 'time_before_today_archive_considered_outdated'), '150');
+ $this->_checkEqual(array('General' => 'enable_browser_archiving_triggering'), '1');
+ $this->_checkEqual(array('General' => 'default_language'), 'en');
+ $this->_checkEqual(array('Tracker' => 'record_statistics'), '1');
+ $this->_checkEqual(array('Tracker' => 'visit_standard_length'), '1800');
+ $this->_checkEqual(array('Tracker' => 'trust_visitors_cookies'), '0');
+ // logging messages are disabled
+ $this->_checkEqual(array('log' => 'log_level'), 'WARN');
+ $this->_checkEqual(array('log' => 'log_writers'), array('screen'));
+ $this->_checkEqual(array('log' => 'logger_api_call'), null);
+
+ require_once PIWIK_INCLUDE_PATH . "/core/TaskScheduler.php";
+ $this->assertFalse(DEBUG_FORCE_SCHEDULED_TASKS);
+
+ // Check the index.php has "backtrace disabled"
+ $content = file_get_contents(PIWIK_INCLUDE_PATH . "/index.php");
+ $expected = "define('PIWIK_PRINT_ERROR_BACKTRACE', false);";
+ $this->assertTrue( false !== strpos($content, $expected), 'index.php should contain: ' . $expected);
+ }
+
+ private function _checkEqual($key, $valueExpected)
+ {
+ $section = key($key);
+ $optionName = current($key);
+ $value = null;
+ if (isset($this->globalConfig[$section][$optionName])) {
+ $value = $this->globalConfig[$section][$optionName];
+ }
+ $this->assertEquals($valueExpected, $value, "$section -> $optionName was '" . var_export($value, true) . "', expected '" . var_export($valueExpected, true) . "'");
+ }
+
+ /**
+ * @group Core
+ */
+ public function testTemplatesDontContainDebug()
+ {
+ $patternFailIfFound = 'dump(';
+ $files = Filesystem::globr(PIWIK_INCLUDE_PATH . '/plugins', '*.twig');
+ foreach ($files as $file) {
+ if ($file == PIWIK_INCLUDE_PATH . '/plugins/CoreConsole/templates/travis.yml.twig') {
+ continue;
+ }
+
+ $content = file_get_contents($file);
+ $this->assertFalse(strpos($content, $patternFailIfFound), 'found in ' . $file);
+ }
+ }
+
+ /**
+ * @group Core
+ */
+ public function testCheckThatGivenPluginsAreDisabledByDefault()
+ {
+ $pluginsShouldBeDisabled = array(
+ 'DBStats'
+ );
+ foreach ($pluginsShouldBeDisabled as $pluginName) {
+ if (in_array($pluginName, $this->globalConfig['Plugins']['Plugins'])) {
+ throw new Exception("Plugin $pluginName is enabled by default but shouldn't.");
+ }
+ }
+
+ }
+
+ /**
+ * test that the profiler is disabled (mandatory on a production server)
+ * @group Core
+ */
+ public function testProfilingDisabledInProduction()
+ {
+ require_once 'Tracker/Db.php';
+ $this->assertTrue(\Piwik\Tracker\Db::isProfilingEnabled() === false, 'SQL profiler should be disabled in production! See Db::$profiling');
+ }
+
+ /**
+ * @group Core
+ */
+ public function testPiwikTrackerDebugIsOff()
+ {
+ $this->assertTrue(!isset($GLOBALS['PIWIK_TRACKER_DEBUG']));
+ $this->assertEquals(0, $this->globalConfig['Tracker']['debug']);
+ }
+
+ /**
+ * This tests that all PHP files start with <?php
+ * This would help detect errors such as a php file starting with spaces
+ * @group Core
+ */
+ public function test_phpFilesStartWithRightCharacter()
+ {
+ $files = Filesystem::globr(PIWIK_INCLUDE_PATH, '*.php');
+
+ foreach($files as $file) {
+ $handle = fopen($file, "r");
+ $expectedStart = "<?php";
+
+ $isIniFile = strpos($file, ".ini.php") !== false || strpos($file, ".ini.travis.php") !== false;
+ if($isIniFile) {
+ $expectedStart = "; <?php exit;";
+ }
+
+ $skipStartFileTest = $this->isSkipPhpFileStartWithPhpBlock($file, $isIniFile);
+
+ if($skipStartFileTest) {
+ continue;
+ }
+
+ $start = fgets($handle, strlen($expectedStart) + 1 );
+ $this->assertEquals($start, $expectedStart, "File $file does not start with $expectedStart");
+ }
+ }
+
+ /**
+ * @group Core
+ */
+ public function test_directoriesShouldBeChmod755()
+ {
+ $pluginsPath = realpath(PIWIK_INCLUDE_PATH . '/plugins/');
+
+ $objects = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($pluginsPath), RecursiveIteratorIterator::SELF_FIRST);
+ $paths = array();
+ foreach($objects as $name => $object){
+ if (is_dir($name)
+ && strpos($name, "/.") === false) {
+ $paths[] = $name;
+ }
+ }
+
+ $this->assertGreaterThan(50, count($paths), 'test at latest 50 directories, got ' . count($paths));
+
+ // to prevent errors with un-readable assets,
+ // we ensure all directories in plugins/* are added to git with CHMOD 755
+ foreach($paths as $pathToTest) {
+
+ $chmod = substr(decoct(fileperms($pathToTest)), -3);
+ $valid = array('777', '775', '755');
+ $command = "find $pluginsPath -type d -exec chmod 755 {} +";
+ $this->assertTrue(in_array($chmod, $valid),
+ "Some directories within plugins/ are not chmod 755 \n\nGot: $chmod for : $pathToTest \n\n".
+ "Run this command to set all directories to 755: \n$command\n");;
+ }
+ }
+
+ /**
+ * Check that directories in plugins/ folder are specifically either enabled or disabled.
+ *
+ * This fails when a new folder is added to plugins/* and forgot to enable or mark as disabled in Manager.php.
+ *
+ * @group Core
+ */
+ public function test_DirectoriesInPluginsFolder_areKnown()
+ {
+ $pluginsBundledWithPiwik = \Piwik\Config::getInstance()->getFromGlobalConfig('Plugins');
+ $pluginsBundledWithPiwik = $pluginsBundledWithPiwik['Plugins'];
+ $magicPlugins = 42;
+ $this->assertTrue(count($pluginsBundledWithPiwik) > $magicPlugins);
+
+ $plugins = _glob(\Piwik\Plugin\Manager::getPluginsDirectory() . '*', GLOB_ONLYDIR);
+ $count = 1;
+ foreach($plugins as $pluginPath) {
+ $pluginName = basename($pluginPath);
+
+ $addedToGit = $this->isPathAddedToGit($pluginPath);
+
+ if(!$addedToGit) {
+ // if not added to git, then it is not part of the release checklist.
+ continue;
+ }
+ $manager = \Piwik\Plugin\Manager::getInstance();
+ $isGitSubmodule = $manager->isPluginOfficialAndNotBundledWithCore($pluginName);
+ $disabled = in_array($pluginName, $manager->getCorePluginsDisabledByDefault()) || $isGitSubmodule;
+
+ $enabled = in_array($pluginName, $pluginsBundledWithPiwik);
+
+ $this->assertTrue( $enabled + $disabled === 1,
+ "Plugin $pluginName should be either enabled (in global.ini.php) or disabled (in Piwik\\Plugin\\Manager).
+ It is currently (enabled=".(int)$enabled. ", disabled=" . (int)$disabled . ")"
+ );
+ $count++;
+ }
+ $this->assertTrue($count > $magicPlugins);
+ }
+
+ /**
+ * @group Core
+ */
+ public function testEndOfLines()
+ {
+ foreach (Filesystem::globr(PIWIK_DOCUMENT_ROOT, '*') as $file) {
+ // skip files in these folders
+ if (strpos($file, '/.git/') !== false ||
+ strpos($file, '/documentation/') !== false ||
+ strpos($file, '/tests/') !== false ||
+ strpos($file, '/lang/') !== false ||
+ strpos($file, 'yuicompressor') !== false ||
+ strpos($file, '/tmp/') !== false
+ ) {
+ continue;
+ }
+
+ // skip files with these file extensions
+ if (preg_match('/\.(bmp|fdf|gif|deb|deflate|exe|gz|ico|jar|jpg|p12|pdf|png|rar|swf|vsd|z|zip|ttf|so|dat|eps|phar|pyc)$/', $file)) {
+ continue;
+ }
+
+ if (!is_dir($file)) {
+ $contents = file_get_contents($file);
+
+ // expect CRLF
+ if (preg_match('/\.(bat|ps1)$/', $file)) {
+ $contents = str_replace("\r\n", '', $contents);
+ $this->assertTrue(strpos($contents, "\n") === false, 'Incorrect line endings in ' . $file);
+ } else {
+ // expect native
+ $hasWindowsEOL = strpos($contents, "\r\n");
+
+ // overwrite translations files with incorrect line endings
+ $this->assertTrue($hasWindowsEOL === false, 'Incorrect line endings \r\n found in ' . $file);
+ }
+ }
+ }
+ }
+
+ /**
+ * @group Core
+ */
+ public function testPiwikJavaScript()
+ {
+ // check source against Snort rule 8443
+ // @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');
+
+ $this->assertTrue(preg_match($pattern, $contents) == 0);
+
+ $contents = file_get_contents(PIWIK_DOCUMENT_ROOT . '/piwik.js');
+ $this->assertTrue(preg_match($pattern, $contents) == 0);
+ }
+
+ /**
+ * @param $files
+ */
+ private function checkFilesAreInPngFormat($files)
+ {
+ $this->checkFilesAreInFormat($files, "png");
+ }
+ private function checkFilesAreInJpgFormat($files)
+ {
+ $this->checkFilesAreInFormat($files, "jpeg");
+ }
+
+ private function checkFilesAreInGifFormat($files)
+ {
+ $this->checkFilesAreInFormat($files, "gif");
+ }
+
+ /**
+ * @param $files
+ * @param $format
+ */
+ private function checkFilesAreInFormat($files, $format)
+ {
+ $errors = array();
+ foreach ($files as $file) {
+ $function = "imagecreatefrom" . $format;
+ if (!function_exists($function)) {
+ throw new \Exception("Unexpected error: $function function does not exist!");
+ }
+
+ $handle = @$function($file);
+ if (empty($handle)) {
+ $errors[] = $file;
+ }
+ }
+
+ if (!empty($errors)) {
+ $icons = var_export($errors, true);
+ $icons = "gimp " . implode(" ", $errors);
+ $this->fail("$format format failed for following icons $icons \n");
+ }
+ }
+
+ /**
+ * @param $file
+ * @param $isIniFile
+ * @return bool
+ */
+ protected function isSkipPhpFileStartWithPhpBlock($file, $isIniFile)
+ {
+ $isIniFileInTests = strpos($file, "/tests/") !== false;
+ $isTestResultFile = strpos($file, "/System/expected") !== false
+ || strpos($file, "/System/processed") !== false
+ || strpos($file, "tests/resources/Updater/") !== false
+ || strpos($file, "Twig/Tests/") !== false
+ || strpos($file, "/vendor/") !== false;
+ $isLib = strpos($file, "lib/xhprof") !== false || strpos($file, "phpunit/phpunit") !== false;
+
+ return ($isIniFile && $isIniFileInTests) || $isTestResultFile || $isLib;
+ }
+
+ /**
+ * @param $pluginPath
+ * @return bool
+ */
+ protected function isPathAddedToGit($pluginPath)
+ {
+ $gitOutput = shell_exec('git ls-files ' . $pluginPath . ' --error-unmatch 2>&1');
+ $addedToGit = (strlen($gitOutput) > 0) && strpos($gitOutput, 'error: pathspec') === false;
+ return $addedToGit;
+ }
+
+}
diff --git a/tests/PHPUnit/Integration/ReportTest.php b/tests/PHPUnit/Integration/ReportTest.php
new file mode 100644
index 0000000000..ce3d87d38f
--- /dev/null
+++ b/tests/PHPUnit/Integration/ReportTest.php
@@ -0,0 +1,543 @@
+<?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\API\Proxy;
+use Piwik\Plugin\Report;
+use Piwik\Plugins\ExampleReport\Reports\GetExampleReport;
+use Piwik\Plugins\Actions\Columns\ExitPageUrl;
+use Piwik\Piwik;
+use Piwik\Metrics;
+use Piwik\Plugins\ExampleTracker\Columns\ExampleDimension;
+use Piwik\Plugins\Referrers\Columns\Keyword;
+use Piwik\WidgetsList;
+use Piwik\Translate;
+use Piwik\Menu\MenuReporting;
+use Piwik\Plugin\Manager as PluginManager;
+use Piwik\Tests\Impl\Fixture;
+use Piwik\Tests\Impl\IntegrationTestCase;
+
+class GetBasicReport extends Report
+{
+ protected function init()
+ {
+ parent::init();
+
+ $this->name = 'My Custom Report Name';
+ $this->order = 20;
+ $this->module = 'TestPlugin';
+ $this->action = 'getBasicReport';
+ $this->category = 'Goals_Goals';
+ $this->actionToLoadSubTables = 'invalidReport';
+ }
+}
+
+class GetAdvancedReport extends GetBasicReport
+{
+ protected function init()
+ {
+ parent::init();
+
+ $this->action = 'getAdvancedReport';
+ $this->widgetTitle = 'Actions_WidgetPageTitlesFollowingSearch';
+ $this->menuTitle = 'Actions_SubmenuPageTitles';
+ $this->documentation = Piwik::translate('ExampleReportDocumentation');
+ $this->dimension = new ExitPageUrl();
+ $this->metrics = array('nb_actions', 'nb_visits');
+ $this->processedMetrics = array('conversion_rate', 'bounce_rate');
+ $this->parameters = array('idGoal' => 1);
+ $this->isSubtableReport = true;
+ $this->actionToLoadSubTables = 'GetBasicReport';
+ $this->constantRowsCount = true;
+ }
+
+ public function set($param, $value)
+ {
+ $this->$param = $value;
+ }
+}
+
+class GetDisabledReport extends GetBasicReport
+{
+ public function isEnabled()
+ {
+ return false;
+ }
+}
+
+/**
+ * @group Core
+ */
+class Plugin_ReportTest extends IntegrationTestCase
+{
+ /**
+ * @var Report
+ */
+ private $exampleReport;
+
+ /**
+ * @var GetDisabledReport
+ */
+ private $disabledReport;
+
+ /**
+ * @var GetBasicReport
+ */
+ private $basicReport;
+
+ /**
+ * @var GetAdvancedReport
+ */
+ private $advancedReport;
+
+ public function setUp()
+ {
+ parent::setUp();
+
+ Fixture::createWebsite('2014-01-01 00:00:00');
+ $this->unloadAllPlugins();
+ $_GET['idSite'] = 1;
+
+ $this->exampleReport = new GetExampleReport();
+ $this->disabledReport = new GetDisabledReport();
+ $this->basicReport = new GetBasicReport();
+ $this->advancedReport = new GetAdvancedReport();
+
+ Proxy::unsetInstance();
+ }
+
+ public function tearDown()
+ {
+ WidgetsList::getInstance()->_reset();
+ MenuReporting::getInstance()->unsetInstance();
+ Translate::unloadEnglishTranslation();
+ unset($_GET['idSite']);
+ parent::tearDown();
+ }
+
+ public function test_shouldDetectTheModuleOfTheReportAutomatically()
+ {
+ $this->assertEquals('ExampleReport', $this->exampleReport->getModule());
+ }
+
+ public function test_shouldDetectTheActionOfTheReportAutomatiacally()
+ {
+ $this->assertEquals('getExampleReport', $this->exampleReport->getAction());
+ }
+
+ public function test_getName_shouldReturnTheNameOfTheReport()
+ {
+ $this->assertEquals('My Custom Report Name', $this->basicReport->getName());
+ }
+
+ public function test_isEnabled_shouldBeEnabledByDefault()
+ {
+ $this->assertTrue($this->basicReport->isEnabled());
+ }
+
+ /**
+ * @expectedException \Exception
+ * @expectedExceptionMessage General_ExceptionReportNotEnabled
+ */
+ public function test_checkIsEnabled_shouldThrowAnExceptionIfReportIsNotEnabled()
+ {
+ $this->disabledReport->checkIsEnabled();
+ }
+
+ public function test_getWidgetTitle_shouldReturnNullIfNoTitleIsSet()
+ {
+ $this->assertNull($this->basicReport->getWidgetTitle());
+ }
+
+ public function test_getWidgetTitle_shouldReturnTranslatedTitleIfSet()
+ {
+ $this->loadEnglishTranslation();
+ $this->assertEquals('Page Titles Following a Site Search', $this->advancedReport->getWidgetTitle());
+ }
+
+ public function test_getCategory_shouldReturnTranslatedCategory()
+ {
+ $this->loadEnglishTranslation();
+ $this->assertEquals('Goals', $this->advancedReport->getCategory());
+ }
+
+ public function test_configureWidget_shouldNotAddAWidgetIfNoWidgetTitleIsSet()
+ {
+ $widgets = WidgetsList::get();
+ $this->assertCount(0, $widgets);
+
+ $this->basicReport->configureWidget(WidgetsList::getInstance());
+
+ $widgets = WidgetsList::get();
+ $this->assertCount(0, $widgets);
+ }
+
+ public function test_configureWidget_shouldAddAWidgetIfAWidgetTitleIsSet()
+ {
+ $widgets = WidgetsList::get();
+ $this->assertCount(0, $widgets);
+
+ $this->advancedReport->configureWidget(WidgetsList::getInstance());
+
+ $widgets = WidgetsList::get();
+ $this->assertCount(1, $widgets);
+ $this->assertEquals(array(array(
+ 'name' => 'Actions_WidgetPageTitlesFollowingSearch',
+ 'uniqueId' => 'widgetTestPlugingetAdvancedReport',
+ 'parameters' => array('module' => 'TestPlugin', 'action' => 'getAdvancedReport')
+ )), $widgets['Goals_Goals']);
+ }
+
+ public function test_configureWidget_shouldMixinWidgetParametersIfSet()
+ {
+ $widgets = WidgetsList::get();
+ $this->assertCount(0, $widgets);
+
+ $this->advancedReport->set('widgetParams', array('foo' => 'bar'));
+ $this->advancedReport->configureWidget(WidgetsList::getInstance());
+
+ $widgets = WidgetsList::get();
+ $this->assertCount(1, $widgets);
+ $this->assertEquals(array('module' => 'TestPlugin', 'action' => 'getAdvancedReport', 'foo' => 'bar'),
+ $widgets['Goals_Goals'][0]['parameters']);
+ }
+
+ public function test_configureReportingMenu_shouldNotAddAMenuIfNoWidgetTitleIsSet()
+ {
+ $menu = MenuReporting::getInstance();
+ $menuItems = $menu->getMenu();
+ $this->assertNull($menuItems);
+
+ $this->basicReport->configureReportingMenu($menu);
+
+ $menuItems = $menu->getMenu();
+ $this->assertNull($menuItems);
+ }
+
+ public function test_configureReportingMenu_shouldAddAMenuIfATitleIsSet()
+ {
+ $menu = MenuReporting::getInstance();
+ $menuItems = $menu->getMenu();
+ $this->assertNull($menuItems);
+
+ $this->advancedReport->configureReportingMenu($menu);
+
+ $menuItems = $menu->getMenu();
+
+ $expected = array(
+ '_tooltip' => false,
+ '_order' => 20,
+ '_hasSubmenu' => true,
+ 'Actions_SubmenuPageTitles' => array(
+ '_url' => array(
+ 'module' => 'TestPlugin',
+ 'action' => 'menuGetAdvancedReport'
+ ),
+ '_order' => 20,
+ '_name' => 'Actions_SubmenuPageTitles',
+ '_tooltip' => false,
+ ));
+
+ $this->assertCount(1, $menuItems);
+ $this->assertEquals($expected, $menuItems['Goals_Goals']);
+ }
+
+ public function test_getMetrics_shouldUseDefaultMetrics()
+ {
+ $this->assertEquals(Metrics::getDefaultMetrics(), $this->basicReport->getMetrics());
+ }
+
+ public function test_getMetrics_shouldReturnEmptyArray_IfNoMetricsDefined()
+ {
+ $this->advancedReport->set('metrics', array());
+ $this->assertEquals(array(), $this->advancedReport->getMetrics());
+ }
+
+ public function test_getMetrics_shouldFindTranslationsForMetricsAndReturnOnlyTheOnesDefinedInSameOrder()
+ {
+ $expected = array(
+ 'nb_visits' => 'General_ColumnNbVisits',
+ 'nb_actions' => 'General_ColumnNbActions'
+ );
+ $this->assertEquals($expected, $this->advancedReport->getMetrics());
+ }
+
+ public function test_getProcessedMetrics_shouldReturnConfiguredValue_IfNotAnArrayGivenToPreventDefaultMetrics()
+ {
+ $this->advancedReport->set('processedMetrics', false);
+ $this->assertEquals(false, $this->advancedReport->getProcessedMetrics());
+ }
+
+ public function test_getProcessedMetrics_shouldReturnEmptyArray_IfNoMetricsDefined()
+ {
+ $this->advancedReport->set('processedMetrics', array());
+ $this->assertEquals(array(), $this->advancedReport->getProcessedMetrics());
+ }
+
+ public function test_getProcessedMetrics_reportShouldUseDefaultProcessedMetrics()
+ {
+ $this->assertEquals(Metrics::getDefaultProcessedMetrics(), $this->basicReport->getProcessedMetrics());
+ }
+
+ public function test_getProcessedMetrics_shouldFindTranslationsForMetricsAndReturnOnlyTheOnesDefinedInSameOrder()
+ {
+ $expected = array(
+ 'conversion_rate' => 'General_ColumnConversionRate',
+ 'bounce_rate' => 'General_ColumnBounceRate'
+ );
+ $this->assertEquals($expected, $this->advancedReport->getProcessedMetrics());
+ }
+
+ public function test_hasGoalMetrics_shouldBeDisabledByDefault()
+ {
+ $this->assertFalse($this->advancedReport->hasGoalMetrics());
+ }
+
+ public function test_hasGoalMetrics_shouldReturnGoalMetricsProperty()
+ {
+ $this->advancedReport->set('hasGoalMetrics', true);
+ $this->assertTrue($this->advancedReport->hasGoalMetrics());
+ }
+
+ public function test_configureReportMetadata_shouldNotAddAReportIfReportIsDisabled()
+ {
+ $reports = array();
+ $this->disabledReport->configureReportMetadata($reports, array());
+ $this->assertEquals(array(), $reports);
+ }
+
+ public function test_configureReportMetadata_shouldAddAReportIfReportIsEnabled()
+ {
+ $reports = array();
+ $this->basicReport->configureReportMetadata($reports, array());
+ $this->assertCount(1, $reports);
+ }
+
+ public function test_configureReportMetadata_shouldBuiltStructureAndIncludeOnlyFieldsThatAreSet()
+ {
+ $reports = array();
+ $this->basicReport->configureReportMetadata($reports, array());
+ $this->assertEquals(array(
+ array(
+ 'category' => 'Goals_Goals',
+ 'name' => 'My Custom Report Name',
+ 'module' => 'TestPlugin',
+ 'action' => 'getBasicReport',
+ 'metrics' => array(
+ 'nb_visits' => 'General_ColumnNbVisits',
+ 'nb_uniq_visitors' => 'General_ColumnNbUniqVisitors',
+ 'nb_actions' => 'General_ColumnNbActions',
+ 'nb_users' => 'General_ColumnNbUsers'
+ ),
+ 'metricsDocumentation' => array(
+ 'nb_visits' => 'General_ColumnNbVisitsDocumentation',
+ 'nb_uniq_visitors' => 'General_ColumnNbUniqVisitorsDocumentation',
+ 'nb_actions' => 'General_ColumnNbActionsDocumentation',
+ 'nb_users' => 'General_ColumnNbUsersDocumentation'
+ ),
+ 'processedMetrics' => array(
+ 'nb_actions_per_visit' => 'General_ColumnActionsPerVisit',
+ 'avg_time_on_site' => 'General_ColumnAvgTimeOnSite',
+ 'bounce_rate' => 'General_ColumnBounceRate',
+ 'conversion_rate' => 'General_ColumnConversionRate',
+ ),
+ 'actionToLoadSubTables' => 'invalidReport',
+ 'order' => 20
+ )
+ ), $reports);
+ }
+
+ public function test_configureReportMetadata_shouldBuiltStructureAllFieldsSet()
+ {
+ $reports = array();
+ $this->advancedReport->configureReportMetadata($reports, array());
+ $this->assertEquals(array(
+ array(
+ 'category' => 'Goals_Goals',
+ 'name' => 'My Custom Report Name',
+ 'module' => 'TestPlugin',
+ 'action' => 'getAdvancedReport',
+ 'parameters' => array(
+ 'idGoal' => 1
+ ),
+ 'dimension' => 'Actions_ColumnExitPageURL',
+ 'documentation' => 'ExampleReportDocumentation',
+ 'isSubtableReport' => true,
+ 'metrics' => array(
+ 'nb_actions' => 'General_ColumnNbActions',
+ 'nb_visits' => 'General_ColumnNbVisits'
+ ),
+ 'metricsDocumentation' => array(
+ 'nb_actions' => 'General_ColumnNbActionsDocumentation',
+ 'nb_visits' => 'General_ColumnNbVisitsDocumentation',
+ ),
+ 'processedMetrics' => array(
+ 'conversion_rate' => 'General_ColumnConversionRate',
+ 'bounce_rate' => 'General_ColumnBounceRate',
+ ),
+ 'actionToLoadSubTables' => 'GetBasicReport',
+ 'constantRowsCount' => true,
+ 'order' => '20'
+ )
+ ), $reports);
+ }
+
+ public function test_factory_shouldCreateReport_WhenActionNameUsed()
+ {
+ $this->loadExampleReportPlugin();
+
+ $module = 'ExampleReport';
+ $action = 'getExampleReport';
+
+ $report = Report::factory($module, $action);
+
+ $this->assertInstanceOf('Piwik\Plugins\ExampleReport\Reports\GetExampleReport', $report);
+ $this->assertEquals($module, $report->getModule());
+ $this->assertEquals($action, $report->getAction());
+
+ // action ucfirst should work as well
+ $report = Report::factory($module, ucfirst($action));
+
+ $this->assertInstanceOf('Piwik\Plugins\ExampleReport\Reports\GetExampleReport', $report);
+ $this->assertEquals($module, $report->getModule());
+ $this->assertEquals($action, $report->getAction());
+ }
+
+ public function test_getAllReports_shouldNotFindAReport_IfNoPluginLoaded()
+ {
+ $this->unloadAllPlugins();
+
+ $report = Report::getAllReports();
+
+ $this->assertEquals(array(), $report);
+ }
+
+ public function test_getAllReports_ShouldFindAllAvailableReports()
+ {
+ $this->loadExampleReportPlugin();
+ $this->loadMorePlugins();
+
+ $reports = Report::getAllReports();
+
+ $this->assertGreaterThan(20, count($reports));
+
+ foreach ($reports as $report) {
+ $this->assertInstanceOf('Piwik\Plugin\Report', $report);
+ }
+ }
+
+ public function test_getSubtableDimension_ShouldReturnNullIfNoSubtableActionExists()
+ {
+ $report = new GetExampleReport();
+ $this->assertNull($report->getSubtableDimension());
+ }
+
+ public function test_getSubtableDimension_ShouldReturnNullIfSubtableActionIsInvalid()
+ {
+ $report = new GetBasicReport();
+ $this->assertNull($report->getSubtableDimension());
+ }
+
+ public function test_getSubtableDimension_ShouldReturnCorrectDimensionIfSubtableActionIsDefinedAndCorrect()
+ {
+ PluginManager::getInstance()->loadPlugins(array('Referrers'));
+
+ $report = Report::factory('Referrers', 'getSearchEngines');
+ $subtableDimension = $report->getSubtableDimension();
+
+ $this->assertNotNull($subtableDimension);
+ $this->assertInstanceOf("Piwik\\Plugins\\Referrers\\Columns\\Keyword", $subtableDimension);
+ }
+
+ public function test_fetch_ShouldUseCorrectApiUrl()
+ {
+ PluginManager::getInstance()->loadPlugins(array('API', 'ExampleReport'));
+
+ $proxyMock = $this->getMock('stdClass', array('call', '__construct'));
+ $proxyMock->expects($this->once())->method('call')->with(
+ '\\Piwik\\Plugins\\ExampleReport\\API', 'getExampleReport', array(
+ 'idSite' => 1,
+ 'date' => '2012-01-02',
+ 'format' => 'original',
+ 'module' => 'API',
+ 'method' => 'ExampleReport.getExampleReport'
+ )
+ )->willReturn("result");
+ Proxy::setSingletonInstance($proxyMock);
+
+ $report = new GetExampleReport();
+ $result = $report->fetch(array('idSite' => 1, 'date' => '2012-01-02'));
+ $this->assertEquals("result", $result);
+ }
+
+ public function test_fetchSubtable_ShouldUseCorrectApiUrl()
+ {
+ PluginManager::getInstance()->loadPlugins(array('API', 'Referrers'));
+
+ $proxyMock = $this->getMock('stdClass', array('call', '__construct'));
+ $proxyMock->expects($this->once())->method('call')->with(
+ '\\Piwik\\Plugins\\Referrers\\API', 'getSearchEnginesFromKeywordId', array(
+ 'idSubtable' => 23,
+ 'idSite' => 1,
+ 'date' => '2012-01-02',
+ 'format' => 'original',
+ 'module' => 'API',
+ 'method' => 'Referrers.getSearchEnginesFromKeywordId'
+ )
+ )->willReturn("result");
+ Proxy::setSingletonInstance($proxyMock);
+
+ $report = new \Piwik\Plugins\Referrers\Reports\GetKeywords();
+ $result = $report->fetchSubtable(23, array('idSite' => 1, 'date' => '2012-01-02'));
+ $this->assertEquals("result", $result);
+ }
+
+ public function test_getForDimension_ShouldReturnCorrectInstanceTypeIfAssociatedReportExists()
+ {
+ PluginManager::getInstance()->loadPlugins(array('Referrers'));
+
+ $report = Report::getForDimension(new Keyword());
+ $this->assertInstanceOf("Piwik\\Plugins\\Referrers\\Reports\\GetKeywords", $report);
+ }
+
+ public function test_getForDimension_ShouldReturnNullIfNoReportExistsForDimension()
+ {
+ $this->loadExampleReportPlugin();
+ $this->loadMorePlugins();
+
+ $report = Report::getForDimension(new ExampleDimension());
+ $this->assertNull($report);
+ }
+
+ public function test_getForDimension_ShouldReturnNullIfReportPluginNotLoaded()
+ {
+ PluginManager::getInstance()->loadPlugins(array());
+
+ $report = Report::getForDimension(new Keyword());
+ $this->assertNull($report);
+ }
+
+ private function loadExampleReportPlugin()
+ {
+ PluginManager::getInstance()->loadPlugins(array('ExampleReport'));
+ }
+
+ private function loadMorePlugins()
+ {
+ PluginManager::getInstance()->loadPlugins(array('Actions', 'DevicesDetection', 'CoreVisualizations', 'API', 'Morpheus'));
+ }
+
+ private function unloadAllPlugins()
+ {
+ PluginManager::getInstance()->unloadPlugins();
+ }
+
+ private function loadEnglishTranslation()
+ {
+ Translate::reloadLanguage('en');
+ }
+} \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/RowEvolutionTest.php b/tests/PHPUnit/Integration/RowEvolutionTest.php
deleted file mode 100755
index 2af1f5fccd..0000000000
--- a/tests/PHPUnit/Integration/RowEvolutionTest.php
+++ /dev/null
@@ -1,239 +0,0 @@
-<?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\TwoSitesManyVisitsOverSeveralDaysWithSearchEngineReferrers;
-
-/**
- * Tests the method API.getRowEvolution
- *
- * @group RowEvolutionTest
- * @group Integration
- */
-class RowEvolutionTest extends IntegrationTestCase
-{
- public static $fixture = null; // initialized below class definition
-
- /**
- * @dataProvider getApiForTesting
- */
- public function testApi($api, $params)
- {
- $this->runApiTests($api, $params);
- }
-
- public function getApiForTesting()
- {
- $idSite = self::$fixture->idSite;
- $idSite2 = self::$fixture->idSite2;
- $dateTime = self::$fixture->dateTime;
- $keywords = self::$fixture->keywords;
-
- $return = array();
-
- $config = array(
- 'testSuffix' => '_referrer1',
- 'idSite' => $idSite,
- 'date' => $dateTime,
- 'otherRequestParameters' => array(
- 'date' => '2010-02-06,2010-03-06',
- 'period' => 'day',
- 'apiModule' => 'Referrers',
- 'apiAction' => 'getWebsites',
- 'label' => 'www.referrer2.com',
- 'expanded' => 0
- )
- );
-
- $return[] = array('API.getRowEvolution', $config);
-
- // Websites, hierarchical
- $config['testSuffix'] = '_referrer2';
- $referrerLabel = urlencode('www.referrer0.com') . '>' . urlencode('theReferrerPage1.html');
- $config['otherRequestParameters']['label'] = ($referrerLabel);
- $return[] = array('API.getRowEvolution', $config);
-
- // Websites, multiple labels including one hierarchical
- $config['testSuffix'] = '_referrerMulti1';
- $referrerLabel = $referrerLabel . ',' . urlencode('www.referrer2.com');
- $config['otherRequestParameters']['label'] = ($referrerLabel);
- $return[] = array('API.getRowEvolution', $config);
-
- // Keywords, label containing > and ,
- $config['otherRequestParameters']['apiAction'] = 'getKeywords';
- $config['testSuffix'] = '_LabelReservedCharacters';
- $keywordsStr = urlencode($keywords[0]) . ',' . urlencode($keywords[1]);
- $config['otherRequestParameters']['label'] = ($keywordsStr);
- $return[] = array('API.getRowEvolution', $config);
-
- // Keywords, hierarchical
- $config['otherRequestParameters']['apiAction'] = 'getSearchEngines';
- $config['testSuffix'] = '_LabelReservedCharactersHierarchical';
- $keywordsStr = "Google>" . urlencode(strtolower($keywords[0]))
- . ',Google>' . urlencode(strtolower($keywords[1]))
- . ',Google>' . urlencode(strtolower($keywords[2]));
- // Test multiple labels search engines, Google should also have a 'logo' entry
- $config['otherRequestParameters']['label'] = ($keywordsStr . ",Google");
- $config['otherRequestParameters']['filter_limit'] = 1; // should have no effect
- $return[] = array('API.getRowEvolution', $config);
-
- // Actions > Pages titles, standard label
- $config['testSuffix'] = '_pageTitles';
- $config['periods'] = array('day', 'week');
- $config['otherRequestParameters']['apiModule'] = 'Actions';
- $config['otherRequestParameters']['apiAction'] = 'getPageTitles';
- $config['otherRequestParameters']['label'] = ('incredible title 0');
- $config['otherRequestParameters']['filter_limit'] = 1; // should have no effect
- $return[] = array('API.getRowEvolution', $config);
-
- // Actions > Page titles, multiple labels
- $config['testSuffix'] = '_pageTitlesMulti';
- $label = urlencode('incredible title 0') . ',' . urlencode('incredible title 2');
- $config['otherRequestParameters']['label'] = ($label);
- $return[] = array('API.getRowEvolution', $config);
-
- // standard label, entry page titles
- $config['testSuffix'] = '_entryPageTitles';
- $config['periods'] = 'day';
- $config['otherRequestParameters']['apiModule'] = 'Actions';
- $config['otherRequestParameters']['apiAction'] = 'getEntryPageTitles';
- $config['otherRequestParameters']['label'] = urlencode('incredible title 0');
- $return[] = array('API.getRowEvolution', $config);
-
- // Actions > Page URLS, hierarchical label
- $config['testSuffix'] = '_pageUrls';
- $config['periods'] = array('range');
- $config['otherRequestParameters']['date'] = '2010-03-01,2010-03-06';
- $config['otherRequestParameters']['apiModule'] = 'Actions';
- $config['otherRequestParameters']['apiAction'] = 'getPageUrls';
- $config['otherRequestParameters']['label'] = ('my>dir>' . urlencode('/page3?foo=bar&baz=bar'));
- $return[] = array('API.getRowEvolution', $config);
-
- // Goals > Visits Until Conversion, idGoal != 0
- $config['testSuffix'] = '_goals_visitsUntilConversion';
- $config['periods'] = array('day');
- $config['otherRequestParameters']['date'] = '2010-02-06,2010-03-06';
- $config['otherRequestParameters']['period'] = 'day';
- $config['otherRequestParameters']['apiModule'] = 'Goals';
- $config['otherRequestParameters']['apiAction'] = 'getVisitsUntilConversion';
- $config['otherRequestParameters']['label'] = ('1 visit, 2 visits');
- $config['otherRequestParameters']['idGoal'] = '2';
- $return[] = array('API.getRowEvolution', $config);
-
- // Goals > Visits Until Conversion, idGoal != 0, without specifying labels
- $config['testSuffix'] = '_goals_visitsUntilConversion_WithoutLabels';
- $config['periods'] = array('day');
- $config['otherRequestParameters']['date'] = '2010-02-06,2010-03-06';
- $config['otherRequestParameters']['period'] = 'day';
- $config['otherRequestParameters']['apiModule'] = 'Goals';
- $config['otherRequestParameters']['apiAction'] = 'getVisitsUntilConversion';
- $config['otherRequestParameters']['label'] = false;
- $config['otherRequestParameters']['filter_limit'] = 2;
- $config['otherRequestParameters']['filter_sort_column'] = 'nb_conversions';
- $config['otherRequestParameters']['idGoal'] = '2';
- $return[] = array('API.getRowEvolution', $config);
-
- // test date range where most recent date has no data (for #3465)
- $return[] = array('API.getRowEvolution', array(
- 'testSuffix' => '_multipleDates_lastNoData',
- 'periods' => 'month',
- 'idSite' => $idSite,
- 'date' => $dateTime,
- 'otherRequestParameters' => array(
- 'date' => '2010-02-01,2010-04-08',
- 'period' => 'month',
- 'apiModule' => 'Referrers',
- 'apiAction' => 'getKeywords',
- // no label
- )
- ));
-
- // test that reports that process row labels are treated correctly
- $return[] = array('API.getRowEvolution', array(
- 'testSuffix' => '_processedRowLabel',
- 'periods' => 'day',
- 'idSite' => $idSite2,
- 'date' => $dateTime,
- 'otherRequestParameters' => array(
- 'date' => '2010-03-01,2010-03-06',
- 'period' => 'month',
- 'apiModule' => 'UserSettings',
- 'apiAction' => 'getBrowser',
- 'label' => 'Firefox,Chrome,Opera'
- )
- ));
-
- // test Row Evolution on Desktop VS Mobile, special "view" report
- $return[] = array('API.getRowEvolution', array(
- 'testSuffix' => '_mobileDesktop',
- 'periods' => 'day',
- 'idSite' => $idSite2,
- 'date' => $dateTime,
- 'otherRequestParameters' => array(
- 'date' => '2010-03-01,2010-03-06',
- 'period' => 'month',
- 'apiModule' => 'UserSettings',
- 'apiAction' => 'getMobileVsDesktop',
- 'label' => 'Desktop,Mobile'
- )
- ));
-
- // test multi row evolution w/ filter_limit to limit all available labels
- $return[] = array('API.getRowEvolution', array(
- 'testSuffix' => '_multiWithFilterLimit',
- 'periods' => 'day',
- 'idSite' => $idSite,
- 'date' => $dateTime,
- 'otherRequestParameters' => array(
- 'date' => '2010-03-01,2010-03-06',
- 'period' => 'day',
- 'apiModule' => 'Referrers',
- 'apiAction' => 'getWebsites',
- 'filter_limit' => 3, // only 3 labels should show up
- )
- ));
-
- // test multi row evolution when there is no data
- $return[] = array('API.getRowEvolution', array(
- 'testSuffix' => '_multiWithNoData',
- 'periods' => 'day',
- 'idSite' => $idSite,
- 'date' => $dateTime,
- 'otherRequestParameters' => array(
- 'date' => '2010-04-01,2010-04-06',
- 'period' => 'day',
- 'apiModule' => 'Referrers',
- 'apiAction' => 'getWebsites',
- // no label
- )
- ));
-
- // (non-rowevolution test) test flattener w/ search engines to make sure
- // queued filters are not applied twice
- $return[] = array('Referrers.getSearchEngines', array(
- 'testSuffix' => '_flatFilters',
- 'periods' => 'month',
- 'idSite' => $idSite,
- 'date' => '2010-02-01',
- 'otherRequestParameters' => array(
- 'flat' => 1,
- 'expanded' => '0'
- )
- ));
-
- return $return;
- }
-
- public static function getOutputPrefix()
- {
- return 'RowEvolution';
- }
-}
-
-RowEvolutionTest::$fixture = new TwoSitesManyVisitsOverSeveralDaysWithSearchEngineReferrers(); \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/SegmentTest.php b/tests/PHPUnit/Integration/SegmentTest.php
new file mode 100644
index 0000000000..15277e379d
--- /dev/null
+++ b/tests/PHPUnit/Integration/SegmentTest.php
@@ -0,0 +1,481 @@
+<?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\Common;
+use Piwik\Segment;
+use Piwik\Tests\Impl\IntegrationTestCase;
+
+/**
+ * @group SegmentTest
+ */
+class SegmentTest extends IntegrationTestCase
+{
+ public function setUp()
+ {
+ parent::setUp();
+
+ // setup the access layer (required in Segment contrustor testing if anonymous is allowed to use segments)
+ $pseudoMockAccess = new FakeAccess;
+ FakeAccess::$superUser = true;
+ Access::setSingletonInstance($pseudoMockAccess);
+ }
+
+ public function tearDown()
+ {
+ parent::tearDown();
+ }
+
+ protected function _filterWhitsSpaces($valueToFilter)
+ {
+ if (is_array($valueToFilter)) {
+ foreach ($valueToFilter as $key => $value) {
+ $valueToFilter[$key] = $this->_filterWhitsSpaces($value);
+ }
+ return $valueToFilter;
+ } else {
+ return preg_replace('/[\s]+/', ' ', $valueToFilter);
+ }
+ }
+
+ public function getCommonTestData()
+ {
+ return array(
+ // Normal segment
+ array('countryCode==France', array(
+ 'where' => ' log_visit.location_country = ? ',
+ 'bind' => array('France'))),
+
+ // unescape the comma please
+ array('countryCode==a\,==', array(
+ 'where' => ' log_visit.location_country = ? ',
+ 'bind' => array('a,=='))),
+
+ // AND, with 2 values rewrites
+ array('countryCode==a;visitorType!=returning;visitorType==new', array(
+ 'where' => ' log_visit.location_country = ? AND ( log_visit.visitor_returning IS NULL OR log_visit.visitor_returning <> ? ) AND log_visit.visitor_returning = ? ',
+ 'bind' => array('a', '1', '0'))),
+
+ // OR, with 2 value rewrites
+ array('referrerType==search,referrerType==direct', array(
+ 'where' => ' (log_visit.referer_type = ? OR log_visit.referer_type = ? )',
+ 'bind' => array(Common::REFERRER_TYPE_SEARCH_ENGINE,
+ Common::REFERRER_TYPE_DIRECT_ENTRY))),
+
+ // IS NOT NULL
+ array('browserCode==ff;referrerKeyword!=', array(
+ 'where' => ' log_visit.config_browser_name = ? AND ( log_visit.referer_keyword IS NOT NULL AND (log_visit.referer_keyword <> \'\' OR log_visit.referer_keyword = 0) ) ',
+ 'bind' => array('ff')
+ )),
+ array('referrerKeyword!=,browserCode==ff', array(
+ 'where' => ' (( log_visit.referer_keyword IS NOT NULL AND (log_visit.referer_keyword <> \'\' OR log_visit.referer_keyword = 0) ) OR log_visit.config_browser_name = ? )',
+ 'bind' => array('ff')
+ )),
+
+ // IS NULL
+ array('browserCode==ff;referrerKeyword==', array(
+ 'where' => ' log_visit.config_browser_name = ? AND ( log_visit.referer_keyword IS NULL OR log_visit.referer_keyword = \'\' ) ',
+ 'bind' => array('ff')
+ )),
+ array('referrerKeyword==,browserCode==ff', array(
+ 'where' => ' (( log_visit.referer_keyword IS NULL OR log_visit.referer_keyword = \'\' ) OR log_visit.config_browser_name = ? )',
+ 'bind' => array('ff')
+ )),
+
+ );
+ }
+
+ /**
+ * @dataProvider getCommonTestData
+ * @group Core
+ */
+ public function testCommon($segment, $expected)
+ {
+ $select = 'log_visit.idvisit';
+ $from = 'log_visit';
+
+ $expected = array(
+ 'sql' => '
+ SELECT
+ log_visit.idvisit
+ FROM
+ ' . Common::prefixTable('log_visit') . ' AS log_visit
+ WHERE
+ ' . $expected['where'],
+ 'bind' => $expected['bind']
+ );
+
+ $segment = new Segment($segment, $idSites = array());
+ $sql = $segment->getSelectQuery($select, $from, false);
+
+ $this->assertEquals($this->_filterWhitsSpaces($expected), $this->_filterWhitsSpaces($sql));
+
+ // calling twice should give same results
+ $sql = $segment->getSelectQuery($select, array($from));
+ $this->assertEquals($this->_filterWhitsSpaces($expected), $this->_filterWhitsSpaces($sql));
+
+ $this->assertEquals(32, strlen($segment->getHash()));
+ }
+
+ /**
+ * @group Core
+ */
+ public function testGetSelectQueryNoJoin()
+ {
+ $select = '*';
+ $from = 'log_visit';
+ $where = 'idsite = ?';
+ $bind = array(1);
+
+ $segment = 'customVariableName1==Test;visitorType==new';
+ $segment = new Segment($segment, $idSites = array());
+
+ $query = $segment->getSelectQuery($select, $from, $where, $bind);
+
+ $expected = array(
+ "sql" => "
+ SELECT
+ *
+ FROM
+ " . Common::prefixTable('log_visit') . " AS log_visit
+ WHERE
+ ( idsite = ? )
+ AND
+ ( log_visit.custom_var_k1 = ? AND log_visit.visitor_returning = ? )",
+ "bind" => array(1, 'Test', 0));
+
+ $this->assertEquals($this->_filterWhitsSpaces($expected), $this->_filterWhitsSpaces($query));
+ }
+
+ /**
+ * @group Core
+ */
+ public function testGetSelectQueryJoinVisitOnAction()
+ {
+ $select = '*';
+ $from = 'log_link_visit_action';
+ $where = 'log_link_visit_action.idvisit = ?';
+ $bind = array(1);
+
+ $segment = 'customVariablePageName1==Test;visitorType==new';
+ $segment = new Segment($segment, $idSites = array());
+
+ $query = $segment->getSelectQuery($select, $from, $where, $bind);
+
+ $expected = array(
+ "sql" => "
+ SELECT
+ *
+ FROM
+ " . Common::prefixTable('log_link_visit_action') . " AS log_link_visit_action
+ LEFT JOIN " . Common::prefixTable('log_visit') . " AS log_visit ON log_visit.idvisit = log_link_visit_action.idvisit
+ WHERE
+ ( log_link_visit_action.idvisit = ? )
+ AND
+ ( log_link_visit_action.custom_var_k1 = ? AND log_visit.visitor_returning = ? )",
+ "bind" => array(1, 'Test', 0));
+
+ $this->assertEquals($this->_filterWhitsSpaces($expected), $this->_filterWhitsSpaces($query));
+ }
+
+ /**
+ * @group Core
+ */
+ public function testGetSelectQueryJoinActionOnVisit()
+ {
+ $select = 'sum(log_visit.visit_total_actions) as nb_actions, max(log_visit.visit_total_actions) as max_actions, sum(log_visit.visit_total_time) as sum_visit_length';
+ $from = 'log_visit';
+ $where = 'log_visit.idvisit = ?';
+ $bind = array(1);
+
+ $segment = 'customVariablePageName1==Test;visitorType==new';
+ $segment = new Segment($segment, $idSites = array());
+
+ $query = $segment->getSelectQuery($select, $from, $where, $bind);
+
+ $expected = array(
+ "sql" => "
+ SELECT
+ sum(log_inner.visit_total_actions) as nb_actions, max(log_inner.visit_total_actions) as max_actions, sum(log_inner.visit_total_time) as sum_visit_length
+ FROM
+ (
+ SELECT
+ log_visit.visit_total_actions,
+ log_visit.visit_total_time
+ FROM
+ " . Common::prefixTable('log_visit') . " AS log_visit
+ LEFT JOIN " . Common::prefixTable('log_link_visit_action') . " AS log_link_visit_action ON log_link_visit_action.idvisit = log_visit.idvisit
+ WHERE
+ ( log_visit.idvisit = ? )
+ AND
+ ( log_link_visit_action.custom_var_k1 = ? AND log_visit.visitor_returning = ? )
+ GROUP BY log_visit.idvisit
+ ) AS log_inner",
+ "bind" => array(1, 'Test', 0));
+
+ $this->assertEquals($this->_filterWhitsSpaces($expected), $this->_filterWhitsSpaces($query));
+ }
+
+ /**
+ * @group Core
+ */
+ public function testGetSelectQueryJoinConversionOnAction()
+ {
+ $select = '*';
+ $from = 'log_link_visit_action';
+ $where = 'log_link_visit_action.idvisit = ?';
+ $bind = array(1);
+
+ $segment = 'customVariablePageName1==Test;visitConvertedGoalId==1;customVariablePageName2==Test2';
+ $segment = new Segment($segment, $idSites = array());
+
+ $query = $segment->getSelectQuery($select, $from, $where, $bind);
+
+ $expected = array(
+ "sql" => "
+ SELECT
+ *
+ FROM
+ " . Common::prefixTable('log_link_visit_action') . " AS log_link_visit_action
+ LEFT JOIN " . Common::prefixTable('log_conversion') . " AS log_conversion ON log_conversion.idlink_va = log_link_visit_action.idlink_va AND log_conversion.idsite = log_link_visit_action.idsite
+ WHERE
+ ( log_link_visit_action.idvisit = ? )
+ AND
+ ( log_link_visit_action.custom_var_k1 = ? AND log_conversion.idgoal = ? AND log_link_visit_action.custom_var_k2 = ? )",
+ "bind" => array(1, 'Test', 1, 'Test2'));
+
+ $this->assertEquals($this->_filterWhitsSpaces($expected), $this->_filterWhitsSpaces($query));
+ }
+
+ /**
+ * @group Core
+ */
+ public function testGetSelectQueryJoinActionOnConversion()
+ {
+ $select = '*';
+ $from = 'log_conversion';
+ $where = 'log_conversion.idvisit = ?';
+ $bind = array(1);
+
+ $segment = 'visitConvertedGoalId!=2;customVariablePageName1==Test;visitConvertedGoalId==1';
+ $segment = new Segment($segment, $idSites = array());
+
+ $query = $segment->getSelectQuery($select, $from, $where, $bind);
+
+ $expected = array(
+ "sql" => "
+ SELECT
+ *
+ FROM
+ " . Common::prefixTable('log_conversion') . " AS log_conversion
+ LEFT JOIN " . Common::prefixTable('log_link_visit_action') . " AS log_link_visit_action ON log_conversion.idlink_va = log_link_visit_action.idlink_va
+ WHERE
+ ( log_conversion.idvisit = ? )
+ AND
+ ( ( log_conversion.idgoal IS NULL OR log_conversion.idgoal <> ? ) AND log_link_visit_action.custom_var_k1 = ? AND log_conversion.idgoal = ? )",
+ "bind" => array(1, 2, 'Test', 1));
+
+ $this->assertEquals($this->_filterWhitsSpaces($expected), $this->_filterWhitsSpaces($query));
+ }
+
+ /**
+ * @group Core
+ */
+ public function testGetSelectQueryJoinConversionOnVisit()
+ {
+ $select = 'log_visit.*';
+ $from = 'log_visit';
+ $where = 'log_visit.idvisit = ?';
+ $bind = array(1);
+
+ $segment = 'visitConvertedGoalId==1';
+ $segment = new Segment($segment, $idSites = array());
+
+ $query = $segment->getSelectQuery($select, $from, $where, $bind);
+
+ $expected = array(
+ "sql" => "
+ SELECT
+ log_inner.*
+ FROM
+ (
+ SELECT
+ log_visit.*
+ FROM
+ " . Common::prefixTable('log_visit') . " AS log_visit
+ LEFT JOIN " . Common::prefixTable('log_conversion') . " AS log_conversion ON log_conversion.idvisit = log_visit.idvisit
+ WHERE
+ ( log_visit.idvisit = ? )
+ AND
+ ( log_conversion.idgoal = ? )
+ GROUP BY log_visit.idvisit
+ ) AS log_inner",
+ "bind" => array(1, 1));
+
+ $this->assertEquals($this->_filterWhitsSpaces($expected), $this->_filterWhitsSpaces($query));
+ }
+
+ /**
+ * @group Core
+ */
+ public function testGetSelectQueryConversionOnly()
+ {
+ $select = 'log_conversion.*';
+ $from = 'log_conversion';
+ $where = 'log_conversion.idvisit = ?';
+ $bind = array(1);
+
+ $segment = 'visitConvertedGoalId==1';
+ $segment = new Segment($segment, $idSites = array());
+
+ $query = $segment->getSelectQuery($select, $from, $where, $bind);
+
+ $expected = array(
+ "sql" => "
+ SELECT
+ log_conversion.*
+ FROM
+ " . Common::prefixTable('log_conversion') . " AS log_conversion
+ WHERE
+ ( log_conversion.idvisit = ? )
+ AND
+ ( log_conversion.idgoal = ? )",
+ "bind" => array(1, 1));
+
+ $this->assertEquals($this->_filterWhitsSpaces($expected), $this->_filterWhitsSpaces($query));
+ }
+
+ /**
+ * @group Core
+ */
+ public function testGetSelectQueryJoinVisitOnConversion()
+ {
+ $select = '*';
+ $from = 'log_conversion';
+ $where = 'log_conversion.idvisit = ?';
+ $bind = array(1);
+
+ $segment = 'visitConvertedGoalId==1,visitServerHour==12';
+ $segment = new Segment($segment, $idSites = array());
+
+ $query = $segment->getSelectQuery($select, $from, $where, $bind);
+
+ $expected = array(
+ "sql" => "
+ SELECT
+ *
+ FROM
+ " . Common::prefixTable('log_conversion') . " AS log_conversion
+ LEFT JOIN " . Common::prefixTable('log_visit') . " AS log_visit ON log_conversion.idvisit = log_visit.idvisit
+ WHERE
+ ( log_conversion.idvisit = ? )
+ AND
+ ( (log_conversion.idgoal = ? OR HOUR(log_visit.visit_last_action_time) = ? ))",
+ "bind" => array(1, 1, 12));
+
+ $this->assertEquals($this->_filterWhitsSpaces($expected), $this->_filterWhitsSpaces($query));
+ }
+
+ /**
+ * visit is joined on action, then conversion is joined
+ * make sure that conversion is joined on action not visit
+ *
+ * @group Core
+ */
+ public function testGetSelectQueryJoinVisitAndConversionOnAction()
+ {
+ $select = '*';
+ $from = 'log_link_visit_action';
+ $where = false;
+ $bind = array();
+
+ $segment = 'visitServerHour==12;visitConvertedGoalId==1';
+ $segment = new Segment($segment, $idSites = array());
+
+ $query = $segment->getSelectQuery($select, $from, $where, $bind);
+
+ $expected = array(
+ "sql" => "
+ SELECT
+ *
+ FROM
+ " . Common::prefixTable('log_link_visit_action') . " AS log_link_visit_action
+ LEFT JOIN " . Common::prefixTable('log_visit') . " AS log_visit ON log_visit.idvisit = log_link_visit_action.idvisit
+ LEFT JOIN " . Common::prefixTable('log_conversion') . " AS log_conversion ON log_conversion.idlink_va = log_link_visit_action.idlink_va AND log_conversion.idsite = log_link_visit_action.idsite
+ WHERE
+ HOUR(log_visit.visit_last_action_time) = ? AND log_conversion.idgoal = ? ",
+ "bind" => array(12, 1));
+
+ $this->assertEquals($this->_filterWhitsSpaces($expected), $this->_filterWhitsSpaces($query));
+ }
+
+ /**
+ * join conversion on visit, then actions
+ * make sure actions are joined before conversions
+ *
+ * @group Core
+ */
+ public function testGetSelectQueryJoinConversionAndActionOnVisit()
+ {
+ $select = 'log_visit.*';
+ $from = 'log_visit';
+ $where = false;
+ $bind = array();
+
+ $segment = 'visitConvertedGoalId==1;visitServerHour==12;customVariablePageName1==Test';
+ $segment = new Segment($segment, $idSites = array());
+
+ $query = $segment->getSelectQuery($select, $from, $where, $bind);
+
+ $expected = array(
+ "sql" => "
+ SELECT
+ log_inner.*
+ FROM
+ (
+ SELECT
+ log_visit.*
+ FROM
+ " . Common::prefixTable('log_visit') . " AS log_visit
+ LEFT JOIN " . Common::prefixTable('log_link_visit_action') . " AS log_link_visit_action ON log_link_visit_action.idvisit = log_visit.idvisit
+ LEFT JOIN " . Common::prefixTable('log_conversion') . " AS log_conversion ON log_conversion.idlink_va = log_link_visit_action.idlink_va AND log_conversion.idsite = log_link_visit_action.idsite
+ WHERE
+ log_conversion.idgoal = ? AND HOUR(log_visit.visit_last_action_time) = ? AND log_link_visit_action.custom_var_k1 = ?
+ GROUP BY log_visit.idvisit
+ ) AS log_inner",
+ "bind" => array(1, 12, 'Test'));
+
+ $this->assertEquals($this->_filterWhitsSpaces($expected), $this->_filterWhitsSpaces($query));
+ }
+
+ /**
+ * Dataprovider for testBogusSegmentThrowsException
+ */
+ public function getBogusSegments()
+ {
+ return array(
+ array('referrerType==not'),
+ array('someRandomSegment==not'),
+ array('A=B')
+ );
+ }
+
+ /**
+ * @group Core
+ *
+ * @dataProvider getBogusSegments
+ */
+ public function testBogusSegmentThrowsException($segment)
+ {
+ try {
+ $segment = new Segment($segment, $idSites = array());
+ } catch (Exception $e) {
+ return;
+ }
+ $this->fail('Expected exception not raised');
+ }
+}
diff --git a/tests/PHPUnit/Integration/ServeStaticFileTest.php b/tests/PHPUnit/Integration/ServeStaticFileTest.php
new file mode 100644
index 0000000000..c8ff7f9c69
--- /dev/null
+++ b/tests/PHPUnit/Integration/ServeStaticFileTest.php
@@ -0,0 +1,591 @@
+<?php
+/**
+ * This php file is used to unit test Piwik::serverStaticFile()
+ * Unit tests for this method should normally be located in /tests/core/Piwik.test.php
+ * To make a comprehensive test suit for Piwik::serverStaticFile() (ie. being able to test combinations of request
+ * headers, being able to test response headers and so on) we need to simulate static file requests in a controlled
+ * environment
+ * The php code which simulates requests using Piwik::serverStaticFile() is provided in the same file (ie. this one)
+ * as the unit testing code for Piwik::serverStaticFile()
+ * This decision has a structural impact on the usual unit test file structure
+ * serverStaticFile.test.php has been created to avoid making too many modifications to /tests/core/Piwik.test.php
+ */
+
+// This is Piwik logo, the static file used in this test suit
+
+// TODO this is an integration or system test! not a unit test
+
+use Piwik\ProxyHttp;
+use Piwik\SettingsServer;
+use Piwik\Tests\Impl\Fixture;
+
+define("TEST_FILE_LOCATION", realpath(dirname(__FILE__) . "/../../resources/lipsum.txt"));
+define("TEST_FILE_CONTENT_TYPE", "text/plain");
+
+// Defines http request parameters
+define("FILE_MODE_REQUEST_VAR", "fileMode");
+define("SRV_MODE_REQUEST_VAR", "serverMode");
+define("ZLIB_OUTPUT_REQUEST_VAR", "zlibOutput");
+
+/**
+ * These constants define the mode in which this php file is used :
+ * - for unit testing Piwik::serverStaticFile() or
+ * - as a static file server
+ */
+define("STATIC_SERVER_MODE", "staticServerMode");
+define("UNIT_TEST_MODE", "unitTestMode");
+
+// These constants define which action will be performed by the static server.
+define("NULL_FILE_SRV_MODE", "nullFile");
+define("GHOST_FILE_SRV_MODE", "ghostFile");
+define("TEST_FILE_SRV_MODE", "testFile");
+define("PARTIAL_TEST_FILE_SRV_MODE", "partialTestFile");
+define("WHOLE_TEST_FILE_WITH_RANGE_SRV_MODE", "wholeTestFileWithRange");
+
+define("PARTIAL_BYTE_START", 1204);
+define("PARTIAL_BYTE_END", 14724);
+
+// If the static file server has not been requested, the standard unit test case class is defined
+class Test_Piwik_ServeStaticFile extends PHPUnit_Framework_TestCase
+{
+ public function tearDown()
+ {
+ parent::tearDown();
+ chmod(TEST_FILE_LOCATION, 0644);
+ }
+
+ /**
+ * Test that php compression isn't enabled ... otherwise, lots of tests will fail
+ *
+ * @group Core
+ */
+ public function test_phpOutputCompression()
+ {
+ $this->assertFalse(ProxyHttp::isPhpOutputCompressed());
+ }
+
+ /**
+ * Checks that "HTTP/1.0 404 Not Found" is returned when Piwik::serverStaticFile is called with a null file
+ *
+ * @group Core
+ */
+ public function test_nullFile()
+ {
+ $curlHandle = curl_init();
+ curl_setopt($curlHandle, CURLOPT_URL, $this->getNullFileSrvModeUrl());
+ curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, true);
+ curl_exec($curlHandle);
+ $responseInfo = curl_getinfo($curlHandle);
+ curl_close($curlHandle);
+
+ $this->assertEquals($responseInfo["http_code"], 404);
+ }
+
+ /**
+ * Checks that "HTTP/1.0 404 Not Found" is returned when Piwik::serverStaticFile is called with a non existing file
+ *
+ *
+ * @group Core
+ */
+ public function test_ghostFile()
+ {
+ $curlHandle = curl_init();
+ curl_setopt($curlHandle, CURLOPT_URL, $this->getGhostFileSrvModeUrl());
+ curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, true);
+ curl_exec($curlHandle);
+ $responseInfo = curl_getinfo($curlHandle);
+ curl_close($curlHandle);
+
+ $this->assertEquals($responseInfo["http_code"], 404);
+ }
+
+ /**
+ * Checks that "HTTP/1.0 505 Internal server error" is returned when Piwik::serverStaticFile is called with a
+ * non-readable file
+ *
+ * @group Core
+ */
+ public function test_nonReadableFile()
+ {
+ /**
+ * This test would fail on a windows environment because it is not possible to remove reading rights on a
+ * windows file using PHP.
+ */
+ if (SettingsServer::isWindows()) {
+ return;
+ }
+
+ // Setting mode so the testing file is non-readable
+ chmod(TEST_FILE_LOCATION, 0200);
+
+ $curlHandle = curl_init();
+ curl_setopt($curlHandle, CURLOPT_URL, $url = $this->getTestFileSrvModeUrl());
+ curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, true);
+ curl_exec($curlHandle);
+ $responseInfo = curl_getinfo($curlHandle);
+ curl_close($curlHandle);
+
+ // Restoring file mode
+ chmod(TEST_FILE_LOCATION, 0644);
+
+ $this->assertEquals($responseInfo["http_code"], 505);
+ }
+
+ /**
+ * Context :
+ * - First access to test file
+ * - zlib.output_compression = 0
+ * - no compression
+ * Expected :
+ * - file is send back without compression
+ * - cache control headers are correctly set
+ *
+ * @group Core
+ */
+ public function test_firstAccessNoCompression()
+ {
+ $curlHandle = curl_init();
+ curl_setopt($curlHandle, CURLOPT_URL, $this->getTestFileSrvModeUrl());
+ curl_setopt($curlHandle, CURLOPT_HEADER, true);
+ curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, true);
+ $fullResponse = curl_exec($curlHandle);
+ $responseInfo = curl_getinfo($curlHandle);
+ curl_close($curlHandle);
+
+ // Tests returned code equals 200
+ $this->assertEquals(200, $responseInfo["http_code"]);
+
+ // Tests content type
+ $this->assertContains(TEST_FILE_CONTENT_TYPE, $responseInfo["content_type"]);
+
+ // Tests no compression has been applied
+ $this->assertNull($this->getContentEncodingValue($fullResponse));
+
+ // Tests returned size
+ $this->assertEquals(filesize(TEST_FILE_LOCATION), $responseInfo["size_download"]);
+
+ // Tests if returned modified date is correctly set
+ $this->assertEquals(gmdate('D, d M Y H:i:s', filemtime(TEST_FILE_LOCATION)) . ' GMT',
+ $this->getLastModifiedValue($fullResponse));
+
+ // Tests if cache control headers are correctly set
+ $this->assertEquals("public, must-revalidate", $this->getCacheControlValue($fullResponse));
+ $pragma = $this->getPragma($fullResponse);
+ $this->assertTrue($pragma == null || $pragma == 'Pragma:');
+ $expires = $this->getExpires($fullResponse);
+ $this->assertTrue(strtotime($expires) > time() + 99 * 86400);
+ }
+
+ /**
+ * Context :
+ * - Second access to test file
+ * - If-Modified-Since set to test file modification date
+ * Expected :
+ * - "HTTP/1.1 304 Not Modified" sent back to client
+ *
+ * @group Core
+ */
+ public function test_secondAccessNoCompression()
+ {
+ $curlHandle = curl_init();
+ curl_setopt($curlHandle, CURLOPT_URL, $this->getTestFileSrvModeUrl());
+ curl_setopt($curlHandle, CURLOPT_TIMECONDITION, 1);
+ curl_setopt($curlHandle, CURLOPT_TIMEVALUE, filemtime(TEST_FILE_LOCATION));
+ curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, true);
+ curl_exec($curlHandle);
+ $responseInfo = curl_getinfo($curlHandle);
+ curl_close($curlHandle);
+
+ $this->assertEquals($responseInfo["http_code"], 304);
+ }
+
+ /**
+ * Context :
+ * - Second access to test file
+ * - If-Modified-Since set to test file modification date minus 1 second
+ * Expected :
+ * - http return code 200 sent back to client
+ *
+ * @group Core
+ */
+ public function test_secondAccessNoCompressionExpiredFile()
+ {
+ $curlHandle = curl_init();
+ curl_setopt($curlHandle, CURLOPT_URL, $this->getTestFileSrvModeUrl());
+ curl_setopt($curlHandle, CURLOPT_TIMECONDITION, 1);
+ curl_setopt($curlHandle, CURLOPT_TIMEVALUE, filemtime(TEST_FILE_LOCATION) - 1);
+ curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, true);
+ curl_exec($curlHandle);
+ $responseInfo = curl_getinfo($curlHandle);
+ curl_close($curlHandle);
+
+ $this->assertEquals($responseInfo["http_code"], 200);
+ }
+
+ /**
+ * Context :
+ * - First access to file
+ * - zlib output compression is on
+ * Expected :
+ * - the response has to be readable, it tests the proxy doesn't compress the file when compression
+ * is enabled in php.
+ *
+ * @group Core
+ */
+ public function test_responseReadableWithPhpCompression()
+ {
+ $curlHandle = curl_init();
+ curl_setopt($curlHandle, CURLOPT_URL, $this->setZlibOutputRequest(($this->getTestFileSrvModeUrl())));
+
+ // The "" parameter sets all compatible content encodings
+ curl_setopt($curlHandle, CURLOPT_ENCODING, "");
+ curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, true);
+ $fullResponse = curl_exec($curlHandle);
+ curl_close($curlHandle);
+
+ // Tests response content, it has to be equal to the test file. If not equal, double compression occurred
+ $this->assertEquals($fullResponse, file_get_contents(TEST_FILE_LOCATION));
+ }
+
+ /**
+ * Context :
+ * - First access to file
+ * - Content-Encoding: deflate
+ * Expected :
+ * - the response has to be readable
+ * - the compression method used must be gzdeflate and not gzcompression to be IE compatible
+ *
+ * @group Core
+ */
+ public function test_deflateCompression()
+ {
+ $this->removeCompressedFiles();
+
+ $curlHandle = curl_init();
+ curl_setopt($curlHandle, CURLOPT_URL, $this->getTestFileSrvModeUrl());
+ curl_setopt($curlHandle, CURLOPT_ENCODING, "deflate");
+ curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, true);
+ $fullResponse = curl_exec($curlHandle);
+ curl_close($curlHandle);
+
+ // Tests response content, it has to be equal to the test file
+ $this->assertEquals($fullResponse, file_get_contents(TEST_FILE_LOCATION));
+
+ // Tests deflate compression has been used
+ $deflateFileLocation = $this->getCompressedFileLocation() . ".deflate";
+ $this->assertTrue(file_exists($deflateFileLocation));
+
+ // Tests gzdeflate has been used for IE compatibility
+ $this->assertEquals(gzinflate(file_get_contents($deflateFileLocation)), file_get_contents(TEST_FILE_LOCATION));
+
+ $this->removeCompressedFiles();
+ }
+
+ /**
+ * Context :
+ * - First access to file
+ * - Content-Encoding: gzip
+ * Expected :
+ * - the response has to be readable
+ * - the compression method used is gzip
+ *
+ * @group Core
+ */
+ public function test_gzipCompression()
+ {
+ $this->removeCompressedFiles();
+
+ $curlHandle = curl_init();
+ curl_setopt($curlHandle, CURLOPT_URL, $this->getTestFileSrvModeUrl());
+ curl_setopt($curlHandle, CURLOPT_ENCODING, "gzip");
+ curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, true);
+ $fullResponse = curl_exec($curlHandle);
+ curl_close($curlHandle);
+
+ // Tests response content, it has to be equal to the test file
+ $this->assertEquals($fullResponse, file_get_contents(TEST_FILE_LOCATION));
+
+ // Tests gzip compression has been used
+ $gzipFileLocation = $this->getCompressedFileLocation() . ".gz";
+ $this->assertTrue(file_exists($gzipFileLocation));
+
+ $this->removeCompressedFiles();
+ }
+
+ /**
+ * Context :
+ * - First access to file
+ * - Content-Encoding: deflate
+ * - Repeat twice
+ * Expected :
+ * - the compressed file cache mechanism works file, ie. the .deflate file is not generated twice
+ *
+ * @group Core
+ */
+ public function test_compressionCache()
+ {
+ $this->removeCompressedFiles();
+ $deflateFileLocation = $this->getCompressedFileLocation() . ".deflate";
+
+ $curlHandle = curl_init();
+ curl_setopt($curlHandle, CURLOPT_URL, $this->getTestFileSrvModeUrl());
+ curl_setopt($curlHandle, CURLOPT_ENCODING, "deflate");
+ curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, true);
+ curl_exec($curlHandle);
+ curl_close($curlHandle);
+
+ $firstAccessModificationTime = filemtime($deflateFileLocation);
+
+ // Requests made to the static file have to be executed at different times for the test to be valid.
+ sleep(1);
+
+ $curlHandle = curl_init();
+ curl_setopt($curlHandle, CURLOPT_URL, $this->getTestFileSrvModeUrl());
+ curl_setopt($curlHandle, CURLOPT_ENCODING, "deflate");
+ curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, true);
+ curl_exec($curlHandle);
+ curl_close($curlHandle);
+
+ // Tests the .deflate file has not been generated twice
+ clearstatcache();
+ $this->assertEquals($firstAccessModificationTime, filemtime($deflateFileLocation));
+
+ $this->removeCompressedFiles();
+ }
+
+ /**
+ * Context :
+ * - First access to file
+ * - Content-Encoding: deflate
+ * - Repeat twice, in between: update the modification date of the test file
+ * Expected :
+ * - the test file has been updated, the cached compressed file should be regenerated
+ *
+ * @group Core
+ */
+ public function test_compressionCacheInvalidation()
+ {
+ $this->removeCompressedFiles();
+ $deflateFileLocation = $this->getCompressedFileLocation() . ".deflate";
+
+ $curlHandle = curl_init();
+ curl_setopt($curlHandle, CURLOPT_URL, $this->getTestFileSrvModeUrl());
+ curl_setopt($curlHandle, CURLOPT_ENCODING, "deflate");
+ curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, true);
+ curl_exec($curlHandle);
+ curl_close($curlHandle);
+
+ $firstAccessModificationTime = filemtime($deflateFileLocation);
+
+ // Requests made to the static file have to be executed at different times for the test to be valid.
+ sleep(1);
+
+ // We update the test file modification date
+ touch(TEST_FILE_LOCATION);
+
+ $curlHandle = curl_init();
+ curl_setopt($curlHandle, CURLOPT_URL, $this->getTestFileSrvModeUrl());
+ curl_setopt($curlHandle, CURLOPT_ENCODING, "deflate");
+ curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, true);
+ curl_exec($curlHandle);
+ curl_close($curlHandle);
+
+ clearstatcache();
+ $this->assertNotEquals($firstAccessModificationTime, filemtime($deflateFileLocation));
+
+ $this->removeCompressedFiles();
+ }
+
+ /**
+ * @group Core
+ */
+ public function test_partialFileServeNoCompression()
+ {
+ $this->removeCompressedFiles();
+
+ $curlHandle = curl_init();
+ curl_setopt($curlHandle, CURLOPT_URL, $this->getPartialTestFileSrvModeUrl());
+ curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, true);
+ $partialResponse = curl_exec($curlHandle);
+ $responseInfo = curl_getinfo($curlHandle);
+ curl_close($curlHandle);
+
+ clearstatcache();
+
+ // check no compressed files created
+ $this->assertFalse(file_exists($this->getCompressedFileLocation() . ".deflate"));
+ $this->assertFalse(file_exists($this->getCompressedFileLocation() . ".gz"));
+
+ // check $partialResponse
+ $this->assertEquals(PARTIAL_BYTE_END - PARTIAL_BYTE_START, $responseInfo["size_download"]);
+
+ $expectedPartialContents = substr(file_get_contents(TEST_FILE_LOCATION), PARTIAL_BYTE_START,
+ PARTIAL_BYTE_END - PARTIAL_BYTE_START);
+ $this->assertEquals($expectedPartialContents, $partialResponse);
+ }
+
+ /**
+ * @group Core
+ * @group TestToExec
+ */
+ public function test_partialFileServeWithCompression()
+ {
+ $this->removeCompressedFiles();
+
+ $curlHandle = curl_init();
+ curl_setopt($curlHandle, CURLOPT_URL, $this->getPartialTestFileSrvModeUrl());
+ curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, true);
+ curl_setopt($curlHandle, CURLOPT_ENCODING, "deflate");
+ $partialResponse = curl_exec($curlHandle);
+ curl_getinfo($curlHandle);
+ curl_close($curlHandle);
+
+ clearstatcache();
+
+ // check the correct compressed file is created
+ $this->assertTrue(file_exists($this->getCompressedFileLocation() . '.' . PARTIAL_BYTE_START . '.' . PARTIAL_BYTE_END . ".deflate"));
+ $this->assertFalse(file_exists($this->getCompressedFileLocation() . ".gz"));
+
+ // check $partialResponse
+ $expectedPartialContents = substr(file_get_contents(TEST_FILE_LOCATION), PARTIAL_BYTE_START,
+ PARTIAL_BYTE_END - PARTIAL_BYTE_START);
+ $this->assertEquals($expectedPartialContents, $partialResponse);
+
+ $this->removeCompressedFiles();
+ }
+
+ /**
+ * @group Core
+ */
+ public function test_wholeFileServeWithByteRange()
+ {
+ $this->removeCompressedFiles();
+
+ $curlHandle = curl_init();
+ curl_setopt($curlHandle, CURLOPT_URL, $this->getWholeTestFileWithRangeSrvModeUrl());
+ curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, true);
+ curl_setopt($curlHandle, CURLOPT_ENCODING, "deflate");
+ $fullResponse = curl_exec($curlHandle);
+ curl_getinfo($curlHandle);
+ curl_close($curlHandle);
+
+ clearstatcache();
+
+ // check the correct compressed file is created
+ $this->assertTrue(file_exists($this->getCompressedFileLocation() . ".deflate"));
+ $this->assertFalse(file_exists($this->getCompressedFileLocation() . ".gz"));
+
+ // check $fullResponse
+ $this->assertEquals(file_get_contents(TEST_FILE_LOCATION), $fullResponse);
+
+ $this->removeCompressedFiles();
+ }
+
+ /**
+ * Helper methods
+ */
+ private function getStaticSrvUrl()
+ {
+ $url = Fixture::getRootUrl();
+ $url .= '/tests/resources/';
+
+ return $url . "staticFileServer.php?" . FILE_MODE_REQUEST_VAR . "=" . STATIC_SERVER_MODE .
+ "&" . SRV_MODE_REQUEST_VAR . "=";
+ }
+
+ private function getNullFileSrvModeUrl()
+ {
+ return $this->getStaticSrvUrl() . NULL_FILE_SRV_MODE;
+ }
+
+ private function getGhostFileSrvModeUrl()
+ {
+ return $this->getStaticSrvUrl() . GHOST_FILE_SRV_MODE;
+ }
+
+ private function getTestFileSrvModeUrl()
+ {
+ return $this->getStaticSrvUrl() . TEST_FILE_SRV_MODE;
+ }
+
+ private function getPartialTestFileSrvModeUrl()
+ {
+ return $this->getStaticSrvUrl() . PARTIAL_TEST_FILE_SRV_MODE;
+ }
+
+ private function getWholeTestFileWithRangeSrvModeUrl()
+ {
+ return $this->getStaticSrvUrl() . WHOLE_TEST_FILE_WITH_RANGE_SRV_MODE;
+ }
+
+ private function setZlibOutputRequest($url)
+ {
+ return $url . "&" . ZLIB_OUTPUT_REQUEST_VAR . "=1";
+ }
+
+ private function getContentEncodingValue($fullResponse)
+ {
+ preg_match_all('/Content-Encoding:[\s*]([[:print:]]*)/', $fullResponse, $matches);
+
+ if (isset($matches[1][0])) {
+ return $matches[1][0];
+ }
+
+ return null;
+ }
+
+ private function getCacheControlValue($fullResponse)
+ {
+ preg_match_all('/Cache-Control:[\s*]([[:print:]]*)/', $fullResponse, $matches);
+
+ if (isset($matches[1][0])) {
+ return $matches[1][0];
+ }
+
+ return null;
+ }
+
+ private function getPragma($fullResponse)
+ {
+ preg_match_all('/(Pragma:[[:print:]]*)/', $fullResponse, $matches);
+
+ if (isset($matches[1][0])) {
+ return trim($matches[1][0]);
+ }
+
+ return null;
+ }
+
+ private function getExpires($fullResponse)
+ {
+ preg_match_all('/Expires: ([[:print:]]*)/', $fullResponse, $matches);
+
+ if (isset($matches[1][0])) {
+ return trim($matches[1][0]);
+ }
+
+ return null;
+ }
+
+ private function getLastModifiedValue($fullResponse)
+ {
+ preg_match_all('/Last-Modified:[\s*]([[:print:]]*)/', $fullResponse, $matches);
+
+ if (isset($matches[1][0])) {
+ return $matches[1][0];
+ }
+
+ return null;
+ }
+
+ private function getCompressedFileLocation()
+ {
+ return \Piwik\AssetManager::getInstance()->getAssetDirectory() . '/' . basename(TEST_FILE_LOCATION);
+ }
+
+ private function removeCompressedFiles()
+ {
+ @unlink($this->getCompressedFileLocation() . ".deflate");
+ @unlink($this->getCompressedFileLocation() . ".gz");
+ }
+}
diff --git a/tests/PHPUnit/Integration/SiteSearchTest.php b/tests/PHPUnit/Integration/SiteSearchTest.php
deleted file mode 100755
index 0ae3c73fd2..0000000000
--- a/tests/PHPUnit/Integration/SiteSearchTest.php
+++ /dev/null
@@ -1,95 +0,0 @@
-<?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\ThreeSitesWithManyVisitsWithSiteSearch;
-
-/**
- * Testing the various use cases w/ internal Site Search tracking
- *
- * @group SiteSearchTest
- * @group Integration
- */
-class SiteSearchTest extends IntegrationTestCase
-{
- public static $fixture = null; // initialized below class definition
-
- /**
- * @dataProvider getApiForTesting
- */
- public function testApi($api, $params)
- {
- $this->runApiTests($api, $params);
- }
-
- protected function getApiToCall()
- {
- return array(
- 'Actions.get',
- 'Actions.getPageUrls',
- 'Actions.getPageTitles',
- 'CustomVariables.getCustomVariables',
- 'Actions.getSiteSearchKeywords',
- 'Actions.getSiteSearchCategories',
- 'Actions.getSiteSearchNoResultKeywords',
- 'Actions.getPageTitlesFollowingSiteSearch',
- 'Actions.getPageUrlsFollowingSiteSearch',
- );
- }
-
- public function getApiForTesting()
- {
- $dateTime = self::$fixture->dateTime;
- $idSite1 = self::$fixture->idSite1;
-
- $apiToCall = $this->getApiToCall();
-
- $periods = array('day', 'month');
-
- $result = array(
- // Request data for the last 6 periods and idSite=all
- array($apiToCall, array('idSite' => 'all',
- 'date' => $dateTime,
- 'periods' => $periods,
- 'setDateLastN' => true,
- 'testSuffix' => '_AllSites')),
-
- // We also test a single period/single site to check that this use case (Reports per idSite in the response) works
- array($apiToCall, array(
- 'idSite' => $idSite1,
- 'date' => $dateTime,
- 'periods' => $periods,
- 'setDateLastN' => false,
- 'testSuffix' => '_NotLastNPeriods')),
- );
-
- // testing metadata API for multiple periods
- foreach ($apiToCall as $api) {
- list($apiModule, $apiAction) = explode(".", $api);
-
- $result[] = array(
- 'API.getProcessedReport', array('idSite' => $idSite1,
- 'date' => $dateTime,
- 'periods' => $periods,
- 'setDateLastN' => true,
- 'apiModule' => $apiModule,
- 'apiAction' => $apiAction,
- 'testSuffix' => '_' . $api . '_firstSite_lastN')
- );
- }
- return $result;
- }
-
- public static function getOutputPrefix()
- {
- return 'SiteSearch';
- }
-}
-
-SiteSearchTest::$fixture = new ThreeSitesWithManyVisitsWithSiteSearch(); \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/SqlTest.php b/tests/PHPUnit/Integration/SqlTest.php
new file mode 100755
index 0000000000..3d6fbac9e3
--- /dev/null
+++ b/tests/PHPUnit/Integration/SqlTest.php
@@ -0,0 +1,47 @@
+<?php
+use Piwik\Db;
+use Piwik\Tests\Impl\IntegrationTestCase;
+
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ * @group Core
+ */
+class Core_SqlTest extends IntegrationTestCase
+{
+ public function setUp()
+ {
+ parent::setUp();
+
+ // create two myisam tables
+ Db::exec("CREATE TABLE table1 (a INT) ENGINE=MYISAM");
+ Db::exec("CREATE TABLE table2 (b INT) ENGINE=MYISAM");
+
+ // create two innodb tables
+ Db::exec("CREATE TABLE table3 (c INT) ENGINE=InnoDB");
+ Db::exec("CREATE TABLE table4 (d INT) ENGINE=InnoDB");
+ }
+
+ public function tearDown()
+ {
+ parent::tearDown();
+ }
+
+ /**
+ * @group Core
+ */
+ public function testOptimize()
+ {
+ // make sure optimizing myisam tables works
+ $this->assertTrue(Db::optimizeTables(array('table1', 'table2')) !== false);
+
+ // make sure optimizing both myisam & innodb results in optimizations
+ $this->assertTrue(Db::optimizeTables(array('table1', 'table2', 'table3', 'table4')) !== false);
+
+ // make sure innodb tables are skipped
+ $this->assertTrue(Db::optimizeTables(array('table3', 'table4')) === false);
+ }
+}
diff --git a/tests/PHPUnit/Integration/TimezonesTest.php b/tests/PHPUnit/Integration/TimezonesTest.php
deleted file mode 100644
index 1603c23cb4..0000000000
--- a/tests/PHPUnit/Integration/TimezonesTest.php
+++ /dev/null
@@ -1,58 +0,0 @@
-<?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\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 TimezonesTest extends IntegrationTestCase
-{
- public static $fixture = null; // initialized below class definition
-
- public function getApiForTesting()
- {
- $idSite = self::$fixture->idSite;
- $date = self::$fixture->date;
-
- return array(
- // should have 1 visit
- array('Live.getLastVisitsDetails', array('idSite' => $idSite,
- 'date' => $date,
- 'period' => 'day')),
-
- // should have 1 visit
- array('VisitsSummary.get', array('idSite' => $idSite,
- 'date' => $date,
- 'period' => 'day',
- 'testSuffix' => '_withVisit')),
-
- // should have no visits
- array('VisitsSummary.get', array('idSite' => $idSite,
- 'date' => Date::factory($date)->addDay(1)->getDatetime(),
- 'period' => 'day',
- 'testSuffix' => '_dayAfterVisit')),
- );
- }
-
- /**
- * @dataProvider getApiForTesting
- */
- public function testApi($api, $params)
- {
- $this->runApiTests($api, $params);
- }
-}
-
-TimezonesTest::$fixture = new VisitsInDifferentTimezones(); \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/TrackCustomVariablesAndCampaignsForceUsingVisitIdNotHeuristicsTest.php b/tests/PHPUnit/Integration/TrackCustomVariablesAndCampaignsForceUsingVisitIdNotHeuristicsTest.php
deleted file mode 100755
index 3f45410510..0000000000
--- a/tests/PHPUnit/Integration/TrackCustomVariablesAndCampaignsForceUsingVisitIdNotHeuristicsTest.php
+++ /dev/null
@@ -1,49 +0,0 @@
-<?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\SomeVisitsCustomVariablesCampaignsNotHeuristics;
-
-/**
- * Test tracker & API when forcing the use of visit ID instead of heuristics. Also
- * tests campaign tracking.
- *
- * @group TrackCustomVariablesAndCampaignsForceUsingVisitIdNotHeuristicsTest
- * @group Integration
- */
-class TrackCustomVariablesAndCampaignsForceUsingVisitIdNotHeuristicsTest extends IntegrationTestCase
-{
- public static $fixture = null; // initialized below class definition
-
- /**
- * @dataProvider getApiForTesting
- */
- public function testApi($api, $params)
- {
- $this->runApiTests($api, $params);
- }
-
- public function getApiForTesting()
- {
- $apiToCall = array('VisitsSummary.get', 'Referrers.getCampaigns', 'Referrers.getWebsites');
-
- return array(
- // TOTAL should be: 1 visit, 1 converted goal, 1 page view
- array($apiToCall, array('idSite' => self::$fixture->idSite, 'date' => self::$fixture->dateTime))
- );
- }
-
- public static function getOutputPrefix()
- {
- return 'PiwikTracker_trackForceUsingVisitId_insteadOfHeuristics_alsoTestsCampaignTracking';
- }
-}
-
-TrackCustomVariablesAndCampaignsForceUsingVisitIdNotHeuristicsTest::$fixture =
- new SomeVisitsCustomVariablesCampaignsNotHeuristics(); \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/TrackGoalsAllowMultipleConversionsPerVisitTest.php b/tests/PHPUnit/Integration/TrackGoalsAllowMultipleConversionsPerVisitTest.php
deleted file mode 100755
index cac31449c2..0000000000
--- a/tests/PHPUnit/Integration/TrackGoalsAllowMultipleConversionsPerVisitTest.php
+++ /dev/null
@@ -1,67 +0,0 @@
-<?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\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 TrackGoalsAllowMultipleConversionsPerVisitTest extends IntegrationTestCase
-{
- public static $fixture = null;
-
- /**
- * @dataProvider getApiForTesting
- */
- public function testApi($api, $params)
- {
- $this->runApiTests($api, $params);
- }
-
- /**
- * @depends testApi
- */
- public function testCheck()
- {
- $idSite = self::$fixture->idSite;
-
- // test delete is working as expected
- $goals = API::getInstance()->getGoals($idSite);
- $this->assertTrue(5 == count($goals));
- API::getInstance()->deleteGoal($idSite, self::$fixture->idGoal_OneConversionPerVisit);
- API::getInstance()->deleteGoal($idSite, self::$fixture->idGoal_MultipleConversionPerVisit);
- $goals = API::getInstance()->getGoals($idSite);
- $this->assertTrue(3 == count($goals));
- }
-
- public function getApiForTesting()
- {
- $apiToCall = array(
- 'VisitTime.getVisitInformationPerServerTime',
- 'VisitsSummary.get'
- );
-
- return array(
- array($apiToCall, array('idSite' => self::$fixture->idSite, 'date' => self::$fixture->dateTime))
- );
- }
-
- public static function getOutputPrefix()
- {
- return 'trackGoals_allowMultipleConversionsPerVisit';
- }
-}
-
-TrackGoalsAllowMultipleConversionsPerVisitTest::$fixture = new SomeVisitsAllConversions(); \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/Tracker/ActionTest.php b/tests/PHPUnit/Integration/Tracker/ActionTest.php
new file mode 100644
index 0000000000..17da150bd6
--- /dev/null
+++ b/tests/PHPUnit/Integration/Tracker/ActionTest.php
@@ -0,0 +1,390 @@
+<?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;
+use Piwik\Tracker\Action;
+use Piwik\Tracker\PageUrl;
+use Piwik\Tracker\Request;
+use Piwik\Translate;
+use Piwik\Plugin\Manager as PluginManager;
+use Piwik\Tests\Impl\IntegrationTestCase;
+
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ * @group Core
+ * @group ActionTest
+ */
+class Core_Tracker_ActionTest extends IntegrationTestCase
+{
+ public function setUp()
+ {
+ parent::setUp();
+ $config = Config::getInstance();
+ $config->clear();
+ $config->setTestEnvironment();
+ $section = Config::getInstance()->Tracker;
+ $section['default_action_url'] = '/';
+ $section['campaign_var_name'] = 'campaign_param_name,piwik_campaign,utm_campaign,test_campaign_name';
+ $section['action_url_category_delimiter'] = '/';
+ $section['campaign_keyword_var_name'] = 'piwik_kwd,utm_term,test_piwik_kwd';
+ Config::getInstance()->Tracker = $section;
+
+ PluginManager::getInstance()->loadPlugins(array('SitesManager'));
+
+ Translate::loadEnglishTranslation();
+ }
+
+ protected function setUpRootAccess()
+ {
+ $pseudoMockAccess = new FakeAccess;
+ FakeAccess::$superUser = true;
+ Access::setSingletonInstance($pseudoMockAccess);
+ }
+
+ public function getTestUrls()
+ {
+ $campaignNameParam = 'test_campaign_name';
+ $campaignKwdParam = 'test_piwik_kwd';
+
+ $urls = array(
+ // a wrongly formatted url (parse_url returns false)
+ array('http:////wrongurl',
+ array(false,
+ false)),
+
+ // a URL with all components
+ array('http://username:password@hostname:80/path?phpSESSID=value#anchor',
+ array('http://username:password@hostname:80/path#anchor',
+ 'http://username:password@hostname:80/path#anchor')),
+
+ // a standard url with excluded campaign parameters
+ array('http://a.com/index?p1=v1&' . $campaignNameParam . '=Adwords-CPC&' . $campaignKwdParam . '=My killer keyword',
+ array('http://a.com/index?p1=v1',
+ 'http://a.com/index?p1=v1')),
+
+ // a standard url with excluded campaign parameters, GA style
+ array('http://a.com/index?p1=v1&utm_campaign=Adwords-CPC&utm_term=My killer keyword',
+ array('http://a.com/index?p1=v1',
+ 'http://a.com/index?p1=v1')),
+
+ // testing with capital parameter
+ array('http://a.com/index?p1=v1&P2=v2&p3=v3',
+ array('http://a.com/index?p1=v1&P2=v2&p3=v3',
+ 'http://a.com/index?p1=v1&p3=v3')),
+
+ // testing with array []
+ array('http://a.com/index?p1=v1&p2[]=v;2a&p2[]=v2b&p2[]=v2c&p3=v3&p4=v4',
+ array('http://a.com/index?p1=v1&p2[]=v;2a&p2[]=v2b&p2[]=v2c&p3=v3&p4=v4',
+ 'http://a.com/index?p1=v1&p3=v3')),
+
+ // testing with missing value
+ array('http://a.com/index?p1=v1&p2=&p3=v3&p4',
+ array('http://a.com/index?p1=v1&p2=&p3=v3&p4',
+ 'http://a.com/index?p1=v1&p3=v3')),
+ array('http://a.com/index?p1&p2=v2&p3=v3&p4',
+ array('http://a.com/index?p1&p2=v2&p3=v3&p4',
+ 'http://a.com/index?p1&p3=v3')),
+
+ // testing with extra &&
+ array('http://a.com/index?p1=v1&&p2=v;2&p3=v%3b3&p4=v4&&',
+ array('http://a.com/index?p1=v1&p2=v;2&p3=v%3b3&p4=v4',
+ 'http://a.com/index?p1=v1&p3=v%3b3')),
+
+ // encode entities
+ array('http://a.com/index?p1=v1&p2%5B%5D=v2&p3=v3&p4=v4',
+ array('http://a.com/index?p1=v1&p2[]=v2&p3=v3&p4=v4',
+ 'http://a.com/index?p1=v1&p3=v3')),
+ array('http://a.com/index?var%5Bvalue%5D%5Bdate%5D=01.01.2012',
+ array('http://a.com/index?var[value][date]=01.01.2012',
+ 'http://a.com/index')),
+
+ // matrix parameters
+ array('http://a.com/index;jsessionid=value;p1=v1;p2=v2',
+ array('http://a.com/index?p1=v1&p2=v2',
+ 'http://a.com/index?p1=v1')),
+ array('http://a.com/index;jsessionid=value?p1=v1&p2=v2',
+ array('http://a.com/index?p1=v1&p2=v2',
+ 'http://a.com/index?p1=v1')),
+ );
+
+ return $urls;
+ }
+
+ /**
+ * No excluded query parameters specified, apart from the standard "session" parameters, always excluded
+ *
+ * @group Core
+ * @dataProvider getTestUrls
+ */
+ public function testExcludeQueryParametersNone($url, $filteredUrl)
+ {
+ $this->setUpRootAccess();
+ $idSite = API::getInstance()->addSite("site1", array('http://example.org'), $ecommerce = 0,
+ $siteSearch = 1, $searchKeywordParameters = null, $searchCategoryParameters = null,
+ $excludedIps = '', $excludedQueryParameters = '', $timezone = null, $currency = null,
+ $group = null, $startDate = null, $excludedUserAgents = null, $keepURLFragments = 1);
+ $this->assertEquals($filteredUrl[0], PageUrl::excludeQueryParametersFromUrl($url, $idSite));
+ }
+
+ public function getTestUrlsHashtag()
+ {
+ $urls = array(
+ // URL, Expected URL
+ array('wrongurl/#', 'http://wrongurl/'),
+ array('wrongurl/#t', 'http://wrongurl/#t'),
+ array('wrongurl/#test', 'http://wrongurl/#test'),
+ array('wrongurl/#test=1', 'http://wrongurl/#test=1'),
+ array('wrongurl/#test=1#', 'http://wrongurl/#test=1'),
+ );
+ return $urls;
+ }
+
+ /**
+ * Test removing hash tag
+ * @group Core
+ * @dataProvider getTestUrlsHashtag
+ */
+ public function testRemoveTrailingHashtag($url, $expectedUrl)
+ {
+ $this->assertEquals(PageUrl::reconstructNormalizedUrl($url, PageUrl::$urlPrefixMap['http://']), $expectedUrl);
+ }
+
+ /**
+ * Testing with some website specific parameters excluded
+ * @group Core
+ * @dataProvider getTestUrls
+ */
+ public function testExcludeQueryParametersSiteExcluded($url, $filteredUrl)
+ {
+ $excludedQueryParameters = 'p4, p2, var[value][date]';
+ $this->setUpRootAccess();
+ $idSite = API::getInstance()->addSite("site1", array('http://example.org'), $ecommerce = 0,
+ $siteSearch = 1, $searchKeywordParameters = null, $searchCategoryParameters = null,
+ $excludedIps = '', $excludedQueryParameters, $timezone = null, $currency = null,
+ $group = null, $startDate = null, $excludedUserAgents = null, $keepURLFragments = 1);
+ $this->assertEquals($filteredUrl[1], PageUrl::excludeQueryParametersFromUrl($url, $idSite));
+ }
+
+ /**
+ * Testing with some website specific and some global excluded query parameters
+ * @group Core
+ * @dataProvider getTestUrls
+ */
+ public function testExcludeQueryParametersSiteAndGlobalExcluded($url, $filteredUrl)
+ {
+ // testing also that query parameters are case insensitive
+ $excludedQueryParameters = 'P2,var[value][date]';
+ $excludedGlobalParameters = 'blabla, P4';
+ $this->setUpRootAccess();
+ $idSite = API::getInstance()->addSite("site1", array('http://example.org'), $ecommerce = 0,
+ $siteSearch = 1, $searchKeywordParameters = null, $searchCategoryParameters = null,
+ $excludedIps = '', $excludedQueryParameters, $timezone = null, $currency = null,
+ $group = null, $startDate = null, $excludedUserAgents = null, $keepURLFragments = 1);
+ API::getInstance()->setGlobalExcludedQueryParameters($excludedGlobalParameters);
+ $this->assertEquals($filteredUrl[1], PageUrl::excludeQueryParametersFromUrl($url, $idSite));
+ }
+
+ public function getExtractUrlData()
+ {
+ return array(
+ // outlinks
+ array(
+ 'request' => array('link' => 'http://example.org'),
+ 'expected' => array('name' => null,
+ 'url' => 'http://example.org',
+ 'type' => Action::TYPE_OUTLINK),
+ ),
+ // outlinks with custom name -> no custom name
+ array(
+ 'request' => array('link' => 'http://example.org', 'action_name' => 'Example.org'),
+ 'expected' => array('name' => null,
+ 'url' => 'http://example.org',
+ 'type' => Action::TYPE_OUTLINK),
+ ),
+ // keep the case in urls, but trim
+ array(
+ 'request' => array('link' => ' http://example.org/Category/Test/ '),
+ 'expected' => array('name' => null,
+ 'url' => 'http://example.org/Category/Test/',
+ 'type' => Action::TYPE_OUTLINK),
+ ),
+
+ // no custom name
+ array(
+ 'request' => array('link' => ' http://example.org/Category/Test/ ', 'action_name' => ' Example dot org '),
+ 'expected' => array('name' => null,
+ 'url' => 'http://example.org/Category/Test/',
+ 'type' => Action::TYPE_OUTLINK),
+ ),
+
+ // downloads
+ array(
+ 'request' => array('download' => 'http://example.org/*$test.zip'),
+ 'expected' => array('name' => null,
+ 'url' => 'http://example.org/*$test.zip',
+ 'type' => Action::TYPE_DOWNLOAD),
+ ),
+
+ // downloads with custom name -> no custom name
+ array(
+ 'request' => array('download' => 'http://example.org/*$test.zip', 'action_name' => 'Download test.zip'),
+ 'expected' => array('name' => null,
+ 'url' => 'http://example.org/*$test.zip',
+ 'type' => Action::TYPE_DOWNLOAD),
+ ),
+
+ // keep the case and multiple / in urls
+ array(
+ 'request' => array('download' => 'http://example.org/CATEGORY/test///test.pdf'),
+ 'expected' => array('name' => null,
+ 'url' => 'http://example.org/CATEGORY/test///test.pdf',
+ 'type' => Action::TYPE_DOWNLOAD),
+ ),
+
+ // page view
+ array(
+ 'request' => array('url' => 'http://example.org/'),
+ 'expected' => array('name' => null,
+ 'url' => 'http://example.org/',
+ 'type' => Action::TYPE_PAGE_URL),
+ ),
+ array(
+ 'request' => array('url' => 'http://example.org/', 'action_name' => 'Example.org Website'),
+ 'expected' => array('name' => 'Example.org Website',
+ 'url' => 'http://example.org/',
+ 'type' => Action::TYPE_PAGE_URL),
+ ),
+ array(
+ 'request' => array('url' => 'http://example.org/CATEGORY/'),
+ 'expected' => array('name' => null,
+ 'url' => 'http://example.org/CATEGORY/',
+ 'type' => Action::TYPE_PAGE_URL),
+ ),
+ array(
+ 'request' => array('url' => 'http://example.org/CATEGORY/TEST', 'action_name' => 'Example.org / Category / test /'),
+ 'expected' => array('name' => 'Example.org/Category/test',
+ 'url' => 'http://example.org/CATEGORY/TEST',
+ 'type' => Action::TYPE_PAGE_URL),
+ ),
+ array(
+ 'request' => array('url' => 'http://example.org/?2,123'),
+ 'expected' => array('name' => null,
+ 'url' => 'http://example.org/?2,123',
+ 'type' => Action::TYPE_PAGE_URL),
+ ),
+
+ // empty request
+ array(
+ 'request' => array(),
+ 'expected' => array('name' => null, 'url' => '',
+ 'type' => Action::TYPE_PAGE_URL),
+ ),
+ array(
+ 'request' => array('name' => null, 'url' => "\n"),
+ 'expected' => array('name' => null, 'url' => '',
+ 'type' => Action::TYPE_PAGE_URL),
+ ),
+ array(
+ 'request' => array('url' => 'http://example.org/category/',
+ 'action_name' => 'custom name with/one delimiter/two delimiters/'),
+ 'expected' => array('name' => 'custom name with/one delimiter/two delimiters',
+ 'url' => 'http://example.org/category/',
+ 'type' => Action::TYPE_PAGE_URL),
+ ),
+ array(
+ 'request' => array('url' => 'http://example.org/category/',
+ 'action_name' => 'http://custom action name look like url/'),
+ 'expected' => array('name' => 'http:/custom action name look like url',
+ 'url' => 'http://example.org/category/',
+ 'type' => Action::TYPE_PAGE_URL),
+ ),
+ // testing: delete tab, trimmed, not strtolowered
+ array(
+ 'request' => array('url' => "http://example.org/category/test///test wOw "),
+ 'expected' => array('name' => null,
+ 'url' => 'http://example.org/category/test///test wOw',
+ 'type' => Action::TYPE_PAGE_URL),
+ ),
+ // testing: inclusion of zero values in action name
+ array(
+ 'request' => array('url' => "http://example.org/category/1/0/t/test"),
+ 'expected' => array('name' => null,
+ 'url' => 'http://example.org/category/1/0/t/test',
+ 'type' => Action::TYPE_PAGE_URL),
+ ),
+ // testing: action name ("Test &hellip;") - expect decoding of some html entities
+ array(
+ 'request' => array('url' => 'http://example.org/ACTION/URL',
+ 'action_name' => "Test &hellip;"),
+ 'expected' => array('name' => 'Test …',
+ 'url' => 'http://example.org/ACTION/URL',
+ 'type' => Action::TYPE_PAGE_URL),
+ ),
+ // testing: action name ("Special &amp; chars") - expect no conversion of html special chars
+ array(
+ 'request' => array('url' => 'http://example.org/ACTION/URL',
+ 'action_name' => "Special &amp; chars"),
+ 'expected' => array('name' => 'Special &amp; chars',
+ 'url' => 'http://example.org/ACTION/URL',
+ 'type' => Action::TYPE_PAGE_URL),
+ ),
+ // testing: action name ("Tést") - handle wide character
+ array(
+ 'request' => array('url' => 'http://example.org/ACTION/URL',
+ 'action_name' => "Tést"),
+ 'expected' => array('name' => 'Tést',
+ 'url' => 'http://example.org/ACTION/URL',
+ 'type' => Action::TYPE_PAGE_URL),
+ ),
+ // testing: action name ("Tést") - handle UTF-8 byte sequence
+ array(
+ 'request' => array('url' => 'http://example.org/ACTION/URL',
+ 'action_name' => "T\xc3\xa9st"),
+ 'expected' => array('name' => 'Tést',
+ 'url' => 'http://example.org/ACTION/URL',
+ 'type' => Action::TYPE_PAGE_URL),
+ ),
+ // testing: action name ("Tést") - invalid UTF-8 (e.g., ISO-8859-1) is not handled
+ array(
+ 'request' => array('url' => 'http://example.org/ACTION/URL',
+ 'action_name' => "T\xe9st"),
+ 'expected' => array('name' => version_compare(PHP_VERSION, '5.2.5') === -1 ? 'T\xe9st' : 'Tést',
+ 'url' => 'http://example.org/ACTION/URL',
+ 'type' => Action::TYPE_PAGE_URL),
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider getExtractUrlData
+ * @group Core
+ */
+ public function testExtractUrlAndActionNameFromRequest($request, $expected)
+ {
+ PluginManager::getInstance()->loadPlugins(array('Actions', 'SitesManager'));
+ $this->setUpRootAccess();
+ $idSite = API::getInstance()->addSite("site1", array('http://example.org'));
+ $request['idsite'] = $idSite;
+ $request = new Request($request);
+
+ $action = Action::factory($request);
+
+ $processed = array(
+ 'name' => $action->getActionName(),
+ 'url' => $action->getActionUrl(),
+ 'type' => $action->getActionType(),
+ );
+
+ $this->assertEquals($processed, $expected);
+ }
+}
diff --git a/tests/PHPUnit/Integration/Tracker/DbTest.php b/tests/PHPUnit/Integration/Tracker/DbTest.php
new file mode 100644
index 0000000000..91d01d0cfe
--- /dev/null
+++ b/tests/PHPUnit/Integration/Tracker/DbTest.php
@@ -0,0 +1,43 @@
+<?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\Common;
+use Piwik\Db;
+use Piwik\Tests\Impl\IntegrationTestCase;
+
+/**
+ * Tracker DB test
+ *
+ * @group Core
+ * @group TrackerDbTest
+ */
+class Core_Tracker_DbTest extends IntegrationTestCase
+{
+ public function test_rowCount_whenUpdating_returnsAllMatchedRowsNotOnlyUpdatedRows()
+ {
+ $db = \Piwik\Tracker::getDatabase();
+ // insert one record
+ $db->query("INSERT INTO `" . Common::prefixTable('option') . "` VALUES ('rowid', '1', false)");
+
+ // We will now UPDATE this table and check rowCount() value
+ $sqlUpdate = "UPDATE `" . Common::prefixTable('option') . "` SET option_value = 2";
+
+ // when no record was updated, return 0
+ $result = $db->query($sqlUpdate . " WHERE option_name = 'NOT FOUND'");
+ $this->assertSame(0, $db->rowCount($result));
+
+ // when one record was found and updated, returns 1
+ $result = $db->query($sqlUpdate . " WHERE option_name = 'rowid'");
+ $this->assertSame(1, $db->rowCount($result));
+
+ // when one record was found but NOT actually updated (as values have not changed), we make sure to return 1
+ // testing for MYSQLI_CLIENT_FOUND_ROWS and MYSQL_ATTR_FOUND_ROWS
+ $result = $db->query($sqlUpdate . " WHERE option_name = 'rowid'");
+ $this->assertSame(1, $db->rowCount($result));
+ }
+
+} \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/Tracker/Visit2Test.php b/tests/PHPUnit/Integration/Tracker/Visit2Test.php
new file mode 100644
index 0000000000..a5b3c0541c
--- /dev/null
+++ b/tests/PHPUnit/Integration/Tracker/Visit2Test.php
@@ -0,0 +1,239 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+
+// Tests Visits and Dimensions behavior which is a lot of logic so not in VisitTest
+
+use Piwik\Plugin\Dimension\VisitDimension;
+use Piwik\Tracker\Request;
+use Piwik\Tracker\Visitor;
+use Piwik\Piwik;
+use Piwik\EventDispatcher;
+use Piwik\Tests\Impl\Fixture;
+use Piwik\Tests\Impl\IntegrationTestCase;
+
+class FakeTrackerVisitDimension1 extends VisitDimension
+{
+ protected $columnName = 'custom_dimension_1';
+
+ public function onNewVisit(Request $request, Visitor $visitor, $action)
+ {
+ return false;
+ }
+
+ public function onExistingVisit(Request $request, Visitor $visitor, $action)
+ {
+ return 'existing1';
+ }
+}
+
+class FakeTrackerVisitDimension2 extends VisitDimension
+{
+ protected $columnName = 'custom_dimension_2';
+
+ public function onNewVisit(Request $request, Visitor $visitor, $action)
+ {
+ return 'onNew2';
+ }
+
+ public function onExistingVisit(Request $request, Visitor $visitor, $action)
+ {
+ return false;
+ }
+
+ public function onConvertedVisit(Request $request, Visitor $visitor, $action)
+ {
+ return false;
+ }
+}
+
+class FakeTrackerVisitDimension3 extends VisitDimension
+{
+ protected $columnName = 'custom_dimension_3';
+
+ public function onNewVisit(Request $request, Visitor $visitor, $action)
+ {
+ return 'onNew3';
+ }
+
+ public function onExistingVisit(Request $request, Visitor $visitor, $action)
+ {
+ return 'existing3';
+ }
+
+ public function onConvertedVisit(Request $request, Visitor $visitor, $action)
+ {
+ return 'converted3';
+ }
+}
+
+class FakeTrackerVisitDimension4 extends VisitDimension
+{
+ protected $columnName = 'custom_dimension_4';
+
+ public function onExistingVisit(Request $request, Visitor $visitor, $action)
+ {
+ return $visitor->getVisitorColumn('custom_dimension_3') . 'extended';
+ }
+
+ public function getRequiredFields()
+ {
+ return array('custom_dimension_3');
+ }
+}
+
+
+class FakeTrackerVisit extends \Piwik\Tracker\Visit
+{
+ public function __construct($request)
+ {
+ $this->request = $request;
+ $this->visitorInfo['location_ip'] = $request->getIp();
+ $this->visitorInfo['idvisitor'] = 1;
+ }
+
+ public function handleExistingVisit($visitor, $action, $visitIsConverted)
+ {
+ parent::handleExistingVisit($visitor, $action, $visitIsConverted);
+ }
+
+ public function handleNewVisit($visitor, $action, $visitIsConverted)
+ {
+ parent::handleNewVisit($visitor, $action, $visitIsConverted);
+ }
+
+ public function getAllVisitDimensions()
+ {
+ return array(
+ new FakeTrackerVisitDimension1(),
+ new FakeTrackerVisitDimension2(),
+ new FakeTrackerVisitDimension3(),
+ new FakeTrackerVisitDimension4(),
+ );
+ }
+
+ public function getVisitorInfo()
+ {
+ return $this->visitorInfo;
+ }
+
+ protected function insertNewVisit($visit)
+ {
+
+ }
+
+ protected function updateExistingVisit($valuesToUpdate)
+ {
+
+ }
+}
+
+/**
+ * @group Core
+ * @group VisitTest
+ */
+class VisitTest extends IntegrationTestCase
+{
+
+ public function setUp()
+ {
+ parent::setUp();
+ Fixture::createWebsite('2014-01-01 00:00:00');
+ Piwik::addAction('Tracker.Request.getIdSite', function (&$idSite) {
+ $idSite = 1;
+ });
+ }
+
+ public function tearDown()
+ {
+ EventDispatcher::getInstance()->clearObservers('Tracker.Request.getIdSite');
+ parent::tearDown();
+ }
+
+ public function test_handleNewVisitWithoutConversion_shouldTriggerDimensions()
+ {
+ $request = new \Piwik\Tracker\Request(array());
+ $visitor = new \Piwik\Tracker\Visitor($request, '');
+
+ $visit = new FakeTrackerVisit($request);
+ $visit->handleNewVisit($visitor, null, false);
+
+ $info = $visit->getVisitorInfo();
+
+ $this->assertEquals('onNew2', $info['custom_dimension_2']);
+ $this->assertEquals('onNew3', $info['custom_dimension_3']);
+ $this->assertArrayNotHasKey('custom_dimension_1', $info); // on new visit returns false and should be ignored
+ $this->assertArrayNotHasKey('custom_dimension_4', $info); // on new visit not defined
+
+ // make sure visitor gets updated as well
+ $this->assertEquals('onNew2', $visitor->getVisitorColumn('custom_dimension_2'));
+ $this->assertEquals('onNew3', $visitor->getVisitorColumn('custom_dimension_3'));
+ $this->assertFalse($visitor->getVisitorColumn('custom_dimension_1'));
+ $this->assertFalse($visitor->getVisitorColumn('custom_dimension_4'));
+ }
+
+ public function test_handleNewVisitWithConversion_shouldTriggerDimensions()
+ {
+ $request = new \Piwik\Tracker\Request(array());
+ $visitor = new \Piwik\Tracker\Visitor($request, '');
+
+ $visit = new FakeTrackerVisit($request);
+ $visit->handleNewVisit($visitor, null, true);
+
+ $info = $visit->getVisitorInfo();
+
+ $this->assertEquals('onNew2', $info['custom_dimension_2']); // on converted visit returns false and should be ignored
+ $this->assertEquals('converted3', $info['custom_dimension_3']); // a conversion should overwrite an existing value
+ $this->assertArrayNotHasKey('custom_dimension_1', $info);
+ $this->assertArrayNotHasKey('custom_dimension_4', $info);
+
+ $this->assertEquals('converted3', $visitor->getVisitorColumn('custom_dimension_3'));
+ }
+
+ public function test_handleExistingVisitWithoutConversion_shouldTriggerDimensions()
+ {
+ $request = new \Piwik\Tracker\Request(array());
+ $visitor = new \Piwik\Tracker\Visitor($request, '');
+
+ $visit = new FakeTrackerVisit($request);
+ $visit->handleNewVisit($visitor, null, false);
+ $visit->handleExistingVisit($visitor, null, false);
+
+ $info = $visit->getVisitorInfo();
+
+ $this->assertEquals('existing1', $info['custom_dimension_1']);
+ $this->assertEquals('onNew2', $info['custom_dimension_2']); // on existing visit returns false and should be ignored/ not overwrite on new value
+ $this->assertEquals('existing3', $info['custom_dimension_3']);
+ $this->assertEquals('existing3extended', $info['custom_dimension_4']); // accesses a previously set column
+
+ // make sure visitor gets updated as well
+ $this->assertEquals('existing1', $visitor->getVisitorColumn('custom_dimension_1'));
+ $this->assertEquals('onNew2', $visitor->getVisitorColumn('custom_dimension_2'));
+ $this->assertEquals('existing3', $visitor->getVisitorColumn('custom_dimension_3'));
+ $this->assertEquals('existing3extended', $visitor->getVisitorColumn('custom_dimension_4'));
+ }
+
+ public function test_handleExistingVisitWithConversion_shouldTriggerDimensions()
+ {
+ $request = new \Piwik\Tracker\Request(array());
+ $visitor = new \Piwik\Tracker\Visitor($request, '');
+
+ $visit = new FakeTrackerVisit($request);
+ $visit->handleNewVisit($visitor, null, false);
+ $visit->handleExistingVisit($visitor, null, true);
+
+ $info = $visit->getVisitorInfo();
+
+ $this->assertEquals('existing1', $info['custom_dimension_1']);
+ $this->assertEquals('onNew2', $info['custom_dimension_2']); // on converted visit returns false and should be ignored
+ $this->assertEquals('converted3', $info['custom_dimension_3']); // a conversion should overwrite an existing value
+ $this->assertEquals('existing3extended', $info['custom_dimension_4']);
+
+ $this->assertEquals('converted3', $visitor->getVisitorColumn('custom_dimension_3'));
+ }
+} \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/Tracker/VisitTest.php b/tests/PHPUnit/Integration/Tracker/VisitTest.php
new file mode 100644
index 0000000000..cdc69110d4
--- /dev/null
+++ b/tests/PHPUnit/Integration/Tracker/VisitTest.php
@@ -0,0 +1,275 @@
+<?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\IP;
+use Piwik\Plugins\SitesManager\API;
+use Piwik\Tracker\Request;
+use Piwik\Tracker\VisitExcluded;
+use Piwik\Tests\Impl\IntegrationTestCase;
+
+/**
+ * Class Core_Tracker_VisitTest
+ *
+ * @group Core
+ */
+class Core_Tracker_VisitTest extends IntegrationTestCase
+{
+ public function setUp()
+ {
+ parent::setUp();
+
+ // setup the access layer
+ $pseudoMockAccess = new FakeAccess;
+ FakeAccess::$superUser = true;
+ Access::setSingletonInstance($pseudoMockAccess);
+
+ \Piwik\Plugin\Manager::getInstance()->loadPlugins(array('SitesManager'));
+ }
+
+ /**
+ * Dataprovider
+ */
+ public function getExcludedIpTestData()
+ {
+ return array(
+ array('12.12.12.12', array(
+ '12.12.12.12' => true,
+ '12.12.12.11' => false,
+ '12.12.12.13' => false,
+ '0.0.0.0' => false,
+ '255.255.255.255' => false
+ )),
+ array('12.12.12.12/32', array(
+ '12.12.12.12' => true,
+ '12.12.12.11' => false,
+ '12.12.12.13' => false,
+ '0.0.0.0' => false,
+ '255.255.255.255' => false
+ )),
+ array('12.12.12.*', array(
+ '12.12.12.0' => true,
+ '12.12.12.255' => true,
+ '12.12.12.12' => true,
+ '12.12.11.255' => false,
+ '12.12.13.0' => false,
+ '0.0.0.0' => false,
+ '255.255.255.255' => false,
+ )),
+ array('12.12.12.0/24', array(
+ '12.12.12.0' => true,
+ '12.12.12.255' => true,
+ '12.12.12.12' => true,
+ '12.12.11.255' => false,
+ '12.12.13.0' => false,
+ '0.0.0.0' => false,
+ '255.255.255.255' => false,
+ )),
+ // add some ipv6 addresses!
+ );
+ }
+
+ /**
+ * @group Core
+ * @dataProvider getExcludedIpTestData
+ */
+ public function testIsVisitorIpExcluded($excludedIp, $tests)
+ {
+ $idsite = API::getInstance()->addSite("name", "http://piwik.net/", $ecommerce = 0,
+ $siteSearch = 1, $searchKeywordParameters = null, $searchCategoryParameters = null, $excludedIp);
+
+ $request = new Request(array('idsite' => $idsite));
+
+ // test that IPs within the range, or the given IP, are excluded
+ foreach ($tests as $ip => $expected) {
+ $testIpIsExcluded = IP::P2N($ip);
+
+ $excluded = new VisitExcluded_public($request, $testIpIsExcluded);
+ $this->assertSame($expected, $excluded->public_isVisitorIpExcluded($testIpIsExcluded));
+ }
+ }
+
+ /**
+ * Dataprovider for testIsVisitorUserAgentExcluded.
+ */
+ public function getExcludedUserAgentTestData()
+ {
+ return array(
+ array('', array(
+ 'whatever' => false,
+ '' => false,
+ 'nlksdjfsldkjfsa' => false,
+ )),
+ array('mozilla', array(
+ 'this has mozilla in it' => true,
+ 'this doesn\'t' => false,
+ 'partial presence: mozi' => false,
+ )),
+ array('cHrOmE,notinthere,&^%', array(
+ 'chrome is here' => true,
+ 'CHROME is here' => true,
+ '12&^%345' => true,
+ 'sfasdf' => false,
+ )),
+ );
+ }
+
+ /**
+ * @group Core
+ * @dataProvider getExcludedUserAgentTestData
+ */
+ public function testIsVisitorUserAgentExcluded($excludedUserAgent, $tests)
+ {
+ API::getInstance()->setSiteSpecificUserAgentExcludeEnabled(true);
+
+ $idsite = API::getInstance()->addSite("name", "http://piwik.net/", $ecommerce = 0,
+ $siteSearch = 1, $searchKeywordParameters = null, $searchCategoryParameters = null, $excludedIp = null,
+ $excludedQueryParameters = null, $timezone = null, $currency = null, $group = null, $startDate = null,
+ $excludedUserAgent);
+
+ $request = new Request(array('idsite' => $idsite));
+
+ // test that user agents that contain excluded user agent strings are excluded
+ foreach ($tests as $ua => $expected) {
+ $excluded = new VisitExcluded_public($request, $ip = false, $ua);
+
+ $this->assertSame($expected, $excluded->public_isUserAgentExcluded(), "Result if isUserAgentExcluded('$ua') was not " . ($expected ? 'true' : 'false') . ".");
+ }
+ }
+
+ /**
+ * @group Core
+ * @group referrerIsKnownSpam
+ */
+ public function testIsVisitor_referrerIsKnownSpam()
+ {
+ $knownSpammers = array(
+ 'http://semalt.com' => true,
+ 'http://semalt.com/random/sub/page' => true,
+ 'http://semalt.com/out/of/here?mate' => true,
+ 'http://valid.domain/' => false,
+ 'http://valid.domain/page' => false,
+ );
+ API::getInstance()->setSiteSpecificUserAgentExcludeEnabled(true);
+
+ $idsite = API::getInstance()->addSite("name", "http://piwik.net/");
+
+ // test that user agents that contain excluded user agent strings are excluded
+ foreach ($knownSpammers as $spamUrl => $expectedIsReferrerSpam) {
+ $spamUrl = urlencode($spamUrl);
+ $request = new Request(array(
+ 'idsite' => $idsite,
+ 'urlref' => $spamUrl
+ ));
+ $excluded = new VisitExcluded_public($request);
+
+ $this->assertSame($expectedIsReferrerSpam, $excluded->public_isReferrerSpamExcluded(), $spamUrl);
+ }
+ }
+
+ /**
+ * @group Core
+ * @group IpIsKnownBot
+ */
+ public function testIsVisitor_ipIsKnownBot()
+ {
+ $isIpBot = array(
+ // Source: http://forum.piwik.org/read.php?3,108926
+ '66.249.85.36' => true,
+ '66.249.91.150' => true,
+ '64.233.172.1' => true,
+
+ // ddos bot
+ '1.202.218.8' => true,
+
+ // Not bots
+ '66.248.91.150' => false,
+ '66.250.91.150' => false,
+ );
+
+ $idsite = API::getInstance()->addSite("name", "http://piwik.net/");
+ $request = new Request(array('idsite' => $idsite, 'bots' => 0));
+
+ foreach ($isIpBot as $ip => $isBot) {
+ $excluded = new VisitExcluded_public($request, IP::P2N($ip));
+
+ $this->assertSame($isBot, $excluded->public_isNonHumanBot(), $ip);
+ }
+ }
+
+ /**
+ * @group Core
+ * @group UserAgentIsKnownBot
+ */
+ public function testIsVisitor_userAgentIsKnownBot()
+ {
+ $isUserAgentBot = array(
+ 'baiduspider' => true,
+ 'bingbot' => true,
+ 'BINGBOT' => true,
+ 'x BingBot x' => true,
+ 'BingPreview' => true,
+ 'facebookexternalhit' => true,
+ 'YottaaMonitor' => true,
+ 'Mozilla/5.0 (compatible; CloudFlare-AlwaysOnline/1.0; +http://www.cloudflare.com/always-online) XXXX' => true,
+ 'Pingdom.com_bot_version_1.4_(http://www.pingdom.com/)' => true,
+ 'Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)' => true,
+ 'Exabot/2.0' => true,
+ 'sogou spider' => true,
+ 'Mozilla/5.0(compatible;Sosospider/2.0;+http://help.soso.com/webspider.htm)' => true,
+
+ 'AdsBot-Google (+http://www.google.com/adsbot.html)' => true,
+ 'Google Page Speed Insights' => true,
+ // Web snippets
+ 'Mozilla/5.0 (Windows NT 6.1; rv:6.0) Gecko/20110814 Firefox/6.0 Google (+https://developers.google.com/+/web/snippet/)' => true,
+ // Google Web Preview
+ 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/534.51 (KHTML, like Gecko; Google Web Preview) Chrome/12.0.742 Safari/534.51' => true,
+ 'Googlebot-Video/1.0' => true,
+ 'Googlebot' => true,
+
+ 'random' => false,
+ 'hello world' => false,
+ 'this is a user agent' => false,
+ 'Mozilla' => false,
+ );
+
+ $idsite = API::getInstance()->addSite("name", "http://piwik.net/");
+
+ foreach ($isUserAgentBot as $userAgent => $isBot) {
+ $request = new Request(array(
+ 'idsite' => $idsite,
+ 'bots' => 0,
+ 'ua' => $userAgent,
+ ));
+
+ $excluded = new VisitExcluded_public($request);
+
+ $this->assertSame($isBot, $excluded->public_isNonHumanBot(), $userAgent);
+ }
+ }
+}
+
+class VisitExcluded_public extends VisitExcluded
+{
+ public function public_isVisitorIpExcluded($ip)
+ {
+ return $this->isVisitorIpExcluded($ip);
+ }
+
+ public function public_isUserAgentExcluded()
+ {
+ return $this->isUserAgentExcluded();
+ }
+ public function public_isReferrerSpamExcluded()
+ {
+ return $this->isReferrerSpamExcluded();
+ }
+ public function public_isNonHumanBot()
+ {
+ return $this->isNonHumanBot();
+ }
+}
diff --git a/tests/PHPUnit/Integration/TrackerTest.php b/tests/PHPUnit/Integration/TrackerTest.php
new file mode 100644
index 0000000000..53865b0993
--- /dev/null
+++ b/tests/PHPUnit/Integration/TrackerTest.php
@@ -0,0 +1,68 @@
+<?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\Tests\Impl\Fixture;
+use Piwik\Tests\Impl\IntegrationTestCase;
+
+/**
+ * @group Core
+ */
+class Core_TrackerTest extends IntegrationTestCase
+{
+ public function setUp()
+ {
+ parent::setUp();
+ Fixture::createWebsite('2014-02-04');
+ }
+
+ protected static function configureFixture($fixture)
+ {
+ $fixture->createSuperUser = true;
+ }
+
+ /**
+ * Test the Bulk tracking API as documented in: http://developer.piwik.org/api-reference/tracking-api#bulk-tracking
+ *
+ * With invalid token_auth the request would still work
+ */
+ public function test_trackingApiWithBulkRequests_viaCurl_withWrongTokenAuth()
+ {
+ $token_auth = '33dc3f2536d3025974cccb4b4d2d98f4';
+ $this->issueBulkTrackingRequest($token_auth, $expectTrackingToSucceed = true);
+ }
+
+ public function test_trackingApiWithBulkRequests_viaCurl_withCorrectTokenAuth()
+ {
+ $token_auth = Fixture::getTokenAuth();
+ \Piwik\Filesystem::deleteAllCacheOnUpdate();
+ $this->issueBulkTrackingRequest($token_auth, $expectTrackingToSucceed = true);
+ }
+
+ protected function issueBulkTrackingRequest($token_auth, $expectTrackingToSucceed)
+ {
+ $piwikHost = Fixture::getRootUrl() . 'tests/PHPUnit/proxy/piwik.php';
+
+ $command = 'curl -s -X POST -d \'{"requests":["?idsite=1&url=http://example.org&action_name=Test bulk log Pageview&rec=1","?idsite=1&url=http://example.net/test.htm&action_name=Another bulk page view&rec=1"],"token_auth":"' . $token_auth . '"}\' ' . $piwikHost;
+
+ exec($command, $output, $result);
+ if ($result !== 0) {
+ throw new Exception("tracking bulk failed: " . implode("\n", $output) . "\n\ncommand used: $command");
+ }
+ $output = implode("", $output);
+ $this->assertStringStartsWith('{"status":', $output);
+
+ if($expectTrackingToSucceed) {
+ $this->assertNotContains('error', $output);
+ $this->assertContains('success', $output);
+ } else {
+ $this->assertContains('error', $output);
+ $this->assertNotContains('success', $output);
+ }
+
+ }
+}
diff --git a/tests/PHPUnit/Integration/TrackerWindowLookBackTest.php b/tests/PHPUnit/Integration/TrackerWindowLookBackTest.php
deleted file mode 100644
index 58f1eecde7..0000000000
--- a/tests/PHPUnit/Integration/TrackerWindowLookBackTest.php
+++ /dev/null
@@ -1,51 +0,0 @@
-<?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\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 TrackerWindowLookBackTest extends IntegrationTestCase
-{
- public static $fixture = null; // initialized below class definition
-
- /**
- * @dataProvider getApiForTesting
- */
- public function testApi($api, $params)
- {
- $this->runApiTests($api, $params);
- }
-
- public function getApiForTesting()
- {
- $idSite = self::$fixture->idSite;
-
- return array(
- array('VisitsSummary.getVisits', array( 'date' => '2010-12-01,2011-01-31',
- 'periods' => array('range'),
- 'idSite' => $idSite,
- ))
- );
- }
-
- public static function getOutputPrefix()
- {
- return 'TrackerWindowLookBack';
- }
-}
-
-TrackerWindowLookBackTest::$fixture = new VisitsOverSeveralDays();
-TrackerWindowLookBackTest::$fixture->forceLargeWindowLookBackForVisitor = true; \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/TransitionsTest.php b/tests/PHPUnit/Integration/TransitionsTest.php
deleted file mode 100644
index 613e66dd45..0000000000
--- a/tests/PHPUnit/Integration/TransitionsTest.php
+++ /dev/null
@@ -1,91 +0,0 @@
-<?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 TransitionsTest extends IntegrationTestCase
-{
- public static $fixture = null; // initialized below class definition
-
- /**
- * @dataProvider getApiForTesting
- */
- public function testApi($api, $params)
- {
- $this->runApiTests($api, $params);
- }
-
- public function getApiForTesting()
- {
- $return = array();
- $return[] = array('Transitions.getTransitionsForPageUrl', array(
- 'idSite' => self::$fixture->idSite,
- 'date' => self::$fixture->dateTime,
- 'periods' => array('day', 'month'),
- 'testSuffix' => '_noLimit',
- 'otherRequestParameters' => array(
- 'pageUrl' => 'http://example.org/page/one.html',
- )
- ));
- $return[] = array('Transitions.getTransitionsForPageTitle', array(
- 'idSite' => self::$fixture->idSite,
- 'date' => self::$fixture->dateTime,
- 'periods' => array('day', 'month'),
- 'testSuffix' => '_noLimit',
- 'otherRequestParameters' => array(
- 'pageTitle' => 'page title - page/one.html',
- )
- ));
-
- // test w/ pages that don't exist
- $return[] = array('Transitions.getTransitionsForPageUrl', array(
- 'idSite' => self::$fixture->idSite,
- 'date' => self::$fixture->dateTime,
- 'periods' => array('day', 'month'),
- 'testSuffix' => '_noData',
- 'otherRequestParameters' => array(
- 'pageUrl' => 'http://example.org/not/a/page.html',
- )
- ));
- $return[] = array('Transitions.getTransitionsForPageTitle', array(
- 'idSite' => self::$fixture->idSite,
- 'date' => self::$fixture->dateTime,
- 'periods' => array('day', 'month'),
- 'testSuffix' => '_noData',
- 'otherRequestParameters' => array(
- 'pageTitle' => 'not a page title',
- )
- ));
-
- $return[] = array('Transitions.getTransitionsForPageUrl', array( // test w/ limiting
- 'idSite' => self::$fixture->idSite,
- 'date' => self::$fixture->dateTime,
- 'periods' => array('day', 'month'),
- 'otherRequestParameters' => array(
- 'pageUrl' => 'http://example.org/page/one.html',
- 'limitBeforeGrouping' => 2
- )
- ));
- return $return;
- }
-
- public static function getOutputPrefix()
- {
- return 'Transitions';
- }
-}
-
-TransitionsTest::$fixture = new SomeVisitsManyPageviewsWithTransitions(); \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/TravisEnvironmentTest.php b/tests/PHPUnit/Integration/TravisEnvironmentTest.php
new file mode 100644
index 0000000000..c8fce30ba2
--- /dev/null
+++ b/tests/PHPUnit/Integration/TravisEnvironmentTest.php
@@ -0,0 +1,36 @@
+<?php
+
+use Piwik\Translate;
+use Piwik\Tests\Impl\IntegrationTestCase;
+
+/**
+ * Class TravisEnvironmentTest
+ *
+ * @group Core
+ */
+class Core_TravisEnvironmentTest extends IntegrationTestCase
+{
+ public function testUsageOfCorrectMysqlAdapter()
+ {
+ $mysqlAdapter = getenv('MYSQL_ADAPTER');
+
+ if (empty($mysqlAdapter)) {
+ return;
+ }
+
+ $this->assertTrue(in_array($mysqlAdapter, array('PDO_MYSQL', 'PDO\MYSQL', 'MYSQLI')));
+
+ $db = Piwik\Db::get();
+
+ switch ($mysqlAdapter) {
+ case 'PDO_MYSQL':
+ case 'PDO\MYSQL':
+ $this->assertInstanceOf('\Piwik\Db\Adapter\Pdo\Mysql', $db);
+ break;
+ case 'MYSQLI':
+ $this->assertInstanceOf('\Piwik\Db\Adapter\Mysqli', $db);
+ break;
+ }
+
+ }
+} \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/TwoVisitorsTwoWebsitesDifferentDaysArchivingDisabledTest.php b/tests/PHPUnit/Integration/TwoVisitorsTwoWebsitesDifferentDaysArchivingDisabledTest.php
deleted file mode 100755
index a5f1aa5f5a..0000000000
--- a/tests/PHPUnit/Integration/TwoVisitorsTwoWebsitesDifferentDaysArchivingDisabledTest.php
+++ /dev/null
@@ -1,89 +0,0 @@
-<?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\TwoSitesTwoVisitorsDifferentDays;
-
-/**
- * Tests IndexedBySite optimizations when archiving is disabled.
- *
- * @group TwoVisitorsTwoWebsitesDifferentDaysArchivingDisabledTest
- * @group Integration
- */
-class TwoVisitorsTwoWebsitesDifferentDaysArchivingDisabledTest extends IntegrationTestCase
-{
- public static $fixture = null; // initialized below class definition
-
- /**
- * @dataProvider getApiForTesting
- */
- public function testApi($api, $params)
- {
- $this->runApiTests($api, $params);
- }
-
- public function getApiForTesting()
- {
- $dateTime = self::$fixture->dateTime;
-
- $periods = array('day', 'week', 'month', 'year');
-
- $dateStart = \Piwik\Date::factory($dateTime)->subDay(10)->toString();
- $dateEnd = \Piwik\Date::factory($dateTime)->addDay(15)->toString();
- $dateRange = $dateStart . "," . $dateEnd;
-
- return array(
- // disable archiving & check that there is no archive data
- array('VisitsSummary.get', array('idSite' => 'all',
- 'date' => $dateTime,
- 'periods' => $periods,
- 'disableArchiving' => true,
- 'testSuffix' => '_disabledBefore')),
-
- // re-enable archiving & check the output
- array('VisitsSummary.get', array('idSite' => 'all',
- 'date' => $dateTime,
- 'periods' => $periods,
- 'disableArchiving' => false,
- 'testSuffix' => '_enabled')),
-
- // diable archiving again & check the output
- array('VisitsSummary.get', array('idSite' => 'all',
- 'date' => $dateTime,
- 'periods' => $periods,
- 'disableArchiving' => true,
- 'testSuffix' => '_disabledAfter')),
-
- // 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,
- 'periods' => array('range'),
- 'disableArchiving' => false,
- 'testSuffix' => '_enabledBefore_isDateRange')),
-
- // DISABLE Archiving + DELETE Date range archives before this test.
- // This should return the same data as the test above!
- array('VisitsSummary.get', array('idSite' => 'all',
- 'date' => $dateRange,
- 'periods' => array('range'),
- 'disableArchiving' => true,
- 'testSuffix' => '_disabledBefore_isDateRange')),
-
- );
- }
-
- public static function getOutputPrefix()
- {
- return 'TwoVisitors_twoWebsites_differentDays_ArchivingDisabled';
- }
-}
-
-TwoVisitorsTwoWebsitesDifferentDaysArchivingDisabledTest::$fixture = new TwoSitesTwoVisitorsDifferentDays();
-TwoVisitorsTwoWebsitesDifferentDaysArchivingDisabledTest::$fixture->allowConversions = true; \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/TwoVisitorsTwoWebsitesDifferentDaysConversionsTest.php b/tests/PHPUnit/Integration/TwoVisitorsTwoWebsitesDifferentDaysConversionsTest.php
deleted file mode 100755
index 9557cba704..0000000000
--- a/tests/PHPUnit/Integration/TwoVisitorsTwoWebsitesDifferentDaysConversionsTest.php
+++ /dev/null
@@ -1,119 +0,0 @@
-<?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\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 TwoVisitorsTwoWebsitesDifferentDaysConversionsTest extends IntegrationTestCase
-{
- public static $fixture = null; // initialized below class definition
-
- /**
- * @dataProvider getApiForTesting
- */
- public function testApi($api, $params)
- {
- $this->runApiTests($api, $params);
- }
-
- public function getApiToCall()
- {
- return array('Goals.getDaysToConversion',
- 'MultiSites.getAll'
- );
- }
-
- public function getApiForTesting()
- {
- $dateTime = self::$fixture->dateTime;
- $idSite1 = self::$fixture->idSite1;
-
- // NOTE: copied from TwoVisitors_TwoWebsites_DifferentDays (including the test or inheriting means
- // the test will get run by phpunit, even when we only want to run this one. should be put into
- // non-test class later.)
- $apiToCall = $this->getApiToCall();
- $singlePeriodApi = array('VisitsSummary.get', 'Goals.get');
-
- $periods = array(
- 'day',
- 'week',
- 'month',
- 'year'
- );
-
- $result = array(
- // Request data for the last 6 periods and idSite=all
- array($apiToCall, array('idSite' => 'all',
- 'date' => $dateTime,
- 'periods' => $periods,
- 'setDateLastN' => true)),
-
- // Request data for the last 6 periods and idSite=1
- array($apiToCall, array('idSite' => $idSite1,
- 'date' => $dateTime,
- 'periods' => $periods,
- 'setDateLastN' => true,
- 'testSuffix' => '_idSiteOne_')),
-
- // We also test a single period to check that this use case (Reports per idSite in the response) works
- array($singlePeriodApi, array('idSite' => 'all',
- 'date' => $dateTime,
- 'periods' => array('day', 'month'),
- 'setDateLastN' => false,
- 'testSuffix' => '_NotLastNPeriods')),
- );
-
- // testing metadata API for multiple periods
- $apiToCall = array_diff($apiToCall, array('Actions.getPageTitle', 'Actions.getPageUrl'));
- foreach ($apiToCall as $api) {
- list($apiModule, $apiAction) = explode(".", $api);
-
- $result[] = array(
- 'API.getProcessedReport', array('idSite' => $idSite1,
- 'date' => $dateTime,
- 'periods' => array('day'),
- 'setDateLastN' => true,
- 'apiModule' => $apiModule,
- 'apiAction' => $apiAction,
- 'testSuffix' => '_' . $api . '_firstSite_lastN')
- );
- }
-
- // Tests that getting a visits summary metric (nb_visits) & a Goal's metric (Goal_revenue)
- // at the same time works.
- $dateTime = '2010-01-03,2010-01-06';
- $columns = 'nb_visits,' . Archiver::getRecordName('conversion_rate');
-
- $result[] = array(
- 'VisitsSummary.get', array('idSite' => 'all', 'date' => $dateTime, 'periods' => 'range',
- 'otherRequestParameters' => array('columns' => $columns),
- 'testSuffix' => '_getMetricsFromDifferentReports')
- );
-
- return $result;
- }
-
- public static function getOutputPrefix()
- {
- return 'TwoVisitors_twoWebsites_differentDays_Conversions';
- }
-}
-
-TwoVisitorsTwoWebsitesDifferentDaysConversionsTest::$fixture = new TwoSitesTwoVisitorsDifferentDays();
-TwoVisitorsTwoWebsitesDifferentDaysConversionsTest::$fixture->allowConversions = true; \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/TwoVisitorsTwoWebsitesDifferentDaysTest.php b/tests/PHPUnit/Integration/TwoVisitorsTwoWebsitesDifferentDaysTest.php
deleted file mode 100755
index f4c14d3569..0000000000
--- a/tests/PHPUnit/Integration/TwoVisitorsTwoWebsitesDifferentDaysTest.php
+++ /dev/null
@@ -1,112 +0,0 @@
-<?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\TwoSitesTwoVisitorsDifferentDays;
-
-/**
- * tests Tracker several websites, different days.
- * tests API for period=day/week/month/year, requesting data for both websites,
- * and requesting data for last N periods.
- * Also tests a visit that spans over 2 days.
- * 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 TwoVisitorsTwoWebsitesDifferentDaysTest extends IntegrationTestCase
-{
- public static $fixture = null; // initialized below class definition
-
- public function testImagesIncludedInTests()
- {
- $this->alertWhenImagesExcludedFromTests();
- }
-
- /**
- * @dataProvider getApiForTesting
- */
- public function testApi($api, $params)
- {
- $this->runApiTests($api, $params);
- }
-
- protected function getApiToCall()
- {
- return array('VisitFrequency.get',
- 'VisitsSummary.get',
- 'Referrers.getWebsites',
- 'Actions.getPageUrls',
- 'Actions.getPageTitles',
- 'Actions.getOutlinks',
- 'Actions.getPageTitle',
- 'Actions.getPageUrl',
- 'VisitorInterest.getNumberOfVisitsByDaysSinceLast');
- }
-
- public function getApiForTesting()
- {
- $idSite1 = self::$fixture->idSite1;
- $dateTime = self::$fixture->dateTime;
-
- $apiToCall = $this->getApiToCall();
- $singlePeriodApi = array('VisitsSummary.get', 'Goals.get');
-
- $periods = array('day', 'week', 'month', 'year');
-
- $result = array(
- // Request data for the last 6 periods and idSite=all
- array($apiToCall, array('idSite' => 'all',
- 'date' => $dateTime,
- 'periods' => $periods,
- 'setDateLastN' => true)),
-
- // Request data for the last 6 periods and idSite=1
- array($apiToCall, array('idSite' => $idSite1,
- 'date' => $dateTime,
- 'periods' => $periods,
- 'setDateLastN' => true,
- 'testSuffix' => '_idSiteOne_')),
-
- // We also test a single period to check that this use case (Reports per idSite in the response) works
- array($singlePeriodApi, array('idSite' => 'all',
- 'date' => $dateTime,
- 'periods' => array('day', 'month'),
- 'setDateLastN' => false,
- 'testSuffix' => '_NotLastNPeriods')),
- );
-
- // testing metadata API for multiple periods
- $apiToCall = array_diff($apiToCall, array('Actions.getPageTitle', 'Actions.getPageUrl'));
- foreach ($apiToCall as $api) {
- list($apiModule, $apiAction) = explode(".", $api);
-
- $result[] = array(
- 'API.getProcessedReport', array('idSite' => $idSite1,
- 'date' => $dateTime,
- 'periods' => array('day'),
- 'setDateLastN' => true,
- 'apiModule' => $apiModule,
- 'apiAction' => $apiAction,
- 'testSuffix' => '_' . $api . '_firstSite_lastN')
- );
- }
-
- return array_merge($result, self::getApiForTestingScheduledReports($dateTime, 'month'));
- }
-
- public static function getOutputPrefix()
- {
- return 'TwoVisitors_twoWebsites_differentDays';
- }
-}
-
-TwoVisitorsTwoWebsitesDifferentDaysTest::$fixture = new TwoSitesTwoVisitorsDifferentDays(); \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/TwoVisitsWithCustomVariablesSegmentContainsTest.php b/tests/PHPUnit/Integration/TwoVisitsWithCustomVariablesSegmentContainsTest.php
deleted file mode 100755
index 1f31497a53..0000000000
--- a/tests/PHPUnit/Integration/TwoVisitsWithCustomVariablesSegmentContainsTest.php
+++ /dev/null
@@ -1,67 +0,0 @@
-<?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\TwoVisitsWithCustomVariables;
-
-/**
- * Tests use of custom variable segments.
- *
- * @group Integration
- * @group TwoVisitsWithCustomVariablesSegmentContainsTest
- */
-class TwoVisitsWithCustomVariablesSegmentContainsTest extends IntegrationTestCase
-{
- public static $fixture = null; // initialized below class definition
-
- public static function getOutputPrefix()
- {
- return 'twoVisitsWithCustomVariables';
- }
-
- /**
- * @dataProvider getApiForTesting
- */
- public function testApi($api, $params)
- {
- $this->runApiTests($api, $params);
- }
-
- public function getApiForTesting()
- {
- $idSite = self::$fixture->idSite;
- $dateTime = self::$fixture->dateTime;
-
- $return = array();
-
- $api = array('Actions.getPageUrls', 'Actions.getPageTitles', 'VisitsSummary.get');
- $segmentsToTest = array(
- // array( SegmentString , TestSuffix , Array of API to test)
- array("pageTitle=@*_)%", '_SegmentPageTitleContainsStrangeCharacters', array('Actions.getPageTitles', 'VisitsSummary.get')),
- array("pageUrl=@user/profile", '_SegmentPageUrlContains', $api),
- array("pageTitle=@Profile pa", '_SegmentPageTitleContains', $api),
- array("pageUrl!@user/profile", '_SegmentPageUrlExcludes', $api),
- array("pageTitle!@Profile pa", '_SegmentPageTitleExcludes', $api),
- );
-
- foreach ($segmentsToTest as $segment) {
- // Also test "Page URL / Page title CONTAINS string" feature
- $return[] = array($segment[2],
- array('idSite' => $idSite, 'date' => $dateTime, 'periods' => array('day'),
- 'setDateLastN' => false,
- 'segment' => $segment[0],
- 'testSuffix' => $segment[1])
- );
- }
- return $return;
- }
-}
-
-TwoVisitsWithCustomVariablesSegmentContainsTest::$fixture = new TwoVisitsWithCustomVariables();
-TwoVisitsWithCustomVariablesSegmentContainsTest::$fixture->doExtraQuoteTests = false; \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/TwoVisitsWithCustomVariablesSegmentMatchALLNoGoalDataTest.php b/tests/PHPUnit/Integration/TwoVisitsWithCustomVariablesSegmentMatchALLNoGoalDataTest.php
deleted file mode 100755
index d800deca65..0000000000
--- a/tests/PHPUnit/Integration/TwoVisitsWithCustomVariablesSegmentMatchALLNoGoalDataTest.php
+++ /dev/null
@@ -1,54 +0,0 @@
-<?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\TwoVisitsWithCustomVariables;
-
-/**
- * @group Integration
- * @group TwoVisitsWithCustomVariablesSegmentMatchALLNoGoalDataTest
- */
-class TwoVisitsWithCustomVariablesSegmentMatchALLNoGoalDataTest extends IntegrationTestCase
-{
- public static $fixture = null; // initialized below class definition
-
- /**
- * @dataProvider getApiForTesting
- */
- public function testApi($api, $params)
- {
- $this->runApiTests($api, $params);
- }
-
- public function getApiForTesting()
- {
- $apiToCall = array('VisitsSummary.get', 'CustomVariables.getCustomVariables');
-
- // Segment matching ALL
- // + adding DOES NOT CONTAIN segment always matched, to test this particular operator
- $resolution = self::$fixture->resolutionWidthToUse . 'x' . self::$fixture->resolutionHeightToUse;
- $segment = 'resolution==' . $resolution . ';customVariableName1!@randomvalue does not exist';
-
- return array(
- array($apiToCall, array('idSite' => 'all',
- 'date' => self::$fixture->dateTime,
- 'periods' => array('day', 'week'),
- 'setDateLastN' => true,
- 'segment' => $segment))
- );
- }
-
- public static function getOutputPrefix()
- {
- return 'twoVisitsWithCustomVariables_segmentMatchALL_noGoalData';
- }
-}
-
-TwoVisitsWithCustomVariablesSegmentMatchALLNoGoalDataTest::$fixture = new TwoVisitsWithCustomVariables();
-TwoVisitsWithCustomVariablesSegmentMatchALLNoGoalDataTest::$fixture->doExtraQuoteTests = false; \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/TwoVisitsWithCustomVariablesSegmentMatchNONETest.php b/tests/PHPUnit/Integration/TwoVisitsWithCustomVariablesSegmentMatchNONETest.php
deleted file mode 100755
index 1c0af3449a..0000000000
--- a/tests/PHPUnit/Integration/TwoVisitsWithCustomVariablesSegmentMatchNONETest.php
+++ /dev/null
@@ -1,93 +0,0 @@
-<?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\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 TwoVisitsWithCustomVariablesSegmentMatchNONETest extends IntegrationTestCase
-{
- public static $fixture = null; // initialized below class definition
-
- /**
- * @dataProvider getApiForTesting
- */
- public function testApi($api, $params)
- {
- $this->runApiTests($api, $params);
- }
-
- public function getApiForTesting()
- {
- // we will test all segments from all plugins
- Fixture::loadAllPlugins();
-
- $apiToCall = array('VisitsSummary.get', 'CustomVariables.getCustomVariables');
-
- return array(
- array($apiToCall, array('idSite' => 'all',
- 'date' => self::$fixture->dateTime,
- 'periods' => array('day', 'week'),
- 'setDateLastN' => true,
- 'segment' => $this->getSegmentToTest()))
- );
- }
-
- public function getSegmentToTest()
- {
- // Segment matching NONE
- $segments = API::getInstance()->getSegmentsMetadata(self::$fixture->idSite);
-
- $minimumExpectedSegmentsCount = 55; // as of Piwik 1.12
- $this->assertTrue( count($segments) >= $minimumExpectedSegmentsCount);
- $segmentExpression = array();
-
- $seenVisitorId = false;
- foreach ($segments as $segment) {
- $value = 'campaign';
- if ($segment['segment'] == 'visitorId') {
- $seenVisitorId = true;
- $value = '34c31e04394bdc63';
- }
- if ($segment['segment'] == 'visitEcommerceStatus') {
- $value = 'none';
- }
- $matchNone = $segment['segment'] . '!=' . $value;
-
- // deviceType != campaign matches ALL visits, but we want to match None
- if($segment['segment'] == 'deviceType') {
- $matchNone = $segment['segment'] . '==car%20browser';
- }
- $segmentExpression[] = $matchNone;
- }
-
- $segment = implode(";", $segmentExpression);
-
- // just checking that this segment was tested (as it has the only visible to admin flag)
- $this->assertTrue($seenVisitorId);
- $this->assertGreaterThan(100, strlen($segment));
-
- return $segment;
- }
-
- public static function getOutputPrefix()
- {
- return 'twoVisitsWithCustomVariables_segmentMatchNONE';
- }
-}
-
-TwoVisitsWithCustomVariablesSegmentMatchNONETest::$fixture = new TwoVisitsWithCustomVariables();
-TwoVisitsWithCustomVariablesSegmentMatchNONETest::$fixture->doExtraQuoteTests = false; \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/TwoVisitsWithCustomVariablesSegmentMatchVisitorTypeTest.php b/tests/PHPUnit/Integration/TwoVisitsWithCustomVariablesSegmentMatchVisitorTypeTest.php
deleted file mode 100755
index d7582bdcc6..0000000000
--- a/tests/PHPUnit/Integration/TwoVisitsWithCustomVariablesSegmentMatchVisitorTypeTest.php
+++ /dev/null
@@ -1,114 +0,0 @@
-<?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\Tests\IntegrationTestCase;
-use Piwik\Tests\Fixtures\TwoVisitsWithCustomVariables;
-
-/**
- * Tests use of custom variable segments.
- *
- * @group Integration
- * @group TwoVisitsWithCustomVariablesSegmentMatchVisitorTypeTest
- */
-class TwoVisitsWithCustomVariablesSegmentMatchVisitorTypeTest extends IntegrationTestCase
-{
- public static $fixture = null; // initialized below class definition
-
- /**
- * @dataProvider getApiForTesting
- */
- public function testApi($api, $params)
- {
- $this->runApiTests($api, $params);
- }
-
- public function getApiForTesting()
- {
- // Segment matching some
- $segments = array('customVariableName1==VisitorType;customVariableValue1==LoggedIn',
- 'customVariableName1==VisitorType;customVariableValue1=@LoggedI');
-
- $apiToCall = array('Referrers.getKeywords', 'CustomVariables.getCustomVariables', 'VisitsSummary.get');
-
- $periods = array('day', 'week');
-
- // We run it twice just to check that running archiving twice for same input parameters doesn't create more records/overhead
- $result = array();
- for ($i = 1; $i <= 2; $i++) {
- foreach ($segments as $segment) {
- $result[] = array(
- $apiToCall, array('idSite' => 'all',
- 'date' => self::$fixture->dateTime,
- 'periods' => $periods,
- 'setDateLastN' => true,
- 'segment' => $segment)
- );
- }
- }
-
- return $result;
- }
-
- /**
- * @depends testApi
- * @group Integration
- */
- public function testCheck()
- {
- // ----------------------------------------------
- // Implementation Checks
- // ----------------------------------------------
- // Verify that, when a segment is specified, only the requested report is processed
- // In this case, check that only the Custom Variables blobs have been processed
-
- $tests = array(
- // 1) CHECK 'day' archive stored in January
- // We expect 2 segments
- // * (1 custom variable name + 2 ref metrics
- // + 6 subtable for the custom var values + 5 Referrers blob
- // )
- 'archive_blob_2010_01' => 28,
- // This contains all 'last N' weeks & days,
- // (2 metrics
- // + 2 referrer metrics
- // + 3 done flag )
- // * 2 segments
- // + 1 Done flag per Plugin, for each "Last N" date
- 'archive_numeric_2010_01' => 142,
-
- // 2) CHECK 'week' archive stored in December (week starts the month before)
- // We expect 2 segments * (1 custom variable name + 2 ref metrics + 5 subtable for the values of the name + 5 referrers blob)
- 'archive_blob_2009_12' => 28,
- // 7 metrics,
- // 2 Referrer metrics (Referrers_distinctSearchEngines/Referrers_distinctKeywords),
- // 3 done flag (referrers, CustomVar, VisitsSummary),
- // X * 2 segments
- 'archive_numeric_2009_12' => (6 + 2 + 3) * 2,
- );
- foreach ($tests as $table => $expectedRows) {
- $sql = "SELECT count(*) FROM " . Common::prefixTable($table);
- $countBlobs = Db::get()->fetchOne($sql);
-
- if($expectedRows != $countBlobs) {
- var_export(Db::get()->fetchAll("SELECT * FROM " . Common::prefixTable($table) . " ORDER BY name, idarchive ASC"));
- }
- $this->assertEquals($expectedRows, $countBlobs, "$table: %s");
- }
- }
-
- public static function getOutputPrefix()
- {
- return 'twoVisitsWithCustomVariables_segmentMatchVisitorType';
- }
-}
-
-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
deleted file mode 100755
index a9fafeddb8..0000000000
--- a/tests/PHPUnit/Integration/TwoVisitsWithCustomVariablesTest.php
+++ /dev/null
@@ -1,63 +0,0 @@
-<?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\TwoVisitsWithCustomVariables;
-
-/**
- * Tests w/ two visits & custom variables.
- *
- * @group TwoVisitsWithCustomVariablesTest
- * @group Integration
- */
-class TwoVisitsWithCustomVariablesTest extends IntegrationTestCase
-{
- public static $fixture = null; // initialized below class definition
-
- public function getApiForTesting()
- {
- $idSite = self::$fixture->idSite;
- $dateTime = self::$fixture->dateTime;
-
- $apiToCall = array('VisitsSummary.get', 'CustomVariables.getCustomVariables');
-
- $return = array(
- array($apiToCall, array('idSite' => 'all',
- 'date' => $dateTime,
- 'periods' => array('day', 'week'),
- 'setDateLastN' => true)),
-
- // test getProcessedReport w/ custom variables subtable
- array('API.getProcessedReport', array('idSite' => $idSite,
- 'date' => $dateTime,
- 'periods' => 'day',
- 'apiModule' => 'CustomVariables',
- 'apiAction' => 'getCustomVariablesValuesFromNameId',
- 'supertableApi' => 'CustomVariables.getCustomVariables',
- 'testSuffix' => '__subtable')),
- );
-
- return $return;
- }
-
- /**
- * @dataProvider getApiForTesting
- */
- public function testApi($api, $params)
- {
- $this->runApiTests($api, $params);
- }
-
- public static function getOutputPrefix()
- {
- return 'twoVisitsWithCustomVariables';
- }
-}
-
-TwoVisitsWithCustomVariablesTest::$fixture = new TwoVisitsWithCustomVariables(); \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/UpdaterTest.php b/tests/PHPUnit/Integration/UpdaterTest.php
new file mode 100644
index 0000000000..a0b7662b63
--- /dev/null
+++ b/tests/PHPUnit/Integration/UpdaterTest.php
@@ -0,0 +1,77 @@
+<?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\Core;
+
+use Piwik\Tests\Impl\IntegrationTestCase;
+use Piwik\Updater;
+use Piwik\Tests\Impl\Fixture;
+
+/**
+ * Class Core_UpdaterTest
+ *
+ * @group Core
+ * @group Core_UpdaterTest
+ */
+class UpdaterTest extends IntegrationTestCase
+{
+ public function testUpdaterChecksCoreVersionAndDetectsUpdateFile()
+ {
+ $updater = new Updater();
+ $updater->pathUpdateFileCore = PIWIK_INCLUDE_PATH . '/tests/resources/Updater/core/';
+ $updater->recordComponentSuccessfullyUpdated('core', '0.1');
+ $updater->addComponentToCheck('core', '0.3');
+ $componentsWithUpdateFile = $updater->getComponentsWithUpdateFile();
+ $this->assertEquals(1, count($componentsWithUpdateFile));
+ }
+
+ public function testUpdaterChecksGivenPluginVersionAndDetectsMultipleUpdateFileInOrder()
+ {
+ $updater = new Updater();
+ $updater->pathUpdateFilePlugins = PIWIK_INCLUDE_PATH . '/tests/resources/Updater/%s/';
+ $updater->recordComponentSuccessfullyUpdated('testpluginUpdates', '0.1beta');
+ $updater->addComponentToCheck('testpluginUpdates', '0.1');
+ $componentsWithUpdateFile = $updater->getComponentsWithUpdateFile();
+
+ $this->assertEquals(1, count($componentsWithUpdateFile));
+ $updateFiles = $componentsWithUpdateFile['testpluginUpdates'];
+ $this->assertEquals(2, count($updateFiles));
+
+ $path = PIWIK_INCLUDE_PATH . '/tests/resources/Updater/testpluginUpdates/';
+ $expectedInOrder = array(
+ $path . '0.1beta2.php' => '0.1beta2',
+ $path . '0.1.php' => '0.1'
+ );
+ $this->assertEquals($expectedInOrder, array_map("basename", $updateFiles));
+ }
+
+ public function testUpdaterChecksCoreAndPluginCheckThatCoreIsRanFirst()
+ {
+ $updater = new Updater();
+ $updater->pathUpdateFilePlugins = PIWIK_INCLUDE_PATH . '/tests/resources/Updater/%s/';
+ $updater->pathUpdateFileCore = PIWIK_INCLUDE_PATH . '/tests/resources/Updater/core/';
+
+ $updater->recordComponentSuccessfullyUpdated('testpluginUpdates', '0.1beta');
+ $updater->addComponentToCheck('testpluginUpdates', '0.1');
+
+ $updater->recordComponentSuccessfullyUpdated('core', '0.1');
+ $updater->addComponentToCheck('core', '0.3');
+
+ $componentsWithUpdateFile = $updater->getComponentsWithUpdateFile();
+ $this->assertEquals(2, count($componentsWithUpdateFile));
+ 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/UrlNormalizationTest.php b/tests/PHPUnit/Integration/UrlNormalizationTest.php
deleted file mode 100644
index 867fdcad60..0000000000
--- a/tests/PHPUnit/Integration/UrlNormalizationTest.php
+++ /dev/null
@@ -1,123 +0,0 @@
-<?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 UrlNormalizationTest extends IntegrationTestCase
-{
- public static $fixture = null; // initialized below class definition
-
- /**
- * @dataProvider getApiForTesting
- */
- public function testApi($api, $params)
- {
- $this->runApiTests($api, $params);
- }
-
- public function getApiForTesting()
- {
- $idSite = self::$fixture->idSite;
- $dateTime = self::$fixture->dateTime;
-
- $return = array();
- $return[] = array('Actions.getPageUrls', array(
- 'testSuffix' => '_urls',
- 'idSite' => $idSite,
- 'date' => $dateTime,
- ));
- $return[] = array('Actions.getPageTitles', array(
- 'testSuffix' => '_titles',
- 'idSite' => $idSite,
- 'date' => $dateTime,
- ));
-
- $return[] = array('Actions.getPageUrls', array(
- 'testSuffix' => '_pagesSegmented',
- 'idSite' => $idSite,
- 'date' => $dateTime,
- 'segment' => 'pageUrl==https://WWw.example.org/foo/bar2.html',
- ));
- // Testing entryPageUrl with AND segment
- $return[] = array('Actions.getPageUrls', array(
- 'testSuffix' => '_pagesSegmented',
- 'idSite' => $idSite,
- 'date' => $dateTime,
- 'segment' => 'entryPageUrl==http://example.org/foo/bar.html;pageUrl==https://WWw.example.org/foo/bar2.html',
- ));
- // Testing exitPageUrl with AND segment
- $return[] = array('Actions.getPageUrls', array(
- 'testSuffix' => '_pagesSegmented',
- 'idSite' => $idSite,
- 'date' => $dateTime,
- 'segment' => 'exitPageUrl==example.org/foo/bar4.html;pageUrl==https://WWw.example.org/foo/bar2.html',
- ));
- $return[] = array('Actions.getPageUrls', array(
- 'testSuffix' => '_pagesSegmented',
- 'idSite' => $idSite,
- 'date' => $dateTime,
- 'segment' => 'pageUrl==example.org/foo/bar2.html',
- ));
- $return[] = array('Actions.getPageUrls', array(
- 'testSuffix' => '_pagesSegmentedRef',
- 'idSite' => $idSite,
- 'date' => $dateTime,
- 'segment' => 'referrerUrl==http://www.google.com/search?q=piwik',
- ));
- $return[] = array('Referrers.getKeywordsForPageUrl', array(
- 'testSuffix' => '_keywords',
- 'idSite' => $idSite,
- 'date' => $dateTime,
- 'otherRequestParameters' => array(
- 'url' => 'http://WWW.example.org/foo/bar.html'
- )
- ));
- return $return;
- }
-
- /**
- * @depends testApi
- */
- public function testCheckPostConditions()
- {
- $sql = "SELECT count(*) FROM " . Common::prefixTable('log_action');
- $count = Db::get()->fetchOne($sql);
- $expected = 9; // 4 urls + 5 titles
- $this->assertEquals($expected, $count, "only $expected actions expected");
-
- $sql = "SELECT name, url_prefix FROM " . Common::prefixTable('log_action')
- . " WHERE type = " . Action::TYPE_PAGE_URL
- . " ORDER BY idaction ASC";
- $urls = Db::get()->fetchAll($sql);
- $expected = array(
- array('name' => 'example.org/foo/bar.html', 'url_prefix' => 0),
- array('name' => 'example.org/foo/bar2.html', 'url_prefix' => 3),
- array('name' => 'example.org/foo/bar3.html', 'url_prefix' => 1),
- array('name' => 'example.org/foo/bar4.html', 'url_prefix' => 2)
- );
- $this->assertEquals($expected, $urls, "normalization went wrong");
- }
-
- public static function getOutputPrefix()
- {
- return 'UrlNormalization';
- }
-}
-
-UrlNormalizationTest::$fixture = new OneVisitWithAbnormalPageviewUrls(); \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/UserIdAndVisitorIdTest.php b/tests/PHPUnit/Integration/UserIdAndVisitorIdTest.php
deleted file mode 100644
index d572544b13..0000000000
--- a/tests/PHPUnit/Integration/UserIdAndVisitorIdTest.php
+++ /dev/null
@@ -1,104 +0,0 @@
-<?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\API\Proxy;
-use Piwik\Tests\IntegrationTestCase;
-use Piwik\Tests\Fixtures\FewVisitsWithSetVisitorId;
-
-/**
- * This test tests that when using &cid=, the visitor ID is enforced
- *
- * @group UserIdAndVisitorIdTest
- * @group Integration
- */
-class UserIdAndVisitorIdTest extends IntegrationTestCase
-{
- public static $fixture = null; // initialized below class definition
-
- public function setUp()
- {
- Proxy::getInstance()->setHideIgnoredFunctions(false);
- }
-
- public function tearDown()
- {
- Proxy::getInstance()->setHideIgnoredFunctions(true);
- }
-
- public static function getOutputPrefix()
- {
- return "UserId_VisitorId";
- }
-
- /**
- * @dataProvider getApiForTesting
- */
- public function testApi($api, $params)
- {
- $this->runApiTests($api, $params);
- }
-
- public function getApiForTesting()
- {
- return array(
- array(array('VisitsSummary.get', 'VisitsSummary.getUsers'),
- array('idSite' => self::$fixture->idSite,
- 'date' => self::$fixture->dateTime,
- 'periods' => array( 'day', 'month', 'week', 'year' ),
- 'testSuffix' => '',
- )),
-
- array('Live.getLastVisitsDetails',
- array('idSite' => self::$fixture->idSite,
- 'date' => self::$fixture->dateTime,
- 'periods' => 'month',
- 'keepLiveIds' => true,
- 'keepLiveDates' => true,
- 'otherRequestParameters' => array(
- 'showColumns' => 'idVisit,visitorId,userId,lastActionDateTime,actions,actionDetails',
- 'filter_sort_column' => 'idVisit',
- 'filter_sort_order' => 'asc',
- )
- )),
-
- // Testing userId segment matches both log_visits and log_conversion
- array(array('VisitsSummary.get', 'Goals.get'),
- array('idSite' => self::$fixture->idSite,
- 'date' => self::$fixture->dateTime,
- 'periods' => 'day',
- 'segment' => 'userId==' . urlencode('new-email@example.com'),
- 'testSuffix' => '_segmentUserId',
- )),
-
- // Test invalid segment match type throws exception
- array('VisitsSummary.get',
- array('idSite' => self::$fixture->idSite,
- 'date' => self::$fixture->dateTime,
- 'periods' => 'day',
- 'segment' => 'userId=@invalidSegment',
- 'testSuffix' => '_invalidSegmentUserId',
- )),
-
-
- // Testing userId segment matches both log_visits and log_conversion
- array('Goals.getItemsName',
- array('idSite' => self::$fixture->idSite,
- 'date' => self::$fixture->dateTime,
- 'periods' => 'day',
- 'segment' => 'visitEcommerceStatus==abandonedCart;userId==' . urlencode('new-email@example.com'),
- 'testSuffix' => '_segmentUserIdAndCartAbandoned_getAbandonedCartItems',
- 'otherRequestParameters' => array(
- 'abandonedCarts' => 1
- ),
- )),
- );
- }
-}
-
-UserIdAndVisitorIdTest::$fixture = new FewVisitsWithSetVisitorId(); \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/ViewDataTable/ManagerTest.php b/tests/PHPUnit/Integration/ViewDataTable/ManagerTest.php
new file mode 100644
index 0000000000..6f73818801
--- /dev/null
+++ b/tests/PHPUnit/Integration/ViewDataTable/ManagerTest.php
@@ -0,0 +1,106 @@
+<?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\ViewDataTable\Manager as ViewDataTableManager;
+use Piwik\Tests\Impl\IntegrationTestCase;
+
+/**
+ * Class Core_Plugin_SettingsTest
+ * @group Core
+ * @group ViewDataTable
+ */
+class Core_Plugin_ViewDataTable_ManagerTest extends IntegrationTestCase
+{
+
+ public function setUp()
+ {
+ parent::setUp();
+ Access::setSingletonInstance(null);
+ }
+
+ public function test_getViewDataTableParameters_shouldReturnEmptyArray_IfNothingPersisted()
+ {
+ $login = 'mylogin';
+ $method = 'API.get';
+ $storedParams = ViewDataTableManager::getViewDataTableParameters($login, $method);
+
+ $this->assertEquals(array(), $storedParams);
+ }
+
+ public function test_getViewDataTableParameters_shouldOnlyReturnParams_IfLoginAndActionMatches()
+ {
+ $params = $this->addParameters();
+
+ $storedParams = ViewDataTableManager::getViewDataTableParameters('WroNgLogIn', $params['method']);
+ $this->assertEquals(array(), $storedParams);
+
+ $storedParams = ViewDataTableManager::getViewDataTableParameters($params['login'], 'API.wRoNg');
+ $this->assertEquals(array(), $storedParams);
+
+ $storedParams = ViewDataTableManager::getViewDataTableParameters($params['login'], $params['method']);
+ $this->assertEquals($params['params'], $storedParams);
+ }
+
+ public function test_clearAllViewDataTableParameters_shouldRemoveAllPersistedParameters()
+ {
+ ViewDataTableManager::saveViewDataTableParameters('mylogin1', 'API.get1', array('flat' => 1));
+ ViewDataTableManager::saveViewDataTableParameters('mylogin1', 'API.get2', array('flat' => 1));
+ ViewDataTableManager::saveViewDataTableParameters('mylogin2', 'API.get3', array('flat' => 1));
+ ViewDataTableManager::saveViewDataTableParameters('mylogin1', 'API.get4', array('flat' => 1));
+ ViewDataTableManager::saveViewDataTableParameters('mylogin3', 'API.get5', array('flat' => 1));
+
+ $this->assertNotEmpty(ViewDataTableManager::getViewDataTableParameters('mylogin1', 'API.get1'));
+ $this->assertNotEmpty(ViewDataTableManager::getViewDataTableParameters('mylogin1', 'API.get2'));
+ $this->assertNotEmpty(ViewDataTableManager::getViewDataTableParameters('mylogin2', 'API.get3'));
+ $this->assertNotEmpty(ViewDataTableManager::getViewDataTableParameters('mylogin1', 'API.get4'));
+ $this->assertNotEmpty(ViewDataTableManager::getViewDataTableParameters('mylogin3', 'API.get5'));
+
+ ViewDataTableManager::clearAllViewDataTableParameters();
+
+ $this->assertEmpty(ViewDataTableManager::getViewDataTableParameters('mylogin1', 'API.get1'));
+ $this->assertEmpty(ViewDataTableManager::getViewDataTableParameters('mylogin1', 'API.get2'));
+ $this->assertEmpty(ViewDataTableManager::getViewDataTableParameters('mylogin2', 'API.get3'));
+ $this->assertEmpty(ViewDataTableManager::getViewDataTableParameters('mylogin1', 'API.get4'));
+ $this->assertEmpty(ViewDataTableManager::getViewDataTableParameters('mylogin3', 'API.get5'));
+ }
+
+ public function test_clearUserViewDataTableParameters_shouldOnlyRemoveAUsersParameters()
+ {
+ ViewDataTableManager::saveViewDataTableParameters('mylogin1', 'API.get1', array('flat' => 1));
+ ViewDataTableManager::saveViewDataTableParameters('mylogin1', 'API.get2', array('flat' => 1));
+ ViewDataTableManager::saveViewDataTableParameters('mylogin2', 'API.get3', array('flat' => 1));
+ ViewDataTableManager::saveViewDataTableParameters('mylogin1', 'API.get4', array('flat' => 1));
+ ViewDataTableManager::saveViewDataTableParameters('mylogin3', 'API.get5', array('flat' => 1));
+
+ $this->assertNotEmpty(ViewDataTableManager::getViewDataTableParameters('mylogin1', 'API.get1'));
+ $this->assertNotEmpty(ViewDataTableManager::getViewDataTableParameters('mylogin1', 'API.get2'));
+ $this->assertNotEmpty(ViewDataTableManager::getViewDataTableParameters('mylogin2', 'API.get3'));
+ $this->assertNotEmpty(ViewDataTableManager::getViewDataTableParameters('mylogin1', 'API.get4'));
+ $this->assertNotEmpty(ViewDataTableManager::getViewDataTableParameters('mylogin3', 'API.get5'));
+
+ ViewDataTableManager::clearUserViewDataTableParameters('mylogin1');
+
+ $this->assertEmpty(ViewDataTableManager::getViewDataTableParameters('mylogin1', 'API.get1'));
+ $this->assertEmpty(ViewDataTableManager::getViewDataTableParameters('mylogin1', 'API.get2'));
+ $this->assertEmpty(ViewDataTableManager::getViewDataTableParameters('mylogin1', 'API.get4'));
+ $this->assertNotEmpty(ViewDataTableManager::getViewDataTableParameters('mylogin2', 'API.get3'));
+ $this->assertNotEmpty(ViewDataTableManager::getViewDataTableParameters('mylogin3', 'API.get5'));
+ }
+
+ private function addParameters()
+ {
+ $login = 'mylogin';
+ $method = 'API.get';
+ $params = array('flat' => '0', 'expanded' => 1, 'viewDataTable' => 'tableAllColumns');
+
+ ViewDataTableManager::saveViewDataTableParameters($login, $method, $params);
+
+ return array('login' => $login, 'method' => $method, 'params' => $params);
+ }
+} \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/VisitsInPastInvalidateOldReportsTest.php b/tests/PHPUnit/Integration/VisitsInPastInvalidateOldReportsTest.php
deleted file mode 100644
index 32c085ceff..0000000000
--- a/tests/PHPUnit/Integration/VisitsInPastInvalidateOldReportsTest.php
+++ /dev/null
@@ -1,151 +0,0 @@
-<?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\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.
- *
- * See also other test: ArchiveInvalidationTest
- *
- * @group Integration
- * @group VisitsInPastInvalidateOldReportsTest
- */
-class VisitsInPastInvalidateOldReportsTest extends IntegrationTestCase
-{
- public static $fixture = null; // initialized below class definition
-
- /**
- * @dataProvider getApiForTesting
- */
- public function testApi($api, $params)
- {
- $this->runApiTests($api, $params);
- }
-
- /**
- * This should NOT return data for old dates before website creation
- */
- public function getApiForTesting()
- {
- $idSite = self::$fixture->idSite;
- $idSite2 = self::$fixture->idSite2;
- $dateTimeDateInPastWebsite1 = self::$fixture->dateTimeDateInPastWebsite1;
- $dateTimeDateInPastWebsite2 = self::$fixture->dateTimeDateInPastWebsite2;
-
- // We test a typical Numeric and a Recursive blob reports
- $apiToCall = array('VisitsSummary.get', 'Actions.getPageUrls');
-
- // We also test a segment
- //TODO
-
- // Build tests for the 2 websites
- return array(
- array($apiToCall, array('idSite' => $idSite,
- 'testSuffix' => 'Website' . $idSite . '_OldReportsShouldNotAppear',
- 'date' => $dateTimeDateInPastWebsite1,
- 'periods' => 'month',
- 'setDateLastN' => 4, // 4months ahead
- 'otherRequestParameters' => array('expanded' => 1))),
- array($apiToCall, array('idSite' => $idSite2,
- 'testSuffix' => 'Website' . $idSite2 . '_OldReportsShouldNotAppear',
- 'date' => $dateTimeDateInPastWebsite2,
- 'periods' => 'month',
- 'setDateLastN' => 4, // 4months ahead
- 'otherRequestParameters' => array('expanded' => 1))),
- );
- }
-
- /**
- * @depends testApi
- * @dataProvider getAnotherApiForTesting
- */
- public function testAnotherApi($api, $params)
- {
- $idSite = self::$fixture->idSite;
- $idSite2 = self::$fixture->idSite2;
-
- // 1) Invalidate old reports for the 2 websites
- // Test invalidate 1 date only
- $r = new Request("module=API&method=CoreAdminHome.invalidateArchivedReports&idSites=4,5,6,55,-1,s',1&dates=2010-01-03");
- $this->assertApiResponseHasNoError($r->process());
-
- // Test invalidate comma separated dates
- $r = new Request("module=API&method=CoreAdminHome.invalidateArchivedReports&idSites=" . $idSite . "," . $idSite2 . "&dates=2010-01-06,2009-10-30");
- $this->assertApiResponseHasNoError($r->process());
-
- // test invalidate date in the past
- // Format=original will re-throw exception
- $r = new Request("module=API&method=CoreAdminHome.invalidateArchivedReports&idSites=" . $idSite2 . "&dates=2009-06-29&format=original");
- $this->assertApiResponseHasNoError($r->process());
-
- // invalidate a date more recent to check the date is only updated when it's earlier than current
- $r = new Request("module=API&method=CoreAdminHome.invalidateArchivedReports&idSites=" . $idSite2 . "&dates=2010-03-03");
- $this->assertApiResponseHasNoError($r->process());
-
-
- // Make an invalid call
- $idSiteNoAccess = 777;
- try {
- $request = new Request("module=API&method=CoreAdminHome.invalidateArchivedReports&idSites=" . $idSiteNoAccess . "&dates=2010-03-03&format=original");
- $request->process();
- $this->fail();
- } catch(Exception $e) {}
-
- // test an invalidate period parameter
- try {
- $invalidPeriod = "day,month";
- $request = new Request("module=API&method=CoreAdminHome.invalidateArchivedReports&period=$invalidPeriod&idSites=$idSite&dates=2010-03-03&format=original");
- $request->process();
- $this->fail();
- } catch(Exception $e) {}
-
- // 2) Call API again, with an older date, which should now return data
- $this->runApiTests($api, $params);
- }
-
- /**
- * This is called after getApiToTest()
- * WE invalidate old reports and check that data is now returned for old dates
- */
- public function getAnotherApiForTesting()
- {
- $idSite = self::$fixture->idSite;
- $idSite2 = self::$fixture->idSite2;
- $dateTimeDateInPastWebsite1 = self::$fixture->dateTimeDateInPastWebsite1;
- $dateTimeDateInPastWebsite2 = self::$fixture->dateTimeDateInPastWebsite2;
-
- $apiToCall = array('VisitsSummary.get', 'Actions.getPageUrls');
-
- return array(
- array($apiToCall, array('idSite' => $idSite,
- 'testSuffix' => 'Website' . $idSite . '_OldReportsShouldAppear',
- 'date' => $dateTimeDateInPastWebsite1,
- 'periods' => 'month',
- 'setDateLastN' => 4, // 4months ahead
- 'otherRequestParameters' => array('expanded' => 1))),
- array($apiToCall, array('idSite' => $idSite2,
- 'testSuffix' => 'Website' . $idSite2 . '_OldReportsShouldAppear',
- 'date' => $dateTimeDateInPastWebsite2,
- 'periods' => 'month',
- 'setDateLastN' => 4, // 4months ahead
- 'otherRequestParameters' => array('expanded' => 1))),
- );
- }
-
- public static function getOutputPrefix()
- {
- return 'VisitsInPast_InvalidateOldReports';
- }
-}
-
-VisitsInPastInvalidateOldReportsTest::$fixture = new TwoSitesVisitsInPast(); \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/WidgetsListTest.php b/tests/PHPUnit/Integration/WidgetsListTest.php
new file mode 100644
index 0000000000..f84c05873c
--- /dev/null
+++ b/tests/PHPUnit/Integration/WidgetsListTest.php
@@ -0,0 +1,192 @@
+<?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\Goals\API;
+use Piwik\WidgetsList;
+use Piwik\Tests\Impl\Fixture;
+use Piwik\Tests\Impl\IntegrationTestCase;
+
+/**
+ * Class Core_WidgetsListTest
+ *
+ * @group Core
+ */
+class Core_WidgetsListTest extends IntegrationTestCase
+{
+ /**
+ * @group Core
+ */
+ public function testGet()
+ {
+ // setup the access layer
+ $pseudoMockAccess = new FakeAccess;
+ FakeAccess::$superUser = true;
+ Access::setSingletonInstance($pseudoMockAccess);
+
+ Fixture::createWebsite('2009-01-04 00:11:42');
+
+ $_GET['idSite'] = 1;
+
+ WidgetsList::_reset();
+ $widgets = WidgetsList::get();
+ WidgetsList::_reset();
+
+ // check if each category has the right number of widgets
+ $numberOfWidgets = array(
+ 'VisitsSummary_VisitsSummary' => 6,
+ 'Live!' => 4,
+ 'General_Visitors' => 12,
+ 'UserSettings_VisitorSettings' => 11,
+ 'General_Actions' => 10,
+ 'Events_Events' => 3,
+ 'Actions_SubmenuSitesearch' => 5,
+ 'Referrers_Referrers' => 7,
+ 'Goals_Goals' => 1,
+ 'SEO' => 2,
+ 'Example Widgets' => 4,
+ 'DevicesDetection_DevicesDetection' => 8,
+ 'Insights_WidgetCategory' => 2
+ );
+
+ // number of main categories
+ $this->assertEquals(count($numberOfWidgets), count($widgets));
+
+ foreach ($numberOfWidgets as $category => $widgetCount) {
+ $this->assertEquals($widgetCount, count($widgets[$category]), sprintf("Widget: %s", $category));
+ }
+ }
+
+ /**
+ * @group Core
+ */
+ public function testGetWithGoals()
+ {
+ // setup the access layer
+ $pseudoMockAccess = new FakeAccess;
+ FakeAccess::$superUser = true;
+ Access::setSingletonInstance($pseudoMockAccess);
+
+ Fixture::createWebsite('2009-01-04 00:11:42');
+ API::getInstance()->addGoal(1, 'Goal 1 - Thank you', 'title', 'Thank you', 'contains', $caseSensitive = false, $revenue = 10, $allowMultipleConversions = 1);
+
+ $_GET['idSite'] = 1;
+
+ WidgetsList::_reset();
+ $widgets = WidgetsList::get();
+ WidgetsList::_reset();
+
+ // number of main categories
+ $this->assertEquals(13, count($widgets));
+
+ // check that the goal widget was added
+ $numberOfWidgets = array(
+ 'Goals_Goals' => 2,
+ );
+
+ foreach ($numberOfWidgets as $category => $widgetCount) {
+ $this->assertEquals($widgetCount, count($widgets[$category]));
+ }
+ }
+
+ /**
+ * @group Core
+ */
+ public function testGetWithGoalsAndEcommerce()
+ {
+ // setup the access layer
+ $pseudoMockAccess = new FakeAccess;
+ FakeAccess::$superUser = true;
+ Access::setSingletonInstance($pseudoMockAccess);
+
+ Fixture::createWebsite('2009-01-04 00:11:42', true);
+ API::getInstance()->addGoal(1, 'Goal 1 - Thank you', 'title', 'Thank you', 'contains', $caseSensitive = false, $revenue = 10, $allowMultipleConversions = 1);
+
+ $_GET['idSite'] = 1;
+
+ WidgetsList::_reset();
+ $widgets = WidgetsList::get();
+ WidgetsList::_reset();
+
+ // number of main categories
+ $this->assertEquals(14, count($widgets));
+
+ // check if each category has the right number of widgets
+ $numberOfWidgets = array(
+ 'Goals_Goals' => 2,
+ 'Goals_Ecommerce' => 5,
+ );
+
+ foreach ($numberOfWidgets as $category => $widgetCount) {
+ $this->assertEquals($widgetCount, count($widgets[$category]));
+ }
+ }
+
+ /**
+ * @group Core
+ */
+ public function testRemove()
+ {
+ // setup the access layer
+ $pseudoMockAccess = new FakeAccess;
+ FakeAccess::$superUser = true;
+ Access::setSingletonInstance($pseudoMockAccess);
+
+ Fixture::createWebsite('2009-01-04 00:11:42', true);
+ API::getInstance()->addGoal(1, 'Goal 1 - Thank you', 'title', 'Thank you', 'contains', $caseSensitive = false, $revenue = 10, $allowMultipleConversions = 1);
+
+ $_GET['idSite'] = 1;
+
+ WidgetsList::_reset();
+ $widgets = WidgetsList::get();
+
+ $this->assertCount(14, $widgets);
+ WidgetsList::remove('SEO', 'NoTeXiStInG');
+
+ $widgets = WidgetsList::get();
+ $this->assertCount(14, $widgets);
+
+ $this->assertArrayHasKey('SEO', $widgets);
+ $this->assertCount(2, $widgets['SEO']);
+
+ WidgetsList::remove('SEO', 'SEO_SeoRankings');
+ $widgets = WidgetsList::get();
+
+ $this->assertCount(1, $widgets['SEO']);
+
+ WidgetsList::remove('SEO');
+ $widgets = WidgetsList::get();
+
+ $this->assertArrayNotHasKey('SEO', $widgets);
+
+ WidgetsList::_reset();
+ }
+
+ /**
+ * @group Core
+ */
+ public function testIsDefined()
+ {
+ // setup the access layer
+ $pseudoMockAccess = new FakeAccess;
+ FakeAccess::$superUser = true;
+ Access::setSingletonInstance($pseudoMockAccess);
+
+ \Piwik\Translate::loadEnglishTranslation();
+
+ Fixture::createWebsite('2009-01-04 00:11:42', true);
+
+ $_GET['idSite'] = 1;
+
+ WidgetsList::_reset();
+ WidgetsList::add('Actions', 'Pages', 'Actions', 'getPageUrls');
+
+ $this->assertTrue(WidgetsList::isDefined('Actions', 'getPageUrls'));
+ $this->assertFalse(WidgetsList::isDefined('Actions', 'inValiD'));
+ }
+}
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitor_NoKeywordSpecified__Live.getLastVisitsDetails_day.xml b/tests/PHPUnit/Integration/expected/test_OneVisitor_NoKeywordSpecified__Live.getLastVisitsDetails_day.xml
deleted file mode 100644
index 5140d7b591..0000000000
--- a/tests/PHPUnit/Integration/expected/test_OneVisitor_NoKeywordSpecified__Live.getLastVisitsDetails_day.xml
+++ /dev/null
@@ -1,207 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<result>
- <row>
- <idSite>1</idSite>
- <idVisit>2</idVisit>
- <visitIp>156.5.0.0</visitIp>
-
- <actionDetails>
- <row>
- <type>action</type>
- <url>http://example.org/this%20is%20cool!</url>
- <pageTitle />
- <pageIdAction>2</pageIdAction>
-
- <pageId>2</pageId>
- <icon />
- </row>
- </actionDetails>
- <goalConversions>0</goalConversions>
- <siteCurrency>USD</siteCurrency>
- <siteCurrencySymbol>$</siteCurrencySymbol>
-
-
-
-
- <userId />
- <visitorType>new</visitorType>
- <visitorTypeIcon />
- <visitConverted>0</visitConverted>
- <visitConvertedIcon />
- <visitCount>1</visitCount>
-
- <visitEcommerceStatus>none</visitEcommerceStatus>
- <visitEcommerceStatusIcon />
- <daysSinceFirstVisit>0</daysSinceFirstVisit>
- <daysSinceLastEcommerceOrder>0</daysSinceLastEcommerceOrder>
- <visitDuration>0</visitDuration>
- <visitDurationPretty>0s</visitDurationPretty>
- <searches>0</searches>
- <actions>1</actions>
- <referrerType>search</referrerType>
- <referrerTypeName>Moteurs de recherche</referrerTypeName>
- <referrerName>Google</referrerName>
- <referrerKeyword>&lt;&gt;&amp;\&quot;the pdo extension is required for this adapter but the extension is not loaded</referrerKeyword>
- <referrerKeywordPosition>4</referrerKeywordPosition>
- <referrerUrl>http://www.google.com.vn/search?q=%3C%3E%26%5C%22the+pdo+extension+is+required+for+this+adapter+but+the+extension+is+not+loaded</referrerUrl>
- <referrerSearchEngineUrl>http://google.com</referrerSearchEngineUrl>
- <referrerSearchEngineIcon>plugins/Referrers/images/searchEngines/google.com.png</referrerSearchEngineIcon>
- <operatingSystem>Bot</operatingSystem>
- <operatingSystemCode>BOT</operatingSystemCode>
- <operatingSystemShortName>BOT</operatingSystemShortName>
- <operatingSystemIcon>plugins/UserSettings/images/os/UNK.gif</operatingSystemIcon>
- <browserName>Inconnu</browserName>
- <browserIcon>plugins/UserSettings/images/browsers/UNK.gif</browserIcon>
- <browserCode>UNK</browserCode>
- <browserVersion />
- <screenType>normal</screenType>
- <resolution>1024x768</resolution>
- <screenTypeIcon>plugins/UserSettings/images/screens/normal.gif</screenTypeIcon>
- <plugins>flash, java</plugins>
- <pluginsIcons>
- <row>
- <pluginIcon>plugins/UserSettings/images/plugins/flash.gif</pluginIcon>
- <pluginName>flash</pluginName>
- </row>
- <row>
- <pluginIcon>plugins/UserSettings/images/plugins/java.gif</pluginIcon>
- <pluginName>java</pluginName>
- </row>
- </pluginsIcons>
- <deviceType>Inconnu</deviceType>
- <browserFamily />
- <browserFamilyDescription>Inconnu</browserFamilyDescription>
- <events>0</events>
- <continent>Europe</continent>
- <continentCode>eur</continentCode>
- <country>France</country>
- <countryCode>fr</countryCode>
- <countryFlag>plugins/UserCountry/images/flags/fr.png</countryFlag>
- <region />
- <regionCode />
- <city />
- <location>France</location>
- <latitude />
- <longitude />
- <visitLocalTime>12:34:06</visitLocalTime>
- <visitLocalHour>12</visitLocalHour>
- <daysSinceLastVisit>0</daysSinceLastVisit>
- <customVariables>
- </customVariables>
- <provider>Inconnu</provider>
- <providerName>Inconnu</providerName>
- <providerUrl />
-
-
-
-
-
- </row>
- <row>
- <idSite>1</idSite>
- <idVisit>1</idVisit>
- <visitIp>156.5.0.0</visitIp>
-
- <actionDetails>
- <row>
- <type>action</type>
- <url>http://example.org/this%20is%20cool!</url>
- <pageTitle>incredible title!</pageTitle>
- <pageIdAction>2</pageIdAction>
-
- <pageId>1</pageId>
- <icon />
- </row>
- <row>
- <type>goal</type>
- <goalName>triggered js</goalName>
- <goalId>1</goalId>
- <revenue>0</revenue>
- <goalPageId />
-
- <url>http://example.org/this%20is%20cool!</url>
- <icon>plugins/Morpheus/images/goal.png</icon>
- </row>
- </actionDetails>
- <goalConversions>1</goalConversions>
- <siteCurrency>USD</siteCurrency>
- <siteCurrencySymbol>$</siteCurrencySymbol>
-
-
-
-
- <userId />
- <visitorType>new</visitorType>
- <visitorTypeIcon />
- <visitConverted>1</visitConverted>
- <visitConvertedIcon>plugins/Morpheus/images/goal.png</visitConvertedIcon>
- <visitCount>1</visitCount>
-
- <visitEcommerceStatus>none</visitEcommerceStatus>
- <visitEcommerceStatusIcon />
- <daysSinceFirstVisit>0</daysSinceFirstVisit>
- <daysSinceLastEcommerceOrder>0</daysSinceLastEcommerceOrder>
- <visitDuration>1084</visitDuration>
- <visitDurationPretty>18 min 4s</visitDurationPretty>
- <searches>0</searches>
- <actions>1</actions>
- <referrerType>search</referrerType>
- <referrerTypeName>Moteurs de recherche</referrerTypeName>
- <referrerName>Google</referrerName>
- <referrerKeyword>Mot clef indéfini</referrerKeyword>
- <referrerKeywordPosition>1</referrerKeywordPosition>
- <referrerUrl>http://piwik.org/faq/general/#faq_144</referrerUrl>
- <referrerSearchEngineUrl>http://google.com</referrerSearchEngineUrl>
- <referrerSearchEngineIcon>plugins/Referrers/images/searchEngines/google.com.png</referrerSearchEngineIcon>
- <operatingSystem>Bot</operatingSystem>
- <operatingSystemCode>BOT</operatingSystemCode>
- <operatingSystemShortName>BOT</operatingSystemShortName>
- <operatingSystemIcon>plugins/UserSettings/images/os/UNK.gif</operatingSystemIcon>
- <browserName>Inconnu</browserName>
- <browserIcon>plugins/UserSettings/images/browsers/UNK.gif</browserIcon>
- <browserCode>UNK</browserCode>
- <browserVersion />
- <screenType>normal</screenType>
- <resolution>1024x768</resolution>
- <screenTypeIcon>plugins/UserSettings/images/screens/normal.gif</screenTypeIcon>
- <plugins>flash, java</plugins>
- <pluginsIcons>
- <row>
- <pluginIcon>plugins/UserSettings/images/plugins/flash.gif</pluginIcon>
- <pluginName>flash</pluginName>
- </row>
- <row>
- <pluginIcon>plugins/UserSettings/images/plugins/java.gif</pluginIcon>
- <pluginName>java</pluginName>
- </row>
- </pluginsIcons>
- <deviceType>Inconnu</deviceType>
- <browserFamily />
- <browserFamilyDescription>Inconnu</browserFamilyDescription>
- <events>0</events>
- <continent>Europe</continent>
- <continentCode>eur</continentCode>
- <country>France</country>
- <countryCode>fr</countryCode>
- <countryFlag>plugins/UserCountry/images/flags/fr.png</countryFlag>
- <region />
- <regionCode />
- <city />
- <location>France</location>
- <latitude />
- <longitude />
- <visitLocalTime>12:34:06</visitLocalTime>
- <visitLocalHour>12</visitLocalHour>
- <daysSinceLastVisit>0</daysSinceLastVisit>
- <customVariables>
- </customVariables>
- <provider>Inconnu</provider>
- <providerName>Inconnu</providerName>
- <providerUrl />
-
-
-
-
-
- </row>
-</result> \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/processed/.gitkeep b/tests/PHPUnit/Integration/processed/.gitkeep
deleted file mode 100644
index e69de29bb2..0000000000
--- a/tests/PHPUnit/Integration/processed/.gitkeep
+++ /dev/null
diff --git a/tests/PHPUnit/IntegrationTestCase.php b/tests/PHPUnit/IntegrationTestCase.php
index d5d78128a4..8cd33978dc 100755..100644
--- a/tests/PHPUnit/IntegrationTestCase.php
+++ b/tests/PHPUnit/IntegrationTestCase.php
@@ -5,573 +5,19 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
-namespace Piwik\Tests;
-
-use Exception;
-use Piwik\API\DocumentationGenerator;
-use Piwik\API\Proxy;
-use Piwik\API\Request;
-use Piwik\ArchiveProcessor\Rules;
-use Piwik\Common;
-use Piwik\Config;
-use Piwik\DataAccess\ArchiveTableCreator;
-use Piwik\Db;
-use Piwik\DbHelper;
-use Piwik\ReportRenderer;
-use Piwik\Translate;
-use Piwik\UrlHelper;
-use Piwik\Tests\Impl\TestRequestCollection;
-use Piwik\Tests\Impl\TestRequestResponse;
-use Piwik\Tests\Impl\ApiTestConfig;
-use Piwik\Log;
-use PHPUnit_Framework_TestCase;
-
-require_once PIWIK_INCLUDE_PATH . '/libs/PiwikTracker/PiwikTracker.php';
/**
- * Base class for Integration tests.
- *
- * Provides helpers to track data and then call API get* methods to check outputs automatically.
- *
+ * @deprecated since 2.8.0 extend \Piwik\Tests\Impl\SystemTestCase instead
*/
-abstract class IntegrationTestCase extends PHPUnit_Framework_TestCase
+class IntegrationTestCase extends \Piwik\Tests\Impl\SystemTestCase
{
- /**
- * Identifies the last language used in an API/Controller call.
- *
- * @var string
- */
- protected $lastLanguage;
-
- protected $missingExpectedFiles = array();
- protected $comparisonFailures = array();
public static function setUpBeforeClass()
{
- Log::debug("Setting up " . get_called_class());
-
- if (!isset(static::$fixture)) {
- $fixture = new Fixture();
- } else {
- $fixture = static::$fixture;
- }
+ \Piwik\Log::debug('\IntegrationTestCase is deprecated since 2.8.0 extend \Piwik\Tests\Impl\SystemTestCase instead');
- $fixture->testCaseClass = get_called_class();
-
- try {
- $fixture->performSetUp();
- } catch (Exception $e) {
- static::fail("Failed to setup fixture: " . $e->getMessage() . "\n" . $e->getTraceAsString());
- }
- }
-
- public static function tearDownAfterClass()
- {
- Log::debug("Tearing down " . get_called_class());
-
- if (!isset(static::$fixture)) {
- $fixture = new Fixture();
- } else {
- $fixture = static::$fixture;
- }
-
- $fixture->performTearDown();
- }
-
- /**
- * Returns true if continuous integration running this request
- * Useful to exclude tests which may fail only on this setup
- */
- public static function isTravisCI()
- {
- $travis = getenv('TRAVIS');
- return !empty($travis);
- }
-
- public static function isPhpVersion53()
- {
- return strpos(PHP_VERSION, '5.3') === 0;
- }
-
- public static function isMysqli()
- {
- return getenv('MYSQL_ADAPTER') == 'MYSQLI';
- }
-
- protected function alertWhenImagesExcludedFromTests()
- {
- if (!Fixture::canImagesBeIncludedInScheduledReports()) {
- $this->markTestSkipped(
- 'Scheduled reports generated during integration tests will not contain the image graphs. ' .
- 'For tests to generate images, use a machine with the following specifications : ' .
- 'OS = '.Fixture::IMAGES_GENERATED_ONLY_FOR_OS.', PHP = '.Fixture::IMAGES_GENERATED_FOR_PHP .
- ' and GD = ' . Fixture::IMAGES_GENERATED_FOR_GD
- );
- }
- }
-
- /**
- * Return 4 Api Urls for testing scheduled reports :
- * - one in HTML format with all available reports
- * - one in PDF format with all available reports
- * - two in SMS (one for each available report: MultiSites.getOne & MultiSites.getAll)
- *
- * @param string $dateTime eg '2010-01-01 12:34:56'
- * @param string $period eg 'day', 'week', 'month', 'year'
- * @return array
- */
- protected static function getApiForTestingScheduledReports($dateTime, $period)
- {
- $apiCalls = array();
-
- // HTML Scheduled Report
- array_push(
- $apiCalls,
- array(
- 'ScheduledReports.generateReport',
- array(
- 'testSuffix' => '_scheduled_report_in_html_tables_only',
- 'date' => $dateTime,
- 'periods' => array($period),
- 'format' => 'original',
- 'fileExtension' => 'html',
- 'otherRequestParameters' => array(
- 'idReport' => 1,
- 'reportFormat' => ReportRenderer::HTML_FORMAT,
- 'outputType' => \Piwik\Plugins\ScheduledReports\API::OUTPUT_RETURN
- )
- )
- )
- );
-
- // CSV Scheduled Report
- array_push(
- $apiCalls,
- array(
- 'ScheduledReports.generateReport',
- array(
- 'testSuffix' => '_scheduled_report_in_csv',
- 'date' => $dateTime,
- 'periods' => array($period),
- 'format' => 'original',
- 'fileExtension' => 'csv',
- 'otherRequestParameters' => array(
- 'idReport' => 1,
- 'reportFormat' => ReportRenderer::CSV_FORMAT,
- 'outputType' => \Piwik\Plugins\ScheduledReports\API::OUTPUT_RETURN
- )
- )
- )
- );
-
- 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(
- $apiCalls,
- array(
- 'ScheduledReports.generateReport',
- array(
- 'testSuffix' => '_scheduled_report_in_pdf_tables_only',
- 'date' => $dateTime,
- 'periods' => array($period),
- 'format' => 'original',
- 'fileExtension' => 'pdf',
- 'otherRequestParameters' => array(
- 'idReport' => 1,
- 'reportFormat' => ReportRenderer::PDF_FORMAT,
- 'outputType' => \Piwik\Plugins\ScheduledReports\API::OUTPUT_RETURN
- )
- )
- )
- );
- }
-
- // SMS Scheduled Report, one site
- array_push(
- $apiCalls,
- array(
- 'ScheduledReports.generateReport',
- array(
- 'testSuffix' => '_scheduled_report_via_sms_one_site',
- 'date' => $dateTime,
- 'periods' => array($period),
- 'format' => 'original',
- 'fileExtension' => 'sms.txt',
- 'otherRequestParameters' => array(
- 'idReport' => 2,
- 'outputType' => \Piwik\Plugins\ScheduledReports\API::OUTPUT_RETURN
- )
- )
- )
- );
-
- // SMS Scheduled Report, all sites
- array_push(
- $apiCalls,
- array(
- 'ScheduledReports.generateReport',
- array(
- 'testSuffix' => '_scheduled_report_via_sms_all_sites',
- 'date' => $dateTime,
- 'periods' => array($period),
- 'format' => 'original',
- 'fileExtension' => 'sms.txt',
- 'otherRequestParameters' => array(
- 'idReport' => 3,
- 'outputType' => \Piwik\Plugins\ScheduledReports\API::OUTPUT_RETURN
- )
- )
- )
- );
-
- if (Fixture::canImagesBeIncludedInScheduledReports()) {
- // HTML Scheduled Report with images
- array_push(
- $apiCalls,
- array(
- 'ScheduledReports.generateReport',
- array(
- 'testSuffix' => '_scheduled_report_in_html_tables_and_graph',
- 'date' => $dateTime,
- 'periods' => array($period),
- 'format' => 'original',
- 'fileExtension' => 'html',
- 'otherRequestParameters' => array(
- 'idReport' => 4,
- 'reportFormat' => ReportRenderer::HTML_FORMAT,
- 'outputType' => \Piwik\Plugins\ScheduledReports\API::OUTPUT_RETURN
- )
- )
- )
- );
-
- // mail report with one row evolution based png graph
- array_push(
- $apiCalls,
- array(
- 'ScheduledReports.generateReport',
- array(
- 'testSuffix' => '_scheduled_report_in_html_row_evolution_graph',
- 'date' => $dateTime,
- 'periods' => array($period),
- 'format' => 'original',
- 'fileExtension' => 'html',
- 'otherRequestParameters' => array(
- 'idReport' => 5,
- 'outputType' => \Piwik\Plugins\ScheduledReports\API::OUTPUT_RETURN
- )
- )
- )
- );
- }
-
- return $apiCalls;
- }
-
- protected function _testApiUrl($testName, $apiId, $requestUrl, $compareAgainst, $xmlFieldsToRemove = array(), $params = array())
- {
- list($processedFilePath, $expectedFilePath) =
- $this->getProcessedAndExpectedPaths($testName, $apiId, $format = null, $compareAgainst);
-
- $originalGET = $_GET;
- $_GET = $requestUrl;
- unset($_GET['serialize']);
-
- $processedResponse = TestRequestResponse::loadFromApi($params, $requestUrl);
- if (empty($compareAgainst)) {
- $processedResponse->save($processedFilePath);
- }
-
- $_GET = $originalGET;
-
- try {
- $expectedResponse = TestRequestResponse::loadFromFile($expectedFilePath, $params, $requestUrl);
- } catch (Exception $ex) {
- $this->handleMissingExpectedFile($expectedFilePath, $processedResponse);
- return;
- }
-
- try {
- TestRequestResponse::assertEquals($expectedResponse, $processedResponse, "Differences with expected in '$processedFilePath'");
- } catch (Exception $ex) {
- $this->comparisonFailures[] = $ex;
- }
- }
-
- private function handleMissingExpectedFile($expectedFilePath, TestRequestResponse $processedResponse)
- {
- $this->missingExpectedFiles[] = $expectedFilePath;
-
- print("The expected file is not found at '$expectedFilePath'. The Processed response was:");
- print("\n----------------------------\n\n");
- var_dump($processedResponse->getResponseText());
- print("\n----------------------------\n");
- }
-
- public static function assertApiResponseHasNoError($response)
- {
- if(!is_string($response)) {
- $response = json_encode($response);
- }
- self::assertTrue(stripos($response, 'error') === false, "error in $response");
- self::assertTrue(stripos($response, 'exception') === false, "exception in $response");
- }
-
- protected static function getProcessedAndExpectedDirs()
- {
- $path = static::getPathToTestDirectory();
- $processedPath = $path . '/processed/';
-
- if (!is_dir($processedPath)) {
- mkdir($processedPath, $mode = 0777, $recursive = true);
- }
-
- if (!is_writable($processedPath)) {
- self::fail('To run the tests, you need to give write permissions to the following directory (create it if '
- . 'it doesn\'t exist).<code><br/>mkdir ' . $processedPath . '<br/>chmod 777 ' . $processedPath
- . '</code><br/>');
- }
-
- return array($processedPath, $path . '/expected/');
- }
-
- private function getProcessedAndExpectedPaths($testName, $testId, $format = null, $compareAgainst = false)
- {
- $filenameSuffix = '__' . $testId;
- if ($format) {
- $filenameSuffix .= ".$format";
- }
-
- $processedFilename = $testName . $filenameSuffix;
-
- $expectedFilename = $compareAgainst ? ('test_' . $compareAgainst) : $testName;
- $expectedFilename .= $filenameSuffix;
-
- list($processedDir, $expectedDir) = static::getProcessedAndExpectedDirs();
-
- return array($processedDir . $processedFilename, $expectedDir . $expectedFilename);
- }
-
- /**
- * Returns an array describing the API methods to call & compare with
- * expected output.
- *
- * The returned array must be of the following format:
- * <code>
- * array(
- * array('SomeAPI.method', array('testOption1' => 'value1', 'testOption2' => 'value2'),
- * array(array('SomeAPI.method', 'SomeOtherAPI.method'), array(...)),
- * .
- * .
- * .
- * )
- * </code>
- *
- * Valid test options are described in the ApiTestConfig class docs.
- *
- * All test options are optional, except 'idSite' & 'date'.
- */
- public function getApiForTesting()
- {
- return array();
- }
-
- /**
- * Gets the string prefix used in the name of the expected/processed output files.
- */
- public static function getOutputPrefix()
- {
- $parts = explode("\\", get_called_class());
- $result = end($parts);
- $result = str_replace('Test_Piwik_Integration_', '', $result);
- return $result;
- }
-
- /**
- * Assert that the response of an API method call is the same as the contents in an
- * expected file.
- *
- * @param string $api ie, `"UserSettings.getBrowser"`
- * @param array $queryParams Query parameters to send to the API.
- */
- public function assertApiResponseEqualsExpected($apiMethod, $queryParams)
- {
- $this->runApiTests($apiMethod, array(
- 'idSite' => $queryParams['idSite'],
- 'date' => $queryParams['date'],
- 'periods' => $queryParams['period'],
- 'format' => isset($queryParams['format']) ? $queryParams['format'] : 'xml',
- 'testSuffix' => '_' . $this->getName(), // TODO: instead of using a test suffix, the whole file name should just be the test method
- 'otherRequestParameters' => $queryParams
- ));
- }
-
- /**
- * Runs API tests.
- */
- protected function runApiTests($api, $params)
- {
- $testConfig = new ApiTestConfig($params);
-
- $testName = 'test_' . static::getOutputPrefix();
- $this->missingExpectedFiles = array();
- $this->comparisonFailures = array();
-
- if ($testConfig->disableArchiving) {
- Rules::$archivingDisabledByTests = true;
- Config::getInstance()->General['browser_archiving_disabled_enforce'] = 1;
- } else {
- Rules::$archivingDisabledByTests = false;
- Config::getInstance()->General['browser_archiving_disabled_enforce'] = 0;
- }
-
- if ($testConfig->language) {
- $this->changeLanguage($testConfig->language);
- }
-
- $testRequests = new TestRequestCollection($api, $testConfig, $api);
-
- foreach ($testRequests->getRequestUrls() as $apiId => $requestUrl) {
- $this->_testApiUrl($testName . $testConfig->testSuffix, $apiId, $requestUrl, $testConfig->compareAgainst, $testConfig->xmlFieldsToRemove, $params);
- }
-
- // change the language back to en
- if ($this->lastLanguage != 'en') {
- $this->changeLanguage('en');
- }
-
- if (!empty($this->missingExpectedFiles)) {
- $expectedDir = dirname(reset($this->missingExpectedFiles));
- $this->fail(" ERROR: Could not find expected API output '"
- . implode("', '", $this->missingExpectedFiles)
- . "'. For new tests, to pass the test, you can copy files from the processed/ directory into"
- . " $expectedDir after checking that the output is valid. %s ");
- }
-
- // Display as one error all sub-failures
- if (!empty($this->comparisonFailures)) {
- $this->printComparisonFailures();
- throw reset($this->comparisonFailures);
- }
-
- return count($this->comparisonFailures) == 0;
- }
-
- private function printComparisonFailures()
- {
- $messages = '';
- foreach ($this->comparisonFailures as $index => $failure) {
- $msg = $failure->getMessage();
- $msg = strtok($msg, "\n");
- $messages .= "\n#" . ($index + 1) . ": " . $msg;
- }
- $messages .= " \n ";
-
- print($messages);
- }
-
- /**
- * changing the language within one request is a bit fancy
- * in order to keep the core clean, we need a little hack here
- *
- * @param string $langId
- */
- protected function changeLanguage($langId)
- {
- if ($this->lastLanguage != $langId) {
- $_GET['language'] = $langId;
- Translate::reset();
- Translate::reloadLanguage($langId);
- }
-
- $this->lastLanguage = $langId;
- }
-
- /**
- * Path where expected/processed output files are stored.
- */
- public static function getPathToTestDirectory()
- {
- return dirname(__FILE__) . DIRECTORY_SEPARATOR . 'Integration';
- }
-
- /**
- * Returns an array associating table names w/ lists of row data.
- *
- * @return array
- */
- protected static function getDbTablesWithData()
- {
- $result = array();
- foreach (DbHelper::getTablesInstalled() as $tableName) {
- $result[$tableName] = Db::fetchAll("SELECT * FROM `$tableName`");
- }
- return $result;
- }
-
- /**
- * Truncates all tables then inserts the data in $tables into each
- * mapped table.
- *
- * @param array $tables Array mapping table names with arrays of row data.
- */
- protected static function restoreDbTables($tables)
- {
- DbHelper::truncateAllTables();
-
- // insert data
- $existingTables = DbHelper::getTablesInstalled();
- foreach ($tables as $table => $rows) {
- // create table if it's an archive table
- if (strpos($table, 'archive_') !== false && !in_array($table, $existingTables)) {
- $tableType = strpos($table, 'archive_numeric') !== false ? 'archive_numeric' : 'archive_blob';
-
- $createSql = DbHelper::getTableCreateSql($tableType);
- $createSql = str_replace(Common::prefixTable($tableType), $table, $createSql);
- Db::query($createSql);
- }
-
- if (empty($rows)) {
- continue;
- }
-
- $rowsSql = array();
- $bind = array();
- foreach ($rows as $row) {
- $values = array();
- foreach ($row as $value) {
- if (is_null($value)) {
- $values[] = 'NULL';
- } else if (is_numeric($value)) {
- $values[] = $value;
- } else if (!ctype_print($value)) {
- $values[] = "x'" . bin2hex(substr($value, 1)) . "'";
- } else {
- $values[] = "?";
- $bind[] = $value;
- }
- }
-
- $rowsSql[] = "(" . implode(',', $values) . ")";
- }
-
- $sql = "INSERT INTO `$table` VALUES " . implode(',', $rowsSql);
- Db::query($sql, $bind);
- }
- }
-
- /**
- * Drops all archive tables.
- */
- public static function deleteArchiveTables()
- {
- foreach (ArchiveTableCreator::getTablesArchivesInstalled() as $table) {
- Log::debug("Dropping table $table");
-
- Db::query("DROP TABLE IF EXISTS `$table`");
- }
-
- ArchiveTableCreator::refreshTableList($forceReload = true);
+ parent::setUpBeforeClass();
}
}
+
+IntegrationTestCase::$fixture = new \Piwik\Tests\Impl\Fixture(); \ No newline at end of file
diff --git a/tests/PHPUnit/MockLocationProvider.php b/tests/PHPUnit/MockLocationProvider.php
index 9d613ae18f..45cb0c8c04 100755
--- a/tests/PHPUnit/MockLocationProvider.php
+++ b/tests/PHPUnit/MockLocationProvider.php
@@ -12,7 +12,7 @@ class MockLocationProvider extends LocationProvider
{
public static $locations = array();
private $currentLocation = 0;
- private $ipToLocations = array();
+ private $ipToLocations = array();
public function getLocation($info)
{
@@ -26,7 +26,9 @@ class MockLocationProvider extends LocationProvider
$this->ipToLocations[$ip] = $result;
}
+
$this->completeLocationResult($result);
+
return $result;
}
diff --git a/tests/PHPUnit/Plugins/ActionsTest.php b/tests/PHPUnit/Plugins/ActionsTest.php
deleted file mode 100644
index 662ec20fac..0000000000
--- a/tests/PHPUnit/Plugins/ActionsTest.php
+++ /dev/null
@@ -1,123 +0,0 @@
-<?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\Plugins\Actions\ArchivingHelper;
-use Piwik\Tracker\Action;
-use Piwik\Translate;
-
-require_once 'Actions/Actions.php';
-
-class ActionsTests extends PHPUnit_Framework_TestCase
-{
- public function setUp()
- {
- Translate::reloadLanguage('en');
- }
-
- public function tearDown()
- {
- Translate::unloadEnglishTranslation();
- }
-
- public function getActionNameTestData()
- {
- return array(
- array(
- 'params' => array('name' => 'http://example.org/', 'type' => Action::TYPE_PAGE_URL, 'urlPrefix' => null),
- 'expected' => array('/index'),
- ),
- array(
- 'params' => array('name' => 'example.org/', 'type' => Action::TYPE_PAGE_URL, 'urlPrefix' => 1),
- 'expected' => array('/index'),
- ),
- array(
- 'params' => array('name' => 'example.org/', 'type' => Action::TYPE_PAGE_URL, 'urlPrefix' => 2),
- 'expected' => array('/index'),
- ),
- array(
- 'params' => array('name' => 'example.org/', 'type' => Action::TYPE_PAGE_URL, 'urlPrefix' => 3),
- 'expected' => array('/index'),
- ),
- array(
- 'params' => array('name' => 'example.org/', 'type' => Action::TYPE_PAGE_URL, 'urlPrefix' => 4),
- 'expected' => array('/index'),
- ),
- array(
- 'params' => array('name' => 'example.org/path/', 'type' => Action::TYPE_PAGE_URL, 'urlPrefix' => 4),
- 'expected' => array('path', '/index'),
- ),
- array(
- 'params' => array('name' => 'example.org/test/path', 'type' => Action::TYPE_PAGE_URL, 'urlPrefix' => 1),
- 'expected' => array('test', '/path'),
- ),
- array(
- 'params' => array('name' => 'http://example.org/path/', 'type' => Action::TYPE_PAGE_URL),
- 'expected' => array('path', '/index'),
- ),
- array(
- 'params' => array('name' => 'example.org/test/path', 'type' => Action::TYPE_PAGE_URL, 'urlPrefix' => 1),
- 'expected' => array('test', '/path'),
- ),
- array(
- 'params' => array('name' => 'Test / Path', 'type' => Action::TYPE_PAGE_URL),
- 'expected' => array('Test', '/Path'),
- ),
- array(
- 'params' => array('name' => ' Test trim ', 'type' => Action::TYPE_PAGE_URL),
- 'expected' => array('/Test trim'),
- ),
- array(
- 'params' => array('name' => 'Category / Subcategory', 'type' => Action::TYPE_PAGE_TITLE),
- 'expected' => array('Category', ' Subcategory'),
- ),
- array(
- 'params' => array('name' => '/path/index.php?var=test', 'type' => Action::TYPE_PAGE_TITLE),
- 'expected' => array('path', ' index.php?var=test'),
- ),
- array(
- 'params' => array('name' => 'http://example.org/path/Default.aspx#anchor', 'type' => Action::TYPE_PAGE_TITLE),
- 'expected' => array('path', ' Default.aspx#anchor'),
- ),
- array(
- 'params' => array('name' => '', 'type' => Action::TYPE_PAGE_TITLE),
- 'expected' => array('Page Name not defined'),
- ),
- array(
- 'params' => array('name' => '', 'type' => Action::TYPE_PAGE_URL),
- 'expected' => array('Page URL not defined'),
- ),
- array(
- 'params' => array('name' => 'http://example.org/download.zip', 'type' => Action::TYPE_DOWNLOAD),
- 'expected' => array('example.org', '/download.zip'),
- ),
- array(
- 'params' => array('name' => 'http://example.org/download/1/', 'type' => Action::TYPE_DOWNLOAD),
- 'expected' => array('example.org', '/download/1/'),
- ),
- array(
- 'params' => array('name' => 'http://example.org/link', 'type' => Action::TYPE_OUTLINK),
- 'expected' => array('example.org', '/link'),
- ),
- array(
- 'params' => array('name' => 'http://example.org/some/path/', 'type' => Action::TYPE_OUTLINK),
- 'expected' => array('example.org', '/some/path/'),
- ),
- );
- }
-
- /**
- * @dataProvider getActionNameTestData
- * @group Plugins
- */
- public function testGetActionExplodedNames($params, $expected)
- {
- ArchivingHelper::reloadConfig();
- $processed = ArchivingHelper::getActionExplodedNames($params['name'], $params['type'], (isset($params['urlPrefix']) ? $params['urlPrefix'] : null));
- $this->assertEquals($expected, $processed);
- }
-}
-
diff --git a/tests/PHPUnit/Plugins/AnonymizeIPTest.php b/tests/PHPUnit/Plugins/AnonymizeIPTest.php
deleted file mode 100644
index 449d255f1f..0000000000
--- a/tests/PHPUnit/Plugins/AnonymizeIPTest.php
+++ /dev/null
@@ -1,89 +0,0 @@
-<?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\IP;
-use Piwik\Plugins\PrivacyManager\IPAnonymizer;
-
-require_once 'PrivacyManager/IPAnonymizer.php';
-
-class AnonymizeIPTest extends PHPUnit_Framework_TestCase
-{
- // IPv4 addresses and expected results
- public function getipv4Addresses()
- {
- return array(
- // ip, array( expected0, expected1, expected2, expected3, expected4 ),
- array('0.0.0.0', array("\x00\x00\x00\x00", "\x00\x00\x00\x00", "\x00\x00\x00\x00", "\x00\x00\x00\x00", "\x00\x00\x00\x00")),
- array('0.0.0.1', array("\x00\x00\x00\x01", "\x00\x00\x00\x00", "\x00\x00\x00\x00", "\x00\x00\x00\x00", "\x00\x00\x00\x00")),
- array('0.0.0.255', array("\x00\x00\x00\xff", "\x00\x00\x00\x00", "\x00\x00\x00\x00", "\x00\x00\x00\x00", "\x00\x00\x00\x00")),
- array('0.0.1.0', array("\x00\x00\x01\x00", "\x00\x00\x01\x00", "\x00\x00\x00\x00", "\x00\x00\x00\x00", "\x00\x00\x00\x00")),
- array('0.0.1.1', array("\x00\x00\x01\x01", "\x00\x00\x01\x00", "\x00\x00\x00\x00", "\x00\x00\x00\x00", "\x00\x00\x00\x00")),
- array('0.0.255.255', array("\x00\x00\xff\xff", "\x00\x00\xff\x00", "\x00\x00\x00\x00", "\x00\x00\x00\x00", "\x00\x00\x00\x00")),
- array('0.1.0.0', array("\x00\x01\x00\x00", "\x00\x01\x00\x00", "\x00\x01\x00\x00", "\x00\x00\x00\x00", "\x00\x00\x00\x00")),
- array('0.1.1.1', array("\x00\x01\x01\x01", "\x00\x01\x01\x00", "\x00\x01\x00\x00", "\x00\x00\x00\x00", "\x00\x00\x00\x00")),
- array('0.255.255.255', array("\x00\xff\xff\xff", "\x00\xff\xff\x00", "\x00\xff\x00\x00", "\x00\x00\x00\x00", "\x00\x00\x00\x00")),
- array('1.0.0.0', array("\x01\x00\x00\x00", "\x01\x00\x00\x00", "\x01\x00\x00\x00", "\x01\x00\x00\x00", "\x00\x00\x00\x00")),
- array('127.255.255.255', array("\x7f\xff\xff\xff", "\x7f\xff\xff\x00", "\x7f\xff\x00\x00", "\x7f\x00\x00\x00", "\x00\x00\x00\x00")),
- array('128.0.0.0', array("\x80\x00\x00\x00", "\x80\x00\x00\x00", "\x80\x00\x00\x00", "\x80\x00\x00\x00", "\x00\x00\x00\x00")),
- array('255.255.255.255', array("\xff\xff\xff\xff", "\xff\xff\xff\x00", "\xff\xff\x00\x00", "\xff\x00\x00\x00", "\x00\x00\x00\x00")),
- );
- }
-
- public function getipv6Addresses()
- {
- return array(
- array('2001:db8:0:8d3:0:8a2e:70:7344', array(
- "\x20\x01\x0d\xb8\x00\x00\x08\xd3\x00\x00\x8a\x2e\x00\x70\x73\x44",
- "\x20\x01\x0d\xb8\x00\x00\x08\xd3\x00\x00\x00\x00\x00\x00\x00\x00", // mask 64 bits
- "\x20\x01\x0d\xb8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // mask 80 bits
- "\x20\x01\x0d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" // mask 104 bits
- )),
- array('2001:6f8:900:724::2', array(
- "\x20\x01\x06\xf8\x09\x00\x07\x24\x00\x00\x00\x00\x00\x00\x00\x02",
- "\x20\x01\x06\xf8\x09\x00\x07\x24\x00\x00\x00\x00\x00\x00\x00\x00",
- "\x20\x01\x06\xf8\x09\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00",
- "\x20\x01\x06\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00",
- ))
- );
- }
-
- /**
- * @dataProvider getipv4Addresses
- * @group Plugins
- */
- public function testApplyIPMask($ip, $expected)
- {
- // each IP is tested with 0 to 4 octets masked
- for ($maskLength = 0; $maskLength <= 4; $maskLength++) {
- $res = IPAnonymizer::applyIPMask(IP::P2N($ip), $maskLength);
- $this->assertEquals($expected[$maskLength], $res, "Got " . bin2hex($res) . ", Expected " . bin2hex($expected[$maskLength]));
- }
-
- // edge case (bounds check)
- $this->assertEquals("\x00\x00\x00\x00", IPAnonymizer::applyIPMask(IP::P2N($ip), 5));
-
- // mask IPv4 mapped addresses
- for ($maskLength = 0; $maskLength <= 4; $maskLength++) {
- $res = IPAnonymizer::applyIPMask(IP::P2N('::ffff:' . $ip), $maskLength);
- $this->assertEquals($res, "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff" . $expected[$maskLength], "Got " . bin2hex($res) . ", Expected " . bin2hex($expected[$maskLength]));
- }
- $this->assertEquals("\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\x00\x00\x00\x00\x00", IPAnonymizer::applyIPMask(IP::P2N('::ffff:' . $ip), 5));
- }
-
- /**
- * @dataProvider getipv6Addresses
- * @group Plugins
- */
- public function testApplyIPMask6($ip, $expected)
- {
- // each IP is tested with 0 to 4 octets masked
- for ($maskLength = 0; $maskLength < 4; $maskLength++) {
- $res = IPAnonymizer::applyIPMask(IP::P2N($ip), $maskLength);
- $this->assertEquals($expected[$maskLength], $res, "Got " . bin2hex($res) . ", Expected " . bin2hex($expected[$maskLength]) . ", Mask Level " . $maskLength);
- }
- }
-} \ No newline at end of file
diff --git a/tests/PHPUnit/Plugins/LanguagesManagerTest.php b/tests/PHPUnit/Plugins/LanguagesManagerTest.php
deleted file mode 100755
index 13cb46c6e6..0000000000
--- a/tests/PHPUnit/Plugins/LanguagesManagerTest.php
+++ /dev/null
@@ -1,177 +0,0 @@
-<?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\Common;
-use Piwik\Plugins\LanguagesManager\API;
-use Piwik\Translate\Filter\ByParameterCount;
-use Piwik\Translate\Filter\EmptyTranslations;
-use Piwik\Translate\Filter\EncodedEntities;
-use Piwik\Translate\Filter\UnnecassaryWhitespaces;
-use Piwik\Translate\Validate\CoreTranslations;
-use Piwik\Translate\Validate\NoScripts;
-use Piwik\Translate\Writer;
-
-require_once 'LanguagesManager/API.php';
-
-class Test_LanguagesManager extends PHPUnit_Framework_TestCase
-{
- public function setUp()
- {
- parent::setUp();
- include PIWIK_INCLUDE_PATH . '/core/DataFiles/Languages.php';
- }
-
- function getTestDataForLanguageFiles()
- {
- // we also test that none of the language php files outputs any character on the screen (eg. space before the <?php)
- $languages = API::getInstance()->getAvailableLanguages();
-
- $plugins = \Piwik\Plugin\Manager::getInstance()->readPluginsDirectory();
-
- $pluginsWithTranslation = array();
-
- foreach ($plugins as $plugin) {
-
- if (API::getInstance()->getPluginTranslationsForLanguage($plugin, 'en')) {
-
- $pluginsWithTranslation[] = $plugin;
- }
- }
-
- $return = array();
- foreach ($languages as $language) {
- if ($language != 'en') {
- $return[] = array($language, null);
-
- foreach ($pluginsWithTranslation as $plugin) {
-
- $return[] = array($language, $plugin);
- }
- }
- }
- return $return;
- }
-
- /**
- * test all languages
- *
- * @group Plugins
- *
- * @dataProvider getTestDataForLanguageFiles
- */
- function testGetTranslationsForLanguages($language, $plugin)
- {
- $translationWriter = new Writer($language, $plugin);
-
- $baseTranslations = $translationWriter->getTranslations('en');
-
- $translationWriter->addValidator(new NoScripts());
- if (empty($plugin)) {
- $translationWriter->addValidator(new CoreTranslations($baseTranslations));
- }
-
- // prevent build from failing when translations string have been deleted
-// $translationWriter->addFilter(new ByBaseTranslations($baseTranslations));
- $translationWriter->addFilter(new EmptyTranslations());
- $translationWriter->addFilter(new ByParameterCount($baseTranslations));
- $translationWriter->addFilter(new UnnecassaryWhitespaces($baseTranslations));
- $translationWriter->addFilter(new EncodedEntities());
-
- $translations = $translationWriter->getTranslations($language);
-
- if (empty($translations)) {
- return; // skip language / plugin combinations that aren't present
- }
-
- $translationWriter->setTranslations($translations);
-
- $this->assertTrue($translationWriter->isValid(), $translationWriter->getValidationMessage());
-
- if ($translationWriter->wasFiltered()) {
-
- $translationWriter->saveTemporary();
- $this->fail(implode("\n", $translationWriter->getFilterMessages()) . "\n"
- . 'Translation file errors detected in ' . $language . "...\n"
- . "To overwrite you could manually fix the language files, or run the following command may work if you have access to oTrance: \n"
- . "$ ./console translations:update [--plugin=XYZ] \n");
- }
- }
-
- /**
- * test language when it's not defined
- *
- * @group Plugins
- *
- * @expectedException Exception
- */
- function testWriterInvalidPlugin()
- {
- new Writer('de', 'iNvaLiDPluGin'); // invalid plugin throws exception
- }
-
- /**
- * test language when it's not defined
- *
- * @group Plugins
- */
- function testGetTranslationsForLanguagesNot()
- {
- $this->assertFalse(API::getInstance()->getTranslationsForLanguage("../no-language"));
- }
-
- /**
- * test English short name for language
- *
- * @group Plugins
- */
- function testGetLanguageNamesInEnglish()
- {
- $languages = API::getInstance()->getAvailableLanguages();
- foreach ($languages as $language) {
- $data = file_get_contents(PIWIK_INCLUDE_PATH . "/lang/$language.json");
- $translations = json_decode($data, true);
- $name = $translations['General']['EnglishLanguageName'];
-
- if ($language != 'en') {
- $this->assertFalse($name == 'English', "for $language");
- }
-
- $languageCode = substr($language, 0, 2);
- $this->assertTrue(isset($GLOBALS['Piwik_LanguageList'][$languageCode]));
- $names = $GLOBALS['Piwik_LanguageList'][$languageCode];
-
- if (isset($GLOBALS['Piwik_LanguageList'][$language])) {
- if (is_array($names)) {
- $this->assertTrue(in_array($name, $names), "$language: failed because $name not a known language name");
- } else {
- $this->assertTrue($name == $names, "$language: failed because $name == $names");
- }
- } else {
- if (is_array($names)) {
- $this->assertTrue(strpos($name, $names[0]) !== false);
- } else {
- $this->fail("$language: expected an array of language names");
- }
- }
- }
- }
-
- /**
- * test format of DataFile/Languages.php
- *
- * @group Plugins
- */
- function testGetLanguagesList()
- {
- $languages = Common::getLanguagesList();
- $this->assertTrue(count($languages) > 0);
- foreach ($languages as $langCode => $langs) {
- $this->assertTrue(strlen($langCode) == 2, "$langCode length = 2");
- $this->assertTrue(is_array($langs) && count($langs) >= 1, "$langCode array(names) >= 1");
- }
- }
-}
diff --git a/tests/PHPUnit/Plugins/ProxyTest.php b/tests/PHPUnit/Plugins/ProxyTest.php
deleted file mode 100644
index ab5a57bcc4..0000000000
--- a/tests/PHPUnit/Plugins/ProxyTest.php
+++ /dev/null
@@ -1,40 +0,0 @@
-<?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\Plugins\Proxy\Controller;
-
-class ProxyTest extends PHPUnit_Framework_TestCase
-{
- public function getAcceptableRemoteUrls()
- {
- return array(
- // piwik white list (and used in homepage)
- array('http://piwik.org/', true),
-
- array('http://piwik.org', true),
- array('http://qa.piwik.org/', true),
- array('http://forum.piwik.org/', true),
- array('http://dev.piwik.org/', true),
- array('http://demo.piwik.org/', true),
-
- // not in the piwik white list
- array('http://www.piwik.org/', false),
- array('https://piwik.org/', false),
- array('http://example.org/', false),
- );
- }
-
- /**
- * @dataProvider getAcceptableRemoteUrls
- * @group Plugins
- */
- public function testIsAcceptableRemoteUrl($url, $expected)
- {
- $this->assertEquals($expected, Controller::isPiwikUrl($url));
- }
-}
-
diff --git a/tests/PHPUnit/Plugins/ReferrersTest.php b/tests/PHPUnit/Plugins/ReferrersTest.php
deleted file mode 100644
index c03c9ad61d..0000000000
--- a/tests/PHPUnit/Plugins/ReferrersTest.php
+++ /dev/null
@@ -1,243 +0,0 @@
-<?php
-/**
- * Piwik - free/libre analytics platform
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- */
-require_once 'Referrers/Referrers.php';
-
-use Piwik\DataTable;
-use Piwik\DataTable\Row;
-use Piwik\Period;
-
-class ReferrersTest extends PHPUnit_Framework_TestCase
-{
- /**
- * Dataprovider serving all search engine data
- */
- public function getSearchEngines()
- {
- include PIWIK_PATH_TEST_TO_ROOT . '/core/DataFiles/SearchEngines.php';
-
- $searchEngines = array();
- foreach ($GLOBALS['Piwik_SearchEngines'] as $url => $searchEngine) {
- $searchEngines[] = array($url, $searchEngine);
- }
- return $searchEngines;
- }
-
- /**
- * search engine has at least one keyword
- *
- * @group Plugins
- *
- * @dataProvider getSearchEngines
- */
- public function testMissingSearchEngineKeyword($url, $searchEngine)
- {
- // Get list of search engines and first appearing URL
- static $searchEngines = array();
-
- $name = parse_url('http://' . $url);
- if (!array_key_exists($searchEngine[0], $searchEngines)) {
- $searchEngines[$searchEngine[0]] = $url;
-
- $this->assertTrue(!empty($searchEngine[1]), $name['host']);
- }
- }
-
- /**
- * search engine is defined in DataFiles/SearchEngines.php but there's no favicon
- *
- * @group Plugins
- *
- * @dataProvider getSearchEngines
- */
- public function testMissingSearchEngineIcons($url, $searchEngine)
- {
- // Get list of existing favicons
- $favicons = scandir(PIWIK_PATH_TEST_TO_ROOT . '/plugins/Referrers/images/searchEngines/');
-
- // Get list of search engines and first appearing URL
- static $searchEngines = array();
-
- $name = parse_url('http://' . $url);
- if (!array_key_exists($searchEngine[0], $searchEngines)) {
- $searchEngines[$searchEngine[0]] = $url;
-
- $this->assertTrue(in_array($name['host'] . '.png', $favicons), $name['host']);
- }
- }
-
- /**
- * favicon exists but there's no corresponding search engine defined in DataFiles/SearchEngines.php
- *
- * @group Plugins
- */
- public function testObsoleteSearchEngineIcons()
- {
- include PIWIK_PATH_TEST_TO_ROOT . '/core/DataFiles/SearchEngines.php';
-
- // Get list of search engines and first appearing URL
- $searchEngines = array();
- foreach ($GLOBALS['Piwik_SearchEngines'] as $url => $searchEngine) {
- $name = parse_url('http://' . $url);
- if (!array_key_exists($name['host'], $searchEngines)) {
- $searchEngines[$name['host']] = true;
- }
- }
-
- // Get list of existing favicons
- $favicons = scandir(PIWIK_PATH_TEST_TO_ROOT . '/plugins/Referrers/images/searchEngines/');
- foreach ($favicons as $name) {
- if ($name[0] == '.' || strpos($name, 'xx.') === 0) {
- continue;
- }
-
- $host = substr($name, 0, -4);
- $this->assertTrue(array_key_exists($host, $searchEngines), $host);
- }
- }
-
- /**
- * get search engine host from url
- *
- * @group Plugins
- */
- public function testGetSearchEngineHostFromUrl()
- {
- $data = array(
- 'http://www.google.com/cse' => array('www.google.com', 'www.google.com/cse'),
- 'http://www.google.com' => array('www.google.com', 'www.google.com'),
- );
-
- foreach ($data as $url => $expected) {
- $this->assertEquals($expected[0], \Piwik\Plugins\Referrers\getSearchEngineHostFromUrl($url));
- $this->assertEquals($expected[1], \Piwik\Plugins\Referrers\getSearchEngineHostPathFromUrl($url));
- }
- }
-
- /**
- * Dataprovider for testGetSearchEngineUrlFromUrlAndKeyword
- */
- public function getSearchEngineUrlFromUrlAndKeywordTestData()
- {
- return array(
- array('http://apollo.lv/portal/search/', 'piwik', 'http://apollo.lv/portal/search/?cof=FORID%3A11&q=piwik&search_where=www'),
- array('http://bing.com/images/search', 'piwik', 'http://bing.com/images/search/?q=piwik'),
- array('http://google.com', 'piwik', 'http://google.com/search?q=piwik'),
- );
- }
-
- /**
- * get search engine url from name and keyword
- *
- * @group Plugins
- *
- * @dataProvider getSearchEngineUrlFromUrlAndKeywordTestData
- */
- public function testGetSearchEngineUrlFromUrlAndKeyword($url, $keyword, $expected)
- {
- include PIWIK_PATH_TEST_TO_ROOT . '/core/DataFiles/SearchEngines.php';
- $this->assertEquals($expected, \Piwik\Plugins\Referrers\getSearchEngineUrlFromUrlAndKeyword($url, $keyword));
- }
-
- /**
- * Dataprovider for getSocialNetworkFromDomainTestData
- */
- public function getSocialNetworkFromDomainTestData()
- {
- return array(
- array('http://www.facebook.com', 'Facebook'),
- array('http://www.facebook.com/piwik', 'Facebook'),
- array('http://m.facebook.com', 'Facebook'),
- array('https://m.facebook.com', 'Facebook'),
- array('m.facebook.com', 'Facebook'),
- array('http://lastfm.com.tr', 'Last.fm'),
- array('http://t.co/test', 'Twitter'),
- array('http://xxt.co/test', \Piwik\Piwik::translate('General_Unknown')),
- array('asdfasdfadsf.com', \Piwik\Piwik::translate('General_Unknown')),
- array('http://xwayn.com', \Piwik\Piwik::translate('General_Unknown')),
- array('http://live.com/test', \Piwik\Piwik::translate('General_Unknown')),
- );
- }
-
- /**
- * @group Plugins
- *
- * @dataProvider getSocialNetworkFromDomainTestData
- */
- public function testGetSocialNetworkFromDomain($url, $expected)
- {
- include PIWIK_INCLUDE_PATH . '/core/DataFiles/Socials.php';
- $this->assertEquals($expected, \Piwik\Plugins\Referrers\getSocialNetworkFromDomain($url));
- }
-
- public function getSocialsLogoFromUrlTestData()
- {
- return array(
- array('http://www.facebook.com', 'facebook.com.png'),
- array('www.facebook.com', 'facebook.com.png',),
- array('http://lastfm.com.tr', 'last.fm.png'),
- array('http://asdfasdf.org/test', 'xx.png'),
- array('http://www.google.com', 'xx.png'),
- );
- }
-
- /**
- * @group Plugins
- *
- * @dataProvider getSocialsLogoFromUrlTestData
- */
- public function testGetSocialsLogoFromUrl($url, $expected)
- {
- include PIWIK_INCLUDE_PATH . '/core/DataFiles/Socials.php';
- $this->assertContains($expected, \Piwik\Plugins\Referrers\getSocialsLogoFromUrl($url));
- }
-
- public function isSocialUrlTestData()
- {
- return array(
- array('http://www.facebook.com', 'Facebook', true),
- array('http://www.facebook.com', 'Twitter', false),
- array('http://m.facebook.com', false, true),
- array('http://lastfm.com.tr', 'Last.fm', true),
- array('http://asdfasdf.org/test', false, false),
- array('http://asdfasdf.com/test', 'Facebook', false),
- );
- }
-
- /**
- * @group Plugins
- *
- * @dataProvider isSocialUrlTestData
- */
- public function testIsSocialUrl($url, $assumedSocial, $expected)
- {
- include PIWIK_INCLUDE_PATH . '/core/DataFiles/Socials.php';
- $this->assertEquals($expected, \Piwik\Plugins\Referrers\isSocialUrl($url, $assumedSocial));
- }
-
- public function removeUrlProtocolTestData()
- {
- return array(
- array('http://www.facebook.com', 'www.facebook.com'),
- array('https://bla.fr', 'bla.fr'),
- array('ftp://bla.fr', 'bla.fr'),
- array('udp://bla.fr', 'bla.fr'),
- array('bla.fr', 'bla.fr'),
- array('ASDasdASDDasd', 'ASDasdASDDasd'),
- );
- }
-
- /**
- * @group Plugins
- *
- * @dataProvider removeUrlProtocolTestData
- */
- public function testRemoveUrlProtocol($url, $expected)
- {
- $this->assertEquals($expected, \Piwik\Plugins\Referrers\removeUrlProtocol($url));
- }
-}
diff --git a/tests/PHPUnit/Plugins/SEOTest.php b/tests/PHPUnit/Plugins/SEOTest.php
deleted file mode 100644
index 8cb377eeef..0000000000
--- a/tests/PHPUnit/Plugins/SEOTest.php
+++ /dev/null
@@ -1,60 +0,0 @@
-<?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\DataTable\Renderer;
-use Piwik\Plugins\SEO\API;
-
-class SEOTest extends PHPUnit_Framework_TestCase
-{
- public function setUp()
- {
- parent::setUp();
-
- // setup the access layer
- $pseudoMockAccess = new FakeAccess;
- FakeAccess::setIdSitesView(array(1, 2));
- FakeAccess::setIdSitesAdmin(array(3, 4));
-
- //finally we set the user as a Super User by default
- FakeAccess::$superUser = true;
- Access::setSingletonInstance($pseudoMockAccess);
-
- $user_agents = array(
- 'Mozilla/6.0 (Macintosh; I; Intel Mac OS X 11_7_9; de-LI; rv:1.9b4) Gecko/2012010317 Firefox/10.0a4',
- 'Mozilla/5.0 (compatible; MSIE 10.6; Windows NT 6.1; Trident/5.0; InfoPath.2; SLCC1; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET CLR 2.0.50727) 3gpp-gba UNTRUSTED/1.0',
- 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/18.6.872.0 Safari/535.2 UNTRUSTED/1.0 3gpp-gba UNTRUSTED/1.0',
- 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_8; de-at) AppleWebKit/533.21.1 (KHTML, like Gecko) Version/5.0.5 Safari/533.21.1',
- );
-
- $_SERVER['HTTP_USER_AGENT'] = $user_agents[mt_rand(0, count($user_agents) - 1)];
- }
-
- /**
- * tell us when the API is broken
- *
- * @group Plugins
- */
- public function test_API()
- {
- try {
- $dataTable = API::getInstance()->getRank('http://www.microsoft.com/');
- } catch(Exception $e) {
- $this->markTestSkipped('A SEO http request failed, Skipping this test for now. Error was: '.$e->getMessage());
- }
- $renderer = Renderer::factory('php');
- $renderer->setSerialize(false);
- $ranks = $renderer->render($dataTable);
- foreach ($ranks as $rank) {
- $message = $rank['id'] . ' expected non-zero rank, got [' . $rank['rank'] . ']';
- if(empty($rank['rank'])) {
- $this->markTestSkipped("Skipped to avoid random build failure: " . $message);
- }
- $this->assertNotEmpty($rank['rank'], $message);
- }
- }
-}
diff --git a/tests/PHPUnit/Plugins/UserCountryTest.php b/tests/PHPUnit/Plugins/UserCountryTest.php
deleted file mode 100644
index 72f9e7bfce..0000000000
--- a/tests/PHPUnit/Plugins/UserCountryTest.php
+++ /dev/null
@@ -1,182 +0,0 @@
-<?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\Plugins\UserCountry\GeoIPAutoUpdater;
-use Piwik\Plugins\UserCountry\LocationProvider\GeoIp;
-use Piwik\Plugins\UserCountry;
-use Piwik\Plugins\UserCountry\LocationProvider;
-
-require_once PIWIK_INCLUDE_PATH . '/plugins/UserCountry/UserCountry.php';
-require_once PIWIK_INCLUDE_PATH . '/plugins/UserCountry/functions.php';
-require_once PIWIK_INCLUDE_PATH . '/core/DataFiles/Countries.php';
-
-class Test_Piwik_UserCountry extends PHPUnit_Framework_Testcase
-{
- /**
- * @group Plugins
- */
- public function testGetFlagFromCode()
- {
- $flag = \Piwik\Plugins\UserCountry\getFlagFromCode("us");
- $this->assertEquals(basename($flag), "us.png");
- }
-
- /**
- * @group Plugins
- */
- public function testGetFlagFromInvalidCode()
- {
- $flag = \Piwik\Plugins\UserCountry\getFlagFromCode("foo");
- $this->assertEquals(basename($flag), "xx.png");
- }
-
- /**
- * @group Plugins
- */
- public function testFlagsAndContinents()
- {
- require PIWIK_PATH_TEST_TO_ROOT . '/core/DataFiles/Countries.php';
-
- $continents = $GLOBALS['Piwik_ContinentList'];
- $countries = array_merge($GLOBALS['Piwik_CountryList'], $GLOBALS['Piwik_CountryList_Extras']);
-
- // Get list of existing flag icons
- $flags = scandir(PIWIK_PATH_TEST_TO_ROOT . '/plugins/UserCountry/images/flags/');
-
- // Get list of countries
- foreach ($countries as $country => $continent) {
- // test continent
- $this->assertContains($continent, $continents);
-
- // test flag
- $this->assertContains($country . '.png', $flags);
- }
-
- foreach ($flags as $filename) {
- if ($filename == '.' || $filename == '..') {
- continue;
- }
-
- $country = substr($filename, 0, strpos($filename, '.png'));
-
- // test country
- $this->assertArrayHasKey($country, $countries, $filename);
- }
- }
-
- /**
- * Test that redundant checks work.
- *
- * @group Plugins
- */
- public function testGeoIpUpdaterRedundantChecks()
- {
- GeoIp::$geoIPDatabaseDir = 'tests/lib/geoip-files';
- LocationProvider::$providers = null;
-
- // create empty ISP & Org files
- $this->createEmptyISPOrgFiles();
-
- // run redundant checks
- $updater = new Piwik_UserCountry_GeoIPAutoUpdater_publictest();
- $updater->performRedundantDbChecks();
-
- // check that files are renamed correctly
- $this->checkBrokenGeoIPState();
-
- // create empty files again & run checks again
- $this->createEmptyISPOrgFiles();
- $updater->performRedundantDbChecks();
-
- // check that w/ broken files already there, redundant checks still work correctly
- $this->checkBrokenGeoIPState();
- }
-
- /**
- * @group Plugins
- *
- * @dataProvider getInvalidGeoIpUrlsToTest
- */
- public function testGeoIpDownloadInvalidUrl($url)
- {
- $updater = new Piwik_UserCountry_GeoIPAutoUpdater_publictest();
- try {
- $updater->downloadFile('loc', $url);
- $this->fail("Downloading invalid url succeeded!");
- } catch (Exception $ex) {
- $this->assertEquals("UserCountry_UnsupportedArchiveType", $ex->getMessage());
- }
- }
-
- public function getInvalidGeoIpUrlsToTest()
- {
- return array(array("http://localhost/tests/resources/geoip.tar"),
- array("http://localhost/tests/resources/geoip.tar.bz2"),
- array("http://localhost/tests/resources/geoip.dat"));
- }
-
- public function setUp()
- {
- // empty
- }
-
- public function tearDown()
- {
- $geoIpDirPath = PIWIK_INCLUDE_PATH . '/tests/lib/geoip-files';
- $filesToRemove = array('GeoIPISP.dat.broken', 'GeoIPOrg.dat.broken', 'GeoIPISP.dat', 'GeoIPOrg.dat');
-
- foreach ($filesToRemove as $name) {
- $path = $geoIpDirPath . '/' . $name;
- if (file_exists($path)) {
- unlink($path);
- }
- }
- }
-
- private function createEmptyISPOrgFiles()
- {
- $geoIpDir = PIWIK_INCLUDE_PATH . '/tests/lib/geoip-files';
-
- $fd = fopen($geoIpDir . '/GeoIPISP.dat', 'w');
- fclose($fd);
-
- $fd = fopen($geoIpDir . '/GeoIPOrg.dat', 'w');
- fclose($fd);
- }
-
- private function checkBrokenGeoIPState()
- {
- $geoIpDir = PIWIK_INCLUDE_PATH . '/tests/lib/geoip-files';
-
- $this->assertFalse(file_exists($geoIpDir . '/GeoIPCity.dat.broken'));
-
- $this->assertFalse(file_exists($geoIpDir . '/GeoIPISP.dat'));
- $this->assertTrue(file_exists($geoIpDir . '/GeoIPISP.dat.broken'));
-
- $this->assertFalse(file_exists($geoIpDir . '/GeoIPOrg.dat'));
- $this->assertTrue(file_exists($geoIpDir . '/GeoIPOrg.dat.broken'));
- }
-}
-
-class Piwik_UserCountry_GeoIPAutoUpdater_publictest extends GeoIPAutoUpdater
-{
- public function __construct()
- {
- // empty
- }
-
- public function performRedundantDbChecks()
- {
- parent::performRedundantDbChecks();
- }
-
- public function downloadFile($type, $url)
- {
- parent::downloadFile($type, $url);
- }
-}
diff --git a/tests/PHPUnit/Plugins/UserSettingsTest.php b/tests/PHPUnit/Plugins/UserSettingsTest.php
deleted file mode 100644
index b18362f1e5..0000000000
--- a/tests/PHPUnit/Plugins/UserSettingsTest.php
+++ /dev/null
@@ -1,1032 +0,0 @@
-<?php
-/**
- * Piwik - free/libre analytics platform
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- */
-require_once 'UserSettings/UserSettings.php';
-require_once 'UserSettings/functions.php';
-
-class UserSettingsTest extends PHPUnit_Framework_TestCase
-{
- // User agent strings and expected parser results
- public function getUserAgents()
- {
- return array(
- // array('User Agent String', array(
- // array( browser_id, name, short_name, version, major_number, minor_number, family ),
- // array( os_id, name, short_name ))),
-
- // Special: URL encoded IE8
- array('Mozilla/4.0+(compatible;+MSIE+8.0;+Windows+NT+6.1;+WOW64;+Trident/4.0;+GTB7.4;+SLCC2;+.NET+CLR+2.0.50727;+.NET+CLR+3.5.30729;+.NET+CLR+3.0.30729;+Media+Center+PC+6.0;+.NET4.0C;+.NET4.0E;+MS-RTC+LM+8;+InfoPath.2)', array(
- array('IE', 'Internet Explorer', 'IE', '8.0', '8', '0', 'ie'),
- array('WI7', 'Windows 7', 'Win 7'))),
-
- // ABrowse
- array('Mozilla/5.0 (compatible; U; ABrowse 0.6; Syllable) AppleWebKit/420+ (KHTML, like Gecko)', array(
- array('AB', 'ABrowse', 'ABrowse', '0.6', '0', '6', 'webkit'),
- array('SYL', 'Syllable', 'Syllable'))),
- array('Mozilla/5.0 (compatible; ABrowse 0.4; Syllable)', array(
- array('AB', 'ABrowse', 'ABrowse', '0.4', '0', '4', 'webkit'),
- array('SYL', 'Syllable', 'Syllable'))),
-
- // Acoo Browser (treat as IE)
- array('Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; GTB6; Acoo Browser; .NET CLR 1.1.4322; .NET CLR 2.0.50727)', array(
- array('IE', 'Internet Explorer', 'IE', '8.0', '8', '0', 'ie'),
- array('WXP', 'Windows XP', 'Win XP'))),
- array('Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Acoo Browser; .NET CLR 2.0.50727; .NET CLR 1.1.4322)', array(
- array('IE', 'Internet Explorer', 'IE', '7.0', '7', '0', 'ie'),
- array('WXP', 'Windows XP', 'Win XP'))),
- array('Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Acoo Browser; .NET CLR 1.1.4322; .NET CLR 2.0.50727)', array(
- array('IE', 'Internet Explorer', 'IE', '6.0', '6', '0', 'ie'),
- array('WXP', 'Windows XP', 'Win XP'))),
-
- // Amaya
- array('amaya/9.52 libwww/5.4.0', array(
- array('AM', 'Amaya', 'Amaya', '9.52', '9', '52', 'unknown'),
- false)),
-
- // AmigaVoyager
- array('AmigaVoyager/3.2 (AmigaOS/MC680x0)', array(
- array('AV', 'AmigaVoyager', 'AmigaVoyager', '3.2', '3', '2', 'unknown'),
- array('AMI', 'AmigaOS', 'AmigaOS'))),
- array('AmigaVoyager/2.95 (compatible; MC680x0; AmigaOS; SV1)', array(
- array('AV', 'AmigaVoyager', 'AmigaVoyager', '2.95', '2', '95', 'unknown'),
- array('AMI', 'AmigaOS', 'AmigaOS'))),
- array('AmigaVoyager/2.95 (compatible; MC680x0; AmigaOS)', array(
- array('AV', 'AmigaVoyager', 'AmigaVoyager', '2.95', '2', '95', 'unknown'),
- array('AMI', 'AmigaOS', 'AmigaOS'))),
-
- // Android
- array('Mozilla/5.0 (Linux; U; Android 1.1; en-us; dream) AppleWebKit/525.10+ (KHTML, like Gecko) Version/3.0.4 Mobile Safari/523.12.2', array(
- array('SF', 'Safari', 'Safari', '3.0', '3', '0', 'webkit'),
- array('AND', 'Android', 'Android'))),
- array('Mozilla/5.0 (Linux; U; Android 2.2.1; en-us; Nexus One Build/FRG83) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1', array(
- array('SF', 'Safari', 'Safari', '4.0', '4', '0', 'webkit'),
- array('AND', 'Android', 'Android'))),
- array('Mozilla/5.0 (Linux; U; Android 2.2.1; en-us; device Build/FRG83) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Safari/533.1', array(
- array('SF', 'Safari', 'Safari', '4.0', '4', '0', 'webkit'),
- array('AND', 'Android', 'Android'))),
- array('Mozilla/5.0 (Linux; U; Android 4.0.1; en-us; Galaxy Nexus Build/ITL41D) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30', array(
- array('SF', 'Safari', 'Safari', '4.0', '4', '0', 'webkit'),
- array('AND', 'Android', 'Android'))),
-
- // Android - Mobile Chrome
- /*
- array('rray('Mozilla/5.0 (Linux; U; Android 4.1; en-us) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.16 Safari/534.24', array(
- array('CH', 'Chrome', 'Chrome', '11.0', '11', '0', 'webkit'),
- array('AND', 'Android', 'Android'))),
- */
- array('Mozilla/5.0 (Linux; U; Android 4.0.1; en-us; Galaxy Nexus Build/ITL41F) AppleWebKit/535.7 (KHTML, like Gecko) CrMo/16.0.912.75 Mobile Safari/535.7', array(
- array('CH', 'Chrome', 'Chrome', '16.0', '16', '0', 'webkit'),
- array('AND', 'Android', 'Android'))),
-
- // AOL / America Online Browser (treat as IE)
- array('Mozilla/4.0 (compatible; MSIE 7.0; AOL 9.5; AOLBuild 4337.43; Windows NT 5.1; .NET CLR 1.1.4322)', array(
- array('IE', 'Internet Explorer', 'IE', '7.0', '7', '0', 'ie'),
- array('WXP', 'Windows XP', 'Win XP'))),
- array('Mozilla/4.0 (compatible; MSIE 7.0; AOL 9.1; AOLBuild 4334.5009; Windows NT 5.1; GTB5; .NET CLR 1.1.4322)', array(
- array('IE', 'Internet Explorer', 'IE', '7.0', '7', '0', 'ie'),
- array('WXP', 'Windows XP', 'Win XP'))),
- array('Mozilla/4.0 (compatible; MSIE 7.0; AOL 9.0; Windows NT 5.1; InfoPath.1)', array(
- array('IE', 'Internet Explorer', 'IE', '7.0', '7', '0', 'ie'),
- array('WXP', 'Windows XP', 'Win XP'))),
- array('Mozilla/4.0 (compatible; MSIE 6.0; AOL 8.0; Windows NT 5.1; SV1)', array(
- array('IE', 'Internet Explorer', 'IE', '6.0', '6', '0', 'ie'),
- array('WXP', 'Windows XP', 'Win XP'))),
- array('Mozilla/4.0 (compatible; MSIE 7.0; AOL 7.0; Windows NT 5.1)', array(
- array('IE', 'Internet Explorer', 'IE', '7.0', '7', '0', 'ie'),
- array('WXP', 'Windows XP', 'Win XP'))),
- array('Mozilla/4.0 (compatible; MSIE 5.5; AOL 6.0; Windows 98; Win 9x 4.90)', array(
- array('IE', 'Internet Explorer', 'IE', '5.5', '5', '5', 'ie'),
- array('WME', 'Windows Me', 'Win Me'))),
- array('Mozilla/4.0 (compatible; MSIE 5.5; AOL 5.0; Windows NT 5.0)', array(
- array('IE', 'Internet Explorer', 'IE', '5.5', '5', '5', 'ie'),
- array('W2K', 'Windows 2000', 'Win 2000'))),
- array('Mozilla/4.0 (compatible; MSIE 4.01; AOL 4.0; Windows 95)', array(
- array('IE', 'Internet Explorer', 'IE', '4.01', '4', '01', 'ie'),
- array('W95', 'Windows 95', 'Win 95'))),
- array('Mozilla/4.0 (compatible; MSIE 7.0; America Online Browser 1.1; Windows NT 5.1; (R1 1.5); .NET CLR 2.0.50727; InfoPath.1)', array(
- array('IE', 'Internet Explorer', 'IE', '7.0', '7', '0', 'ie'),
- array('WXP', 'Windows XP', 'Win XP'))),
- array('Mozilla/4.0 (compatible; MSIE 6.0; America Online Browser 1.1; Windows 98)', array(
- array('IE', 'Internet Explorer', 'IE', '6.0', '6', '0', 'ie'),
- array('W98', 'Windows 98', 'Win 98'))),
-
- // Arora
- array('Mozilla/5.0 (X11; U; Linux; de-DE) AppleWebKit/527+ (KHTML, like Gecko, Safari/419.3) Arora/0.8.0', array(
- array('AR', 'Arora', 'Arora', '0.8', '0', '8', 'webkit'),
- array('LIN', 'Linux', 'Linux'))),
- array('Mozilla/5.0 (X11; U; Linux; en-US) AppleWebKit/527+ (KHTML, like Gecko, Safari/419.3) Arora/0.6', array(
- array('AR', 'Arora', 'Arora', '0.6', '0', '6', 'webkit'),
- array('LIN', 'Linux', 'Linux'))),
- array('Mozilla/5.0 (Windows; U; Windows NT 5.2; pt-BR) AppleWebKit/527+ (KHTML, like Gecko, Safari/419.3) Arora/0.4 (Change: )', array(
- array('AR', 'Arora', 'Arora', '0.4', '0', '4', 'webkit'),
- array('WS3', 'Windows Server 2003 / XP x64', 'Win S2003'))),
- array('Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN) AppleWebKit/523.15 (KHTML, like Gecko, Safari/419.3) Arora/0.3 (Change: 287 c9dfb30)', array(
- array('AR', 'Arora', 'Arora', '0.3', '0', '3', 'webkit'),
- array('WXP', 'Windows XP', 'Win XP'))),
- array('Mozilla/5.0 (X11; U; Linux; en-US) AppleWebKit/523.15 (KHTML, like Gecko, Safari/419.3) Arora/0.2 (Change: 189 35c14e0)', array(
- array('AR', 'Arora', 'Arora', '0.2', '0', '2', 'webkit'),
- array('LIN', 'Linux', 'Linux'))),
-
- // Avant (treat as IE)
- array('Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Avant Browser; .NET CLR 2.0.50727; MAXTHON 2.0)', array(
- array('IE', 'Internet Explorer', 'IE', '7.0', '7', '0', 'ie'),
- array('WXP', 'Windows XP', 'Win XP'))),
- array('Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; Avant Browser; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0)', array(
- array('IE', 'Internet Explorer', 'IE', '8.0', '8', '0', 'ie'),
- array('WI7', 'Windows 7', 'Win 7'))),
-
- // AWeb
- array('Amiga-AWeb/3.5.07 beta', array(
- array('AW', 'Amiga AWeb', 'AWeb', '3.5', '3', '5', 'unknown'),
- array('AMI', 'AmigaOS', 'AmigaOS'))),
- array('Mozilla/6.0; (Spoofed by Amiga-AWeb/3.5.07 beta)', array(
- array('AW', 'Amiga AWeb', 'AWeb', '3.5', '3', '5', 'unknown'),
- array('AMI', 'AmigaOS', 'AmigaOS'))),
- array('MSIE/6.0; (Spoofed by Amiga-AWeb/3.4APL)', array(
- array('AW', 'Amiga AWeb', 'AWeb', '3.4', '3', '4', 'unknown'),
- array('AMI', 'AmigaOS', 'AmigaOS'))),
-
- // Beonex
- array('Mozilla/5.0 (Windows; U; WinNT; en; rv:1.0.2) Gecko/20030311 Beonex/0.8.2-stable', array(
- array('BE', 'Beonex', 'Beonex', '0.8', '0', '8', 'unknown'),
- array('WNT', 'Windows NT', 'Win NT'))),
- array('Mozilla/5.0 (Windows; U; WinNT; en; Preview) Gecko/20020603 Beonex/0.8-stable', array(
- array('BE', 'Beonex', 'Beonex', '0.8', '0', '8', 'unknown'),
- array('WNT', 'Windows NT', 'Win NT'))),
-
- // BlackBerry
- array('BlackBerry8700/4.1.0 Profile/MIDP-2.0 Configuration/CLDC-1.1', array(
- array('BB', 'BlackBerry', 'BlackBerry', '4.1', '4', '1', 'webkit'),
- array('BLB', 'BlackBerry', 'BlackBerry'))),
-
- array('Mozilla/5.0 (BlackBerry; U; BlackBerry 9800; en) AppleWebKit/534.1+ (KHTML, Like Gecko) Version/6.0.0.141 Mobile Safari/534.1+', array(
- array('BB', 'BlackBerry', 'BlackBerry', '6.0', '6', '0', 'webkit'),
- array('BLB', 'BlackBerry', 'BlackBerry'))),
-
- array('Mozilla/5.0 (PlayBook; U; RIM Tablet OS 1.0.0; en-US) AppleWebKit/534.11+ (KHTML, like Gecko) Version/0.0.1 Safari/534.11+', array(
- array('BP', 'PlayBook', 'PlayBook', '0.0', '0', '0', 'webkit'),
- array('QNX', 'QNX', 'QNX'))),
-
- // BrowseX
- array('Mozilla/4.61 [en] (X11; U; ) - BrowseX (2.0.0 Windows)', array(
- array('BX', 'BrowseX', 'BrowseX', '2.0', '2', '0', 'unknown'),
- false)),
-
- // Camino (formerly known as Chimera; not to be confused with another browser also named Chimera)
- array('Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en; rv:1.9.0.8pre) Gecko/2009022800 Camino/2.0b3pre', array(
- array('CA', 'Camino', 'Camino', '2.0', '2', '0', 'gecko'),
- array('MAC', 'Mac OS', 'Mac OS'))),
- array('Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en; rv:1.9.0.10pre) Gecko/2009041800 Camino/2.0b3pre (like Firefox/3.0.10pre)', array(
- array('CA', 'Camino', 'Camino', '2.0', '2', '0', 'gecko'),
- array('MAC', 'Mac OS', 'Mac OS'))),
- array('Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en; rv:1.8.1.4pre) Gecko/20070511 Camino/1.6pre', array(
- array('CA', 'Camino', 'Camino', '1.6', '1', '6', 'gecko'),
- array('MAC', 'Mac OS', 'Mac OS'))),
- array('Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en; rv:1.8.1.6) Gecko/20070809 Firefox/2.0.0.6 Camino/1.5.1', array(
- array('CA', 'Camino', 'Camino', '1.5', '1', '5', 'gecko'),
- array('MAC', 'Mac OS', 'Mac OS'))),
- array('Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.0.1) Gecko/20030306 Camino/0.7', array(
- array('CA', 'Camino', 'Camino', '0.7', '0', '7', 'gecko'),
- array('MAC', 'Mac OS', 'Mac OS'))),
- array('Mozilla/5.0 (Macintosh; U; PPC Mac OS X; pl-PL; rv:1.0.1) Gecko/20021111 Chimera/0.6', array(
- array('CA', 'Camino', 'Camino', '0.6', '0', '6', 'gecko'),
- array('MAC', 'Mac OS', 'Mac OS'))),
-
- // Cheshire
- array('Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/418.8 (KHTML, like Gecko, Safari) Cheshire/1.0.UNOFFICIAL', array(
- array('CS', 'Cheshire', 'Cheshire', '1.0', '1', '0', 'webkit'),
- array('MAC', 'Mac OS', 'Mac OS'))),
- array('Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/419 (KHTML, like Gecko, Safari/419.3) Cheshire/1.0.ALPHA', array(
- array('CS', 'Cheshire', 'Cheshire', '1.0', '1', '0', 'webkit'),
- array('MAC', 'Mac OS', 'Mac OS'))),
- array('Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/418.9 (KHTML, like Safari) Cheshire/1.0.ALPHA', array(
- array('CS', 'Cheshire', 'Cheshire', '1.0', '1', '0', 'webkit'),
- array('MAC', 'Mac OS', 'Mac OS'))),
-
- // Chrome / Chromium
- array('Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US) AppleWebKit/532.9 (KHTML, like Gecko) Chrome/5.0.310.0 Safari/532.9', array(
- array('CH', 'Chrome', 'Chrome', '5.0', '5', '0', 'webkit'),
- array('WS3', 'Windows Server 2003 / XP x64', 'Win S2003'))),
- array('Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.19 (KHTML, like Gecko) Chrome/1.0.154.48 Safari/525.19', array(
- array('CH', 'Chrome', 'Chrome', '1.0', '1', '0', 'webkit'),
- array('WXP', 'Windows XP', 'Win XP'))),
- array('Mozilla/5.0 (Linux; U; en-US) AppleWebKit/525.13 (KHTML, like Gecko) Chrome/0.2.149.27 Safari/525.13', array(
- array('CH', 'Chrome', 'Chrome', '0.2', '0', '2', 'webkit'),
- array('LIN', 'Linux', 'Linux'))),
- array('Mozilla/5.0 (Windows NT 6.0; WOW64) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.16 Safari/534.24', array(
- array('CH', 'Chrome', 'Chrome', '11.0', '11', '0', 'webkit'),
- array('WVI', 'Windows Vista', 'Win Vista'))),
- array('Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.16 Safari/534.24', array(
- array('CH', 'Chrome', 'Chrome', '11.0', '11', '0', 'webkit'),
- array('LIN', 'Linux', 'Linux'))),
-
- // Chrome Frame
- array('Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; chromeframe/11.0.660.0)', array(
- array('CF', 'Chrome Frame', 'Chrome Frame', '11.0', '11', '0', 'webkit'),
- array('WXP', 'Windows XP', 'Win XP'))),
- array('Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) chromeframe/11.0.660.0', array(
- array('CF', 'Chrome Frame', 'Chrome Frame', '11.0', '11', '0', 'webkit'),
- array('WXP', 'Windows XP', 'Win XP'))),
- array('Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; chromeframe/11.0.660.0) AppleWebKit/534.18 (KHTML, like Gecko) Chrome/11.0.660.0 Safari/534.18', array(
- array('CF', 'Chrome Frame', 'Chrome Frame', '11.0', '11', '0', 'webkit'),
- array('WXP', 'Windows XP', 'Win XP'))),
- array('Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/534.18 (KHTML, like Gecko) Chrome/11.0.660.0 Safari/534.18', array(
- array('CH', 'Chrome', 'Chrome', '11.0', '11', '0', 'webkit'),
- array('WXP', 'Windows XP', 'Win XP'))),
-
- // ChromePlus (treat as Chrome)
- array('Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.2 (KHTML, like Gecko) ChromePlus/4.0.222.3 Chrome/4.0.222.3 Safari/532.2', array(
- array('CH', 'Chrome', 'Chrome', '4.0', '4', '0', 'webkit'),
- array('WXP', 'Windows XP', 'Win XP'))),
- array('Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.28.3 (KHTML, like Gecko) Version/3.2.3 ChromePlus/4.0.222.3 Chrome/4.0.222.3 Safari/525.28.3', array(
- array('CH', 'Chrome', 'Chrome', '3.2', '3', '2', 'webkit'),
- array('WXP', 'Windows XP', 'Win XP'))),
-
- // CometBird
- array('Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.5) Gecko/2009011615 Firefox/3.0.5 CometBird/3.0.5', array(
- array('CO', 'CometBird', 'CometBird', '3.0', '3', '0', 'gecko'),
- array('WXP', 'Windows XP', 'Win XP'))),
-
- // Crazy Browser (treat as IE)
- array('Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; InfoPath.2; .NET CLR 2.0.50727; .NET CLR 1.1.4322; Crazy Browser 3.0.0 Beta2)', array(
- array('IE', 'Internet Explorer', 'IE', '7.0', '7', '0', 'ie'),
- array('WXP', 'Windows XP', 'Win XP'))),
- array('Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Avant Browser; .NET CLR 2.0.50727; .NET CLR 3.0.04506.590; .NET CLR 3.5.20706; Crazy Browser 2.0.1)', array(
- array('IE', 'Internet Explorer', 'IE', '7.0', '7', '0', 'ie'),
- array('WXP', 'Windows XP', 'Win XP'))),
-
- // Dillo
- array('Dillo/2.0', array(
- array('DI', 'Dillo', 'Dillo', '2.0', '2', '0', 'unknown'),
- false)),
- array('Dillo/0.6.4', array(
- array('DI', 'Dillo', 'Dillo', '0.6', '0', '6', 'unknown'),
- false)),
-
- // Dolfin (or Dolphin, depending on which Samsung documentation you read); and yes, it's "bada" (lower-case)
- array('Mozilla/5.0 (SAMSUNG; SAMSUNG-GT-S5250/S5250AIJI3; U; Bada/1.0; it-it) AppleWebKit/533.1 (KHTML, like Gecko) Dolfin/2.0 Mobile WQVGA SMM-MMS/1.2.0 NexPlayer/3.0 profile/MIDP-2.1 configuration/CLDC-1.1 OPN-B', array(
- array('DF', 'Dolfin', 'Dolfin', '2.0', '2', '0', 'webkit'),
- array('SBA', 'bada', 'bada'))),
- array('Mozilla/5.0 (SAMSUNG; SAMSUNG-GT-S8530/S8530XXJKA; U; Bada/1.2; en-us) AppleWebKit/533.1 (KHTML, like Gecko) Dolfin/2.2 Mobile WVGA SMM-MMS/1.2.0 OPN-B', array(
- array('DF', 'Dolfin', 'Dolfin', '2.2', '2', '2', 'webkit'),
- array('SBA', 'bada', 'bada'))),
-
- // ELinks
- array('ELinks/0.12~pre2.dfsg0-1ubuntu1-lite (textmode; Debian; Linux 2.6.32-4-jolicloud i686; 143x37-2)', array(
- array('EL', 'ELinks', 'ELinks', '0.12', '0', '12', 'unknown'),
- array('LIN', 'Linux', 'Linux'))),
- array('ELinks/0.12pre5.GIT (textmode; CYGWIN_NT-6.1 1.7.1(0.218/5/3) i686; 80x24-2)', array(
- array('EL', 'ELinks', 'ELinks', '0.12', '0', '12', 'unknown'),
- array('WI7', 'Windows 7', 'Win 7'))),
- array('ELinks (0.4.3; NetBSD 3.0.2_PATCH sparc64; 141x19)', array(
- array('EL', 'ELinks', 'ELinks', '0.4', '0', '4', 'unknown'),
- array('NBS', 'NetBSD', 'NetBSD'))),
-
- // Epiphany
- array('Mozilla/5.0 (X11; U; Linux i686; en-us) AppleWebKit/531.2+ (KHTML, like Gecko) Safari/531.2+ Epiphany/2.29.5', array(
- array('EP', 'Epiphany', 'Epiphany', '2.29', '2', '29', 'webkit'),
- array('LIN', 'Linux', 'Linux'))),
- array('Mozilla/5.0 (X11; U; Linux i686; en; rv:1.9.0.11) Gecko/20080528 Epiphany/2.22 Firefox/3.0', array(
- // technically, this should be 'gecko' but UserAgentParser only supports one browserType (family) per browser
- array('EP', 'Epiphany', 'Epiphany', '2.22', '2', '22', 'webkit'),
- array('LIN', 'Linux', 'Linux'))),
-
- // Fennec
- array('Mozilla/5.0 (Android; Linux armv7l; rv:2.0.1) Gecko/20100101 Firefox/4.0.1 Fennec/2.0.1', array(
- array('FE', 'Fennec', 'Fennec', '2.0', '2', '0', 'gecko'),
- array('AND', 'Android', 'Android'))),
- array('Mozilla/5.0 (Maemo; Linux armv7l; rv2.0.1) Gecko/20100101 Firefox/4.0.1 Fennec/2.0.1', array(
- array('FE', 'Fennec', 'Fennec', '2.0', '2', '0', 'gecko'),
- array('MAE', 'Maemo', 'Maemo'))),
- array('Mozilla/5.0 (X11; Linux i686; rv2.0.1) Gecko/20100101 Firefox/4.0.1 Fennec/2.0.1', array(
- array('FE', 'Fennec', 'Fennec', '2.0', '2', '0', 'gecko'),
- array('LIN', 'Linux', 'Linux'))),
- array('Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2a1pre) Gecko/20090626 Fennec/1.0b2', array(
- array('FE', 'Fennec', 'Fennec', '1.0', '1', '0', 'gecko'),
- array('MAC', 'Mac OS', 'Mac OS'))),
- array('Mozilla/5.0 (X11; U; Linux armv6l; en-US; rv:1.9.1b1pre) Gecko/20081005220218 Gecko/2008052201 Fennec/0.9pre', array(
- array('FE', 'Fennec', 'Fennec', '0.9', '0', '9', 'gecko'),
- array('LIN', 'Linux', 'Linux'))),
- array('Mozilla/5.0 (X11; U; Linux armv6l; en-US; rv:1.9.1a1pre) Gecko/2008071707 Fennec/0.5', array(
- array('FE', 'Fennec', 'Fennec', '0.5', '0', '5', 'gecko'),
- array('LIN', 'Linux', 'Linux'))),
-
- // Firefox (formerly Firebird, formerly Phoenix; and rebranded versions)
- array('Mozilla/5.0 (X11; Linux i686; rv:5.0a2) Gecko/20110413 Firefox/5.0a2', array(
- array('FF', 'Firefox', 'Firefox', '5.0', '5', '0', 'gecko'),
- array('LIN', 'Linux', 'Linux'))),
- array('Mozilla/5.0 (Windows NT 6.1; rv:2.0.1) Gecko/20100101 Firefox/4.0.1', array(
- array('FF', 'Firefox', 'Firefox', '4.0', '4', '0', 'gecko'),
- array('WI7', 'Windows 7', 'Win 7'))),
- array('Mozilla/5.0 (X11; U; Linux i686; en-US; rv:2.0a1pre) Gecko/2008060602 Minefield/4.0a1pre', array(
- array('FF', 'Firefox', 'Firefox', '4.0', '4', '0', 'gecko'),
- array('LIN', 'Linux', 'Linux'))),
- array('Mozilla/5.0 (X11; U; Linux i686; en-US; rv:2.0a1pre) Gecko/2008060602 Minefield/4.0a1p', array(
- array('FF', 'Firefox', 'Firefox', '4.0', '4', '0', 'gecko'),
- array('LIN', 'Linux', 'Linux'))),
- array('Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2a2pre) Gecko/20090826 Namoroka/3.6a2pre', array(
- array('FF', 'Firefox', 'Firefox', '3.6', '3', '6', 'gecko'),
- array('WVI', 'Windows Vista', 'Win Vista'))),
- array('Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2) Gecko/20100119 Namoroka/3.6', array(
- array('FF', 'Firefox', 'Firefox', '3.6', '3', '6', 'gecko'),
- array('WI7', 'Windows 7', 'Win 7'))),
- array('Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1b4pre) Gecko/20090420 Shiretoko/3.5b4pre (.NET CLR 3.5.30729)', array(
- array('FF', 'Firefox', 'Firefox', '3.5', '3', '5', 'gecko'),
- array('WI7', 'Windows 7', 'Win 7'))),
- array('Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.2) Gecko/20090803 Ubuntu/9.04 (jaunty) Shiretoko/3.5.2', array(
- array('FF', 'Firefox', 'Firefox', '3.5', '3', '5', 'gecko'),
- array('LIN', 'Linux', 'Linux'))),
- array('Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.6) Gecko/2009011913 Firefox/3.0.6', array(
- array('FF', 'Firefox', 'Firefox', '3.0', '3', '0', 'gecko'),
- array('WXP', 'Windows XP', 'Win XP'))),
- array('Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9a7) Gecko/2007080210 GranParadiso/3.0a7', array(
- array('FF', 'Firefox', 'Firefox', '3.0', '3', '0', 'gecko'),
- array('WVI', 'Windows Vista', 'Win Vista'))),
- array('Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.1) Gecko/2008072716 IceCat/3.0.1-g1', array(
- array('FF', 'Firefox', 'Firefox', '3.0', '3', '0', 'gecko'),
- array('LIN', 'Linux', 'Linux'))),
- array('Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.1) Gecko/2008071420 Iceweasel/3.0.1 (Debian-3.0.1-1)', array(
- array('FF', 'Firefox', 'Firefox', '3.0', '3', '0', 'gecko'),
- array('LIN', 'Linux', 'Linux'))),
- array('Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1b2) Gecko/20060821 BonEcho/2.0b2', array(
- array('FF', 'Firefox', 'Firefox', '2.0', '2', '0', 'gecko'),
- array('LIN', 'Linux', 'Linux'))),
- array('Mozilla/5.0 (X11; U; Darwin Power Macintosh; en-US; rv:1.8.0.12) Gecko/20070803 Firefox/1.5.0.12 Fink Community Edition', array(
- array('FF', 'Firefox', 'Firefox', '1.5', '1', '5', 'gecko'),
- array('MAC', 'Mac OS', 'Mac OS'))),
- array('Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6b) Gecko/20031212 Firebird/0.7+', array(
- array('FB', 'Firebird', 'Firebird', '0.7', '0', '7', 'gecko'),
- array('WXP', 'Windows XP', 'Win XP'))),
- array('Mozilla/5.0 (Windows; U; Win98; de-DE; rv:1.4b) Gecko/20030516 Mozilla Firebird/0.6', array(
- array('FB', 'Firebird', 'Firebird', '0.6', '0', '6', 'gecko'),
- array('W98', 'Windows 98', 'Win 98'))),
- array('Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.3a) Gecko/20021207 Phoenix/0.5', array(
- array('PX', 'Phoenix', 'Phoenix', '0.5', '0', '5', 'gecko'),
- array('WNT', 'Windows NT', 'Win NT'))),
- array('Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.2b) Gecko/20020923 Phoenix/0.1', array(
- array('PX', 'Phoenix', 'Phoenix', '0.1', '0', '1', 'gecko'),
- array('WXP', 'Windows XP', 'Win XP'))),
- array('Mozilla/5.0 (Nintendo DS v4; U; M3 Adapter CF + PassMe2; en-US; rv:1.8.0.6 ) Gecko/20060728 Firefox/1.5.0.6 (firefox.gba.ds)', array(
- array('FF', 'Firefox', 'Firefox', '1.5', '1', '5', 'gecko'),
- array('NDS', 'Nintendo DS', 'DS'))),
- array('Mozilla/5.0 (Android; Mobile; rv:15.0) Gecko/15.0 Firefox/15.0a1', array(
- array('FF', 'Firefox', 'Firefox', '15.0', '15', '0', 'gecko'),
- array('AND', 'Android', 'Android'))),
-
- // Flock
- array('Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/532.5 (KHTML, like Gecko) Flock/3.0.0.3737 Chrome/4.1.249.1071 Safari/532.5', array(
- array('FL', 'Flock', 'Flock', '3.0', '3', '0', 'webkit'),
- array('WI7', 'Windows 7', 'Win 7'))),
- // pre-3.0 is actually gecko
- array('Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7 Flock/2.5.6 (.NET CLR 3.5.30729)', array(
- array('FL', 'Flock', 'Flock', '2.5', '2', '5', 'webkit'),
- array('WXP', 'Windows XP', 'Win XP'))),
- array('Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.7) Gecko/20091221 AppleWebKit/531.21.8 KHTML/4.3.5 (like Gecko) Firefox/3.5.7 Flock/2.5.6 (.NET CLR 3.5.30729)', array(
- array('FL', 'Flock', 'Flock', '2.5', '2', '5', 'webkit'),
- array('WXP', 'Windows XP', 'Win XP'))),
- array('Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.7) Gecko/20091221 AppleWebKit/531.21.8 (KHTML, like Gecko) Firefox/3.5.7 Flock/2.5.6 (.NET CLR 3.5.30729)', array(
- array('FL', 'Flock', 'Flock', '2.5', '2', '5', 'webkit'),
- array('WXP', 'Windows XP', 'Win XP'))),
- array('Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.9) Gecko/20071106 Firefox/2.0.0.9 Flock/1.0.1', array(
- array('FL', 'Flock', 'Flock', '1.0', '1', '0', 'webkit'),
- array('MAC', 'Mac OS', 'Mac OS'))),
- array('Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8.1.8) Gecko/20071101 Firefox/2.0.0.8 Flock/1.0', array(
- array('FL', 'Flock', 'Flock', '1.0', '1', '0', 'webkit'),
- array('MAC', 'Mac OS', 'Mac OS'))),
- array('Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8b5) Gecko/20051021 Flock/0.4 Firefox/1.0+', array(
- array('FL', 'Flock', 'Flock', '0.4', '0', '4', 'webkit'),
- array('MAC', 'Mac OS', 'Mac OS'))),
-
- // Fluid
- array('Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_1; nl-nl) AppleWebKit/532.3+ (KHTML, like Gecko) Fluid/0.9.6 Safari/532.3+', array(
- array('FD', 'Fluid', 'Fluid', '0.9', '0', '9', 'webkit'),
- array('MAC', 'Mac OS', 'Mac OS'))),
- array('Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.13 (KHTML, like Gecko) Fluid/0.9.4 Safari/525.13', array(
- array('FD', 'Fluid', 'Fluid', '0.9', '0', '9', 'webkit'),
- array('WXP', 'Windows XP', 'Win XP'))),
-
- // Galeon
- array('Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.8) Gecko/20090327 Galeon/2.0.7', array(
- array('GA', 'Galeon', 'Galeon', '2.0', '2', '0', 'gecko'),
- array('LIN', 'Linux', 'Linux'))),
- array('Mozilla/5.0 (X11; U; OpenBSD i386; en-US; rv:1.8.1.19) Gecko/20090701 Galeon/2.0.7', array(
- array('GA', 'Galeon', 'Galeon', '2.0', '2', '0', 'gecko'),
- array('OBS', 'OpenBSD', 'OpenBSD'))),
- array('Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.19) Gecko/20081216 Galeon/2.0.4 Firefox/2.0.0.19', array(
- array('GA', 'Galeon', 'Galeon', '2.0', '2', '0', 'gecko'),
- array('LIN', 'Linux', 'Linux'))),
- array('Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.13pre) Gecko/20080207 Galeon/2.0.1 (Ubuntu package 2.0.1-1ubuntu2) Firefox/1.5.0.13pre', array(
- array('GA', 'Galeon', 'Galeon', '2.0', '2', '0', 'gecko'),
- array('LIN', 'Linux', 'Linux'))),
- array('Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.6) Gecko/20040406 Galeon/1.3.15', array(
- array('GA', 'Galeon', 'Galeon', '1.3', '1', '3', 'gecko'),
- array('BSD', 'FreeBSD', 'FreeBSD'))),
- array('Mozilla/5.0 Galeon/1.2.9 (X11; Linux i686; U;) Gecko/20021213 Debian/1.2.9-0.bunk', array(
- array('GA', 'Galeon', 'Galeon', '1.2', '1', '2', 'gecko'),
- array('LIN', 'Linux', 'Linux'))),
- array('Mozilla/5.0 Galeon/1.0.3 (X11; Linux i686; U;) Gecko/0', array(
- array('GA', 'Galeon', 'Galeon', '1.0', '1', '0', 'gecko'),
- array('LIN', 'Linux', 'Linux'))),
-
- // Google Earth embedded browser
- array('Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/532.4 (KHTML, like Gecko) Google Earth/5.2.1.1329 Safari/532.4', array(
- array('GE', 'Google Earth', 'Google Earth', '5.2', '5', '2', 'webkit'),
- array('WI7', 'Windows 7', 'Win 7'))),
-
- // GreenBrowser (treat as IE)
- array('Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.0.04506; Media Center PC 5.0; .NET CLR 3.5.21022; GreenBrowser)', array(
- array('IE', 'Internet Explorer', 'IE', '6.0', '6', '0', 'ie'),
- array('WXP', 'Windows XP', 'Win XP'))),
- array('Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.5.30729; InfoPath.2; .NET CLR 3.0.30729; GreenBrowser)', array(
- array('IE', 'Internet Explorer', 'IE', '8.0', '8', '0', 'ie'),
- array('WVI', 'Windows Vista', 'Win Vista'))),
-
- // Hana
- array('Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/418.9 (KHTML, like Gecko) Hana/1.1', array(
- array('HA', 'Hana', 'Hana', '1.1', '1', '1', 'webkit'),
- array('MAC', 'Mac OS', 'Mac OS'))),
- array('Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/417.9 (KHTML, like Gecko) Hana/1.0', array(
- array('HA', 'Hana', 'Hana', '1.0', '1', '0', 'webkit'),
- array('MAC', 'Mac OS', 'Mac OS'))),
-
- // HotJava
- array('HotJava/1.1.2 FCS', array(
- array('HJ', 'HotJava', 'HotJava', '1.1', '1', '1', 'unknown'),
- false)),
- array('HotJava/1.0.1/JRE1.1.x', array(
- array('HJ', 'HotJava', 'HotJava', '1.0', '1', '0', 'unknown'),
- false)),
-
- // iBrowse
- array('Mozilla/5.0 (compatible; IBrowse 3.0; AmigaOS4.0)', array(
- array('IB', 'IBrowse', 'IBrowse', '3.0', '3', '0', 'unknown'),
- array('AMI', 'AmigaOS', 'AmigaOS'))),
- array('Mozilla/4.0 (compatible; IBrowse 2.3; AmigaOS4.0)', array(
- array('IB', 'IBrowse', 'IBrowse', '2.3', '2', '3', 'unknown'),
- array('AMI', 'AmigaOS', 'AmigaOS'))),
- array('IBrowse/2.4 (AmigaOS 3.9; 68K)', array(
- array('IB', 'IBrowse', 'IBrowse', '2.4', '2', '4', 'unknown'),
- array('AMI', 'AmigaOS', 'AmigaOS'))),
- array('IBrowse/2.3 (AmigaOS V51)', array(
- array('IB', 'IBrowse', 'IBrowse', '2.3', '2', '3', 'unknown'),
- array('AMI', 'AmigaOS', 'AmigaOS'))),
- array('IBrowse/2.3 (AmigaOS 4.0)', array(
- array('IB', 'IBrowse', 'IBrowse', '2.3', '2', '3', 'unknown'),
- array('AMI', 'AmigaOS', 'AmigaOS'))),
-
- // iCab
- array('iCab/4.5 (Macintosh; U; PPC Mac OS X)', array(
- array('IC', 'iCab', 'iCab', '4.5', '4', '5', 'unknown'),
- array('MAC', 'Mac OS', 'Mac OS'))),
- array('iCab/4.5 (Macintosh; U; Mac OS X Leopard 10.5.7)', array(
- array('IC', 'iCab', 'iCab', '4.5', '4', '5', 'unknown'),
- array('MAC', 'Mac OS', 'Mac OS'))),
- array('Mozilla/5.0 (compatible; iCab 3.0.5; Macintosh; U; PPC Mac OS)', array(
- array('IC', 'iCab', 'iCab', '3.0', '3', '0', 'unknown'),
- array('MAC', 'Mac OS', 'Mac OS'))),
- array('Mozilla/5.0 (compatible; iCab 3.0.5; Macintosh; U; PPC Mac OS X)', array(
- array('IC', 'iCab', 'iCab', '3.0', '3', '0', 'unknown'),
- array('MAC', 'Mac OS', 'Mac OS'))),
- array('Mozilla/5.0 (Macintosh; U; PPC Mac OS; en) iCab 3', array(
- array('IC', 'iCab', 'iCab', '3.0', '3', '0', 'unknown'),
- array('MAC', 'Mac OS', 'Mac OS'))),
- array('Mozilla/4.5 (compatible; iCab 2.7.1; Macintosh; I; PPC)', array(
- array('IC', 'iCab', 'iCab', '2.7', '2', '7', 'unknown'),
- array('MAC', 'Mac OS', 'Mac OS'))),
- array('iCab/2.9.8 (Macintosh; U; 68K)', array(
- array('IC', 'iCab', 'iCab', '2.9', '2', '9', 'unknown'),
- array('MAC', 'Mac OS', 'Mac OS'))),
- array('Lynx/2.8 (compatible; iCab 2.9.8; Macintosh; U; 68K)', array(
- array('IC', 'iCab', 'iCab', '2.9', '2', '9', 'unknown'),
- array('MAC', 'Mac OS', 'Mac OS'))),
- array('Mozilla/4/5 (compatible; iCab 2.9.8; Macintosh; U; 68K)', array(
- array('IC', 'iCab', 'iCab', '2.9', '2', '9', 'unknown'),
- array('MAC', 'Mac OS', 'Mac OS'))),
- array('Mozilla/4.0 (compatible; MSIE 5.0; Mac_PowerPC)', array(
- array('IE', 'Internet Explorer', 'IE', '5.0', '5', '0', 'ie'),
- array('MAC', 'Mac OS', 'Mac OS'))),
- array('Mozilla/4.76 (Macintosh; I; PPC)', array(
- array('NS', 'Netscape', 'Netscape', '4.76', '4', '76', 'gecko'),
- array('MAC', 'Mac OS', 'Mac OS'))),
-
- // Internet Explorer
- array('Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0; Xbox)', array(
- array('IE', 'Internet Explorer', 'IE', '9.0', '9', '0', 'ie'),
- array('XBX', 'Xbox', 'Xbox'))),
- array('Mozilla/5.0 (compatible; MSIE 9.0; Windows Phone OS 7.5; Trident/5.0; IEMobile/9.0; Xbox)', array(
- array('IE', 'Internet Explorer', 'IE', '9.0', '9', '0', 'ie'),
- array('XBX', 'Xbox', 'Xbox'))),
- array('Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Win64; x64; Trident/6.0)', array(
- array('IE', 'Internet Explorer', 'IE', '10.0', '10', '0', 'ie'),
- array('WI8', 'Windows 8', 'Win 8'))),
- array('Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0)', array(
- array('IE', 'Internet Explorer', 'IE', '10.0', '10', '0', 'ie'),
- array('WI7', 'Windows 7', 'Win 7'))),
- array('Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Trident/6.0)', array(
- array('IE', 'Internet Explorer', 'IE', '10.0', '10', '0', 'ie'),
- array('WI7', 'Windows 7', 'Win 7'))),
- array('Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)', array(
- array('IE', 'Internet Explorer', 'IE', '9.0', '9', '0', 'ie'),
- array('WI7', 'Windows 7', 'Win 7'))),
- array('Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; Trident/5.0)', array(
- array('IE', 'Internet Explorer', 'IE', '9.0', '9', '0', 'ie'),
- array('WVI', 'Windows Vista', 'Win Vista'))),
- array('Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET CLR 3.0.04506; .NET CLR 3.5.21022; InfoPath.2; SLCC1; Zune 3.0)', array(
- array('IE', 'Internet Explorer', 'IE', '8.0', '8', '0', 'ie'),
- array('WI7', 'Windows 7', 'Win 7'))),
- array('Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0)', array(
- array('IE', 'Internet Explorer', 'IE', '8.0', '8', '0', 'ie'),
- array('WVI', 'Windows Vista', 'Win Vista'))),
- array('Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; Trident/4.0)', array(
- array('IE', 'Internet Explorer', 'IE', '8.0', '8', '0', 'ie'),
- array('WVI', 'Windows Vista', 'Win Vista'))),
- array('Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0)', array(
- array('IE', 'Internet Explorer', 'IE', '8.0', '8', '0', 'ie'),
- array('WXP', 'Windows XP', 'Win XP'))),
- array('Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648)', array(
- array('IE', 'Internet Explorer', 'IE', '6.0', '6', '0', 'ie'),
- array('WXP', 'Windows XP', 'Win XP'))),
- array('Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)', array(
- array('IE', 'Internet Explorer', 'IE', '6.0', '6', '0', 'ie'),
- array('WS3', 'Windows Server 2003 / XP x64', 'Win S2003'))),
- array('Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; WOW64; SV1; .NET CLR 2.0.50727)', array(
- array('IE', 'Internet Explorer', 'IE', '6.0', '6', '0', 'ie'),
- array('WS3', 'Windows Server 2003 / XP x64', 'Win S2003'))),
- array('Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; Win64; x64; SV1; .NET CLR 2.0.50727)', array(
- array('IE', 'Internet Explorer', 'IE', '6.0', '6', '0', 'ie'),
- array('WS3', 'Windows Server 2003 / XP x64', 'Win S2003'))),
-
- // IE Mobile
- array('Mozilla/5.0 (compatible; MSIE 9.0; Windows Phone OS 7.5; Trident/5.0; IEMobile/9.0; SAMSUNG; SGH-i917)', array(
- array('IE', 'Internet Explorer', 'IE', '9.0', '9', '0', 'ie'),
- array('WPH', 'Windows Phone OS', 'WinPhone'))),
- array('Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; XBLWP7; ZuneWP7)', array(
- array('IE', 'Internet Explorer', 'IE', '7.0', '7', '0', 'ie'),
- array('WPH', 'Windows Phone OS', 'WinPhone'))),
- array('Mozilla/4.0 (compatible; MSIE 7.0; Windows Phone OS 7.0; Trident/3.1; IEMobile/7.0; DeviceManufacturer; DeviceModel)', array(
- array('IE', 'Internet Explorer', 'IE', '7.0', '7', '0', 'ie'),
- array('WPH', 'Windows Phone OS', 'WinPhone'))),
- array('Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; IEMobile 7.11)', array(
- array('IE', 'Internet Explorer', 'IE', '6.0', '6', '0', 'ie'),
- array('WMO', 'Windows Mobile', 'WinMo'))),
- array('Mozilla/4.0 (compatible; MSIE 4.01; Windows CE; PPC; 240x320)', array(
- array('IE', 'Internet Explorer', 'IE', '4.01', '4', '01', 'ie'),
- array('WCE', 'Windows CE', 'Win CE'))),
-
- // Internet Explorer with misbehaving Google Tool Bar
- array('Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; GTB6.5; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)', array(
- array('IE', 'Internet Explorer', 'IE', '8.0', '8', '0', 'ie'),
- array('WXP', 'Windows XP', 'Win XP'))),
- array('Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; GTB0.0; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)', array(
- array('IE', 'Internet Explorer', 'IE', '8.0', '8', '0', 'ie'),
- array('WXP', 'Windows XP', 'Win XP'))),
-
- // Iron
- array('Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/531.0 (KHTML, like Gecko) Iron/3.0.189.0 Safari/531.0', array(
- array('IR', 'Iron', 'Iron', '3.0', '3', '0', 'webkit'),
- array('WI7', 'Windows 7', 'Win 7'))),
-
- // K-Meleon
- array('Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.21) Gecko/20090331 K-Meleon/1.5.3', array(
- array('KM', 'K-Meleon', 'K-Meleon', '1.5', '1', '5', 'gecko'),
- array('LIN', 'Linux', 'Linux'))),
- array('Mozilla/5.0 (Darwin; FreeBSD 5.6; en-GB; rv:1.8.1.17pre) Gecko/20080716 K-Meleon/1.5.0', array(
- array('KM', 'K-Meleon', 'K-Meleon', '1.5', '1', '5', 'gecko'),
- array('MAC', 'Mac OS', 'Mac OS'))),
- array('Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.2b) Gecko/20021016 K-Meleon 0.7', array(
- array('KM', 'K-Meleon', 'K-Meleon', '0.7', '0', '7', 'gecko'),
- array('WNT', 'Windows NT', 'Win NT'))),
-
- // Kapiko
- array('Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9.0.1) Gecko/20080722 Firefox/3.0.1 Kapiko/3.0', array(
- array('KP', 'Kapiko', 'Kapiko', '3.0', '3', '0', 'gecko'),
- array('WXP', 'Windows XP', 'Win XP'))),
-
- // Kazehakase
- array('Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.11) Gecko Kazehakase/0.5.4 Debian/0.5.4-2.1ubuntu3', array(
- array('KZ', 'Kazehakase', 'Kazehakase', '0.5', '0', '5', 'gecko'),
- array('LIN', 'Linux', 'Linux'))),
- array('Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.13) Gecko/20080311 (Debian-1.8.1.13+nobinonly-0ubuntu1) Kazehakase/0.5.2', array(
- array('KZ', 'Kazehakase', 'Kazehakase', '0.5', '0', '5', 'gecko'),
- array('LIN', 'Linux', 'Linux'))),
- array('Mozilla/5.0 (X11; Linux x86_64; U;) Gecko/20060207 Kazehakase/0.3.5 Debian/0.3.5-1', array(
- array('KZ', 'Kazehakase', 'Kazehakase', '0.3', '0', '3', 'gecko'),
- array('LIN', 'Linux', 'Linux'))),
-
- // KKMAN (treat as IE)
- array('Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; KKMAN3.2)', array(
- array('IE', 'Internet Explorer', 'IE', '7.0', '7', '0', 'ie'),
- array('WXP', 'Windows XP', 'Win XP'))),
-
- // Konqueror
- array('Mozilla/5.0 (compatible; Konqueror/4.0; Linux) KHTML/4.0.5 (like Gecko)', array(
- array('KO', 'Konqueror', 'Konqueror', '4.0', '4', '0', 'khtml'),
- array('LIN', 'Linux', 'Linux'))),
- array('Mozilla/5.0 (compatible; Konqueror/4.0; Microsoft Windows) KHTML/4.0.80 (like Gecko)', array(
- array('KO', 'Konqueror', 'Konqueror', '4.0', '4', '0', 'khtml'),
- false)),
- array('Mozilla/5.0 (compatible; Konqueror/3.5; GNU/kFreeBSD) KHTML/3.5.9 (like Gecko) (Debian)', array(
- array('KO', 'Konqueror', 'Konqueror', '3.5', '3', '5', 'khtml'),
- array('BSD', 'FreeBSD', 'FreeBSD'))),
- array('Mozilla/5.0 (compatible; Konqueror/2.1.1; X11)', array(
- array('KO', 'Konqueror', 'Konqueror', '2.1', '2', '1', 'khtml'),
- false)),
-
- // Links
- array('Links', array(
- false,
- false)),
- array('Links (2.1pre31; Linux 2.6.21-omap1 armv6l; x)', array(
- array('LI', 'Links', 'Links', '2.1', '2', '1', 'unknown'),
- array('LIN', 'Linux', 'Linux'))),
- array('Links (0.99; OS/2 1 i386; 80x33)', array(
- array('LI', 'Links', 'Links', '0.99', '0', '99', 'unknown'),
- array('OS2', 'OS/2', 'OS/2'))),
-
- // Lunascape (identity crisis)
- array('Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1) Gecko/20090701 Firefox/3.5 Lunascape/5.1.2.3', array(
- array('FF', 'Firefox', 'Firefox', '3.5', '3', '5', 'gecko'),
- array('WVI', 'Windows Vista', 'Win Vista'))),
- array('Mozilla/5.0 (Windows; U; ; cs-CZ) AppleWebKit/532+ (KHTML, like Gecko, Safari/532.0) Lunascape/5.1.2.3', array(
- array('SF', 'Safari', 'Safari', '4.0', '4', '0', 'webkit'),
- false)),
- array('Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; InfoPath.1; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Lunascape 5.1.2.3)', array(
- array('IE', 'Internet Explorer', 'IE', '6.0', '6', '0', 'ie'),
- array('WXP', 'Windows XP', 'Win XP'))),
-
- // Lynx
- array('Lynx (textmode)', array(
- false,
- false)),
- array('Lynx/2.8.7dev.9 libwww-FM/2.14', array(
- array('LX', 'Lynx', 'Lynx', '2.8', '2', '8', 'unknown'),
- false)),
-
- // Maxathon (treat as IE)
- array('Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; SV1; Maxthon; .NET CLR 1.1.4322)', array(
- array('IE', 'Internet Explorer', 'IE', '7.0', '7', '0', 'ie'),
- array('WXP', 'Windows XP', 'Win XP'))),
-
- // Midori
- array('Midori/0.1.9 (X11; Linux i686; U; fr-fr) WebKit/532+', array(
- array('MI', 'Midori', 'Midori', '0.1', '0', '1', 'webkit'),
- array('LIN', 'Linux', 'Linux'))),
- array('Mozilla/5.0 (X11; U; Linux; pt-br) AppleWebKit/531+ (KHTML, like Gecko) Safari/531.2+ Midori/0.3', array(
- array('MI', 'Midori', 'Midori', '0.3', '0', '3', 'webkit'),
- array('LIN', 'Linux', 'Linux'))),
-
- // Mozilla Suite
- array('Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.7) Gecko/20070606', array(
- array('MO', 'Mozilla', 'Mozilla', '1.7', '1', '7', 'gecko'),
- array('SOS', 'SunOS', 'SunOS'))),
- array('Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050927 Debian/1.7.8-1sarge3', array(
- array('MO', 'Mozilla', 'Mozilla', '1.7', '1', '7', 'gecko'),
- array('LIN', 'Linux', 'Linux'))),
-
- // NCSA Mosaic
- array('PATHWORKS Mosaic/1.0 libwww/2.15_Spyglass', array(
- array('MC', 'NCSA Mosaic', 'Mosaic', '1.0', '1', '0', 'unknown'),
- false)),
- array('WinMosaic/Version 2.0 (ALPHA 2)', array(
- array('MC', 'NCSA Mosaic', 'Mosaic', '2.0', '2', '0', 'unknown'),
- false)),
- array('VMS_Mosaic/3.8-1 (Motif;OpenVMS V7.3-2 DEC 3000 - M700) libwww/2.12_Mosaic', array(
- array('MC', 'NCSA Mosaic', 'Mosaic', '3.8', '3', '8', 'unknown'),
- array('VMS', 'OpenVMS', 'OpenVMS'))),
- array('Mosaic from Digital/1.02_Win32', array(
- array('MC', 'NCSA Mosaic', 'Mosaic', '1.02', '1', '02', 'unknown'),
- array('W95', 'Windows 95', 'Win 95'))),
- array('NCSA Mosaic/2.0.0b4 (Windows AXP)', array(
- array('MC', 'NCSA Mosaic', 'Mosaic', '2.0', '2', '0', 'unknown'),
- false)),
- array('NCSA_Mosaic/2.7b5 (X11;Linux 2.6.7 i686) libwww/2.12 modified', array(
- array('MC', 'NCSA Mosaic', 'Mosaic', '2.7', '2', '7', 'unknown'),
- array('LIN', 'Linux', 'Linux'))),
- array('mMosaic/3.6.6 (X11;SunOS 5.8 sun4m)', array(
- array('MC', 'NCSA Mosaic', 'Mosaic', '3.6', '3', '6', 'unknown'),
- array('SOS', 'SunOS', 'SunOS'))),
-
- // Netscape Navigator (9.x)
- array('Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.8pre) Gecko/20071015 Firefox/2.0.0.7 Navigator/9.0', array(
- array('NS', 'Netscape', 'Netscape', '9.0', '9', '0', 'gecko'),
- array('LIN', 'Linux', 'Linux'))),
- array('Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20070321 Netscape/9.0', array(
- array('NS', 'Netscape', 'Netscape', '9.0', '9', '0', 'gecko'),
- array('LIN', 'Linux', 'Linux'))),
-
- // Netscape (6.x - 8.x)
- array('Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20070321 Netscape/8.1.3', array(
- array('NS', 'Netscape', 'Netscape', '8.1', '8', '1', 'gecko'),
- array('LIN', 'Linux', 'Linux'))),
- array('Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.2) Gecko/20040804 Netscape/7.2 (ax)', array(
- array('NS', 'Netscape', 'Netscape', '7.2', '7', '2', 'gecko'),
- array('WXP', 'Windows XP', 'Win XP'))),
- array('Mozilla/5.0 (X11; U; OSF1 alpha; en-US; rv:0.9.4.1) Gecko/20020517 Netscape6/6.2.3', array(
- array('NS', 'Netscape', 'Netscape', '6.2', '6', '2', 'gecko'),
- array('T64', 'Tru64', 'Tru64'))),
- array('Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.2) Gecko/20010726 Netscape6/6.1', array(
- array('NS', 'Netscape', 'Netscape', '6.1', '6', '1', 'gecko'),
- array('LIN', 'Linux', 'Linux'))),
-
- // Netscape Communicator (4.x)
- array('Mozilla/4.76C-SGI [en] (X11; I; IRIX64 6.5 IP30)', array(
- array('NS', 'Netscape', 'Netscape', '4.76', '4', '76', 'gecko'),
- array('IRI', 'IRIX', 'IRIX'))),
- array('Mozilla/4.72 [en] (X11; I; HP-UX B.11.00 9000/800)', array(
- array('NS', 'Netscape', 'Netscape', '4.72', '4', '72', 'gecko'),
- array('HPX', 'HP-UX', 'HP-UX'))),
- array('Mozilla/4.41 (BEOS; U ;Nav)', array(
- array('NS', 'Netscape', 'Netscape', '4.41', '4', '41', 'gecko'),
- array('BEO', 'BeOS', 'BeOS'))),
- array('Mozilla/4.0 (compatible; Windows NT 5.1; U; en)', array(
- array('NS', 'Netscape', 'Netscape', '4.0', '4', '0', 'gecko'),
- array('WXP', 'Windows XP', 'Win XP'))),
-
- // Netscape Navigator (up to 3.x)
- array('Mozilla/3.0 (X11; I; AIX 2)', array(
- array('NS', 'Netscape', 'Netscape', '3.0', '3', '0', 'gecko'),
- array('AIX', 'AIX', 'AIX'))),
- array('Mozilla/2.02 [fr] (WinNT; I)', array(
- array('NS', 'Netscape', 'Netscape', '2.02', '2', '02', 'gecko'),
- array('WNT', 'Windows NT', 'Win NT'))),
-
- // NetFront NX
- array('Mozilla/5.0 (Nintendo WiiU) AppleWebKit/534.52 (KHTML, like Gecko) NX/2.1.0.8.21 NintendoBrowser/1.0.0.7494.US', array(
- array('NF', 'NetFront', 'NetFront', '2.1', '2', '1', 'webkit'),
- array('WIU', 'Nintendo Wii U', 'Wii U'))),
- array('Mozilla/5.0 (Nintendo 3DS; U; ; en) Version/1.7498.US', array(
- array('NF', 'NetFront', 'NetFront', '1.7498', '1', '7498', 'webkit'),
- array('3DS', 'Nintendo 3DS', '3DS'))),
- array('Mozilla/5.0 (Playstation Vita 1.61) AppleWebKit/531.22.8 (KHTML, like Gecko) Silk/3.2', array(
- array('NF', 'NetFront', 'NetFront', '3.2', '3', '2', 'webkit'),
- array('PSV', 'PlayStation Vita', 'PS Vita'))),
-
- // Kindle
- array('Mozilla/4.0 (compatible; Linux 2.6.10) NetFront/3.3 Kindle/1.0 (screen 600x800)', array(
- array('NF', 'NetFront', 'NetFront', '3.3', '3', '3', 'webkit'),
- array('LIN', 'Linux', 'Linux'))),
- array('Mozilla/5.0 (Linux; U; Android 2.3.4; en-us; Kindle Fire Build/GINGERBREAD) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1', array(
- array('SF', 'Safari', 'Safari', '4.0', '4', '0', 'webkit'),
- array('AND', 'Android', 'Android'))),
- array('Mozilla/5.0 (Linux; U; en-US) AppleWebKit/528.5+ (KHTML, like Gecko, Safari/528.5+) Version/4.0 Kindle/3.0 (screen 600×800; rotate)', array(
- array('SF', 'Safari', 'Safari', '4.0', '4', '0', 'webkit'),
- array('LIN', 'Linux', 'Linux'))),
- array('Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-us; Silk/1.1.0-80) AppleWebKit/533.16 (KHTML, like Gecko) Version/5.0 Safari/533.16 Silk-Accelerated=true', array(
- array('SF', 'Safari', 'Safari', '5.0', '5', '0', 'webkit'),
- array('MAC', 'Mac OS', 'Mac OS'))),
-
- // Omniweb
- array('Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US) AppleWebKit/525.18 (KHTML, like Gecko, Safari/525.20) OmniWeb/v622.3.0.105198', array(
- array('OW', 'OmniWeb', 'OmniWeb', '5.8', '5', '8', 'webkit'),
- array('MAC', 'Mac OS', 'Mac OS'))),
- array('Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/522+ (KHTML, like Gecko, Safari/522) OmniWeb/v613', array(
- array('OW', 'OmniWeb', 'OmniWeb', '5.6', '5', '6', 'webkit'),
- array('MAC', 'Mac OS', 'Mac OS'))),
- array('Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/420+ (KHTML, like Gecko, Safari/420) OmniWeb/v607', array(
- array('OW', 'OmniWeb', 'OmniWeb', '5.5', '5', '5', 'webkit'),
- array('MAC', 'Mac OS', 'Mac OS'))),
- array('Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/125.4 (KHTML, like Gecko, Safari) OmniWeb/v563.34', array(
- array('OW', 'OmniWeb', 'OmniWeb', '5.1', '5', '1', 'webkit'),
- array('MAC', 'Mac OS', 'Mac OS'))),
- array('Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/85 (KHTML, like Gecko) OmniWeb/v558.36', array(
- array('OW', 'OmniWeb', 'OmniWeb', '5.0', '5', '0', 'webkit'),
- array('MAC', 'Mac OS', 'Mac OS'))),
- array('Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/85 (KHTML, like Gecko) OmniWeb/v496', array(
- array('OW', 'OmniWeb', 'OmniWeb', '4.5', '4', '5', 'webkit'),
- array('MAC', 'Mac OS', 'Mac OS'))),
-
- // Opera
- array('Opera/9.63 (Windows NT 5.1; U; en) Presto/2.1.1', array(
- array('OP', 'Opera', 'Opera', '9.63', '9', '63', 'opera'),
- array('WXP', 'Windows XP', 'Win XP'))),
- array('Opera/9.30 (Nintendo Wii; U; ; 2047-7; en)', array(
- array('OP', 'Opera', 'Opera', '9.30', '9', '30', 'opera'),
- array('WII', 'Nintendo Wii', 'Wii'))),
- array('Opera/9.64 (Windows ME; U; en) Presto/2.1.1', array(
- array('OP', 'Opera', 'Opera', '9.64', '9', '64', 'opera'),
- array('WME', 'Windows Me', 'Win Me'))),
- array('Opera/9.80 (Windows NT 5.1; U; en) Presto/2.2.15 Version/10.00', array(
- array('OP', 'Opera', 'Opera', '10.00', '10', '0', 'opera'),
- array('WXP', 'Windows XP', 'Win XP'))),
- array('Mozilla/4.0 (compatible; MSIE 6.0; Nitro) Opera 8.50 [en Mozilla/4.0 (compatible; MSIE 6.0; Nitro) Opera 8.50 [ja]', array(
- array('OP', 'Opera', 'Opera', '8.50', '8', '50', 'opera'),
- array('NDS', 'Nintendo DS', 'DS'))),
- array('Opera/9.00 (Nintendo DS U; ; 1309-9; de)', array(
- array('OP', 'Opera', 'Opera', '9.00', '9', '00', 'opera'),
- array('NDS', 'Nintendo DS', 'DS'))),
- array('Opera/9.50 (Nintendo DSi; Opera/507; U; en-US) ', array(
- array('OP', 'Opera', 'Opera', '9.50', '9', '50', 'opera'),
- array('DSI', 'Nintendo DSi', 'DSi'))),
-
- // PlayStation
- array('Mozilla/5.0 (PLAYSTATION 3; 1.00)', array(
- false,
- array('PS3', 'PlayStation 3', 'PS3'))),
-
- // PSP
- array('PSP (PlayStation Portable); 2.00', array(
- false,
- array('PSP', 'PlayStation Portable', 'PSP'))),
- array('Mozilla/4.0 (PSP (PlayStation Portable); 2.00)', array(
- false,
- array('PSP', 'PlayStation Portable', 'PSP'))),
-
- // Rekonq 1.0+
- array('Mozilla/5.0 (X11; Linux i686) AppleWebKit/534.34 (KHTML, like Gecko) rekonq/1.0 Safari/534.34', array(
- array('RK', 'Rekonq', 'Rekonq', '1.0', '1', '0', 'webkit'),
- array('LIN', 'Linux', 'Linux'))),
-
- // Safari
- array('Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.19 (KHTML, like Gecko) Version/3.1.2 Safari/525.21', array(
- array('SF', 'Safari', 'Safari', '3.1', '3', '1', 'webkit'),
- array('WXP', 'Windows XP', 'Win XP'))),
- array('Mozilla/5.0 (iPhone; U; CPU iPhone OS 2_2 like Mac OS X; en-us) AppleWebKit/525.18.1 (KHTML, like Gecko) Version/3.1.1 Mobile/5G77 Safari/525.20', array(
- array('SF', 'Safari', 'Safari', '3.1', '3', '1', 'webkit'),
- array('IPH', 'iPhone', 'iPhone'))),
- array('Mozilla/5.0 (iPod; U; CPU like Mac OS X; en) AppleWebKit/420.1 (KHTML, like Gecko) Version/3.0 Mobile/3A100a Safari/419.3', array(
- array('SF', 'Safari', 'Safari', '3.0', '3', '0', 'webkit'),
- array('IPD', 'iPod', 'iPod'))),
- array('Mozilla/5.0 (iPod; U; CPU iPhone OS 2_2_1 like Mac OS X; en-us) AppleWebKit/525.18.1 (KHTML, like Gecko) Version/3.1.1 Mobile/5H11a Safari/525.20', array(
- array('SF', 'Safari', 'Safari', '3.1', '3', '1', 'webkit'),
- array('IPD', 'iPod', 'iPod'))),
- array('Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_5; en-us) AppleWebKit/527.3+ (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1', array(
- array('SF', 'Safari', 'Safari', '3.1', '3', '1', 'webkit'),
- array('MAC', 'Mac OS', 'Mac OS'))),
- array('Mozilla/5.0 (iPad; U; CPU iPhone OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B314 Safari/531.21.10', array(
- array('SF', 'Safari', 'Safari', '4.0', '4', '0', 'webkit'),
- array('IPA', 'iPad', 'iPad'))),
- array('Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B367 Safari/531.21.10', array(
- array('SF', 'Safari', 'Safari', '4.0', '4', '0', 'webkit'),
- array('IPA', 'iPad', 'iPad'))),
- array('Mozilla/5.0 (iPod; U; CPU iPhone OS 4_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A293 Safari/6531.22.7', array(
- array('SF', 'Safari', 'Safari', '4.0', '4', '0', 'webkit'),
- array('IPD', 'iPod', 'iPod'))),
- array('Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A293 Safari/6531.22.7', array(
- array('SF', 'Safari', 'Safari', '4.0', '4', '0', 'webkit'),
- array('IPH', 'iPhone', 'iPhone'))),
- array('Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/533.19.4 (KHTML, like Gecko) ', array(
- array('SF', 'Safari', 'Safari', '5.0', '5', '0', 'webkit'),
- array('WVI', 'Windows Vista', 'Win Vista'))),
- array('Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/534.50 (KHTML, like Gecko) Version/5.1 Safari/534.50', array(
- array('SF', 'Safari', 'Safari', '5.1', '5', '1', 'webkit'),
- array('MAC', 'Mac OS', 'Mac OS'))),
- array('Mozilla/5.0 (iPhone; CPU iPhone OS 6_1 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Mobile/10B141', array(
- array('SF', 'Safari', 'Safari', '6.0', '6', '0', 'webkit'),
- array('IPH', 'iPhone', 'iPhone'))),
- array('Mozilla/5.0 (iPhone; CPU iPhone OS 6_1 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10B141 Safari/8536.25', array(
- array('SF', 'Safari', 'Safari', '6.0', '6', '0', 'webkit'),
- array('IPH', 'iPhone', 'iPhone'))),
-
- // SeaMonkey (formerly Mozilla Suite and rebranded versions)
- array('Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.8) Gecko/20071008 Iceape/1.1.5 (Ubuntu-1.1.5-1ubuntu0.7.10)', array(
- array('SM', 'SeaMonkey', 'SeaMonkey', '1.1', '1', '1', 'gecko'),
- array('LIN', 'Linux', 'Linux'))),
- array('Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1b4pre) Gecko/20090405 SeaMonkey/2.0b1pre', array(
- array('SM', 'SeaMonkey', 'SeaMonkey', '2.0', '2', '0', 'gecko'),
- array('LIN', 'Linux', 'Linux'))),
- array('Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9) Gecko', array(
- // this pre-2.0 UA is missing the SeaMonkey/X.Y
- array('SM', 'SeaMonkey', 'SeaMonkey', '1.9', '1', '9', 'gecko'),
- array('WXP', 'Windows XP', 'Win XP'))),
- array('Mozilla/5.0 (Windows; U; Windows NT 5.1; cs; rv:1.9) Gecko/2008052906', array(
- // this pre-2.0 UA is missing the SeaMonkey/X.Y
- array('SM', 'SeaMonkey', 'SeaMonkey', '1.9', '1', '9', 'gecko'),
- array('WXP', 'Windows XP', 'Win XP'))),
-
- // Palm webOS
- array('Mozilla/5.0 (webOS/1.0; U; en-us) AppleWebKit/525.27.1 (KHTML, like Gecko) Version/1.0 Safari/525.27.1 Pre/1.0', array(
- array('WO', 'Palm webOS', 'webOS', '1.0', '1', '0', 'webkit'),
- array('WOS', 'Palm webOS', 'webOS'))),
- array('Mozilla/5.0 (webOS/Palm webOS 1.2.9; U; en-US) AppleWebKit/525.27.1 (KHTML, like Gecko) Version/1.0 Safari/525.27.1 Pixi/1.0', array(
- array('WO', 'Palm webOS', 'webOS', '1.0', '1', '0', 'webkit'),
- array('WOS', 'Palm webOS', 'webOS'))),
- array('Mozilla/5.0 [en] (PalmOS; U; WebPro/3.5; Palm-Zi72)', array(
- array('WP', 'WebPro', 'WebPro', '3.5', '3', '5', 'unknown'),
- array('POS', 'Palm OS', 'Palm OS'))),
-
- // Palm WebPro
- array('Mozilla/4.76 [en] (PalmOS; U; WebPro/3.0.1a; Palm-Cct1)', array(
- array('WP', 'WebPro', 'WebPro', '3.0', '3', '0', 'unknown'),
- array('POS', 'Palm OS', 'Palm OS'))),
- array('Mozilla/4.76 [en] (PalmOS; U; WebPro/3.0; Palm-Arz1)', array(
- array('WP', 'WebPro', 'WebPro', '3.0', '3', '0', 'unknown'),
- array('POS', 'Palm OS', 'Palm OS'))),
-
- // Shiira 1.x - treat as Safari since it uses the installed version of Safari's WebKit
- array('Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/417.9 (KHTML, like Gecko, Safari) Shiira/1.1', array(
- array('SF', 'Safari', 'Safari', '2.0', '2', '0', 'webkit'),
- array('MAC', 'Mac OS', 'Mac OS'))),
- array('Mozilla/5.0 (Macintosh; U; PPC Mac OS X; pl-pl) AppleWebKit/312.8 (KHTML, like Gecko) Shiira/1.2.1 Safari/125', array(
- array('SF', 'Safari', 'Safari', '1.3', '1', '3', 'webkit'),
- array('MAC', 'Mac OS', 'Mac OS'))),
-
- // Shiira 2.x - ditto
- array('Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_7; en-us) AppleWebKit/525.28.3 (KHTML, like Gecko) Shiira Safari/125', array(
- array('SF', 'Safari', 'Safari', '3.2', '3', '2', 'webkit'),
- array('MAC', 'Mac OS', 'Mac OS'))),
-
- // SymbianOS
- array('Nokia3650/1.0 SymbianOS/6.1 Series60/1.2 Profile/MIDP-1.0 Configuration/CLDC-1.0', array(
- false,
- array('SYM', 'SymbianOS', 'SymbianOS'))),
- array('Mozilla/5.0 (SymbianOS/9.4; U; Series60/5.0 Nokia5800d-1b/20.2.014; Profile/MIDP-2.1 Configuration/CLDC-1.1 ) AppleWebKit/413 (KHTML, like Gecko) Safari/413', array(
- array('SF', 'Safari', 'Safari', '2.0', '2', '0', 'webkit'),
- array('SYM', 'SymbianOS', 'SymbianOS'))),
- array('Opera/9.80 (S60; SymbOS; Opera Mobi/499; U; en-GB) Presto/2.4.18 Version/10.00', array(
- array('OP', 'Opera', 'Opera', '10.00', '10', '00', 'opera'),
- array('SYM', 'SymbianOS', 'SymbianOS'))),
- array('SonyEricssonG700/R100 Mozilla/4.0 (compatible; MSIE 6.0; Symbian OS; 958) Opera 8.65 [ru]', array(
- array('OP', 'Opera', 'Opera', '8.65', '8', '65', 'opera'),
- array('SYM', 'SymbianOS', 'SymbianOS'))),
-
- // Appcelerator Titanium
- array('Appcelerator Titanium/1.8.0 (iPhone Simulator/4.3; iPhone OS; en_US;)', array(
- array('TI', 'Titanium', 'Titanium', '1.8', '1', '8', 'webkit'),
- array('IPH', 'iPhone', 'iPhone'))),
-
- array('Appcelerator Titanium/1.8.0 (iPod touch/4.3.1; iPhone OS; de_DE;)', array(
- array('TI', 'Titanium', 'Titanium', '1.8', '1', '8', 'webkit'),
- array('IPD', 'iPod', 'iPod'))),
-
- array('Appcelerator Titanium/1.8.0 (iPad/4.3.3; iPhone OS; de_DE;)', array(
- array('TI', 'Titanium', 'Titanium', '1.8', '1', '8', 'webkit'),
- array('IPA', 'iPad', 'iPad'))),
-
- array('Dalvik/1.1.0 (Linux; U; Android 2.1; google_sdk Build/ERD79) Titanium/1.8.0', array(
- array('TI', 'Titanium', 'Titanium', '1.8', '1', '8', 'webkit'),
- array('AND', 'Android', 'Android'))),
-
- array('Dalvik/1.4.0 (Linux; U; Android 2.3.3; GT-I9100 Build/GINGERBREAD) Titanium/1.8.0', array(
- array('TI', 'Titanium', 'Titanium', '1.8', '1', '8', 'webkit'),
- array('AND', 'Android', 'Android'))),
-
- array('Mozilla/5.0 (X11; U; CrOS i686 9.10.0; en-US) AppleWebKit/532.5 (KHTML, like Gecko) Chrome/4.0.253.0 Safari/532.5', array(
- array('CH', 'Chrome', 'Chrome', '4.0', '4', '0', 'webkit'),
- array('LIN', 'Linux', 'Linux'))),
-
- // Email Clients
-
- // Thunderbird
- array('Mozilla/5.0 (Windows NT 5.1; rv:14.0) Gecko/20120713 Thunderbird/14.0 Lightning/1.6', array(
- array('TB', 'Thunderbird', 'Thunderbird', '14.0', '14', '0', 'gecko'),
- array('WXP', 'Windows XP', 'Win XP'))),
-
- array('Mozilla/5.0 (X11; Linux i686; rv:16.0) Gecko/20121011 Thunderbird/16.0.1', array(
- array('TB', 'Thunderbird', 'Thunderbird', '16.0', '16', '0', 'gecko'),
- array('LIN', 'Linux', 'Linux'))),
-
- array('Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 Lightning/1.9', array(
- array('TB', 'Thunderbird', 'Thunderbird', '17.0', '17', '0', 'gecko'),
- array('WI7', 'Windows 7', 'Win 7'))),
-
- array('Mozilla/5.0 (X11; Linux i686 on x86_64; rv:15.0) Gecko/20120907 Thunderbird/15.0.1', array(
- array('TB', 'Thunderbird', 'Thunderbird', '15.0', '15', '0', 'gecko'),
- array('LIN', 'Linux', 'Linux')))
-
- );
- }
-
- /**
- * Test getBrowser()
- *
- * @dataProvider getUserAgents
- * @group Plugins
- */
- public function testGetBrowser($userAgent, $expected)
- {
- $res = UserAgentParser::getBrowser($userAgent);
- $family = false;
-
- if ($res === false)
- $this->assertFalse($expected[0]);
- else {
- $family = \Piwik\Plugins\UserSettings\getBrowserFamily($res['id']);
- $this->assertEquals($expected[0][0], $res['id']);
- $this->assertEquals($expected[0][1], $res['name']);
- $this->assertEquals($expected[0][2], $res['short_name']);
- $this->assertEquals($expected[0][3], $res['version']);
- $this->assertEquals($expected[0][4], $res['major_number']);
- $this->assertEquals($expected[0][5], $res['minor_number']);
- $this->assertEquals($expected[0][6], $family);
- }
- }
-
- /**
- * Test getOperatingSystem()
- *
- * @dataProvider getUserAgents
- * @group Plugins
- */
- public function testGetOperatingSystem($userAgent, $expected)
- {
- $res = UserAgentParser::getOperatingSystem($userAgent);
-
- $this->assertEquals($expected[1][0], $res['id']);
- $this->assertEquals($expected[1][1], $res['name']);
- $this->assertEquals($expected[1][2], $res['short_name']);
- }
-}
diff --git a/tests/PHPUnit/System/AnnotationsTest.php b/tests/PHPUnit/System/AnnotationsTest.php
new file mode 100755
index 0000000000..42a5bb2376
--- /dev/null
+++ b/tests/PHPUnit/System/AnnotationsTest.php
@@ -0,0 +1,287 @@
+<?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\System;
+
+use Piwik\Access;
+use Piwik\API\Request;
+use Piwik\Plugins\Annotations\API;
+use Piwik\Tests\Impl\SystemTestCase;
+use Piwik\Tests\Fixtures\TwoSitesWithAnnotations;
+use FakeAccess;
+use Exception;
+
+/**
+ * @group Plugins
+ * @group AnnotationsTest
+ */
+class AnnotationsTest extends SystemTestCase
+{
+ public static $fixture = null;
+
+ public static function getOutputPrefix()
+ {
+ return 'annotations';
+ }
+
+ public function getApiForTesting()
+ {
+ $idSite1 = self::$fixture->idSite1;
+
+ return array(
+
+ // get
+ array('Annotations.get', array('idSite' => $idSite1,
+ 'date' => '2012-01-01',
+ 'periods' => 'day',
+ 'otherRequestParameters' => array('idNote' => 1))),
+
+ // getAll
+ array('Annotations.getAll', array('idSite' => $idSite1,
+ 'date' => '2011-12-01',
+ 'periods' => array('day', 'week', 'month'))),
+ array('Annotations.getAll', array('idSite' => $idSite1,
+ 'date' => '2012-01-01',
+ 'periods' => array('year'))),
+ array('Annotations.getAll', array('idSite' => $idSite1,
+ 'date' => '2012-03-01',
+ 'periods' => array('week'),
+ 'otherRequestParameters' => array('lastN' => 6),
+ 'testSuffix' => '_lastN')),
+ array('Annotations.getAll', array('idSite' => $idSite1,
+ 'date' => '2012-01-15,2012-02-15',
+ 'periods' => array('range'),
+ 'otherRequestParameters' => array('lastN' => 6),
+ 'testSuffix' => '_range')),
+ array('Annotations.getAll', array('idSite' => 'all',
+ 'date' => '2012-01-01',
+ 'periods' => array('month'),
+ 'testSuffix' => '_multipleSites')),
+
+ // getAnnotationCountForDates
+ array('Annotations.getAnnotationCountForDates', array('idSite' => $idSite1,
+ 'date' => '2011-12-01',
+ 'periods' => array('day', 'week', 'month'))),
+ array('Annotations.getAnnotationCountForDates', array('idSite' => $idSite1,
+ 'date' => '2012-01-01',
+ 'periods' => array('year'))),
+ array('Annotations.getAnnotationCountForDates', array('idSite' => $idSite1,
+ 'date' => '2012-03-01',
+ 'periods' => array('week'),
+ 'otherRequestParameters' => array('lastN' => 6),
+ 'testSuffix' => '_lastN')),
+ array('Annotations.getAnnotationCountForDates', array('idSite' => $idSite1,
+ 'date' => '2012-01-15,2012-02-15',
+ 'periods' => array('range'),
+ 'otherRequestParameters' => array('lastN' => 6),
+ 'testSuffix' => '_range')),
+ array('Annotations.getAnnotationCountForDates', array('idSite' => 'all',
+ 'date' => '2012-01-01',
+ 'periods' => array('month'),
+ 'testSuffix' => '_multipleSites')),
+ );
+ }
+
+ /**
+ * @dataProvider getApiForTesting
+ */
+ public function testApi($api, $params)
+ {
+ $this->runApiTests($api, $params);
+ }
+
+ public function testAddMultipleSitesFail()
+ {
+ try {
+ API::getInstance()->add("1,2,3", "2012-01-01", "whatever");
+ $this->fail("add should fail when given multiple sites in idSite");
+ } catch (Exception $ex) {
+ // pass
+ }
+ }
+
+ public function testAddInvalidDateFail()
+ {
+ try {
+ API::getInstance()->add(self::$fixture->idSite1, "invaliddate", "whatever");
+ $this->fail("add should fail when given invalid date");
+ } catch (Exception $ex) {
+ // pass
+ }
+ }
+
+ public function testSaveMultipleSitesFail()
+ {
+ try {
+ API::getInstance()->save("1,2,3", 0);
+ $this->fail("save should fail when given multiple sites");
+ } catch (Exception $ex) {
+ // pass
+ }
+ }
+
+ public function testSaveInvalidDateFail()
+ {
+ try {
+ API::getInstance()->save(self::$fixture->idSite1, 0, "invaliddate");
+ $this->fail("save should fail when given an invalid date");
+ } catch (Exception $ex) {
+ // pass
+ }
+ }
+
+ public function testSaveInvalidNoteIdFail()
+ {
+ try {
+ API::getInstance()->save(self::$fixture->idSite1, -1);
+ $this->fail("save should fail when given an invalid note id");
+ } catch (Exception $ex) {
+ // pass
+ }
+ }
+
+ public function testDeleteMultipleSitesFail()
+ {
+ try {
+ API::getInstance()->delete("1,2,3", 0);
+ $this->fail("delete should fail when given multiple site IDs");
+ } catch (Exception $ex) {
+ // pass
+ }
+ }
+
+ public function testDeleteInvalidNoteIdFail()
+ {
+ try {
+ API::getInstance()->delete(self::$fixture->idSite1, -1);
+ $this->fail("delete should fail when given an invalid site ID");
+ } catch (Exception $ex) {
+ // pass
+ }
+ }
+
+ public function testGetMultipleSitesFail()
+ {
+ try {
+ API::getInstance()->get("1,2,3", 0);
+ $this->fail("get should fail when given multiple site IDs");
+ } catch (Exception $ex) {
+ // pass
+ }
+ }
+
+ public function testGetInvalidNoteIdFail()
+ {
+ try {
+ API::getInstance()->get(self::$fixture->idSite1, -1);
+ $this->fail("get should fail when given an invalid note ID");
+ } catch (Exception $ex) {
+ // pass
+ }
+ }
+
+ public function testSaveSuccess()
+ {
+ API::getInstance()->save(
+ self::$fixture->idSite1, 0, $date = '2011-04-01', $note = 'new note text', $starred = 1);
+
+ $expectedAnnotation = array(
+ 'date' => '2011-04-01',
+ 'note' => 'new note text',
+ 'starred' => 1,
+ 'user' => 'superUserLogin',
+ 'idNote' => 0,
+ 'canEditOrDelete' => true
+ );
+ $this->assertEquals($expectedAnnotation, API::getInstance()->get(self::$fixture->idSite1, 0));
+ }
+
+ public function testSaveNoChangesSuccess()
+ {
+ API::getInstance()->save(self::$fixture->idSite1, 1);
+
+ $expectedAnnotation = array(
+ 'date' => '2011-12-02',
+ 'note' => '1: Site 1 annotation for 2011-12-02',
+ 'starred' => 0,
+ 'user' => 'superUserLogin',
+ 'idNote' => 1,
+ 'canEditOrDelete' => true
+ );
+ $this->assertEquals($expectedAnnotation, API::getInstance()->get(self::$fixture->idSite1, 1));
+ }
+
+ public function testDeleteSuccess()
+ {
+ API::getInstance()->delete(self::$fixture->idSite1, 1);
+
+ try {
+ API::getInstance()->get(self::$fixture->idSite1, 1);
+ $this->fail("failed to delete annotation");
+ } catch (Exception $ex) {
+ // pass
+ }
+ }
+
+ public function getPermissionsFailData()
+ {
+ return array(
+ // getAll
+ array(false, false, "module=API&method=Annotations.getAll&idSite=1&date=2012-01-01&period=year", true, "getAll should throw if user does not have view access"),
+
+ // get
+ array(false, false, "module=API&method=Annotations.get&idSite=1&idNote=0", true, "get should throw if user does not have view access"),
+
+ // getAnnotationCountForDates
+ array(false, false, "module=API&method=Annotations.getAnnotationCountForDates&idSite=1&date=2012-01-01&period=year", true, "getAnnotationCountForDates should throw if user does not have view access"),
+
+ // add
+ array(false, false, "module=API&method=Annotations.add&idSite=1&date=2011-02-01&note=whatever", true, "add should throw if user does not have view access"),
+ array(false, true, "module=API&method=Annotations.add&idSite=1&date=2011-02-01&note=whatever2", false, "add should not throw if user has view access"),
+ array(true, true, "module=API&method=Annotations.add&idSite=1&date=2011-02-01&note=whatever3", false, "add should not throw if user has admin access"),
+
+ // save
+ array(false, false, "module=API&method=Annotations.save&idSite=1&idNote=0&date=2011-03-01&note=newnote", true, "save should throw if user does not have view access"),
+ array(false, true, "module=API&method=Annotations.save&idSite=1&idNote=0&date=2011-03-01&note=newnote", true, "save should throw if user has view access but did not edit note"),
+ array(true, true, "module=API&method=Annotations.save&idSite=1&idNote=0&date=2011-03-01&note=newnote", false, "save should not throw if user has admin access"),
+
+ // delete
+ array(false, false, "module=API&method=Annotations.delete&idSite=1&idNote=0", true, "delete should throw if user does not have view access"),
+ array(false, true, "module=API&method=Annotations.delete&idSite=1&idNote=0", true, "delete should throw if user does not have view access"),
+ array(true, true, "module=API&method=Annotations.delete&idSite=1&idNote=0", false, "delete should not throw if user has admin access"),
+ );
+ }
+
+ /**
+ * @dataProvider getPermissionsFailData
+ */
+ public function testMethodPermissions($hasAdminAccess, $hasViewAccess, $request, $checkException, $failMessage)
+ {
+ // create fake access that denies user access
+ $access = new FakeAccess();
+ FakeAccess::$superUser = false;
+ FakeAccess::$idSitesAdmin = $hasAdminAccess ? array(self::$fixture->idSite1) : array();
+ FakeAccess::$idSitesView = $hasViewAccess ? array(self::$fixture->idSite1) : array();
+ Access::setSingletonInstance($access);
+
+ if ($checkException) {
+ try {
+ $request = new Request($request);
+ $request->process();
+ $this->fail($failMessage);
+ } catch (Exception $ex) {
+ // pass
+ }
+ } else {
+ $request = new Request($request);
+ $request->process();
+
+ }
+ }
+}
+
+AnnotationsTest::$fixture = new TwoSitesWithAnnotations(); \ No newline at end of file
diff --git a/tests/PHPUnit/System/ApiGetReportMetadataTest.php b/tests/PHPUnit/System/ApiGetReportMetadataTest.php
new file mode 100755
index 0000000000..7772da6224
--- /dev/null
+++ b/tests/PHPUnit/System/ApiGetReportMetadataTest.php
@@ -0,0 +1,92 @@
+<?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\System;
+
+use Piwik\API\Proxy;
+use Piwik\Tests\Impl\SystemTestCase;
+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 Plugins
+ * @group ApiGetReportMetadataTest
+ */
+class ApiGetReportMetadataTest extends SystemTestCase
+{
+ public static $fixture = null; // initialized below class definition
+
+ public function setUp()
+ {
+ parent::setUp();
+
+ // From Piwik 1.5, we hide Goals.getConversions and other get* methods via @ignore, but we
+ // ensure that they still work. This hack allows the API proxy to let us generate example
+ // URLs for the ignored functions
+ Proxy::getInstance()->setHideIgnoredFunctions(false);
+ }
+
+ public function tearDown()
+ {
+ parent::tearDown();
+
+ // reset that value after the test
+ Proxy::getInstance()->setHideIgnoredFunctions(true);
+ }
+
+ public static function getOutputPrefix()
+ {
+ return 'apiGetReportMetadata';
+ }
+
+ public function getApiForTesting()
+ {
+ $idSite = self::$fixture->idSite;
+ $dateTime = self::$fixture->dateTime;
+
+ return array(
+ array('API', array('idSite' => $idSite, 'date' => $dateTime)),
+
+ // test w/ hideMetricsDocs=true
+ array('API.getMetadata', array('idSite' => $idSite, 'date' => $dateTime,
+ 'apiModule' => 'Actions', 'apiAction' => 'get',
+ 'testSuffix' => '_hideMetricsDoc',
+ 'otherRequestParameters' => array('hideMetricsDoc' => 1))),
+ array('API.getProcessedReport', array('idSite' => $idSite, 'date' => $dateTime,
+ 'apiModule' => 'Actions', 'apiAction' => 'get',
+ 'testSuffix' => '_hideMetricsDoc',
+ 'otherRequestParameters' => array('hideMetricsDoc' => 1))),
+
+ // Test w/ showRawMetrics=true
+ array('API.getProcessedReport', array('idSite' => $idSite, 'date' => $dateTime,
+ 'apiModule' => 'UserCountry', 'apiAction' => 'getCountry',
+ 'testSuffix' => '_showRawMetrics',
+ 'otherRequestParameters' => array('showRawMetrics' => 1))),
+
+ // Test w/ showRawMetrics=true
+ array('Actions.getPageTitles', array('idSite' => $idSite, 'date' => $dateTime,
+ 'testSuffix' => '_pageTitleZeroString')),
+
+ // test php renderer w/ array data
+ array('API.getDefaultMetricTranslations', array('idSite' => $idSite, 'date' => $dateTime,
+ 'format' => 'php', 'testSuffix' => '_phpRenderer')),
+ );
+ }
+
+ /**
+ * @dataProvider getApiForTesting
+ */
+ public function testApi($api, $params)
+ {
+ $this->runApiTests($api, $params);
+ }
+}
+
+ApiGetReportMetadataTest::$fixture = new ThreeGoalsOnePageview(); \ No newline at end of file
diff --git a/tests/PHPUnit/System/ApiGetReportMetadataYearTest.php b/tests/PHPUnit/System/ApiGetReportMetadataYearTest.php
new file mode 100755
index 0000000000..78edafbb19
--- /dev/null
+++ b/tests/PHPUnit/System/ApiGetReportMetadataYearTest.php
@@ -0,0 +1,52 @@
+<?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\System;
+
+use Piwik\Tests\Impl\SystemTestCase;
+use Piwik\Tests\Fixtures\InvalidVisits;
+
+/**
+ * test the Yearly metadata API response,
+ * with no visits, with custom response language
+ *
+ * @group Plugins
+ * @group ApiGetReportMetadataYearTest
+ */
+class ApiGetReportMetadataYearTest extends SystemTestCase
+{
+ public static $fixture = null; // initialized below class definition
+
+ public function getApiForTesting()
+ {
+ $params = array('idSite' => self::$fixture->idSite,
+ 'date' => self::$fixture->dateTime,
+ 'periods' => 'year',
+ 'language' => 'fr');
+ return array(
+ array('API.getProcessedReport', $params),
+ array('LanguagesManager.getAvailableLanguageNames', $params),
+ array('SitesManager.getJavascriptTag', $params)
+ );
+ }
+
+ public static function getOutputPrefix()
+ {
+ return 'apiGetReportMetadata_year';
+ }
+
+ /**
+ * @dataProvider getApiForTesting
+ */
+ public function testApi($api, $params)
+ {
+ $this->runApiTests($api, $params);
+ }
+}
+
+ApiGetReportMetadataYearTest::$fixture = new InvalidVisits();
+ApiGetReportMetadataYearTest::$fixture->trackInvalidRequests = false; \ No newline at end of file
diff --git a/tests/PHPUnit/System/ArchiveCronTest.php b/tests/PHPUnit/System/ArchiveCronTest.php
new file mode 100644
index 0000000000..3d328a3927
--- /dev/null
+++ b/tests/PHPUnit/System/ArchiveCronTest.php
@@ -0,0 +1,167 @@
+<?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\System;
+
+use Piwik\Date;
+use Piwik\Plugins\SitesManager\API;
+use Piwik\Tests\Impl\SystemTestCase;
+use Piwik\Tests\Fixtures\ManySitesImportedLogs;
+use Piwik\Tests\Impl\Fixture;
+use Exception;
+
+/**
+ * Tests to call the cron core:archive command script and check there is no error,
+ * Then call the API testing for "Browser archiving is disabled" (see disableArchiving)
+ * This tests that, when archiving is disabled,
+ * then Piwik API will return data that was pre-processed during archive.php run
+ *
+ * @group Core
+ * @group ArchiveCronTest
+ */
+class ArchiveCronTest extends SystemTestCase
+{
+ public static $fixture = null; // initialized below class definition
+
+ public function getApiForTesting()
+ {
+ $results = array();
+
+ // First, API calls for Segmented reports
+ // Disabling these tests as they randomly fail... This could actually be a bug.
+ // FIXME - I have failed finding the cause for these test to randomly fail
+ // eg.
+// foreach (self::$fixture->getDefaultSegments() as $segmentName => $info) {
+// $results[] = array('VisitsSummary.get', array('idSite' => 'all',
+// 'date' => '2012-08-09',
+// 'periods' => array('day', 'week', 'month', 'year'),
+// 'segment' => $info['definition'],
+// 'testSuffix' => '_' . $segmentName));
+//
+//
+// }
+
+ // API Call Without segments
+ // TODO uncomment week and year period
+ $results[] = array('VisitsSummary.get', array('idSite' => 'all',
+ 'date' => '2012-08-09',
+ 'periods' => array('day', 'month', /* 'year', 'week' */)));
+
+ $results[] = array('VisitsSummary.get', array('idSite' => 'all',
+ 'date' => '2012-08-09',
+ 'periods' => array('day', 'week', 'month', 'year'),
+ 'segment' => 'browserCode==EP',
+ 'testSuffix' => '_nonPreArchivedSegment'));
+
+ $segments = array(ManySitesImportedLogs::SEGMENT_PRE_ARCHIVED,
+ ManySitesImportedLogs::SEGMENT_PRE_ARCHIVED_CONTAINS_ENCODED
+ );
+ foreach($segments as $segment) {
+ // TODO debugging travis
+ continue;
+
+ // Test with a pre-processed segment
+ $results[] = array(array('VisitsSummary.get', 'Live.getLastVisitsDetails', 'VisitFrequency.get'),
+ array('idSite' => '1',
+ 'date' => '2012-08-09',
+ 'periods' => array('day', 'year'),
+ 'segment' => $segment,
+ 'testSuffix' => '_preArchivedSegment'));
+ }
+
+ return $results;
+ }
+
+ public function testArchivePhpCron()
+ {
+ if(self::isPhpVersion53()) {
+ $this->markTestSkipped('Fails on PHP 5.3 once in a blue moon.');
+ }
+
+ $this->setLastRunArchiveOptions();
+ $output = $this->runArchivePhpCron();
+
+ $this->compareArchivePhpOutputAgainstExpected($output);
+
+ foreach ($this->getApiForTesting() as $testInfo) {
+
+ list($api, $params) = $testInfo;
+
+ if (!isset($params['testSuffix'])) {
+ $params['testSuffix'] = '';
+ }
+ $params['testSuffix'] .= '_noOptions';
+ $params['disableArchiving'] = true;
+
+ $success = $this->runApiTests($api, $params);
+
+ if (!$success) {
+ var_dump($output);
+ }
+ }
+ }
+
+ private function setLastRunArchiveOptions()
+ {
+ $periodTypes = array('day', 'periods');
+ $idSites = API::getInstance()->getAllSitesId();
+
+ $daysAgoArchiveRanSuccessfully = 1500;
+ $this->assertTrue($daysAgoArchiveRanSuccessfully > (\Piwik\CronArchive::ARCHIVE_SITES_WITH_TRAFFIC_SINCE / 86400));
+ $time = Date::factory(self::$fixture->dateTime)->subDay($daysAgoArchiveRanSuccessfully)->getTimestamp();
+
+ foreach ($periodTypes as $period) {
+ foreach ($idSites as $idSite) {
+ // lastRunKey() function inlined
+ $lastRunArchiveOption = "lastRunArchive" . $period . "_" . $idSite;
+ \Piwik\Option::set($lastRunArchiveOption, $time);
+ }
+ }
+ }
+
+ private function runArchivePhpCron()
+ {
+ $archivePhpScript = PIWIK_INCLUDE_PATH . '/tests/PHPUnit/proxy/archive.php';
+ $urlToProxy = Fixture::getRootUrl() . 'tests/PHPUnit/proxy/index.php';
+
+ // create the command
+ $cmd = "php \"$archivePhpScript\" --url=\"$urlToProxy\" 2>&1";
+
+ // run the command
+ exec($cmd, $output, $result);
+ if ($result !== 0 || stripos($result, "error")) {
+ $message = 'This failed once after a lunar eclipse, and it has again randomly failed.';
+ $message .= "\n\narchive cron failed: " . implode("\n", $output) . "\n\ncommand used: $cmd";
+ $this->markTestSkipped($message);
+ }
+
+ return $output;
+ }
+
+ private function compareArchivePhpOutputAgainstExpected($output)
+ {
+ $output = implode("\n", $output);
+
+ $fileName = 'test_ArchiveCronTest_archive_php_cron_output.txt';
+ list($pathProcessed, $pathExpected) = static::getProcessedAndExpectedDirs();
+
+ $expectedOutputFile = $pathExpected . $fileName;
+ $processedFile = $pathProcessed . $fileName;
+
+ file_put_contents($processedFile, $output);
+
+ try {
+ $this->assertTrue(is_readable($expectedOutputFile));
+ $this->assertEquals(file_get_contents($expectedOutputFile), $output);
+ } catch (Exception $ex) {
+ $this->comparisonFailures[] = $ex;
+ }
+ }
+}
+
+ArchiveCronTest::$fixture = new ManySitesImportedLogs();
+ArchiveCronTest::$fixture->addSegments = true; \ No newline at end of file
diff --git a/tests/PHPUnit/System/ArchiveInvalidationTest.php b/tests/PHPUnit/System/ArchiveInvalidationTest.php
new file mode 100644
index 0000000000..1a0d1dff38
--- /dev/null
+++ b/tests/PHPUnit/System/ArchiveInvalidationTest.php
@@ -0,0 +1,139 @@
+<?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\System;
+
+use Piwik\API\Request;
+use Piwik\Config;
+use Piwik\Tests\Fixtures\VisitsTwoWebsitesWithAdditionalVisits;
+use Piwik\Tests\Impl\SystemTestCase;
+
+/**
+ * Track visits before website creation date and test that Piwik handles them correctly.
+ *
+ * This tests that the API method invalidateArchivedReports works correctly, that it deletes data:
+ * - on one or multiple websites
+ * - for a given set of dates (and optional period)
+ *
+ * @group Core
+ * @group ArchiveInvalidationTest
+ */
+class ArchiveInvalidationTest extends SystemTestCase
+{
+ public static $fixture = null; // initialized below class definition
+
+ protected $suffix = '_NewDataShouldNotAppear';
+
+ /**
+ * @dataProvider getApiForTesting
+ */
+ public function testApi($api, $params)
+ {
+ $this->runApiTests($api, $params);
+ }
+
+ /**
+ * This should NOT return data for old dates before website creation
+ */
+ public function getApiForTesting()
+ {
+ // We test a typical Numeric and a Recursive blob reports
+ $apiToCall = array('VisitsSummary.get', 'Actions.getPageUrls');
+
+ // Build tests for the 2 websites
+ return array(
+ array($apiToCall, array('idSite' => self::$fixture->idSite1,
+ 'testSuffix' => 'Website' . self::$fixture->idSite1 . $this->suffix,
+ 'date' => self::$fixture->dateTimeFirstDateWebsite1,
+ 'periods' => 'month',
+ 'setDateLastN' => 4, // 4months ahead
+ 'otherRequestParameters' => array('expanded' => 1))
+ ),
+
+ array($apiToCall, array('idSite' => self::$fixture->idSite2,
+ 'testSuffix' => 'Website' . self::$fixture->idSite2 . $this->suffix,
+ 'date' => self::$fixture->dateTimeFirstDateWebsite2,
+ 'periods' => 'month',
+ 'segment' => 'pageUrl=@category/',
+ 'setDateLastN' => 4, // 4months ahead
+ 'otherRequestParameters' => array('expanded' => 1))
+ ),
+
+ array($apiToCall, array('idSite' => self::$fixture->idSite2,
+ 'testSuffix' => 'Website' . self::$fixture->idSite2 . "_NewDataShouldNotAppear_BecauseWeekWasNotInvalidated",
+ 'date' => self::$fixture->dateTimeFirstDateWebsite2,
+ 'periods' => 'week',
+ 'segment' => 'pageUrl=@category/',
+ 'setDateLastN' => 4, // 4months ahead
+ 'otherRequestParameters' => array('expanded' => 1))
+ ),
+ );
+ }
+
+ /**
+ * @depends testApi
+ * @dataProvider getApiForTesting
+ */
+ public function testSameApi($api, $params)
+ {
+ $this->setBrowserArchivingTriggering(0);
+ self::$fixture->trackMoreVisits($params['idSite']);
+
+ $this->invalidateTestArchives();
+ $this->runApiTests($api, $params);
+ }
+
+ /**
+ * @depends testApi
+ * @depends testSameApi
+ * @dataProvider getAnotherApiForTesting
+ */
+ public function testAnotherApi($api, $params)
+ {
+ $this->setBrowserArchivingTriggering(1);
+
+ $this->runApiTests($api, $params);
+ }
+
+ /**
+ * This is called after getApiToTest()
+ * We invalidate old reports and check that data is now returned for old dates
+ */
+ public function getAnotherApiForTesting()
+ {
+ $this->suffix = '_NewDataShouldAppear';
+ return $this->getApiForTesting();
+ }
+
+ public static function getOutputPrefix()
+ {
+ return 'Archive_Invalidation';
+ }
+
+ protected function setBrowserArchivingTriggering($value)
+ {
+ Config::getInstance()->General['enable_browser_archiving_triggering'] = $value;
+ }
+
+ protected function invalidateTestArchives()
+ {
+ $dateToInvalidate1 = new \DateTime(self::$fixture->dateTimeFirstDateWebsite1);
+ $dateToInvalidate2 = new \DateTime(self::$fixture->dateTimeFirstDateWebsite2);
+
+ $r = new Request("module=API&method=CoreAdminHome.invalidateArchivedReports&idSites=" . self::$fixture->idSite1 . "&dates=" . $dateToInvalidate1->format('Y-m-d'));
+ $this->assertApiResponseHasNoError($r->process());
+
+ // Days & Months reports only are invalidated and we test our weekly report will still show old data.
+ $r = new Request("module=API&method=CoreAdminHome.invalidateArchivedReports&period=day&idSites=" . self::$fixture->idSite2 . "&dates=" . $dateToInvalidate2->format('Y-m-d'));
+ $this->assertApiResponseHasNoError($r->process());
+ $r = new Request("module=API&method=CoreAdminHome.invalidateArchivedReports&period=month&idSites=" . self::$fixture->idSite2 . "&dates=" . $dateToInvalidate2->format('Y-m-d'));
+ $this->assertApiResponseHasNoError($r->process());
+
+ }
+}
+
+ArchiveInvalidationTest::$fixture = new VisitsTwoWebsitesWithAdditionalVisits(); \ No newline at end of file
diff --git a/tests/PHPUnit/System/ArchiveWebTest.php b/tests/PHPUnit/System/ArchiveWebTest.php
new file mode 100644
index 0000000000..610c83de45
--- /dev/null
+++ b/tests/PHPUnit/System/ArchiveWebTest.php
@@ -0,0 +1,79 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+namespace Piwik\Tests\System;
+
+use Piwik\Option;
+use Piwik\Http;
+use Piwik\Tests\Impl\SystemTestCase;
+use Piwik\Tests\Fixtures\ManySitesImportedLogs;
+use Piwik\Tests\Impl\Fixture;
+use Exception;
+
+/**
+ * Tests to call the archive.php script via web and check there is no error.
+ *
+ * @group Core
+ * @group ArchiveWebTest
+ */
+class ArchiveWebTest extends SystemTestCase
+{
+ public static $fixture = null; // initialized below class definition
+
+ public function testWebArchiving()
+ {
+ if(self::isMysqli() && self::isTravisCI()) {
+ $this->markTestSkipped('Skipping on Mysqli as it randomly fails.');
+ }
+
+ $host = Fixture::getRootUrl();
+ $token = Fixture::getTokenAuth();
+
+ $urlTmp = Option::get('piwikUrl');
+ Option::set('piwikUrl', $host . 'tests/PHPUnit/proxy/index.php');
+
+ $url = $host . 'tests/PHPUnit/proxy/archive.php?token_auth=' . $token;
+ $output = Http::sendHttpRequest($url, 600);
+
+ // ignore random build issues
+ if (empty($output) || strpos($output, \Piwik\CronArchive::NO_ERROR) === false) {
+ $message = "This test has failed. Because it sometimes randomly fails, we skip the test, and ignore this failure.\n";
+ $message .= "If you see this message often, or in every build, please investigate as this should only be a random and rare occurence!\n";
+ $message .= "\n\narchive web failed: " . $output . "\n\nurl used: $url";
+ $this->markTestSkipped($message);
+ }
+
+ if (!empty($urlTmp)) {
+ Option::set('piwikUrl', $urlTmp);
+ } else {
+ Option::delete('piwikUrl');
+ }
+
+ $this->assertContains('Starting Piwik reports archiving...', $output);
+ $this->assertContains('Archived website id = 1', $output);
+ $this->assertContains('Done archiving!', $output);
+ $this->compareArchivePhpOutputAgainstExpected($output);
+ }
+
+ private function compareArchivePhpOutputAgainstExpected($output)
+ {
+ $fileName = 'test_ArchiveCronTest_archive_php_cron_output.txt';
+ list($pathProcessed, $pathExpected) = static::getProcessedAndExpectedDirs();
+
+ $expectedOutputFile = $pathExpected . $fileName;
+
+ try {
+ $this->assertTrue(is_readable($expectedOutputFile));
+ $this->assertEquals(file_get_contents($expectedOutputFile), $output);
+ } catch (Exception $ex) {
+ $this->comparisonFailures[] = $ex;
+ }
+ }
+}
+
+ArchiveWebTest::$fixture = new ManySitesImportedLogs();
+ArchiveWebTest::$fixture->addSegments = true; \ No newline at end of file
diff --git a/tests/PHPUnit/System/AutoSuggestAPITest.php b/tests/PHPUnit/System/AutoSuggestAPITest.php
new file mode 100644
index 0000000000..f86e6b869c
--- /dev/null
+++ b/tests/PHPUnit/System/AutoSuggestAPITest.php
@@ -0,0 +1,148 @@
+<?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\System;
+
+use Piwik\API\Request;
+use Piwik\Date;
+use Piwik\Tests\Impl\SystemTestCase;
+use Piwik\Tests\Fixtures\ManyVisitsWithGeoIP;
+use Piwik\Tests\Impl\Fixture;
+
+/**
+ * testing a the auto suggest API for all known segments
+ *
+ * @group AutoSuggestAPITest
+ * @group Core
+ */
+class AutoSuggestAPITest extends SystemTestCase
+{
+ public static $fixture = null; // initialized below class definition
+
+ protected static $processed = 0;
+ protected static $skipped = array();
+
+ /**
+ * @dataProvider getApiForTesting
+ */
+ public function testApi($api, $params)
+ {
+ if(self::isPhpVersion53() && self::isTravisCI()) {
+ $this->markTestSkipped("Skipping this test as it seg faults on php 5.3 (bug triggered on travis)");
+ }
+
+ $this->runApiTests($api, $params);
+ }
+
+ public function getApiForTesting()
+ {
+ // we will test all segments from all plugins
+ Fixture::loadAllPlugins();
+
+ $idSite = self::$fixture->idSite;
+ $apiForTesting = array();
+
+ $segments = \Piwik\Plugins\API\API::getInstance()->getSegmentsMetadata(self::$fixture->idSite);
+ foreach ($segments as $segment) {
+ $apiForTesting[] = $this->getApiForTestingForSegment($idSite, $segment['segment']);
+ }
+
+ if (self::isMysqli() || self::isTravisCI()) {
+ // Skip the test on Mysqli as it fails due to rounding Float errors on latitude/longitude
+ // then the test started failing after bc19503 and I cannot understand why
+ echo "Skipped test \n";
+ } else {
+ $apiForTesting[] = array('Live.getLastVisitsDetails',
+ array('idSite' => $idSite,
+ 'date' => '1998-07-12,today',
+ 'period' => 'range',
+ 'otherRequestParameters' => array('filter_limit' => 1000)));
+
+ }
+ return $apiForTesting;
+ }
+
+ /**
+ * @param $idSite
+ * @param $segment
+ * @return array
+ */
+ protected function getApiForTestingForSegment($idSite, $segment)
+ {
+ return array('API.getSuggestedValuesForSegment',
+ array('idSite' => $idSite,
+ 'testSuffix' => '_' . $segment,
+ 'otherRequestParameters' => array('segmentName' => $segment)));
+ }
+
+ /**
+ * @depends testApi
+ * @dataProvider getAnotherApiForTesting
+ */
+ public function testAnotherApi($api, $params)
+ {
+ // Get the top segment value
+ $request = new Request(
+ 'method=API.getSuggestedValuesForSegment'
+ . '&segmentName=' . $params['segmentToComplete']
+ . '&idSite=' . $params['idSite']
+ . '&format=php&serialize=0'
+ );
+ $response = $request->process();
+ $this->assertApiResponseHasNoError($response);
+ $topSegmentValue = @$response[0];
+
+ if ($topSegmentValue !== false && !is_null($topSegmentValue)) {
+ // Now build the segment request
+ $segmentValue = rawurlencode(html_entity_decode($topSegmentValue));
+ $params['segment'] = $params['segmentToComplete'] . '==' . $segmentValue;
+ unset($params['segmentToComplete']);
+ $this->runApiTests($api, $params);
+ self::$processed++;
+ } else {
+ self::$skipped[] = $params['segmentToComplete'];
+ }
+
+ }
+
+ public function getAnotherApiForTesting()
+ {
+ $apiForTesting = array();
+ $segments = \Piwik\Plugins\API\API::getInstance()->getSegmentsMetadata(self::$fixture->idSite);
+ foreach ($segments as $segment) {
+ if(self::isTravisCI() && $segment['segment'] == 'deviceType') {
+ // test started failing after bc19503 and I cannot understand why
+ continue;
+ }
+ $apiForTesting[] = array('VisitsSummary.get',
+ array('idSite' => self::$fixture->idSite,
+ 'date' => date("Y-m-d", strtotime(self::$fixture->dateTime)) . ',today',
+ 'period' => 'range',
+ 'testSuffix' => '_' . $segment['segment'],
+ 'segmentToComplete' => $segment['segment']));
+ }
+ return $apiForTesting;
+ }
+
+ /**
+ * @depends testAnotherApi
+ */
+ public function testCheckOtherTestsWereComplete()
+ {
+ // Check that only a few haven't been tested specifically (these are all custom variables slots since we only test slot 1, 2, 5 (see the fixture) and example dimension slots)
+ $maximumSegmentsToSkip = 16;
+ $this->assertTrue(count(self::$skipped) <= $maximumSegmentsToSkip, 'SKIPPED ' . count(self::$skipped) . ' segments --> some segments had no "auto-suggested values"
+ but we should try and test the autosuggest for all new segments. Segments skipped were: ' . implode(', ', self::$skipped));
+
+ // and check that most others have been tested
+ $minimumSegmentsToTest = 46;
+ $this->assertTrue(self::$processed >= $minimumSegmentsToTest, 'PROCESSED ' . self::$processed . ' segments --> it seems some segments "auto-suggested values" haven\'t been tested as we were expecting');
+ }
+}
+
+AutoSuggestAPITest::$fixture = new ManyVisitsWithGeoIP();
+AutoSuggestAPITest::$fixture->dateTime = Date::yesterday()->subDay(30)->getDatetime();
diff --git a/tests/PHPUnit/System/BackwardsCompatibility1XTest.php b/tests/PHPUnit/System/BackwardsCompatibility1XTest.php
new file mode 100644
index 0000000000..5b74883202
--- /dev/null
+++ b/tests/PHPUnit/System/BackwardsCompatibility1XTest.php
@@ -0,0 +1,137 @@
+<?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\System;
+
+use Piwik\Common;
+use Piwik\Db;
+use Piwik\Plugins\VisitFrequency\API as VisitFrequencyApi;
+use Piwik\Tests\Impl\SystemTestCase;
+use Piwik\Tests\Fixtures\SqlDump;
+use Piwik\Tests\Impl\Fixture;
+
+/**
+ * Tests that Piwik 2.0 works w/ data from Piwik 1.12.
+ *
+ * @group BackwardsCompatibility1XTest
+ * @group Core
+ */
+class BackwardsCompatibility1XTest extends SystemTestCase
+{
+ const FIXTURE_LOCATION = '/tests/resources/piwik-1.13-dump.sql';
+
+ public static $fixture = null; // initialized below class
+
+ public static function setUpBeforeClass()
+ {
+ parent::setUpBeforeClass();
+
+ // note: not sure why I have to manually install plugin
+ \Piwik\Plugin\Manager::getInstance()->loadPlugin('CustomAlerts')->install();
+
+ $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) {
+ Db::query("TRUNCATE TABLE " . Common::prefixTable($table));
+ }
+
+ self::trackTwoVisitsOnSameDay();
+
+ // launch archiving
+ VisitFrequencyApi::getInstance()->get(1, 'year', '2012-12-29');
+ }
+
+
+ /**
+ * add two visits from same visitor on dec. 29
+ */
+ private static function trackTwoVisitsOnSameDay()
+ {
+ $t = Fixture::getTracker(1, '2012-12-29 01:01:30', $defaultInit = true, $useLocal = true);
+ $t->enableBulkTracking();
+
+ $t->setUrl('http://site.com/index.htm');
+ $t->setIp('136.5.3.2');
+ $t->doTrackPageView('incredible title!');
+
+ $t->setForceVisitDateTime('2012-12-29 03:01:30');
+ $t->setUrl('http://site.com/other/index.htm');
+ $t->DEBUG_APPEND_URL = '&_idvc=2'; // make sure visit is marked as returning
+ $t->doTrackPageView('other incredible title!');
+
+ $t->doBulkTrack();
+ }
+
+ /**
+ * @dataProvider getApiForTesting
+ */
+ public function testApi($api, $params)
+ {
+ // note: not sure why I have to manually activate plugin in order for `./console tests:run BackwardsCompatibility1XTest` to work
+ try {
+ \Piwik\Plugin\Manager::getInstance()->activatePlugin('DevicesDetection');
+ } catch(\Exception $e) {
+ }
+
+ $this->runApiTests($api, $params);
+ }
+
+ public function getApiForTesting()
+ {
+ $idSite = 1;
+ $dateTime = '2012-03-06 11:22:33';
+
+ $apiNotToCall = array(
+ // in the SQL dump, a referrer is named referer.com, but now in OneVisitorTwoVisits it is referrer.com
+ 'Referrers',
+
+ // changes made to SQL dump to test VisitFrequency change the day of week
+ 'VisitTime.getByDayOfWeek',
+
+ // did not exist in Piwik 1.X
+ 'DevicesDetection.getBrowserEngines',
+
+ // we test VisitFrequency explicitly
+ 'VisitFrequency.get',
+
+ // the Action.getPageTitles test fails for unknown reason, so skipping it
+ // eg. https://travis-ci.org/piwik/piwik/jobs/24449365
+ 'Action.getPageTitles'
+ );
+
+ return array(
+ array('all', array('idSite' => $idSite, 'date' => $dateTime,
+ 'compareAgainst' => 'OneVisitorTwoVisits',
+ 'disableArchiving' => true,
+ 'apiNotToCall' => $apiNotToCall,
+ 'otherRequestParameters' => array(
+ 'hideColumns' => 'nb_users',
+ ))),
+
+ array('VisitFrequency.get', array('idSite' => $idSite, 'date' => '2012-03-03', 'setDateLastN' => true,
+ 'disableArchiving' => true, 'testSuffix' => '_multipleDates')),
+
+ array('VisitFrequency.get', array('idSite' => $idSite, 'date' => $dateTime,
+ 'periods' => array('day', 'week', 'month', 'year'),
+ 'disableArchiving' => false)),
+
+ array('VisitFrequency.get', array('idSite' => $idSite, 'date' => '2012-03-06,2012-12-31',
+ 'periods' => array('range'), 'disableArchiving' => true)),
+
+ array('VisitFrequency.get', array('idSite' => $idSite, 'date' => '2012-03-03,2012-12-12', 'periods' => array('month'),
+ 'testSuffix' => '_multipleOldNew', 'disableArchiving' => true))
+ );
+ }
+}
+
+BackwardsCompatibility1XTest::$fixture = new SqlDump();
+BackwardsCompatibility1XTest::$fixture->dumpUrl = PIWIK_INCLUDE_PATH . BackwardsCompatibility1XTest::FIXTURE_LOCATION;
+BackwardsCompatibility1XTest::$fixture->tablesPrefix = '';
diff --git a/tests/PHPUnit/System/BlobReportLimitingTest.php b/tests/PHPUnit/System/BlobReportLimitingTest.php
new file mode 100755
index 0000000000..f38ee05da7
--- /dev/null
+++ b/tests/PHPUnit/System/BlobReportLimitingTest.php
@@ -0,0 +1,166 @@
+<?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\System;
+
+use Piwik\Config;
+use Piwik\Plugins\Actions\ArchivingHelper;
+use Piwik\Tests\Impl\SystemTestCase;
+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 Core
+ * @group BlobReportLimitingTest
+ */
+class BlobReportLimitingTest extends SystemTestCase
+{
+ public static $fixture = null; // initialized below class definition
+
+ public static function setUpBeforeClass()
+ {
+ self::setUpConfigOptions();
+ parent::setUpBeforeClass();
+ }
+
+ public function getApiForTesting()
+ {
+ // TODO: test Provider plugin? Not sure if it's possible.
+ $apiToCall = array(
+ 'Actions.getPageUrls', 'Actions.getPageTitles', 'Actions.getDownloads', 'Actions.getOutlinks',
+ 'CustomVariables.getCustomVariables',
+ 'Referrers.getReferrerType', 'Referrers.getKeywords', 'Referrers.getSearchEngines',
+ 'Referrers.getWebsites', 'Referrers.getAll', /* TODO 'Referrers.getCampaigns', */
+ 'UserSettings.getResolution', 'UserSettings.getConfiguration', 'UserSettings.getOS',
+ 'UserSettings.getBrowserVersion',
+ 'UserCountry.getRegion', 'UserCountry.getCity',
+ );
+
+ $ecommerceApi = array('Goals.getItemsSku', 'Goals.getItemsName', 'Goals.getItemsCategory');
+
+ return array(
+ array($apiToCall, array('idSite' => self::$fixture->idSite,
+ 'date' => self::$fixture->dateTime,
+ 'periods' => array('day'))),
+
+ array($ecommerceApi, array('idSite' => self::$fixture->idSite,
+ 'date' => self::$fixture->nextDay,
+ 'periods' => 'day')),
+ );
+ }
+
+ public function getRankingQueryDisabledApiForTesting()
+ {
+ $idSite = self::$fixture->idSite;
+ $dateTime = self::$fixture->dateTime;
+
+ return array(
+ array('Actions.getPageUrls', array('idSite' => $idSite,
+ 'date' => $dateTime,
+ 'periods' => array('day'))),
+
+ array('Provider.getProvider', array('idSite' => $idSite,
+ 'date' => $dateTime,
+ 'periods' => array('month'))),
+
+ array('Provider.getProvider', array('idSite' => $idSite,
+ 'date' => $dateTime,
+ 'periods' => array('month'),
+ 'segment' => 'provider==comcast.net',
+ 'testSuffix' => '_segment_provider')),
+
+ // test getDownloads w/ period=range & flat=1
+ array('Actions.getDownloads', array('idSite' => $idSite,
+ 'date' => '2010-01-02,2010-01-05',
+ 'periods' => 'range',
+ 'testSuffix' => '_rangeFlat',
+ 'otherRequestParameters' => array(
+ 'flat' => 1,
+ 'expanded' => 0
+ ))),
+ );
+ }
+
+ /**
+ * @dataProvider getApiForTesting
+ */
+ public function testApi($api, $params)
+ {
+ $this->runApiTests($api, $params);
+ }
+
+ public function testApiWithRankingQuery()
+ {
+ // custom setup
+ self::deleteArchiveTables();
+ Config::getInstance()->General['archiving_ranking_query_row_limit'] = 3;
+ ArchivingHelper::reloadConfig();
+
+ foreach ($this->getApiForTesting() as $pair) {
+ list($apiToCall, $params) = $pair;
+
+ if (empty($params['testSuffix'])) {
+ $params['testSuffix'] = '';
+ }
+ $params['testSuffix'] .= '_rankingQuery';
+
+ $this->runApiTests($apiToCall, $params);
+ }
+ }
+
+ public function testApiWithRankingQueryDisabled()
+ {
+ self::deleteArchiveTables();
+ $generalConfig =& Config::getInstance()->General;
+ $generalConfig['datatable_archiving_maximum_rows_referrers'] = 500;
+ $generalConfig['datatable_archiving_maximum_rows_subtable_referrers'] = 500;
+ $generalConfig['datatable_archiving_maximum_rows_actions'] = 500;
+ $generalConfig['datatable_archiving_maximum_rows_subtable_actions'] = 500;
+ $generalConfig['datatable_archiving_maximum_rows_standard'] = 500;
+ $generalConfig['datatable_archiving_maximum_rows_custom_variables'] = 500;
+ $generalConfig['datatable_archiving_maximum_rows_subtable_custom_variables'] = 500;
+ $generalConfig['archiving_ranking_query_row_limit'] = 0;
+
+ foreach ($this->getRankingQueryDisabledApiForTesting() as $pair) {
+ list($apiToCall, $params) = $pair;
+
+ if (empty($params['testSuffix'])) {
+ $params['testSuffix'] = '';
+ }
+ $params['testSuffix'] .= '_rankingQueryDisabled';
+
+ $this->runApiTests($apiToCall, $params);
+ }
+ }
+
+ public static function getOutputPrefix()
+ {
+ return 'reportLimiting';
+ }
+
+ protected static function setUpConfigOptions()
+ {
+ Config::getInstance()->setTestEnvironment();
+
+ $generalConfig =& Config::getInstance()->General;
+ $generalConfig['datatable_archiving_maximum_rows_referers'] = 3;
+ $generalConfig['datatable_archiving_maximum_rows_subtable_referers'] = 2;
+ $generalConfig['datatable_archiving_maximum_rows_actions'] = 4;
+ $generalConfig['datatable_archiving_maximum_rows_custom_variables'] = 3;
+ $generalConfig['datatable_archiving_maximum_rows_subtable_custom_variables'] = 2;
+ $generalConfig['datatable_archiving_maximum_rows_subtable_actions'] = 2;
+ $generalConfig['datatable_archiving_maximum_rows_standard'] = 3;
+ $generalConfig['archiving_ranking_query_row_limit'] = 50000;
+ }
+}
+
+BlobReportLimitingTest::$fixture = new ManyVisitsWithMockLocationProvider();
+BlobReportLimitingTest::$fixture->createConfig = false; \ No newline at end of file
diff --git a/tests/PHPUnit/System/CsvExportTest.php b/tests/PHPUnit/System/CsvExportTest.php
new file mode 100755
index 0000000000..2069b70cd4
--- /dev/null
+++ b/tests/PHPUnit/System/CsvExportTest.php
@@ -0,0 +1,84 @@
+<?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\System;
+
+use Piwik\Tests\Impl\SystemTestCase;
+use Piwik\Tests\Fixtures\TwoVisitsWithCustomVariables;
+
+/**
+ * Test CSV export with Expanded rows, Translated labels, Different languages
+ *
+ * @group CsvExportTest
+ * @group Core
+ */
+class CsvExportTest extends SystemTestCase
+{
+ public static $fixture = null; // initialized below class definition
+
+ public function getApiForTesting()
+ {
+ $idSite = self::$fixture->idSite;
+ $dateTime = self::$fixture->dateTime;
+
+ $apiToCall = array('VisitsSummary.get', 'CustomVariables.getCustomVariables');
+
+ $enExtraParam = array('expanded' => 0, 'flat' => 1, 'include_aggregate_rows' => 0, 'translateColumnNames' => 1);
+
+ $deExtraParam = array('expanded' => 0, 'flat' => 1, 'include_aggregate_rows' => 1, 'translateColumnNames' => 1);
+
+ return array(
+ array($apiToCall, array('idSite' => $idSite,
+ 'date' => $dateTime,
+ 'format' => 'csv',
+ 'otherRequestParameters' => array('expanded' => 0, 'flat' => 0),
+ 'testSuffix' => '_xp0')),
+
+ array($apiToCall, array('idSite' => $idSite,
+ 'date' => $dateTime,
+ 'format' => 'csv',
+ 'otherRequestParameters' => $enExtraParam,
+ 'language' => 'en',
+ 'testSuffix' => '_xp1_inner0_trans-en')),
+
+ array($apiToCall, array('idSite' => $idSite,
+ 'date' => $dateTime,
+ 'format' => 'csv',
+ 'otherRequestParameters' => $deExtraParam,
+ 'language' => 'de',
+ 'testSuffix' => '_xp1_inner1_trans-de')),
+
+ array('Live.getLastVisitsDetails', array('idSite' => $idSite,
+ 'date' => $dateTime,
+ 'format' => 'csv',
+ 'otherRequestParameters' => array(
+ 'hideColumns' => 'serverDate,actionDetails,serverTimestamp,serverTimePretty,'
+ . 'serverDatePretty,serverDatePrettyFirstAction,serverTimePrettyFirstAction,'
+ . 'goalTimePretty,serverTimePretty,visitorId,visitServerHour,date,'
+ . 'prettyDate,serverDateTimePrettyFirstAction'
+ )))
+ );
+ }
+
+ /**
+ * @dataProvider getApiForTesting
+ */
+ public function testApi($api, $params)
+ {
+ $this->runApiTests($api, $params);
+ }
+
+ public static function getOutputPrefix()
+ {
+ return 'csvExport';
+ }
+}
+
+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/System/CustomEventsTest.php b/tests/PHPUnit/System/CustomEventsTest.php
new file mode 100644
index 0000000000..1560a91b21
--- /dev/null
+++ b/tests/PHPUnit/System/CustomEventsTest.php
@@ -0,0 +1,141 @@
+<?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\System;
+
+use Piwik\Tests\Impl\SystemTestCase;
+use Piwik\Tests\Fixtures\TwoVisitsWithCustomEvents;
+
+/**
+ * Testing Custom Events
+ *
+ * @group CustomEventsTest
+ * @group Plugins
+ */
+class CustomEventsTest extends SystemTestCase
+{
+ public static $fixture = null; // initialized below class definition
+
+ /**
+ * @dataProvider getApiForTesting
+ */
+ public function testApi($api, $params)
+ {
+ $this->runApiTests($api, $params);
+ }
+
+ protected function getApiToCall()
+ {
+ return array(
+ 'Events.getCategory',
+ 'Events.getAction',
+ 'Events.getName',
+ 'Actions.get',
+ 'Live.getLastVisitsDetails',
+ 'Actions.getPageUrls',
+ );
+ }
+
+ protected function tearDown()
+ {
+ parent::tearDown();
+ }
+
+ public function getApiForTesting()
+ {
+ $dateTime = self::$fixture->dateTime;
+ $idSite1 = self::$fixture->idSite;
+
+ $apiToCallProcessedReportMetadata = $this->getApiToCall();
+
+ $dayPeriod = 'day';
+ $periods = array($dayPeriod, 'month');
+
+ $apiEventAndAction = array('Events', 'Actions.getPageUrls');
+ $result = array(
+ array($apiToCallProcessedReportMetadata, array(
+ 'idSite' => $idSite1,
+ 'date' => $dateTime,
+ 'periods' => $periods,
+ 'setDateLastN' => false,
+ 'testSuffix' => '')),
+
+ array($apiEventAndAction, array(
+ 'idSite' => $idSite1,
+ 'date' => $dateTime,
+ 'periods' => $dayPeriod,
+ 'segment' => "eventCategory==Movie,eventName==".urlencode('La fiancée de l\'eau'),
+ 'setDateLastN' => false,
+ 'testSuffix' => '_eventCategoryOrNameMatch')
+ ),
+
+ // eventAction should not match any page view
+ array($apiEventAndAction, array(
+ 'idSite' => $idSite1,
+ 'date' => $dateTime,
+ 'periods' => $dayPeriod,
+ 'segment' => "eventAction=@play",
+ 'setDateLastN' => false,
+ 'testSuffix' => '_segmentMatchesEventActionPlay')
+ ),
+
+ // eventValue should not match any page view
+// array('Actions.getPageUrls', array(
+// 'idSite' => $idSite1,
+// 'date' => $dateTime,
+// 'periods' => $dayPeriod,
+// 'segment' => "eventValue>0",
+// 'setDateLastN' => false,
+// 'testSuffix' => '_eventSegmentMatchNoAction')
+// ),
+ );
+
+ $apiToCallProcessedReportMetadata = array(
+ 'Events.getCategory',
+ 'Events.getAction',
+ 'Events.getName',
+ );
+ // testing metadata API for Events reports
+ foreach ($apiToCallProcessedReportMetadata as $api) {
+ list($apiModule, $apiAction) = explode(".", $api);
+
+ $result[] = array(
+ 'API.getProcessedReport', array('idSite' => $idSite1,
+ 'date' => $dateTime,
+ 'periods' => $dayPeriod,
+ 'setDateLastN' => true,
+ 'apiModule' => $apiModule,
+ 'apiAction' => $apiAction,
+ 'testSuffix' => '_' . $api . '_lastN')
+ );
+ }
+
+ // Test secondary dimensions
+ $secondaryDimensions = array('eventCategory', 'eventAction', 'eventName');
+ foreach($secondaryDimensions as $secondaryDimension) {
+ $result[] = array(array('Events'), array(
+ 'idSite' => $idSite1,
+ 'date' => $dateTime,
+ 'periods' => $periods,
+ 'otherRequestParameters' => array(
+ 'secondaryDimension' => $secondaryDimension
+ ),
+ 'setDateLastN' => false,
+ 'testSuffix' => '_secondaryDimensionIs' . ucfirst($secondaryDimension))
+ );
+ }
+
+ return $result;
+ }
+
+ public static function getOutputPrefix()
+ {
+ return 'CustomEvents';
+ }
+}
+
+CustomEventsTest::$fixture = new TwoVisitsWithCustomEvents();
diff --git a/tests/PHPUnit/System/EcommerceOrderWithItemsTest.php b/tests/PHPUnit/System/EcommerceOrderWithItemsTest.php
new file mode 100755
index 0000000000..0cf6423a8d
--- /dev/null
+++ b/tests/PHPUnit/System/EcommerceOrderWithItemsTest.php
@@ -0,0 +1,259 @@
+<?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\System;
+
+use Piwik\Date;
+use Piwik\Piwik;
+use Piwik\Tests\Impl\SystemTestCase;
+use Piwik\Tests\Fixtures\TwoSitesEcommerceOrderWithItems;
+
+/**
+ * Tests API methods after ecommerce orders are tracked.
+ *
+ * @group EcommerceOrderWithItemsTest
+ * @group Plugins
+ */
+class EcommerceOrderWithItemsTest extends SystemTestCase
+{
+ public static $fixture = null; // initialized below class definition
+
+ public function testImagesIncludedInTests()
+ {
+ $this->alertWhenImagesExcludedFromTests();
+ }
+
+ /**
+ * @dataProvider getApiForTesting
+ */
+ public function testApi($api, $params)
+ {
+ $this->runApiTests($api, $params);
+ }
+
+ public function getApiForTesting()
+ {
+ $idSite = self::$fixture->idSite;
+ $idSite2 = self::$fixture->idSite2;
+ $dateTime = self::$fixture->dateTime;
+
+ $dayApi = array('VisitsSummary.get', 'VisitTime', 'CustomVariables.getCustomVariables',
+ 'Live.getLastVisitsDetails', 'UserCountry', 'API.getProcessedReport', 'Goals.get',
+ 'Goals.getConversions', 'Goals.getItemsSku', 'Goals.getItemsName', 'Goals.getItemsCategory');
+
+ $goalWeekApi = array('Goals.get', 'Goals.getItemsSku', 'Goals.getItemsName', 'Goals.getItemsCategory');
+
+ $goalItemApi = array('Goals.getItemsSku', 'Goals.getItemsName', 'Goals.getItemsCategory');
+
+ $processedReportApi = array('API.getProcessedReport');
+
+ $apiWithSegments = array(
+ 'Goals.getItemsSku', 'Goals.getItemsName', 'Goals.getItemsCategory'
+ );
+
+ // Normal standard goal
+ $apiWithSegments_visitConvertedGoal = array_merge($apiWithSegments , array('Goals.get', 'VisitsSummary.get'));
+ return array_merge(array(
+
+ // Segment: This will match the first visit of the fixture only
+ array(
+ $apiWithSegments,
+ array(
+ 'idSite' => $idSite,
+ 'date' => $dateTime,
+ 'periods' => array('day', 'week'),
+ 'otherRequestParameters' => array('_leavePiwikCoreVariables' => 1),
+ 'segment' => 'pageUrl=@Another%20Product%20page',
+ 'testSuffix' => '_SegmentPageUrlContains'
+ )
+ ),
+
+ // Segment: This will match the first visit of the fixture only
+ array(
+ $apiWithSegments,
+ array(
+ 'idSite' => $idSite,
+ 'date' => $dateTime,
+ 'periods' => array('day', 'week'),
+ 'otherRequestParameters' => array('_leavePiwikCoreVariables' => 1),
+ 'segment' => 'countryCode==fr',
+ 'testSuffix' => '_SegmentCountryIsFr'
+ )
+ ),
+
+ // day tests
+ array($dayApi, array('idSite' => $idSite, 'date' => $dateTime, 'periods' => array('day'),
+ 'otherRequestParameters' => array('_leavePiwikCoreVariables' => 1))),
+
+ // goals API week tests
+ array($goalWeekApi, array('idSite' => $idSite, 'date' => $dateTime, 'periods' => array('week'))),
+
+ // abandoned carts tests
+ array($goalItemApi, array('idSite' => $idSite, 'date' => $dateTime,
+ 'periods' => array('day', 'week'),
+ 'testSuffix' => '_AbandonedCarts',
+ 'otherRequestParameters' => array(
+ 'abandonedCarts' => 1
+ ))),
+
+ // multiple periods tests
+ array($goalItemApi, array('idSite' => $idSite, 'date' => $dateTime, 'periods' => array('day'),
+ 'setDateLastN' => true, 'testSuffix' => 'multipleDates')),
+
+ // multiple periods & multiple websites tests
+ array($goalItemApi, array('idSite' => sprintf("%u,%u", $idSite, $idSite2), 'date' => $dateTime,
+ 'periods' => array('day'), 'setDateLastN' => true,
+ 'testSuffix' => 'multipleDates_andMultipleWebsites')),
+
+ // test metadata products
+ array($processedReportApi, array('idSite' => $idSite, 'date' => $dateTime,
+ 'periods' => array('day'), 'apiModule' => 'Goals',
+ 'apiAction' => 'getItemsSku', 'testSuffix' => '_Metadata_ItemsSku')),
+ array($processedReportApi, array('idSite' => $idSite, 'date' => $dateTime,
+ 'periods' => array('day'), 'apiModule' => 'Goals',
+ 'apiAction' => 'getItemsCategory', 'testSuffix' => '_Metadata_ItemsCategory')),
+
+ // test metadata Goals.get for Ecommerce orders & Carts
+ array($processedReportApi, array('idSite' => $idSite, 'date' => $dateTime,
+ 'periods' => array('day'), 'apiModule' => 'Goals', 'apiAction' => 'get',
+ 'idGoal' => Piwik::LABEL_ID_GOAL_IS_ECOMMERCE_ORDER,
+ 'testSuffix' => '_Metadata_Goals.Get_Order')),
+ array($processedReportApi, array('idSite' => $idSite, 'date' => $dateTime,
+ 'periods' => array('day'), 'apiModule' => 'Goals', 'apiAction' => 'get',
+ 'idGoal' => Piwik::LABEL_ID_GOAL_IS_ECOMMERCE_CART,
+ 'testSuffix' => '_Metadata_Goals.Get_AbandonedCart')),
+
+ // normal standard goal test
+ array($processedReportApi, array('idSite' => $idSite, 'date' => $dateTime,
+ 'periods' => array('day'), 'apiModule' => 'Goals', 'apiAction' => 'get',
+ 'idGoal' => self::$fixture->idGoalStandard,
+ 'testSuffix' => '_Metadata_Goals.Get_NormalGoal')),
+
+ // non-existant goal test
+ array($processedReportApi, array('idSite' => $idSite, 'date' => $dateTime,
+ 'periods' => array('day'), 'apiModule' => 'Goals', 'apiAction' => 'get',
+ 'idGoal' => 'FAKE IDGOAL',
+ 'testSuffix' => '_Metadata_Goals.Get_NotExistingGoal')),
+
+ // While we're at it, test for a standard Metadata report with zero entries
+ array($processedReportApi, array('idSite' => $idSite, 'date' => $dateTime,
+ 'periods' => array('day'), 'apiModule' => 'VisitTime',
+ 'apiAction' => 'getVisitInformationPerServerTime',
+ 'testSuffix' => '_Metadata_VisitTime.getVisitInformationPerServerTime')),
+
+ // Standard non metadata Goals.get
+ // test Goals.get with idGoal=ecommerceOrder and ecommerceAbandonedCart
+ array('Goals.get', array('idSite' => $idSite, 'date' => $dateTime,
+ 'periods' => array('day', 'week'), 'idGoal' => Piwik::LABEL_ID_GOAL_IS_ECOMMERCE_CART,
+ 'testSuffix' => '_GoalAbandonedCart')),
+ array('Goals.get', array('idSite' => $idSite, 'date' => $dateTime,
+ 'periods' => array('day', 'week'), 'idGoal' => Piwik::LABEL_ID_GOAL_IS_ECOMMERCE_ORDER,
+ 'testSuffix' => '_GoalOrder')),
+ array('Goals.get', array('idSite' => $idSite, 'date' => $dateTime,
+ 'periods' => array('day', 'week'), 'idGoal' => 1, 'testSuffix' => '_GoalMatchTitle')),
+ array('Goals.get', array('idSite' => $idSite, 'date' => $dateTime,
+ 'periods' => array('day', 'week'), 'idGoal' => '', 'testSuffix' => '_GoalOverall')),
+
+ array('VisitsSummary.get', array('idSite' => $idSite, 'date' => $dateTime,
+ 'periods' => array('day'), 'segment' => 'visitEcommerceStatus==none',
+ 'testSuffix' => '_SegmentNoEcommerce')),
+ array('VisitsSummary.get', array('idSite' => $idSite, 'date' => $dateTime,
+ 'periods' => array('day'), 'testSuffix' => '_SegmentOrderedSomething',
+ 'segment' => 'visitEcommerceStatus==ordered,visitEcommerceStatus==orderedThenAbandonedCart')),
+ array('VisitsSummary.get', array('idSite' => $idSite, 'date' => $dateTime,
+ 'periods' => array('day'), 'testSuffix' => '_SegmentAbandonedCart',
+ 'segment' => 'visitEcommerceStatus==abandonedCart,visitEcommerceStatus==orderedThenAbandonedCart')),
+
+ // test segment visitConvertedGoalId
+ array('VisitsSummary.get', array('idSite' => $idSite, 'date' => $dateTime,
+ 'periods' => array('day', 'week'), 'testSuffix' => '_SegmentConvertedGoalId1',
+ 'segment' => "visitConvertedGoalId==" . self::$fixture->idGoalStandard)),
+ array('VisitsSummary.get', array('idSite' => $idSite, 'date' => $dateTime,
+ 'periods' => array('day'), 'testSuffix' => '_SegmentDidNotConvertGoalId1',
+ 'segment' => "visitConvertedGoalId!=" . self::$fixture->idGoalStandard)),
+
+ // test segment visitorType
+ array('VisitsSummary.get', array('idSite' => $idSite, 'date' => $dateTime,
+ 'periods' => array('week'), 'segment' => 'visitorType==new',
+ 'testSuffix' => '_SegmentNewVisitors')),
+ array('VisitsSummary.get', array('idSite' => $idSite, 'date' => $dateTime,
+ 'periods' => array('week'), 'segment' => 'visitorType==returning',
+ 'testSuffix' => '_SegmentReturningVisitors')),
+ array('VisitsSummary.get', array('idSite' => $idSite, 'date' => $dateTime,
+ 'periods' => array('week'), 'segment' => 'visitorType==returningCustomer',
+ 'testSuffix' => '_SegmentReturningCustomers')),
+
+ // test segment visitConvertedGoalId with Ecommerce APIs
+ array($apiWithSegments_visitConvertedGoal,
+ array(
+ 'idSite' => $idSite,
+ 'date' => $dateTime,
+ 'periods' => array('week'),
+ 'segment' => 'visitConvertedGoalId==1;visitConvertedGoalId!=2',
+ 'testSuffix' => '_SegmentVisitHasConvertedGoal')),
+
+ // Different segment will yield same result, so we keep same testSuffix
+ array($apiWithSegments_visitConvertedGoal,
+ array(
+ 'idSite' => $idSite,
+ 'date' => $dateTime,
+ 'periods' => array('week'),
+ 'segment' => 'visitConvertedGoalId==1;visitConvertedGoalId!=2;countryCode!=xx;deviceType!=tv',
+ 'testSuffix' => '_SegmentVisitHasConvertedGoal')),
+
+ // testing a segment on log_conversion matching no visit
+ array($apiWithSegments_visitConvertedGoal,
+ array(
+ 'idSite' => $idSite,
+ 'date' => $dateTime,
+ 'periods' => array('week'),
+ 'segment' => 'visitConvertedGoalId==666',
+ 'testSuffix' => '_SegmentNoVisit_HaveConvertedNonExistingGoal')),
+
+ // test segment visitEcommerceStatus and visitConvertedGoalId
+ array($apiWithSegments_visitConvertedGoal,
+ array(
+ 'idSite' => $idSite,
+ 'date' => $dateTime,
+ 'periods' => array('week'),
+ 'segment' => 'visitEcommerceStatus!=ordered;visitConvertedGoalId==1',
+ 'testSuffix' => '_SegmentVisitHasNotOrderedAndConvertedGoal')),
+
+ // test segment pageTitle
+ array('VisitsSummary.get', array('idSite' => $idSite,
+ 'date' => $dateTime,
+ 'periods' => array('day'),
+ 'segment' => 'pageTitle==incredible title!',
+ 'testSuffix' => '_SegmentPageTitleMatch')),
+
+ // test Live! output is OK also for the visit that just bought something (other visits leave an abandoned cart)
+ array('Live.getLastVisitsDetails', array('idSite' => $idSite,
+ 'date' => Date::factory($dateTime)->addHour(30.65)->getDatetime(),
+ 'periods' => array('day'), 'testSuffix' => '_LiveEcommerceStatusOrdered')),
+
+ // test API.get method
+ array('API.get', array('idSite' => $idSite, 'date' => $dateTime, 'periods' => array('day', 'week'),
+ 'otherRequestParameters' => array(
+ 'columns' => 'nb_pageviews,nb_visits,avg_time_on_site,nb_visits_converted'),
+ 'testSuffix' => '_API_get')),
+
+ // Website2
+ array($goalWeekApi, array('idSite' => $idSite2, 'date' => $dateTime, 'periods' => array('week'),
+ 'testSuffix' => '_Website2')),
+
+ ),
+ self::getApiForTestingScheduledReports($dateTime, 'week')
+ );
+ }
+
+ public static function getOutputPrefix()
+ {
+ return 'ecommerceOrderWithItems';
+ }
+}
+
+EcommerceOrderWithItemsTest::$fixture = new TwoSitesEcommerceOrderWithItems(); \ No newline at end of file
diff --git a/tests/PHPUnit/System/FlattenReportsTest.php b/tests/PHPUnit/System/FlattenReportsTest.php
new file mode 100644
index 0000000000..046bdb8d3d
--- /dev/null
+++ b/tests/PHPUnit/System/FlattenReportsTest.php
@@ -0,0 +1,128 @@
+<?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\System;
+
+use Piwik\Tests\Impl\SystemTestCase;
+use Piwik\Tests\Fixtures\ManyVisitsWithSubDirReferrersAndCustomVars;
+
+/**
+ * Tests the flattening of reports.
+ *
+ * @group FlattenReportsTest
+ * @group Core
+ */
+class FlattenReportsTest extends SystemTestCase
+{
+ public static $fixture = null; // initialized below class definition
+
+ /**
+ * @dataProvider getApiForTesting
+ */
+ public function testApi($api, $params)
+ {
+ $this->runApiTests($api, $params);
+ }
+
+ public function getApiForTesting()
+ {
+ $idSite = self::$fixture->idSite;
+ $dateTime = self::$fixture->dateTime;
+
+ $return = array();
+
+ // referrers
+ $return[] = array(
+ 'Referrers.getWebsites',
+ array(
+ 'idSite' => $idSite,
+ 'date' => $dateTime,
+ 'otherRequestParameters' => array(
+ 'flat' => '1',
+ 'expanded' => '0'
+ )
+ ));
+
+ // urls
+ $return[] = array(
+ 'Actions.getPageUrls',
+ array(
+ 'idSite' => $idSite,
+ 'date' => $dateTime,
+ 'period' => 'week',
+ 'otherRequestParameters' => array(
+ 'flat' => '1',
+ 'expanded' => '0'
+ )
+ ));
+ $return[] = array(
+ 'Actions.getPageUrls',
+ array(
+ 'idSite' => $idSite,
+ 'date' => $dateTime,
+ 'period' => 'week',
+ 'testSuffix' => '_withAggregate',
+ 'otherRequestParameters' => array(
+ 'flat' => '1',
+ 'include_aggregate_rows' => '1',
+ 'expanded' => '0'
+ )
+ ));
+
+ // custom variables for multiple days
+ $return[] = array('CustomVariables.getCustomVariables', array(
+ 'idSite' => $idSite,
+ 'date' => $dateTime,
+ 'otherRequestParameters' => array(
+ 'date' => '2010-03-05,2010-03-08',
+ 'flat' => '1',
+ 'include_aggregate_rows' => '1',
+ 'expanded' => '0'
+ )
+ ));
+
+ // test expanded=1 w/ idSubtable=X
+ $return[] = array('Actions.getPageUrls', array('idSite' => $idSite,
+ 'date' => $dateTime,
+ 'periods' => array('week'),
+ 'apiModule' => 'Actions',
+ 'apiAction' => 'getPageUrls',
+ 'supertableApi' => 'Actions.getPageUrls',
+ 'testSuffix' => '_expandedSubtable',
+ 'otherRequestParameters' => array('expanded' => '1')));
+
+ // test expanded=1 & depth=1
+ $return[] = array('Actions.getPageUrls', array('idSite' => $idSite,
+ 'date' => $dateTime,
+ 'periods' => array('week'),
+ 'testSuffix' => '_expandedWithDepth',
+ 'otherRequestParameters' => array('expanded' => '1',
+ 'depth' => '1')));
+
+ // test flat=1 w/ filter_pattern_recursive
+ $return[] = array('Actions.getPageUrls', array('idSite' => $idSite,
+ 'date' => $dateTime,
+ 'periods' => array('week'),
+ 'apiModule' => 'Actions',
+ 'apiAction' => 'getPageUrls',
+ 'testSuffix' => '_flatFilterPatternRecursive',
+ 'otherRequestParameters' => array(
+ 'flat' => '1',
+ 'expanded' => '0',
+ 'filter_pattern_recursive' => 'dir2/'
+ )));
+
+ return $return;
+ }
+
+ public static function getOutputPrefix()
+ {
+ return 'FlattenReports';
+ }
+}
+
+FlattenReportsTest::$fixture = new ManyVisitsWithSubDirReferrersAndCustomVars(); \ No newline at end of file
diff --git a/tests/PHPUnit/System/ImportLogsTest.php b/tests/PHPUnit/System/ImportLogsTest.php
new file mode 100755
index 0000000000..9dcbbd2a1d
--- /dev/null
+++ b/tests/PHPUnit/System/ImportLogsTest.php
@@ -0,0 +1,105 @@
+<?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\System;
+
+use Piwik\Access;
+use Piwik\Plugins\SitesManager\API;
+use Piwik\Tests\Impl\SystemTestCase;
+use Piwik\Tests\Fixtures\ManySitesImportedLogs;
+
+/**
+ * Tests the log importer.
+ *
+ * @group ImportLogsTest
+ * @group Core
+ */
+class ImportLogsTest extends SystemTestCase
+{
+ public static $fixture = null; // initialized below class definition
+
+ /**
+ * @dataProvider getApiForTesting
+ */
+ public function testApi($api, $params)
+ {
+ $this->runApiTests($api, $params);
+ }
+
+ public function getApiForTesting()
+ {
+ $apis = array(
+ array('all', array('idSite' => self::$fixture->idSite,
+ 'date' => '2012-08-09',
+ 'periods' => 'month')),
+
+ array('MultiSites.getAll', array('idSite' => self::$fixture->idSite,
+ 'date' => '2012-08-09',
+ 'periods' => array('month'),
+ 'setDateLastN' => true,
+ 'otherRequestParameters' => array('enhanced' => 1),
+ 'testSuffix' => '_withEnhancedAndLast7')),
+
+ // report generated from custom log format including generation time
+ array('Actions.getPageUrls', array('idSite' => self::$fixture->idSite,
+ 'date' => '2012-09-30',
+ 'periods' => 'day')),
+
+ array('VisitsSummary.get', array('idSite' => self::$fixture->idSite2,
+ 'date' => '2012-08-09',
+ 'periods' => 'month',
+ 'testSuffix' => '_siteIdTwo_TrackedUsingLogReplay')),
+ );
+
+ // Running a few interesting tests for Log Replay use case
+ $apiMethods = array();
+ if (getenv('MYSQL_ADAPTER') != 'MYSQLI') {
+ // Mysqli rounds latitude/longitude
+ $apiMethods = array('Live.getLastVisitsDetails');
+ }
+ $apiMethods[] = 'Actions';
+ $apiMethods[] = 'VisitorInterest';
+ $apiMethods[] = 'VisitFrequency';
+ $apis[] = array($apiMethods, array(
+ 'idSite' => self::$fixture->idSite,
+ 'date' => '2012-08-09,2014-04-01',
+ 'periods' => 'range',
+ 'otherRequestParameters' => array(
+ 'filter_limit' => 1000
+ )));
+ return $apis;
+ }
+
+ /**
+ * NOTE: This test must be last since the new sites that get added are added in
+ * random order.
+ */
+ public function testDynamicResolverSitesCreated()
+ {
+ self::$fixture->logVisitsWithDynamicResolver();
+
+ // reload access so new sites are viewable
+ Access::getInstance()->setSuperUserAccess(true);
+
+ // make sure sites aren't created twice
+ $piwikDotNet = API::getInstance()->getSitesIdFromSiteUrl('http://piwik.net');
+ $this->assertEquals(1, count($piwikDotNet));
+
+ $anothersiteDotCom = API::getInstance()->getSitesIdFromSiteUrl('http://anothersite.com');
+ $this->assertEquals(1, count($anothersiteDotCom));
+
+ $whateverDotCom = API::getInstance()->getSitesIdFromSiteUrl('http://whatever.com');
+ $this->assertEquals(1, count($whateverDotCom));
+ }
+
+ public static function getOutputPrefix()
+ {
+ return 'ImportLogs';
+ }
+}
+
+ImportLogsTest::$fixture = new ManySitesImportedLogs(); \ No newline at end of file
diff --git a/tests/PHPUnit/System/LabelFilterTest.php b/tests/PHPUnit/System/LabelFilterTest.php
new file mode 100644
index 0000000000..d58f42bc4c
--- /dev/null
+++ b/tests/PHPUnit/System/LabelFilterTest.php
@@ -0,0 +1,172 @@
+<?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\System;
+
+use Piwik\Tests\Impl\SystemTestCase;
+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 Core
+ */
+class LabelFilterTest extends SystemTestCase
+{
+ public static $fixture = null; // initialized below class definition
+
+ /**
+ * @dataProvider getApiForTesting
+ */
+ public function testApi($api, $params)
+ {
+ $this->runApiTests($api, $params);
+ }
+
+ public function getApiForTesting()
+ {
+ $idSite = self::$fixture->idSite;
+ $dateTime = self::$fixture->dateTime;
+
+ $labelsToTest = array(
+ // first level
+ 'shouldBeNoData' => 'nonExistent',
+ 'dir' => ' dir ',
+ '0' => '/0',
+
+ // TODO the label in the API output is ...&amp;#039;... why does it only work this way?
+ 'thisiscool' => '/ééé&quot;&#039;... &lt;this is cool&gt;!',
+
+ // second level
+ 'dirnonExistent' => 'dir>nonExistent',
+ 'dirfilephpfoobarfoo2bar' => 'dir>' . urlencode('/file.php?foo=bar&foo2=bar'),
+
+ // 4 levels
+ 'dir2sub0filephp' => 'dir2>sub>0>' . urlencode('/file.php'),
+ );
+
+ $return = array();
+ foreach ($labelsToTest as $suffix => $label) {
+ $return[] = array('Actions.getPageUrls', array(
+ 'testSuffix' => '_' . $suffix,
+ 'idSite' => $idSite,
+ 'date' => $dateTime,
+ 'otherRequestParameters' => array(
+ 'label' => urlencode($label),
+ 'expanded' => 0
+ )
+ ));
+ }
+
+ $label = 'dir';
+ $return[] = array('Actions.getPageUrls', array(
+ 'testSuffix' => '_' . $label . '_range',
+ 'idSite' => $idSite,
+ 'date' => $dateTime,
+ 'otherRequestParameters' => array(
+ 'date' => '2010-03-06,2010-03-08',
+ 'label' => urlencode($label),
+ 'expanded' => 0
+ )
+ ));
+
+ $return[] = array('Actions.getPageTitles', array(
+ 'testSuffix' => '_titles',
+ 'idSite' => $idSite,
+ 'date' => $dateTime,
+ 'otherRequestParameters' => array(
+ // note: title has no blank prefixed here. in the report it has.
+ 'label' => urlencode('incredible title! <>,;'),
+ 'expanded' => 0
+ )
+ ));
+
+ $return[] = array('Actions.getPageTitles', array(
+ 'testSuffix' => '_titlesRecursive',
+ 'idSite' => $idSite,
+ 'date' => $dateTime,
+ 'otherRequestParameters' => array(
+ 'label' => urlencode(
+ ' ' . // test trimming
+ urlencode('incredible parent title! <>,;') .
+ '>' .
+ urlencode('subtitle <>,;')),
+ 'expanded' => 0
+ )
+ ));
+
+ $keyword = '&lt;&gt;&amp;\&quot;the pdo extension is required for this adapter but the extension is not loaded';
+ $searchEngineTest = array(
+ 'testSuffix' => '_keywords_html',
+ 'idSite' => $idSite,
+ 'date' => $dateTime,
+ 'otherRequestParameters' => array(
+ 'label' => urlencode('Google>' . urlencode($keyword)),
+ 'expanded' => 0
+ )
+ );
+ $return[] = array('Referrers.getSearchEngines', $searchEngineTest);
+
+ $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;
+ }
+
+ public static function getOutputPrefix()
+ {
+ return 'LabelFilter';
+ }
+}
+
+LabelFilterTest::$fixture = new OneVisitSeveralPageViews(); \ No newline at end of file
diff --git a/tests/PHPUnit/System/ManyVisitorsOneWebsiteTest.php b/tests/PHPUnit/System/ManyVisitorsOneWebsiteTest.php
new file mode 100755
index 0000000000..72994a3f16
--- /dev/null
+++ b/tests/PHPUnit/System/ManyVisitorsOneWebsiteTest.php
@@ -0,0 +1,165 @@
+<?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\System;
+
+require_once PIWIK_INCLUDE_PATH . '/tests/PHPUnit/MockLocationProvider.php';
+
+use Piwik\Date;
+use Piwik\Tests\Impl\SystemTestCase;
+use Piwik\Tests\Fixtures\ManyVisitsWithGeoIP;
+
+/**
+ * Tests w/ 14 visitors w/ 2 visits each.
+ * Uses geoip location provider to test city/region reports.
+ *
+ * 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 Core
+ */
+class ManyVisitorsOneWebsiteTest extends SystemTestCase
+{
+ public static $fixture = null; // initialized below class definition
+
+ /**
+ * @dataProvider getApiForTesting
+ */
+ public function testApi($api, $params)
+ {
+ $this->runApiTests($api, $params);
+ }
+
+ public function getApiForTesting()
+ {
+ $idSite = self::$fixture->idSite;
+ $dateTime = self::$fixture->dateTime;
+
+ $dateString = Date::factory($dateTime)->toString();
+
+ // Note: we must set 'UserCountry.getLocationFromIP' since it's "excluded" by default in setApiNotToCall
+ $apiToCall = array('UserCountry');
+
+ $apiToTest = array(
+ array($apiToCall,
+ array('idSite' => $idSite,
+ 'date' => $dateTime,
+ 'periods' => array('month'))),
+
+ array($apiToCall, array('idSite' => $idSite,
+ 'date' => $dateTime,
+ 'periods' => array('month'),
+ 'testSuffix' => '_segment_region',
+ 'segment' => 'regionCode==P3;countryCode==gb')),
+
+ array($apiToCall, array('idSite' => $idSite,
+ 'date' => $dateTime,
+ 'periods' => array('month'),
+ 'testSuffix' => '_segment_city',
+ 'segment' => 'city==Stratford-upon-Avon;regionCode==P3;countryCode==gb')),
+
+ array($apiToCall, array('idSite' => $idSite,
+ 'date' => $dateTime,
+ 'periods' => array('month'),
+ 'testSuffix' => '_segment_lat_long',
+ 'segment' => 'latitude>45;latitude<49.3;longitude>-125;longitude<-122')),
+
+ array('UserCountry.getCountry', array('idSite' => $idSite,
+ 'date' => $dateTime,
+ 'periods' => array('month'),
+ 'testSuffix' => '_segment_continent',
+ 'segment' => 'continentCode==eur')),
+
+ // make sure it is possible to sort getProcessedReport by a processed metric
+ array('API.getProcessedReport', array('idSite' => $idSite,
+ 'date' => $dateTime,
+ 'periods' => 'day',
+ 'apiModule' => 'Actions',
+ 'apiAction' => 'getPageUrls',
+ 'testSuffix' => '_sortByProcessedMetric',
+ 'otherRequestParameters' => array(
+ 'filter_sort_column' => 'nb_actions_per_visit'
+ ))),
+
+ // make sure it is possible to sort getProcessedReport by a processed metric
+ // it should not remove empty rows if report has constant rows count
+ array('API.getProcessedReport', array('idSite' => $idSite,
+ 'date' => $dateTime,
+ 'periods' => 'day',
+ 'apiModule' => 'VisitTime',
+ 'apiAction' => 'getVisitInformationPerServerTime',
+ 'testSuffix' => '_sortByProcessedMetric_constantRowsCountShouldKeepEmptyRows',
+ 'otherRequestParameters' => array(
+ 'filter_sort_column' => 'nb_actions_per_visit'
+ ))),
+
+ array(array('UserCountry.getLocationFromIP', 'Live.getLastVisitsDetails'), array(
+ 'idSite' => $idSite,
+ 'date' => $dateTime,
+ 'periods' => array('month'),
+ 'otherRequestParameters' => array('ip' => '194.57.91.215')
+ )),
+ );
+
+ // Randomly fails on 5.3
+ if(!self::isPhpVersion53()) {
+
+ $apiToTest[] = array('Live.getLastVisitsDetails', array(
+ 'idSite' => $idSite,
+ 'date' => $dateString,
+ 'periods' => 'month',
+ 'testSuffix' => '_Live.getLastVisitsDetails_sortDesc',
+ 'otherRequestParameters' => array('filter_sort_order' => 'desc', 'filter_limit' => 7)
+ ));
+
+ // #5950
+ $apiToTest[] = array('Live.getLastVisitsDetails', array(
+ 'idSite' => $idSite,
+ 'date' => $dateString,
+ 'periods' => 'month',
+ 'testSuffix' => '_Live.getLastVisitsDetails_sortByVisitCount',
+ 'otherRequestParameters' => array('filter_sort_order' => 'desc', 'filter_sort_column' => 'visitCount', 'filter_limit' => 7)
+ ));
+
+ // #5950
+ $apiToTest[] = array('Live.getLastVisitsDetails', array(
+ 'idSite' => $idSite,
+ 'date' => $dateString,
+ 'periods' => 'month',
+ 'testSuffix' => '_Live.getLastVisitsDetails_sortByIdVisit',
+ 'otherRequestParameters' => array('filter_sort_order' => 'desc', 'filter_sort_column' => 'idVisit', 'filter_limit' => 7)
+ ));
+
+ // #5950
+ $apiToTest[] = array('Live.getLastVisitsDetails', array(
+ 'idSite' => $idSite,
+ 'date' => $dateString,
+ 'periods' => 'month',
+ 'testSuffix' => '_Live.getLastVisitsDetails_sortByIdVisitAsc',
+ 'otherRequestParameters' => array('filter_sort_order' => 'asc',
+ 'filter_sort_column' => 'idVisit',
+ 'filter_limit' => 7,
+ 'hideColumns' => 'latitude,longitude' // Mysqli has troubles with lat/long rounding
+ )
+ ));
+ }
+
+ // this also fails on all PHP versions, it seems randomly.
+// $apiToTest[] = array('Live.getLastVisitsDetails', array(
+// 'idSite' => $idSite,
+// 'date' => $dateString,
+// 'periods' => 'month',
+// 'testSuffix' => '_Live.getLastVisitsDetails_sortAsc',
+// 'otherRequestParameters' => array('filter_sort_order' => 'asc', 'filter_limit' => 7)
+// ));
+
+ return $apiToTest;
+ }
+}
+
+ManyVisitorsOneWebsiteTest::$fixture = new ManyVisitsWithGeoIP(); \ No newline at end of file
diff --git a/tests/PHPUnit/System/MultipleSitesArchivingTest.php b/tests/PHPUnit/System/MultipleSitesArchivingTest.php
new file mode 100644
index 0000000000..25a1c1569c
--- /dev/null
+++ b/tests/PHPUnit/System/MultipleSitesArchivingTest.php
@@ -0,0 +1,60 @@
+<?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\System;
+
+use Piwik\Config;
+use Piwik\Piwik;
+use Piwik\Tests\Impl\Fixture;
+use Piwik\Tests\Fixtures\ThreeSitesWithSharedVisitors;
+use Piwik\Tests\Impl\SystemTestCase;
+
+/**
+ * @group Core
+ * @group MultipleSitesArchivingTest
+ */
+class MultipleSitesArchivingTest extends SystemTestCase
+{
+ public static $fixture = null; // initialized below class definition
+
+ public static function setUpBeforeClass()
+ {
+ parent::setUpBeforeClass();
+
+ $extraSite = Fixture::createWebsite(self::$fixture->dateTime, $ecommerce = 1, "the site");
+
+ Piwik::addAction("ArchiveProcessor.Parameters.getIdSites", function (&$sites, $period) use ($extraSite) {
+ if (reset($sites) == $extraSite) {
+ $sites = array(1, 2, 3);
+ }
+ });
+
+ Config::getInstance()->General['enable_processing_unique_visitors_multiple_sites'] = 1;
+ }
+
+ public function getApiForTesting()
+ {
+ $dateTime = self::$fixture->dateTime;
+
+ return array(
+ array('VisitsSummary.get', array('idSite' => 4,
+ 'date' => $dateTime,
+ 'periods' => array('day', 'month'),
+ 'testSuffix' => '_sitesGroup')),
+ );
+ }
+
+ /**
+ * @dataProvider getApiForTesting
+ */
+ public function testApi($api, $params)
+ {
+ $this->runApiTests($api, $params);
+ }
+}
+
+MultipleSitesArchivingTest::$fixture = new ThreeSitesWithSharedVisitors(); \ No newline at end of file
diff --git a/tests/PHPUnit/System/NoVisitTest.php b/tests/PHPUnit/System/NoVisitTest.php
new file mode 100755
index 0000000000..a9851358bf
--- /dev/null
+++ b/tests/PHPUnit/System/NoVisitTest.php
@@ -0,0 +1,53 @@
+<?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\System;
+
+use Piwik\Tests\Impl\SystemTestCase;
+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 Core
+ */
+class NoVisitTest extends SystemTestCase
+{
+ public static $fixture = null; // initialized below class definition
+
+ /**
+ * @dataProvider getApiForTesting
+ */
+ public function testApi($api, $params)
+ {
+ $this->runApiTests($api, $params);
+ }
+
+ public function getApiForTesting()
+ {
+ // this will output empty XML result sets as no visit was tracked
+ return array(
+ array('all', array('idSite' => self::$fixture->idSite,
+ 'date' => self::$fixture->dateTime)),
+ array('all', array('idSite' => self::$fixture->idSite,
+ 'date' => self::$fixture->dateTime,
+ 'periods' => array('day', 'week'),
+ 'setDateLastN' => true,
+ 'testSuffix' => '_PeriodIsLast')),
+ );
+ }
+
+ public static function getOutputPrefix()
+ {
+ return 'noVisit';
+ }
+}
+
+NoVisitTest::$fixture = new InvalidVisits(); \ No newline at end of file
diff --git a/tests/PHPUnit/System/NonUnicodeTest.php b/tests/PHPUnit/System/NonUnicodeTest.php
new file mode 100755
index 0000000000..5bcbfe1dd0
--- /dev/null
+++ b/tests/PHPUnit/System/NonUnicodeTest.php
@@ -0,0 +1,55 @@
+<?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\System;
+
+use Piwik\Tests\Impl\SystemTestCase;
+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 Core
+ */
+class NonUnicodeTest extends SystemTestCase
+{
+ public static $fixture = null; // initialized below class definition
+
+ /**
+ * @dataProvider getApiForTesting
+ */
+ public function testApi($api, $params)
+ {
+ $this->runApiTests($api, $params);
+ }
+
+ public function getApiForTesting()
+ {
+ $apiToCall = array(
+ 'Actions.getSiteSearchKeywords',
+ 'Actions.getPageTitles',
+ 'Actions.getPageUrls',
+ 'Referrers.getWebsites',
+ );
+
+ return array(
+ array($apiToCall, array('idSite' => self::$fixture->idSite1,
+ 'date' => self::$fixture->dateTime,
+ 'periods' => 'day'))
+ );
+ }
+
+ public static function getOutputPrefix()
+ {
+ return 'NonUnicode';
+ }
+
+}
+
+NonUnicodeTest::$fixture = new SomeVisitsWithNonUnicodePageTitles(); \ No newline at end of file
diff --git a/tests/PHPUnit/System/OneVisitorLongUrlsTruncatedTest.php b/tests/PHPUnit/System/OneVisitorLongUrlsTruncatedTest.php
new file mode 100644
index 0000000000..5ec5f22d4a
--- /dev/null
+++ b/tests/PHPUnit/System/OneVisitorLongUrlsTruncatedTest.php
@@ -0,0 +1,54 @@
+<?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\System;
+
+use Piwik\Tests\Impl\SystemTestCase;
+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 Core
+ */
+class OneVisitorLongUrlsTruncatedTest extends SystemTestCase
+{
+ public static $fixture = null; // initialized below class definition
+
+ /**
+ * @dataProvider getApiForTesting
+ */
+ public function testApi($api, $params)
+ {
+ $this->runApiTests($api, $params);
+ }
+
+ public function getApiForTesting()
+ {
+ $apiToCall = array(
+ 'Referrers.getKeywords',
+ 'Actions.getPageUrls',
+
+ // Specifically testing getPlugin filter_truncate works
+ 'UserSettings.getPlugin');
+
+ return array(
+ array($apiToCall, array('idSite' => self::$fixture->idSite,
+ 'date' => self::$fixture->dateTime,
+ 'language' => 'fr',
+ 'otherRequestParameters' => array('expanded' => 1, 'filter_truncate' => 2)))
+ );
+ }
+
+ public static function getOutputPrefix()
+ {
+ return 'OneVisitor_LongUrlsTruncated';
+ }
+}
+
+OneVisitorLongUrlsTruncatedTest::$fixture = new SomeVisitsWithLongUrls(); \ No newline at end of file
diff --git a/tests/PHPUnit/System/OneVisitorNoKeywordSpecifiedTest.php b/tests/PHPUnit/System/OneVisitorNoKeywordSpecifiedTest.php
new file mode 100755
index 0000000000..23d418b0ad
--- /dev/null
+++ b/tests/PHPUnit/System/OneVisitorNoKeywordSpecifiedTest.php
@@ -0,0 +1,56 @@
+<?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\System;
+
+use Piwik\Tests\Impl\SystemTestCase;
+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 Core
+ * @group OneVisitorNoKeywordSpecifiedTest
+ */
+class OneVisitorNoKeywordSpecifiedTest extends SystemTestCase
+{
+ public static $fixture = null; // initialized below class definition
+
+ /**
+ * @dataProvider getApiForTesting
+ */
+ public function testApi($api, $params)
+ {
+ $this->runApiTests($api, $params);
+ }
+
+ public function getApiForTesting()
+ {
+ $apiToCall = array('Referrers.getKeywords');
+
+ // test started failing after bc19503 and I cannot understand why
+ if(!self::isTravisCI()) {
+ $apiToCall[] = 'Live.getLastVisitsDetails';
+ }
+
+ return array(
+ array($apiToCall, array('idSite' => self::$fixture->idSite,
+ 'date' => self::$fixture->dateTime,
+ 'language' => 'fr'))
+ );
+ }
+
+ public static function getOutputPrefix()
+ {
+ return 'OneVisitor_NoKeywordSpecified';
+ }
+}
+
+OneVisitorNoKeywordSpecifiedTest::$fixture = new TwoVisitsNoKeywordWithBot(); \ No newline at end of file
diff --git a/tests/PHPUnit/System/OneVisitorOneWebsiteSeveralDaysDateRangeArchivingTestsTest.php b/tests/PHPUnit/System/OneVisitorOneWebsiteSeveralDaysDateRangeArchivingTestsTest.php
new file mode 100755
index 0000000000..66d334d3d3
--- /dev/null
+++ b/tests/PHPUnit/System/OneVisitorOneWebsiteSeveralDaysDateRangeArchivingTestsTest.php
@@ -0,0 +1,185 @@
+<?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\System;
+
+use Piwik\Common;
+use Piwik\Db;
+use Piwik\Piwik;
+use Piwik\Tests\Impl\SystemTestCase;
+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 Core
+ */
+class OneVisitorOneWebsiteSeveralDaysDateRangeArchivingTest extends SystemTestCase
+{
+ public static $fixture = null; // initialized below test definition
+
+ public static function getOutputPrefix()
+ {
+ return 'oneVisitor_oneWebsite_severalDays_DateRange';
+ }
+
+ /**
+ * @dataProvider getApiForTesting
+ */
+ public function testApi($api, $params)
+ {
+ $this->runApiTests($api, $params);
+ }
+
+ public function getApiForTesting()
+ {
+ $idSite = self::$fixture->idSite;
+
+ $apiToCall = array('Actions.getPageUrls',
+ 'VisitsSummary.get',
+ 'UserSettings.getResolution',
+ 'VisitFrequency.get',
+ 'VisitTime.getVisitInformationPerServerTime');
+
+ // 2 segments: ALL and another way of expressing ALL but triggering the Segment code path
+ $segments = array(
+ false,
+ 'countryCode!=aa',
+ 'pageUrl!=ThisIsNotKnownPageUrl',
+ );
+
+ // Running twice just as health check that second call also works
+ $result = array();
+ for ($i = 0; $i <= 1; $i++) {
+ foreach ($segments as $segment) {
+ $result[] = array($apiToCall, array('idSite' => $idSite, 'date' => '2010-12-15,2011-01-15',
+ 'periods' => array('range'),
+ 'segment' => $segment,
+ 'otherRequestParameters' => array(
+ 'flat' => '0',
+ 'expanded' => '0'
+ ),
+ ));
+ }
+ }
+
+ // Testing Date range in January only
+ // Because of flat=1, this test will archive all sub-tables
+ $result[] = array('Actions.getPageUrls', array('idSite' => $idSite, 'date' => '2011-01-01,2011-02-01',
+ 'periods' => array('range'),
+ 'otherRequestParameters' => array(
+ 'flat' => '1',
+ 'expanded' => '0'
+ ),
+ 'testSuffix' => '_periodIsRange_flattened_')
+ );
+ // testing the same with expanded=1 should not create new archive records
+ $result[] = array('Actions.getPageUrls', array('idSite' => $idSite, 'date' => '2011-01-01,2011-02-01',
+ 'periods' => array('range'),
+ 'otherRequestParameters' => array(
+ 'flat' => '0',
+ 'expanded' => '1'
+ ),
+ 'testSuffix' => '_periodIsRange_expanded_')
+ );
+ return $result;
+ }
+
+ /**
+ * Check that requesting period "Range" means only processing
+ * the requested Plugin blob (Actions in this case), not all Plugins blobs
+ *
+ * @depends testApi
+ */
+ public function test_checkArchiveRecords_whenPeriodIsRange()
+ {
+ // we expect 5 blobs for Actions plugins, because flat=1 or expanded=1 was not set
+ // so we only archived the parent table
+ $expectedActionsBlobs = 5;
+
+ // When flat=1, Actions plugin will process 5 + 3 extra blobs (URL = 'http://example.org/sub1/sub2/sub3/news')
+ $expectedActionsBlobsWhenFlattened = $expectedActionsBlobs + 3;
+
+ $tests = array(
+ // TODO Implement fix, then remove the +3 below
+ 'archive_blob_2010_12' => ( ($expectedActionsBlobs+3) /*Actions*/
+ + 7 /* UserSettings */
+ + 2 /* VisitTime */) * 3,
+
+ /**
+ * In Each "Period=range" Archive, we expect following non zero numeric entries:
+ * 5 metrics + 1 flag // VisitsSummary
+ * + 2 metrics + 1 flag // Actions
+ * + 1 flag // UserSettings
+ * + 1 flag // VisitTime
+ * = 11
+ *
+ * because we call VisitFrequency.get, this creates an archive for the visitorType==returning segment.
+ * -> There are two archives for each segment (one for "countryCode!=aa"
+ * and VisitFrequency creates one for "countryCode!=aa;visitorType==returning")
+ *
+ * So each period=range will have = 11 records + (5 metrics + 1 flag // VisitsSummary)
+ * = 17
+ *
+ * Total expected records = count unique archives * records per archive
+ * = 3 * 17
+ * = 51
+ */
+ 'archive_numeric_2010_12' => 17 * 3,
+
+ /**
+ * In the January date range,
+ * we archive only Actions plugins.
+ * It is flattened so all 3 sub-tables should be archived.
+ */
+ 'archive_blob_2011_01' => $expectedActionsBlobsWhenFlattened,
+
+ /**
+ * 5 metrics + 1 flag // VisitsSummary
+ * + 2 metrics + 1 flag // Actions
+ */
+ 'archive_numeric_2011_01' => (6 + 3),
+
+ // nothing in Feb
+ 'archive_blob_2011_02' => 0,
+ 'archive_numeric_2011_02' => 0,
+ );
+ foreach ($tests as $table => $expectedRows) {
+ $sql = "SELECT count(*) FROM " . Common::prefixTable($table) . " WHERE period = " . Piwik::$idPeriods['range'];
+ $countBlobs = Db::get()->fetchOne($sql);
+
+ if($expectedRows != $countBlobs) {
+ $this->printDebugWhenTestFails($table);
+ }
+ $this->assertEquals($expectedRows, $countBlobs, "$table expected $expectedRows, got $countBlobs");
+ }
+ }
+
+ /**
+ * @param $table
+ */
+ protected function printDebugWhenTestFails($table)
+ {
+ $data = Db::get()->fetchAll("SELECT * FROM " . Common::prefixTable($table) . " WHERE period = " . Piwik::$idPeriods['range'] . " ORDER BY idarchive ASC");
+ var_export($data);
+
+ $idArchives = array();
+ foreach ($data as $row) {
+ $idArchives[] = $row['idarchive'];
+ }
+ $idArchives = array_unique($idArchives);
+ foreach ($idArchives as $idArchive) {
+ $numericTable = str_replace("blob", "numeric", Common::prefixTable($table));
+ var_export(Db::get()->fetchAll("SELECT idarchive, name FROM " . $numericTable . " WHERE idarchive = ? AND name LIKE 'done%' LIMIT 1 ", $idArchive));
+ }
+ }
+
+}
+
+OneVisitorOneWebsiteSeveralDaysDateRangeArchivingTest::$fixture = new VisitsOverSeveralDays(); \ No newline at end of file
diff --git a/tests/PHPUnit/System/OneVisitorOneWebsiteSeveralDaysDateRangeTest.php b/tests/PHPUnit/System/OneVisitorOneWebsiteSeveralDaysDateRangeTest.php
new file mode 100755
index 0000000000..82629f69ec
--- /dev/null
+++ b/tests/PHPUnit/System/OneVisitorOneWebsiteSeveralDaysDateRangeTest.php
@@ -0,0 +1,103 @@
+<?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\System;
+
+use Piwik\Tests\Impl\SystemTestCase;
+use Piwik\Tests\Fixtures\VisitsOverSeveralDays;
+
+/**
+ * Use case testing various important features:
+ * - Test Multisites API use cases
+ * - testing period=range use case.
+ * - Recording data before and after, checking that the requested range is processed correctly
+ * - and more
+ *
+ * @group OneVisitorOneWebsiteSeveralDaysDateRangeTest
+ * @group Core
+ */
+class OneVisitorOneWebsiteSeveralDaysDateRangeTest extends SystemTestCase
+{
+ public static $fixture = null; // initialized below class definition
+
+ /**
+ * @dataProvider getApiForTesting
+ */
+ public function testApi($api, $params)
+ {
+ $this->runApiTests($api, $params);
+ }
+
+ public function getApiForTesting()
+ {
+ $idSite = self::$fixture->idSite;
+
+ return array(
+ // FIRST some MultiSites API goodness!
+
+ // range test
+ array('MultiSites.getAll', array('date' => '2010-12-15,2011-01-15',
+ 'periods' => array('range')
+ // Testing without &pattern= so should return all sites
+ )),
+
+ // test several dates (tests use of IndexedByDate w/ 'date1,date2,etc.')
+ array('MultiSites.getAll', array('date' => '2010-12-15',
+ 'periods' => array('day'),
+ 'testSuffix' => '_IndexedByDate',
+ // Testing the pattern to getAll restrict websites using name matching
+ 'otherRequestParameters' => array('pattern' => 'aAa')
+ )),
+
+ // test getOne call used in MobileMessaging SMS reports
+ array('MultiSites.getOne', array('date' => '2010-12-15,2011-01-15',
+ 'periods' => array('range'),
+ 'idSite' => $idSite,
+ // Testing without &pattern= so should return all sites
+ )),
+
+ // test that multiple periods are not supported
+ array('MultiSites.getAll', array('date' => '2010-12-15,2011-01-15',
+ 'periods' => array('day'),
+ 'testSuffix' => '_MultipleDatesNotSupported',
+ )),
+
+ //---------------------------------------
+ // THEN some Socials tests. Share these...
+ array('Referrers.getSocials', array('idSite' => 'all',
+ 'date' => '2010-12-13,2011-01-18',
+ 'periods' => array('range'))),
+
+ array('Referrers.getSocials', array('idSite' => 'all',
+ 'date' => '2010-12-10',
+ 'periods' => array('day'),
+ 'setDateLastN' => true,
+ 'testSuffix' => '_IndexedByDate')),
+
+ array('Referrers.getUrlsForSocial', array('idSite' => 'all', // test w/o idSubtable
+ 'date' => '2010-12-13,2011-01-18',
+ 'periods' => 'range',
+ 'testSuffix' => '_noIdSubtable')),
+
+ array('Referrers.getUrlsForSocial', array('idSite' => 1, // test w/ idSubtable
+ 'date' => '2010-12-13,2011-01-18',
+ 'periods' => 'range',
+ 'supertableApi' => 'Referrers.getSocials')),
+
+ array('UserCountry.getCountry', array('idSite' => $idSite,
+ 'date' => '2010-12-01,2011-01-15',
+ 'periods' => array('range'))),
+ );
+ }
+
+ public static function getOutputPrefix()
+ {
+ return 'oneVisitor_oneWebsite_severalDays_DateRange';
+ }
+}
+
+OneVisitorOneWebsiteSeveralDaysDateRangeTest::$fixture = new VisitsOverSeveralDays(); \ No newline at end of file
diff --git a/tests/PHPUnit/System/OneVisitorSeveralDaysImportedInRandomOrderTest.php b/tests/PHPUnit/System/OneVisitorSeveralDaysImportedInRandomOrderTest.php
new file mode 100644
index 0000000000..de66f3289b
--- /dev/null
+++ b/tests/PHPUnit/System/OneVisitorSeveralDaysImportedInRandomOrderTest.php
@@ -0,0 +1,51 @@
+<?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\System;
+
+use Piwik\Tests\Impl\SystemTestCase;
+use Piwik\Tests\Fixtures\VisitOverSeveralDaysImportedLogs;
+
+/**
+ * @group Core
+ * @group OneVisitorSeveralDaysImportedInRandomOrderTest
+ */
+class OneVisitorSeveralDaysImportedInRandomOrderTest extends SystemTestCase
+{
+ public static $fixture = null; // initialized below class definition
+
+ public static function getOutputPrefix()
+ {
+ return "OneVisitor_SeveralDays_ImportedInRandomOrderTest";
+ }
+
+ /**
+ * @dataProvider getApiForTesting
+ */
+ public function testApi($api, $params)
+ {
+ $this->runApiTests($api, $params);
+ }
+
+ public function getApiForTesting()
+ {
+ return array(
+ // This should show 1 visit on 3 different days
+ array('Live.getLastVisitsDetails', array(
+ 'idSite' => '1',
+ 'date' => self::$fixture->dateTime,
+ 'periods' => 'month',
+ 'testSuffix' => '_shouldShowOneVisit_InEachOfThreeDays',
+ 'otherRequestParameters' => array('hideColumns' => 'visitorId'),
+ 'keepLiveDates' => true
+
+ )),
+ );
+ }
+}
+
+OneVisitorSeveralDaysImportedInRandomOrderTest::$fixture = new VisitOverSeveralDaysImportedLogs();
diff --git a/tests/PHPUnit/System/OneVisitorTwoVisitsTest.php b/tests/PHPUnit/System/OneVisitorTwoVisitsTest.php
new file mode 100755
index 0000000000..a3b25892ef
--- /dev/null
+++ b/tests/PHPUnit/System/OneVisitorTwoVisitsTest.php
@@ -0,0 +1,238 @@
+<?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\System;
+
+use Piwik\API\Proxy;
+use Piwik\Archive;
+use Piwik\Tests\Impl\SystemTestCase;
+use Piwik\Tests\Fixtures\OneVisitorTwoVisits;
+use Exception;
+
+/**
+ * This use case covers many simple tracking features.
+ * - Tracking Goal by manual trigger, and URL matching, with custom revenue
+ * - Tracking the same Goal twice only records it once
+ * - Tracks 4 page views: 3 clicks and a file download
+ * - URLs parameters exclude is tested
+ * - In a returning visit, tracks a Goal conversion
+ * URL matching, with custom referrer and keyword
+ * NO cookie support
+ *
+ * @group Core
+ * @group OneVisitorTwoVisitsTest
+ */
+class OneVisitorTwoVisitsTest extends SystemTestCase
+{
+ /**
+ * @var Test_Piwik_Fixture_OneVisitorTwoVisits
+ */
+ public static $fixture = null; // initialized below class
+
+ public function setUp()
+ {
+ Proxy::getInstance()->setHideIgnoredFunctions(false);
+ }
+
+ public function tearDown()
+ {
+ Proxy::getInstance()->setHideIgnoredFunctions(true);
+ }
+
+ public static function getOutputPrefix()
+ {
+ return "OneVisitorTwoVisits";
+ }
+
+ /**
+ * @dataProvider getApiForTesting
+ */
+ public function testApi($api, $params)
+ {
+ $this->runApiTests($api, $params);
+ }
+
+ public function getApiForTesting()
+ {
+ $idSite = self::$fixture->idSite;
+ $idSiteBis = self::$fixture->idSiteEmptyBis;
+ $idSiteTer = self::$fixture->idSiteEmptyTer;
+
+ $dateTime = self::$fixture->dateTime;
+
+ $enExtraParam = array('expanded' => 1,
+ 'flat' => 1,
+ 'include_aggregate_rows' => 0,
+ 'translateColumnNames' => 1,
+ );
+ $bulkUrls = array(
+ // Testing with several days
+ "idSite=" . $idSite . "&date=2010-03-06,2010-03-07&expanded=1&period=day&method=VisitsSummary.get",
+ "idSite=" . $idSite . ",$idSiteBis,$idSiteTer&date=2010-03-06,2010-03-07&expanded=1&period=day&method=VisitsSummary.get",
+ "idSite=" . $idSite . "&date=2010-03-06&expanded=1&period=day&method=VisitorInterest.getNumberOfVisitsPerVisitDuration"
+ );
+ foreach ($bulkUrls as &$url) {
+ $url = urlencode($url);
+ }
+ return array(
+ array('all', array('idSite' => $idSite,
+ 'date' => $dateTime,
+ 'otherRequestParameters' => array(
+ 'hideColumns' => 'nb_users',
+ )
+ )),
+
+ // test API.get (for bug that incorrectly reorders columns of CSV output)
+ // note: bug only affects rows after first
+ array('API.get', array('idSite' => $idSite,
+ 'date' => '2009-10-01',
+ 'format' => 'csv',
+ 'periods' => array('month'),
+ 'setDateLastN' => true,
+ 'otherRequestParameters' => $enExtraParam,
+ 'language' => 'en',
+ 'testSuffix' => '_csv')),
+
+ array('API.getBulkRequest', array('format' => 'xml',
+ 'testSuffix' => '_bulk_xml',
+ 'otherRequestParameters' => array('urls' => $bulkUrls))),
+
+ array('API.getBulkRequest', array('format' => 'json',
+ 'testSuffix' => '_bulk_json',
+ 'otherRequestParameters' => array('urls' => $bulkUrls))),
+
+ // test API.getProcessedReport w/ report that is its own 'actionToLoadSubTables'
+ array('API.getProcessedReport', array('idSite' => $idSite,
+ 'date' => $dateTime,
+ 'periods' => array('week'),
+ 'apiModule' => 'Actions',
+ 'apiAction' => 'getPageUrls',
+ 'supertableApi' => 'Actions.getPageUrls',
+ 'testSuffix' => '__subtable')),
+
+ // test hideColumns && showColumns parameters
+ array('VisitsSummary.get', array('idSite' => $idSite, 'date' => $dateTime, 'periods' => 'day',
+ 'testSuffix' => '_hideColumns_',
+ 'otherRequestParameters' => array(
+ 'hideColumns' => 'nb_visits_converted,max_actions,bounce_count,nb_hits,'
+ . 'nb_visits,nb_actions,sum_visit_length,avg_time_on_site'
+ ))),
+ array('VisitsSummary.get', array('idSite' => $idSite, 'date' => $dateTime, 'periods' => 'day',
+ 'testSuffix' => '_showColumns_',
+ 'otherRequestParameters' => array(
+ 'showColumns' => 'nb_visits,nb_actions,nb_hits'
+ ))),
+ array('VisitsSummary.get', array('idSite' => $idSite, 'date' => $dateTime, 'periods' => 'day',
+ 'testSuffix' => '_hideAllColumns_',
+ 'otherRequestParameters' => array(
+ 'hideColumns' => 'nb_visits_converted,max_actions,bounce_count,nb_hits,'
+ . 'nb_visits,nb_actions,sum_visit_length,avg_time_on_site,'
+ . 'bounce_rate,nb_uniq_visitors,nb_actions_per_visit,'
+ ))),
+
+ // test hideColumns w/ API.getProcessedReport
+ array('API.getProcessedReport', array('idSite' => $idSite, 'date' => $dateTime,
+ 'periods' => 'day', 'apiModule' => 'Actions',
+ 'apiAction' => 'getPageTitles', 'testSuffix' => '_hideColumns_',
+ 'otherRequestParameters' => array(
+ 'hideColumns' => 'nb_visits_converted,xyzaug,entry_nb_visits,' .
+ 'bounce_rate,nb_hits,nb_visits,avg_time_on_page,' .
+ 'avg_time_generation,nb_hits_with_time_generation'
+ ))),
+
+ array('API.getProcessedReport', array('idSite' => $idSite, 'date' => $dateTime,
+ 'periods' => 'day', 'apiModule' => 'Actions',
+ 'apiAction' => 'getPageTitles', 'testSuffix' => '_showColumns_',
+ 'otherRequestParameters' => array(
+ 'showColumns' => 'nb_visits_converted,xuena,entry_nb_visits,' .
+ 'bounce_rate,nb_hits'
+ ))),
+ array('API.getProcessedReport', array('idSite' => $idSite, 'date' => $dateTime,
+ 'periods' => 'day', 'apiModule' => 'VisitTime',
+ 'apiAction' => 'getVisitInformationPerServerTime',
+ 'testSuffix' => '_showColumnsWithProcessedMetrics_',
+ 'otherRequestParameters' => array(
+ 'showColumns' => 'nb_visits,revenue'
+ ))),
+
+ // showColumns with only one column and report having no dimension
+ array('API.getProcessedReport', array('idSite' => $idSite, 'date' => $dateTime,
+ 'periods' => 'day', 'apiModule' => 'VisitsSummary',
+ 'apiAction' => 'get',
+ 'testSuffix' => '_showColumns_onlyOne',
+ 'otherRequestParameters' => array(
+ 'showColumns' => 'nb_visits'
+ ))),
+
+ // test hideColumns w/ expanded=1
+ array('Actions.getPageTitles', array('idSite' => $idSite, 'date' => $dateTime,
+ 'periods' => 'day', 'testSuffix' => '_hideColumns_',
+ 'otherRequestParameters' => array(
+ 'hideColumns' => 'nb_visits_converted,entry_nb_visits,' .
+ 'bounce_rate,nb_hits,nb_visits,sum_time_spent,' .
+ 'entry_sum_visit_length,entry_bounce_count,exit_nb_visits,' .
+ 'entry_nb_uniq_visitors,exit_nb_uniq_visitors,entry_nb_actions,' .
+ 'avg_time_generation,nb_hits_with_time_generation',
+ 'expanded' => '1'
+ ))),
+
+ // test showColumns on API.get
+ array('API.get', array(
+ 'idSite' => $idSite,
+ 'date' => $dateTime,
+ 'periods' => 'day',
+ 'testSuffix' => '_showColumns',
+ 'otherRequestParameters' => array(
+ 'showColumns' => 'nb_uniq_visitors,nb_pageviews,bounce_rate'
+ )
+ )),
+ );
+ }
+
+ /**
+ * Test that Archive::getBlob won't fetch extra unnecessary blobs.
+ */
+ public function testArchiveSingleGetBlob()
+ {
+ $archive = Archive::build(self::$fixture->idSite, 'day', self::$fixture->dateTime);
+ $cache = $archive->getBlob('Actions_actions', 'all');
+
+ $foundSubtable = false;
+
+ $this->assertTrue(count($cache) > 0, "empty blob cache");
+ foreach ($cache as $name => $value) {
+ $this->assertTrue(strpos($name, "Actions_actions_url") === false, "found blob w/ name '$name'");
+
+ if (strpos($name, "Actions_actions_") !== false) {
+ $foundSubtable = true;
+ }
+ }
+
+ $this->assertTrue($foundSubtable, "Actions_actions subtable was not loaded");
+ }
+
+ /**
+ * Test that restricting the number of sites to those viewable to another login
+ * works when building an archive query object.
+ */
+ public function testArchiveSitesWhenRestrictingToLogin()
+ {
+ try
+ {
+ Archive::build(
+ 'all', 'day', self::$fixture->dateTime, $segment = false, $_restrictToLogin = 'anotherLogin');
+ $this->fail("Restricting sites to invalid login did not return 0 sites.");
+ }
+ catch (Exception $ex)
+ {
+ // pass
+ }
+ }
+}
+
+OneVisitorTwoVisitsTest::$fixture = new OneVisitorTwoVisits();
+OneVisitorTwoVisitsTest::$fixture->excludeMozilla = true;
diff --git a/tests/PHPUnit/System/OneVisitorTwoVisitsWithCookieSupportTest.php b/tests/PHPUnit/System/OneVisitorTwoVisitsWithCookieSupportTest.php
new file mode 100755
index 0000000000..966382045d
--- /dev/null
+++ b/tests/PHPUnit/System/OneVisitorTwoVisitsWithCookieSupportTest.php
@@ -0,0 +1,53 @@
+<?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\System;
+
+use Piwik\Tests\Impl\SystemTestCase;
+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 Core
+ */
+class OneVisitorTwoVisitsWithCookieSupportTest extends SystemTestCase
+{
+ public static $fixture = null; // initialized below class
+
+ /**
+ * @dataProvider getApiForTesting
+ */
+ public function testApi($api, $params)
+ {
+ $this->runApiTests($api, $params);
+
+ }
+
+ public function getApiForTesting()
+ {
+ $apiToCall = array(
+ 'VisitTime', 'VisitsSummary', 'VisitorInterest', 'VisitFrequency', 'UserSettings',
+ 'UserCountry', 'Referrers', 'Provider', 'Goals', 'CustomVariables', 'CoreAdminHome',
+ 'Actions', 'Live.getLastVisitsDetails');
+
+ return array(
+ array($apiToCall, array('idSite' => self::$fixture->idSite, 'date' => self::$fixture->dateTime))
+ );
+ }
+
+ public static function getOutputPrefix()
+ {
+ return 'OneVisitorTwoVisits_withCookieSupport';
+ }
+}
+
+OneVisitorTwoVisitsWithCookieSupportTest::$fixture = new OneVisitorTwoVisits();
+OneVisitorTwoVisitsWithCookieSupportTest::$fixture->useThirdPartyCookies = true;
+OneVisitorTwoVisitsWithCookieSupportTest::$fixture->useSiteSearch = true; \ No newline at end of file
diff --git a/tests/PHPUnit/System/PeriodIsRangeDateIsLastNMetadataAndNormalAPITest.php b/tests/PHPUnit/System/PeriodIsRangeDateIsLastNMetadataAndNormalAPITest.php
new file mode 100755
index 0000000000..92f1a8bb4a
--- /dev/null
+++ b/tests/PHPUnit/System/PeriodIsRangeDateIsLastNMetadataAndNormalAPITest.php
@@ -0,0 +1,89 @@
+<?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\System;
+
+use Piwik\Date;
+use Piwik\Tests\Impl\SystemTestCase;
+use Piwik\Tests\Fixtures\TwoVisitsWithCustomVariables;
+
+/**
+ * test Metadata API + period=range&date=lastN
+ *
+ * @group PeriodIsRangeDateIsLastNMetadataAndNormalAPITest
+ * @group Core
+ */
+class PeriodIsRangeDateIsLastNMetadataAndNormalAPITest extends SystemTestCase
+{
+ public static $fixture = null;
+
+ public static function setUpBeforeClass()
+ {
+ self::$fixture->dateTime = Date::factory('today')->getDateTime();
+ parent::setUpBeforeClass();
+ }
+
+ /**
+ * @dataProvider getApiForTesting
+ */
+ public function testApi($api, $params)
+ {
+ $this->runApiTests($api, $params);
+ }
+
+ public function getApiForTesting()
+ {
+ $idSite = self::$fixture->idSite;
+ $visitorId = self::$fixture->visitorId;
+
+ $apiToCall = array(
+ 'API.getProcessedReport',
+ 'Actions.getPageUrls',
+ 'Goals.get',
+ 'CustomVariables.getCustomVariables',
+ 'Referrers.getCampaigns',
+ 'Referrers.getKeywords',
+ 'VisitsSummary.get',
+ 'Live');
+
+ $segments = array(
+ false,
+ 'daysSinceFirstVisit!=50',
+ 'visitorId!=33c31e01394bdc63',
+ 'visitorId!=33c31e01394bdc63;daysSinceFirstVisit!=50',
+ // testing segment on Actions table
+ 'pageUrl!=http://unknown/not/viewed',
+ );
+ $dates = array(
+ 'last7',
+ Date::factory('now')->subDay(6)->toString() . ',today',
+ Date::factory('now')->subDay(6)->toString() . ',now',
+ );
+
+ $result = array();
+ foreach ($segments as $segment) {
+ foreach ($dates as $date) {
+ $result[] = array($apiToCall, array('idSite' => $idSite, 'date' => $date,
+ 'periods' => array('range'), 'segment' => $segment,
+ 'otherRequestParameters' => array(
+ 'lastMinutes' => 60 * 24,
+ 'visitorId' => $visitorId // testing getLastVisitsForVisitor requires a visitor ID
+ )));
+ }
+ }
+
+ return $result;
+ }
+
+ public static function getOutputPrefix()
+ {
+ return 'periodIsRange_dateIsLastN_MetadataAndNormalAPI';
+ }
+}
+
+PeriodIsRangeDateIsLastNMetadataAndNormalAPITest::$fixture = new TwoVisitsWithCustomVariables();
+PeriodIsRangeDateIsLastNMetadataAndNormalAPITest::$fixture->doExtraQuoteTests = false; \ No newline at end of file
diff --git a/tests/PHPUnit/System/PivotByQueryParamTest.php b/tests/PHPUnit/System/PivotByQueryParamTest.php
new file mode 100644
index 0000000000..15af9b5373
--- /dev/null
+++ b/tests/PHPUnit/System/PivotByQueryParamTest.php
@@ -0,0 +1,189 @@
+<?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\System;
+
+use Piwik\Config;
+use Piwik\Date;
+use Piwik\Tests\Fixtures\ManyVisitsWithMockLocationProvider;
+use Piwik\Tests\Impl\SystemTestCase;
+
+/**
+ * @group Core
+ * @group PivotByQueryParamTest
+ */
+class PivotByQueryParamTest extends SystemTestCase
+{
+ /**
+ * @var ManyVisitsWithMockLocationProvider
+ */
+ public static $fixture = null;
+
+ public static function setUpBeforeClass()
+ {
+ parent::setUpBeforeClass();
+
+ Config::getInstance()->General['pivot_by_filter_enable_fetch_by_segment'] = 1;
+ }
+
+ public function test_PivotBySubtableDimension_CreatesCorrectPivotTable()
+ {
+ $this->assertApiResponseEqualsExpected("Referrers.getKeywords", array(
+ 'idSite' => self::$fixture->idSite,
+ 'date' => Date::factory(self::$fixture->dateTime)->toString(),
+ 'period' => 'week',
+ 'pivotBy' => 'Referrers.SearchEngine',
+ 'pivotByColumn' => 'nb_visits',
+ 'pivotByColumnLimit' => -1,
+ 'disable_queued_filters' => 1 // test that prepending doesn't happen w/ this
+ ));
+ }
+
+ public function test_PivotBySubtableDimension_WhenEntireHirearchyIsNotLoaded()
+ {
+ $this->assertApiResponseEqualsExpected("Referrers.getKeywords", array(
+ 'idSite' => self::$fixture->idSite,
+ 'date' => Date::factory(self::$fixture->dateTime)->toString(),
+ 'period' => 'week',
+ 'pivotBy' => 'Referrers.SearchEngine',
+ 'pivotByColumn' => '', // also test default pivot column
+ 'pivotByColumnLimit' => -1,
+ 'expanded' => 0
+ ));
+ }
+
+ public function test_PivotBySegment_CreatesCorrectPivotTable()
+ {
+ $this->assertApiResponseEqualsExpected("Referrers.getKeywords", array(
+ 'idSite' => self::$fixture->idSite,
+ 'date' => Date::factory(self::$fixture->dateTime)->toString(),
+ 'period' => 'week',
+ 'pivotBy' => 'UserCountry.City',
+ 'pivotByColumn' => 'nb_visits',
+ 'pivotByColumnLimit' => -1
+ ));
+ }
+
+ public function test_PivotBySegment_CreatesCorrectPivotTable_WhenSegmentUsedInRequest()
+ {
+ $this->assertApiResponseEqualsExpected("Referrers.getKeywords", array(
+ 'idSite' => self::$fixture->idSite,
+ 'date' => Date::factory(self::$fixture->dateTime)->toString(),
+ 'period' => 'week',
+ 'segment' => 'browserCode==FF',
+ 'pivotBy' => 'UserCountry.City',
+ 'pivotByColumn' => 'nb_visits',
+ 'pivotByColumnLimit' => -1
+ ));
+ }
+
+ public function test_PivotByParam_PlaysNiceWithOtherQueryParams()
+ {
+ $this->assertApiResponseEqualsExpected("Referrers.getKeywords", array(
+ 'idSite' => self::$fixture->idSite,
+ 'date' => Date::factory(self::$fixture->dateTime)->toString(),
+ 'period' => 'week',
+ 'pivotBy' => 'Referrers.SearchEngine',
+ 'pivotByColumn' => 'nb_visits',
+ 'pivotByColumnLimit' => -1,
+ 'flat' => 1,
+ 'totals' => 1,
+ 'disable_queued_filters' => 1,
+ 'disable_generic_filters' => 1,
+ 'showColumns' => 'Google,Bing'
+ ));
+ }
+
+ // TODO: known issue: some segment/report relationships are more complicated; for example, UserCountry.GetCity labels are combinations
+ // of city, region & country dimensions, so the segment to get an intersected table needs all 3 of those.
+ public function SHOULD_test_PivotByParam_PlaysNiceWithQueuedFilters()
+ {
+
+ $this->markTestSkipped("Not working right now.");
+
+ $this->assertApiResponseEqualsExpected("UserSettings.getBrowser", array( // should have logo metadata in output
+ 'idSite' => self::$fixture->idSite,
+ 'date' => Date::factory(self::$fixture->dateTime)->toString(),
+ 'period' => 'week',
+ 'pivotBy' => 'UserCountry.City', // testing w/ report that has no subtable report
+ 'pivotByColumn' => 'nb_visits',
+ 'pivotByColumnLimit' => -1
+ ));
+ }
+
+ public function test_PivotByParam_WorksWithReportWhoseSubtableIsSelf()
+ {
+ $this->assertApiResponseEqualsExpected("Actions.getPageUrls", array(
+ 'idSite' => self::$fixture->idSite,
+ 'date' => Date::factory(self::$fixture->dateTime)->toString(),
+ 'period' => 'week',
+ 'pivotBy' => 'Actions.PageUrl',
+ 'pivotByColumn' => 'nb_hits',
+ 'pivotByColumnLimit' => -1
+ ));
+ }
+
+ public function test_PivotByParam_WorksWithColumnLimiting()
+ {
+ $this->assertApiResponseEqualsExpected("Referrers.getKeywords", array(
+ 'idSite' => self::$fixture->idSite,
+ 'date' => Date::factory(self::$fixture->dateTime)->toString(),
+ 'period' => 'week',
+ 'pivotBy' => 'UserCountry.City',
+ 'pivotByColumn' => 'nb_visits',
+ 'pivotByColumnLimit' => 2
+ ));
+ }
+
+ public function test_PivotByParam_WorksWithJsonOutput()
+ {
+ $this->assertApiResponseEqualsExpected("Referrers.getKeywords", array(
+ 'idSite' => self::$fixture->idSite,
+ 'date' => Date::factory(self::$fixture->dateTime)->toString(),
+ 'period' => 'week',
+ 'format' => 'json',
+ 'pivotBy' => 'UserCountry.City',
+ 'pivotByColumn' => 'nb_visits',
+ 'pivotByColumnLimit' => -1
+ ));
+ }
+
+ public function test_PivotByParam_WorksWithCsvOutput()
+ {
+ $this->assertApiResponseEqualsExpected("Referrers.getKeywords", array(
+ 'idSite' => self::$fixture->idSite,
+ 'date' => Date::factory(self::$fixture->dateTime)->toString(),
+ 'period' => 'week',
+ 'format' => 'csv',
+ 'pivotBy' => 'UserCountry.City',
+ 'pivotByColumn' => 'nb_visits',
+ 'pivotByColumnLimit' => -1
+ ));
+ }
+
+ public function test_PivotByParam_PlaysNiceWithDataTableMaps()
+ {
+ $this->assertApiResponseEqualsExpected("Referrers.getKeywords", array(
+ 'idSite' => 'all',
+ 'date' => '2010-01-01,2010-01-07',
+ 'period' => 'day',
+ 'pivotBy' => 'UserCountry.City',
+ 'pivotByColumn' => 'nb_visits',
+ 'pivotByColumnLimit' => -1
+ ));
+ }
+ public function assertApiResponseEqualsExpected($apiMethod, $queryParams)
+ {
+ if(self::isPhpVersion53()) {
+ // 5.3.3 space encoding fail eg. https://travis-ci.org/piwik/piwik/jobs/35920420
+ $this->markTestSkipped();
+ }
+ parent::assertApiResponseEqualsExpected($apiMethod, $queryParams);
+ }
+}
+
+PivotByQueryParamTest::$fixture = new ManyVisitsWithMockLocationProvider();
diff --git a/tests/PHPUnit/System/PrivacyManagerTest.php b/tests/PHPUnit/System/PrivacyManagerTest.php
new file mode 100644
index 0000000000..79fcd1bccd
--- /dev/null
+++ b/tests/PHPUnit/System/PrivacyManagerTest.php
@@ -0,0 +1,889 @@
+<?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\System;
+
+use Piwik\Archive;
+use Piwik\ArchiveProcessor\Rules;
+use Piwik\Common;
+use Piwik\Config;
+use Piwik\DataAccess\ArchiveTableCreator;
+use Piwik\DataTable\Manager;
+use Piwik\Date;
+use Piwik\Db;
+use Piwik\Option;
+use Piwik\Plugins\Goals\API as APIGoals;
+use Piwik\Plugins\Goals\Archiver;
+use Piwik\Plugins\PrivacyManager\LogDataPurger;
+use Piwik\Plugins\PrivacyManager\PrivacyManager;
+use Piwik\Plugins\PrivacyManager\ReportsPurger;
+use Piwik\Plugins\VisitorInterest\API as APIVisitorInterest;
+use Piwik\Site;
+use Piwik\Tracker\Cache;
+use Piwik\Tracker\GoalManager;
+use Piwik\Tests\Impl\SystemTestCase;
+use Piwik\Tests\Impl\Fixture;
+
+require_once PIWIK_INCLUDE_PATH . '/plugins/PrivacyManager/PrivacyManager.php';
+
+/**
+ * @group PrivacyManagerTest
+ * @group Plugins
+ */
+class PrivacyManagerTest extends SystemTestCase
+{
+ // constants used in checking whether numeric tables are populated correctly.
+ // 'done' entries exist for every period, even if there's no metric data, so we need the
+ // total archive count for each month.
+ const TOTAL_JAN_ARCHIVE_COUNT = 37; // 31 + 4 + 1 + 1;
+ const TOTAL_FEB_ARCHIVE_COUNT = 34; // 29 + 4 + 1;
+
+ // the number of archive entries for a single metric if no purging is done. this #
+ // is dependent on the number of periods for which there were visits.
+ const JAN_METRIC_ARCHIVE_COUNT = 11; // 5 days + 4 weeks + 1 month + 1 year
+ const FEB_METRIC_ARCHIVE_COUNT = 11; // 6 days + 4 weeks + 1 month
+
+ const JAN_DONE_FLAGS_COUNT = 43;
+
+ // fake metric/report name used to make sure unwanted metrics are purged
+ const GARBAGE_FIELD = 'abcdefg';
+
+ private static $idSite = 1;
+ private static $dateTime = '2012-02-28';
+ private static $daysAgoStart = 50;
+
+ // maps table names w/ array rows
+ private static $dbData = null;
+
+ /**
+ * @var PrivacyManager
+ */
+ private $instance = null;
+ private $settings = null;
+
+ private $unusedIdAction = null;
+
+ public static function setUpBeforeClass()
+ {
+ parent::setUpBeforeClass();
+
+ self::_addLogData();
+ self::_addReportData();
+
+ self::$dbData = self::getDbTablesWithData();
+ }
+
+ public function setUp()
+ {
+ parent::setUp();
+
+ LogDataPurger::$selectSegmentSize = 2;
+ ReportsPurger::$selectSegmentSize = 2;
+
+ Db::$lockPrivilegeGranted = null;
+
+ self::restoreDbTables(self::$dbData);
+
+ $dateTime = Date::factory(self::$dateTime);
+
+ // purging depends upon today's date, so 'older_than' parts must be dependent upon today
+ $today = Date::factory('today');
+ $daysSinceToday = ($today->getTimestamp() - $dateTime->getTimestamp()) / (24 * 60 * 60);
+
+ $monthsSinceToday = 0;
+ for ($date = $today; $date->toString('Y-m') != $dateTime->toString('Y-m'); $date = $date->subMonth(1)) {
+ ++$monthsSinceToday;
+ }
+
+ // set default config
+ $settings = array();
+ $settings['delete_logs_enable'] = 1;
+
+ // purging log data from before 2012-01-24
+ $settings['delete_logs_older_than'] = 35 + $daysSinceToday;
+ $settings['delete_logs_schedule_lowest_interval'] = 7;
+ $settings['delete_logs_max_rows_per_query'] = 100000;
+ $settings['delete_reports_enable'] = 1;
+ $settings['delete_reports_older_than'] = $monthsSinceToday;
+ $settings['delete_reports_keep_basic_metrics'] = 0;
+ $settings['delete_reports_keep_day_reports'] = 0;
+ $settings['delete_reports_keep_week_reports'] = 0;
+ $settings['delete_reports_keep_month_reports'] = 0;
+ $settings['delete_reports_keep_year_reports'] = 0;
+ $settings['delete_reports_keep_range_reports'] = 0;
+ $settings['delete_reports_keep_segment_reports'] = 0;
+ PrivacyManager::savePurgeDataSettings($settings);
+ $this->settings = $settings;
+ $this->instance = new PrivacyManager();
+ }
+
+ public function tearDown()
+ {
+ parent::tearDown();
+ Manager::getInstance()->deleteAll();
+ Option::clearCache();
+ Site::clearCache();
+ Cache::deleteTrackerCache();
+ ArchiveTableCreator::clear();
+
+ $tempTableName = Common::prefixTable(LogDataPurger::TEMP_TABLE_NAME);
+ Db::query("DROP TABLE IF EXISTS " . $tempTableName);
+ }
+
+ /**
+ * Make sure the first time deleteLogData is run, nothing happens.
+ */
+ public function testDeleteLogDataInitialRun()
+ {
+ $this->_checkNoDataChanges();
+
+ // Check it does not run
+ $this->assertFalse( $this->instance->deleteLogData() );
+
+ // check that initial option is set
+ $this->assertEquals(1, Option::get(PrivacyManager::OPTION_LAST_DELETE_PIWIK_LOGS_INITIAL));
+
+ // perform other checks
+ $this->_checkNoDataChanges();
+ }
+
+ /**
+ * Make sure the first time deleteReportData is run, nothing happens.
+ */
+ public function testDeleteReportDataInitialRun()
+ {
+ $this->assertFalse($this->instance->deleteReportData() );
+
+ // check that initial option is set
+ $this->assertEquals(1, Option::get(PrivacyManager::OPTION_LAST_DELETE_PIWIK_LOGS_INITIAL));
+
+ // perform other checks
+ $this->_checkNoDataChanges();
+ }
+
+ /**
+ * Make sure the task is not run when its scheduled for later.
+ */
+ public function testPurgeDataNotTimeToRun()
+ {
+ $yesterdaySecs = Date::factory('yesterday')->getTimestamp();
+
+ Option::set(PrivacyManager::OPTION_LAST_DELETE_PIWIK_LOGS_INITIAL, 1);
+ Option::set(PrivacyManager::OPTION_LAST_DELETE_PIWIK_LOGS, $yesterdaySecs);
+ Option::set(PrivacyManager::OPTION_LAST_DELETE_PIWIK_REPORTS, $yesterdaySecs);
+ $this->assertFalse( $this->instance->deleteLogData() );
+ $this->assertFalse( $this->instance->deleteReportData() );
+
+ // perform checks
+ $this->_checkNoDataChanges();
+ }
+
+ /**
+ * Make sure purging data runs when scheduled.
+ */
+ public function testPurgeDataNotInitialAndTimeToRun()
+ {
+ // get purge data prediction
+ $prediction = PrivacyManager::getPurgeEstimate();
+
+ // perform checks on prediction
+ $events = 3; // only the event action for the three purged day, dayAgo=x are purged (others are still in use)
+ $expectedPrediction = array(
+ Common::prefixTable('log_conversion') => 6,
+ Common::prefixTable('log_link_visit_action') => 6 + $events,
+ Common::prefixTable('log_visit') => 3,
+ Common::prefixTable('log_conversion_item') => 3,
+ Common::prefixTable('archive_numeric_2012_01') => -1,
+ Common::prefixTable('archive_blob_2012_01') => -1
+ );
+ $this->assertEquals($expectedPrediction, $prediction);
+
+ // purge data
+ $this->_setTimeToRun();
+ $this->assertTrue( $this->instance->deleteLogData() );
+ $this->assertTrue($this->instance->deleteReportData() );
+
+ // perform checks
+ $this->checkLogDataPurged();
+
+ $archiveTables = self::_getArchiveTableNames();
+
+ // January numeric table should be dropped
+ $this->assertEquals(self::JAN_DONE_FLAGS_COUNT, $this->_getTableCount($archiveTables['numeric'][0])); // January
+
+ // Check february metric count
+ $febRowCount = $this->_getExpectedNumericArchiveCountFeb();
+ $this->assertEquals($febRowCount, $this->_getTableCount($archiveTables['numeric'][1])); // February
+
+ // January blob table should be dropped
+ $this->assertEquals(0, $this->_getTableCount($archiveTables['blob'][0])); // January
+
+ // Check february blob count (1 blob per period w/ visits + 1 garbage report)
+ $this->assertEquals(self::FEB_METRIC_ARCHIVE_COUNT + 1, $this->_getTableCount($archiveTables['blob'][1])); // February
+ }
+
+ /**
+ * Make sure nothing happens when deleting logs & reports are both disabled.
+ */
+ public function testPurgeDataBothDisabled()
+ {
+ PrivacyManager::savePurgeDataSettings(array(
+ 'delete_logs_enable' => 0,
+ 'delete_reports_enable' => 0
+ ));
+
+ // get purge data prediction
+ $prediction = PrivacyManager::getPurgeEstimate();
+
+ // perform checks on prediction
+ $expectedPrediction = array();
+ $this->assertEquals($expectedPrediction, $prediction);
+
+ // purge data
+ $this->_setTimeToRun();
+ $hasDeleted = $this->instance->deleteLogData();
+ $this->assertFalse($hasDeleted);
+ $this->assertFalse($this->instance->deleteReportData() );
+
+ // perform checks
+ $this->_checkNoDataChanges();
+ }
+
+ /**
+ * Test that purgeData works when there's no data.
+ */
+ public function testPurgeDataDeleteLogsNoData()
+ {
+ \Piwik\DbHelper::truncateAllTables();
+ foreach (ArchiveTableCreator::getTablesArchivesInstalled() as $table) {
+ Db::exec("DROP TABLE $table");
+ }
+
+ // get purge data prediction
+ $prediction = PrivacyManager::getPurgeEstimate();
+
+ // perform checks on prediction
+ $expectedPrediction = array();
+ $this->assertEquals($expectedPrediction, $prediction);
+
+ // purge data
+ $this->_setTimeToRun();
+ $this->assertTrue( $this->instance->deleteLogData() );
+
+ $this->assertTrue($this->instance->deleteReportData() );
+
+ // perform checks
+ $this->assertEquals(0, $this->_getTableCount('log_visit'));
+ $this->assertEquals(0, $this->_getTableCount('log_conversion'));
+ $this->assertEquals(0, $this->_getTableCount('log_link_visit_action'));
+ $this->assertEquals(0, $this->_getTableCount('log_conversion_item'));
+
+ $archiveTables = self::_getArchiveTableNames();
+ $this->assertFalse($this->_tableExists($archiveTables['numeric'][0])); // January
+ $this->assertFalse($this->_tableExists($archiveTables['numeric'][1])); // February
+ $this->assertFalse($this->_tableExists($archiveTables['blob'][0])); // January
+ $this->assertFalse($this->_tableExists($archiveTables['blob'][1])); // February
+ }
+
+ /**
+ * Test that purgeData works correctly when the 'keep basic metrics' setting is set to true.
+ */
+ public function testPurgeDataDeleteReportsKeepBasicMetrics()
+ {
+ PrivacyManager::savePurgeDataSettings(array(
+ 'delete_reports_keep_basic_metrics' => 1
+ ));
+
+ // get purge data prediction
+ $prediction = PrivacyManager::getPurgeEstimate();
+
+ // perform checks on prediction
+ $events = 3; // only the event action for the three purged day, dayAgo=x are purged (others are still in use)
+ $expectedPrediction = array(
+ Common::prefixTable('log_conversion') => 6,
+ Common::prefixTable('log_link_visit_action') => 6 + $events,
+ Common::prefixTable('log_visit') => 3,
+ Common::prefixTable('log_conversion_item') => 3,
+ Common::prefixTable('archive_numeric_2012_01') => 1, // remove the garbage metric
+ Common::prefixTable('archive_blob_2012_01') => -1
+ );
+ $this->assertEquals($expectedPrediction, $prediction);
+
+ // purge data
+ $this->_setTimeToRun();
+ $this->assertTrue( $this->instance->deleteLogData() );
+ $this->assertTrue($this->instance->deleteReportData() );
+
+ // perform checks
+ $this->checkLogDataPurged();
+
+ $archiveTables = self::_getArchiveTableNames();
+
+ // all numeric metrics should be saved except the garbage metric
+ $janRowCount = $this->_getExpectedNumericArchiveCountJan() - 1;
+ $tableName = $archiveTables['numeric'][0];
+ $tableCount = $this->_getTableCount($tableName);
+ $this->assertEquals($janRowCount, $tableCount); // January
+
+ if ($janRowCount != $tableCount) {
+ $this->dumpTable($tableName);
+ }
+
+ // check february numerics not deleted
+ $febRowCount = $this->_getExpectedNumericArchiveCountFeb();
+ $this->assertEquals($febRowCount, $this->_getTableCount($archiveTables['numeric'][1])); // February
+
+ $this->assertEquals(0, $this->_getTableCount($archiveTables['blob'][0])); // January
+
+ // check for no changes in the february blob table
+ $this->assertEquals(self::FEB_METRIC_ARCHIVE_COUNT + 1, $this->_getTableCount($archiveTables['blob'][1])); // February
+ }
+
+ /**
+ * Test that purgeData works correctly when the 'keep daily reports' setting is set to true.
+ */
+ public function testPurgeDataDeleteReportsKeepDailyReports()
+ {
+ PrivacyManager::savePurgeDataSettings(array(
+ 'delete_reports_keep_day_reports' => 1
+ ));
+
+ // get purge data prediction
+ $prediction = PrivacyManager::getPurgeEstimate();
+
+ // perform checks on prediction
+ $events = 3; // only the event action for the three purged day, dayAgo=x are purged (others are still in use)
+ $expectedPrediction = array(
+ Common::prefixTable('log_conversion') => 6,
+ Common::prefixTable('log_link_visit_action') => 6 + $events,
+ Common::prefixTable('log_visit') => 3,
+ Common::prefixTable('log_conversion_item') => 3,
+ Common::prefixTable('archive_numeric_2012_01') => -1,
+ Common::prefixTable('archive_blob_2012_01') => 10 // removing 4 weeks, 1 month & 1 year + 1 garbage report + 2 range reports + 1 segmented report
+ );
+ $this->assertEquals($expectedPrediction, $prediction);
+
+ // purge data
+ $this->_setTimeToRun();
+ $this->assertTrue( $this->instance->deleteLogData() );
+ $this->assertTrue($this->instance->deleteReportData() );
+
+ // perform checks
+ $this->checkLogDataPurged();
+ $this->_checkReportsAndMetricsPurged($janBlobsRemaining = 5, $janNumericRemaining = 68); // 5 blobs for 5 days
+ }
+
+ /**
+ * Test that purgeData works correctly when the 'keep weekly reports' setting is set to true.
+ */
+ public function testPurgeDataDeleteReportsKeepWeeklyReports()
+ {
+ PrivacyManager::savePurgeDataSettings(array(
+ 'delete_reports_keep_week_reports' => 1
+ ));
+
+ // get purge data prediction
+ $prediction = PrivacyManager::getPurgeEstimate();
+
+ // perform checks on prediction
+ $events = 3; // only the event action for the three purged day, dayAgo=x are purged (others are still in use)
+ $expectedPrediction = array(
+ Common::prefixTable('log_conversion') => 6,
+ Common::prefixTable('log_link_visit_action') => 6 + $events,
+ Common::prefixTable('log_visit') => 3,
+ Common::prefixTable('log_conversion_item') => 3,
+ Common::prefixTable('archive_numeric_2012_01') => -1,
+ Common::prefixTable('archive_blob_2012_01') => 11 // 5 days, 1 month & 1 year to remove + 1 garbage report + 2 range reports + 1 segmented report
+ );
+ $this->assertEquals($expectedPrediction, $prediction);
+
+ // purge data
+ $this->_setTimeToRun();
+ $this->assertTrue( $this->instance->deleteLogData() );
+ $this->assertTrue($this->instance->deleteReportData() );
+
+ // perform checks
+ $this->checkLogDataPurged();
+ $this->_checkReportsAndMetricsPurged($janBlobsRemaining = 4, $janNumericRemaining = 63); // 4 blobs for 4 weeks
+ }
+
+ /**
+ * Test that purgeData works correctly when the 'keep monthly reports' setting is set to true.
+ */
+ public function testPurgeDataDeleteReportsKeepMonthlyReports()
+ {
+ PrivacyManager::savePurgeDataSettings(array(
+ 'delete_reports_keep_month_reports' => 1
+ ));
+
+ // get purge data prediction
+ $prediction = PrivacyManager::getPurgeEstimate();
+
+ // perform checks on prediction
+ $events = 3; // only the event action for the three purged day, dayAgo=x are purged (others are still in use)
+ $expectedPrediction = array(
+ Common::prefixTable('log_conversion') => 6,
+ Common::prefixTable('log_link_visit_action') => 6 + $events,
+ Common::prefixTable('log_visit') => 3,
+ Common::prefixTable('log_conversion_item') => 3,
+ Common::prefixTable('archive_numeric_2012_01') => -1,
+ Common::prefixTable('archive_blob_2012_01') => 14 // 5 days, 4 weeks, 1 year to remove + 1 garbage report + 2 range reports + 1 segmented report
+ );
+ $this->assertEquals($expectedPrediction, $prediction);
+
+ // purge data
+ $this->_setTimeToRun();
+ $this->assertTrue( $this->instance->deleteLogData() );
+ $this->assertTrue($this->instance->deleteReportData() );
+
+ // perform checks
+ $this->checkLogDataPurged();
+ $this->_checkReportsAndMetricsPurged($janBlobsRemaining = 1, $janNumericRemaining = 48);
+ }
+
+ /**
+ * Test that purgeData works correctly when the 'keep yearly reports' setting is set to true.
+ */
+ public function testPurgeDataDeleteReportsKeepYearlyReports()
+ {
+ PrivacyManager::savePurgeDataSettings(array(
+ 'delete_reports_keep_year_reports' => 1
+ ));
+
+ // get purge data prediction
+ $prediction = PrivacyManager::getPurgeEstimate();
+
+ // perform checks on prediction
+ $events = 3; // only the event action for the three purged day, dayAgo=x are purged (others are still in use)
+ $expectedPrediction = array(
+ Common::prefixTable('log_conversion') => 6,
+ Common::prefixTable('log_link_visit_action') => 6 + $events,
+ Common::prefixTable('log_visit') => 3,
+ Common::prefixTable('log_conversion_item') => 3,
+ Common::prefixTable('archive_numeric_2012_01') => -1,
+ Common::prefixTable('archive_blob_2012_01') => 14 // 5 days, 4 weeks & 1 year to remove + 1 garbage report + 2 range reports + 1 segmented report
+ );
+ $this->assertEquals($expectedPrediction, $prediction);
+
+ // purge data
+ $this->_setTimeToRun();
+ $this->assertTrue( $this->instance->deleteLogData() );
+ $this->assertTrue($this->instance->deleteReportData() );
+
+ // perform checks
+ $this->checkLogDataPurged();
+ $this->_checkReportsAndMetricsPurged($janBlobsRemaining = 1, $janNumericRemaining = 48);
+ }
+
+ /**
+ * Test no concurrency issues when deleting log data from log_action table.
+ */
+ public function testPurgeLogDataConcurrency()
+ {
+ \Piwik\Piwik::addAction("LogDataPurger.ActionsToKeepInserted.olderThan", array($this, 'addReferenceToUnusedAction'));
+
+ $purger = LogDataPurger::make($this->settings, true);
+
+ $this->unusedIdAction = Db::fetchOne(
+ "SELECT idaction FROM " . Common::prefixTable('log_action') . " WHERE name = ?",
+ array('whatever.com/_40'));
+ $this->assertTrue($this->unusedIdAction > 0);
+
+ // purge data
+ $purger->purgeData();
+
+ // check that actions were purged
+ $this->assertEquals(22 + $this->getCountEventIdsNotPurged(), $this->_getTableCount('log_action')); // January
+
+ // check that the unused action still exists
+ $count = Db::fetchOne(
+ "SELECT COUNT(*) FROM " . Common::prefixTable('log_action') . " WHERE idaction = ?",
+ array($this->unusedIdAction));
+ $this->assertEquals(1, $count);
+
+ $this->unusedIdAction = null; // so the hook won't get executed twice
+ }
+
+ /**
+ * Tests that purgeData works correctly when the 'keep range reports' setting is set to true.
+ */
+ public function testPurgeDataDeleteReportsKeepRangeReports()
+ {
+ PrivacyManager::savePurgeDataSettings(array(
+ 'delete_reports_keep_range_reports' => 1
+ ));
+
+ // get purge data prediction
+ $prediction = PrivacyManager::getPurgeEstimate();
+
+ // perform checks on prediction
+ $events = 3; // only the event action for the three purged day, dayAgo=x are purged (others are still in use)
+ $expectedPrediction = array(
+ Common::prefixTable('log_conversion') => 6,
+ Common::prefixTable('log_link_visit_action') => 6 + $events,
+ Common::prefixTable('log_visit') => 3,
+ Common::prefixTable('log_conversion_item') => 3,
+ Common::prefixTable('archive_numeric_2012_01') => -1,
+ Common::prefixTable('archive_blob_2012_01') => 13 // 5 days, 4 weeks, 1 month & 1 year + 1 garbage report + 1 segmented report
+ );
+ $this->assertEquals($expectedPrediction, $prediction);
+
+ // purge data
+ $this->_setTimeToRun();
+ $this->assertTrue( $this->instance->deleteLogData() );
+ $this->assertTrue($this->instance->deleteReportData() );
+
+ // perform checks
+ $this->checkLogDataPurged();
+ $this->_checkReportsAndMetricsPurged($janBlobsRemaining = 2, $janNumericRemaining = 47); // 2 range blobs
+ }
+
+ /**
+ * Tests that purgeData works correctly when the 'keep segment reports' setting is set to true.
+ */
+ public function testPurgeDataDeleteReportsKeepSegmentsReports()
+ {
+ PrivacyManager::savePurgeDataSettings(array(
+ 'delete_reports_keep_day_reports' => 1,
+ 'delete_reports_keep_segment_reports' => 1
+ ));
+
+ // get purge data prediction
+ $prediction = PrivacyManager::getPurgeEstimate();
+
+ // perform checks on prediction
+ $events = 3; // only the event action for the three purged day, dayAgo=x are purged (others are still in use)
+ $expectedPrediction = array(
+ Common::prefixTable('log_conversion') => 6,
+ Common::prefixTable('log_link_visit_action') => 6 + $events,
+ Common::prefixTable('log_visit') => 3,
+ Common::prefixTable('log_conversion_item') => 3,
+ Common::prefixTable('archive_numeric_2012_01') => -1,
+ Common::prefixTable('archive_blob_2012_01') => 9 // 4 weeks, 1 month & 1 year + 1 garbage report + 2 range reports
+ );
+ $this->assertEquals($expectedPrediction, $prediction);
+
+ // purge data
+ $this->_setTimeToRun();
+ $this->assertTrue( $this->instance->deleteLogData() );
+ $this->assertTrue($this->instance->deleteReportData() );
+
+ // perform checks
+ $this->checkLogDataPurged();
+ $this->_checkReportsAndMetricsPurged($janBlobsRemaining = 6, $janNumericRemaining = 70); // 1 segmented blob + 5 day blobs
+ }
+
+ // --- utility functions follow ---
+
+ protected static function _addLogData()
+ {
+ // tracks visits on the following days:
+ // - 2012-01-09
+ // - 2012-01-14
+ // - 2012-01-19
+ // - 2012-01-24 <--- everything before this date is to be purged
+ // - 2012-01-29
+ // - 2012-02-03
+ // - 2012-02-08
+ // - 2012-02-13
+ // - 2012-02-18
+ // - 2012-02-23
+ // - 2012-02-28
+ // 6 visits in feb, 5 in jan
+
+ // following actions are created:
+ // - 'First page view'
+ // - 'Second page view'
+ // - 'SKU2'
+ // - 'Canon SLR'
+ // - 'Electronics & Cameras'
+ // - for every visit (11 visits total):
+ // - http://whatever.com/_{$daysSinceLastVisit}
+ // - http://whatever.com/42/{$daysSinceLastVisit}
+
+ $start = Date::factory(self::$dateTime);
+ self::$idSite = Fixture::createWebsite('2012-01-01', $ecommerce = 1);
+ APIGoals::getInstance()->addGoal(self::$idSite, 'match all', 'url', 'http', 'contains');
+
+ $t = Fixture::getTracker(self::$idSite, $start, $defaultInit = true);
+ $t->enableBulkTracking();
+ $t->setTokenAuth(Fixture::getTokenAuth());
+
+ for ($daysAgo = self::$daysAgoStart; $daysAgo >= 0; $daysAgo -= 5) // one visit every 5 days
+ {
+ $dateTime = $start->subDay($daysAgo)->toString();
+
+ $t->setForceVisitDateTime($dateTime);
+ $t->setUserAgent('Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.2.6) Gecko/20100625 Firefox/3.6.6 (.NET CLR 3.5.30729)');
+
+ // use $daysAgo to make sure new actions are created for every day and aren't used again.
+ // when deleting visits, some of these actions will no longer be referenced in the DB.
+ $t->setUrl("http://whatever.com/_$daysAgo");
+ $t->doTrackPageView('First page view');
+
+ $t->setForceVisitDateTime(Date::factory($dateTime)->addHour(0.05));
+ $t->setUrl("http://whatever.com/42/$daysAgo");
+ $t->doTrackPageView('Second page view');
+
+ $t->setForceVisitDateTime(Date::factory($dateTime)->addHour(0.1));
+ $t->setUrl("http://whatever.com/event");
+ $t->doTrackEvent('Event action', 'event cat', 'daysAgo=' . $daysAgo, 1000);
+
+ $t->setForceVisitDateTime(Date::factory($dateTime)->addHour(0.2));
+ $t->addEcommerceItem($sku = 'SKU2', $name = 'Canon SLR', $category = 'Electronics & Cameras',
+ $price = 1500, $quantity = 1);
+ $t->doTrackEcommerceOrder($orderId = '937nsjusu ' . $dateTime, $grandTotal = 1111.11, $subTotal = 1000,
+ $tax = 111, $shipping = 0.11, $discount = 666);
+ }
+ Fixture::checkBulkTrackingResponse($t->doBulkTrack());
+ }
+
+ protected static function _addReportData()
+ {
+ $date = Date::factory(self::$dateTime);
+
+ $archive = Archive::build(self::$idSite, 'year', $date);
+
+ APIVisitorInterest::getInstance()->getNumberOfVisitsPerVisitDuration(self::$idSite, 'year', $date);
+
+ // months are added via the 'year' period, but weeks must be done manually
+ for ($daysAgo = self::$daysAgoStart; $daysAgo > 0; $daysAgo -= 7) // every week
+ {
+ $dateTime = $date->subDay($daysAgo);
+
+ $archive = Archive::build(self::$idSite, 'week', $dateTime);
+ $archive->getNumeric('nb_visits');
+
+ APIVisitorInterest::getInstance()->getNumberOfVisitsPerVisitDuration(
+ self::$idSite, 'week', $dateTime);
+ }
+
+ // add segment for one day
+ $archive = Archive::build(self::$idSite, 'day', '2012-01-14', 'browserCode==FF');
+ $archive->getNumeric('nb_visits', 'nb_hits');
+
+ APIVisitorInterest::getInstance()->getNumberOfVisitsPerVisitDuration(
+ self::$idSite, 'day', '2012-01-14', 'browserCode==FF');
+
+ // add range within January
+ $rangeEnd = Date::factory('2012-01-29');
+ $rangeStart = $rangeEnd->subDay(1);
+ $range = $rangeStart->toString('Y-m-d') . "," . $rangeEnd->toString('Y-m-d');
+
+ $rangeArchive = Archive::build(self::$idSite, 'range', $range);
+ $rangeArchive->getNumeric('nb_visits', 'nb_hits');
+
+ APIVisitorInterest::getInstance()->getNumberOfVisitsPerVisitDuration(self::$idSite, 'range', $range);
+
+ // add range between January & February
+ $rangeStart = $rangeEnd;
+ $rangeEnd = $rangeStart->addDay(3);
+ $range = $rangeStart->toString('Y-m-d') . "," . $rangeEnd->toString('Y-m-d');
+
+ $rangeArchive = Archive::build(self::$idSite, 'range', $range);
+ $rangeArchive->getNumeric('nb_visits', 'nb_hits');
+
+ APIVisitorInterest::getInstance()->getNumberOfVisitsPerVisitDuration(self::$idSite, 'range', $range);
+
+ // when archiving is initiated, the archive metrics & reports for EVERY loaded plugin
+ // are archived. don't want this test to depend on every possible metric, so get rid of
+ // the unwanted archive data now.
+ $metricsToSave = array(
+ 'nb_visits',
+ 'nb_actions',
+ Archiver::getRecordName('revenue'),
+ Archiver::getRecordName('nb_conversions', 1),
+ Archiver::getRecordName('revenue', GoalManager::IDGOAL_ORDER)
+ );
+
+ $archiveTables = self::_getArchiveTableNames();
+ foreach ($archiveTables['numeric'] as $table) {
+ $realTable = Common::prefixTable($table);
+ $sql = "DELETE FROM $realTable WHERE name NOT IN ('" . implode("','", $metricsToSave) . "') AND name NOT LIKE 'done%'";
+ Db::query($sql);
+ }
+ foreach ($archiveTables['blob'] as $table) {
+ $realTable = Common::prefixTable($table);
+ Db::query("DELETE FROM $realTable WHERE name NOT IN ('VisitorInterest_timeGap')");
+ }
+
+ // add garbage metrics
+ $janDate1 = '2012-01-05';
+ $febDate1 = '2012-02-04';
+
+ $sql = "INSERT INTO %s (idarchive,name,idsite,date1,date2,period,ts_archived,value)
+ VALUES (10000,?,1,?,?,?,?,?)";
+
+ // one metric for jan & one for feb
+ Db::query(sprintf($sql, Common::prefixTable($archiveTables['numeric'][0])),
+ array(self::GARBAGE_FIELD, $janDate1, $janDate1, $janDate1, 1, 100));
+ Db::query(sprintf($sql, Common::prefixTable($archiveTables['numeric'][1])),
+ array(self::GARBAGE_FIELD, $febDate1, $febDate1, $febDate1, 1, 200));
+
+ // add garbage reports
+ Db::query(sprintf($sql, Common::prefixTable($archiveTables['blob'][0])),
+ array(self::GARBAGE_FIELD, $janDate1, $janDate1, $janDate1, 10, 'blobval'));
+ Db::query(sprintf($sql, Common::prefixTable($archiveTables['blob'][1])),
+ array(self::GARBAGE_FIELD, $febDate1, $febDate1, $febDate1, 20, 'blobval'));
+ }
+
+ protected function _checkNoDataChanges()
+ {
+ // 11 visits total w/ 2 actions per visit & 2 conversions per visit. 1 e-commerce order per visit.
+ $this->assertEquals(11, $this->_getTableCount('log_visit'));
+ $this->assertEquals(22, $this->_getTableCount('log_conversion'));
+ $this->assertEquals(33, $this->_getTableCount('log_link_visit_action'));
+ $this->assertEquals(11, $this->_getTableCount('log_conversion_item'));
+ $this->assertEquals(41, $this->_getTableCount('log_action'));
+
+ $archiveTables = self::_getArchiveTableNames();
+ //var_export(Db::fetchAll("SELECT * FROM " . Common::prefixTable($archiveTables['numeric'][0])));
+
+ $janMetricCount = $this->_getExpectedNumericArchiveCountJan();
+ $this->assertEquals($janMetricCount, $this->_getTableCount($archiveTables['numeric'][0])); // January
+
+ // no range metric for february
+ $febMetricCount = $this->_getExpectedNumericArchiveCountFeb();
+ $this->assertEquals($febMetricCount, $this->_getTableCount($archiveTables['numeric'][1])); // February
+
+ // 1 entry per period w/ visits + 1 garbage report + 2 range reports + 1 segment report
+ $this->assertEquals(self::JAN_METRIC_ARCHIVE_COUNT + 1 + 2 + 1, $this->_getTableCount($archiveTables['blob'][0])); // January
+ $this->assertEquals(self::FEB_METRIC_ARCHIVE_COUNT + 1, $this->_getTableCount($archiveTables['blob'][1])); // February
+ }
+
+ /**
+ * Helper method. Performs checks after reports are purged. Checks that the january numeric table
+ * was dropped, that the february metric & blob tables are unaffected, and that the january blob
+ * table has a certain number of blobs.
+ */
+ protected function _checkReportsAndMetricsPurged($janBlobsRemaining, $janNumericRemaining)
+ {
+ $archiveTables = self::_getArchiveTableNames();
+
+ $this->assertEquals($janNumericRemaining, $this->_getTableCount($archiveTables['numeric'][0]));
+
+ // check february numerics not deleted
+ $febRowCount = $this->_getExpectedNumericArchiveCountFeb();
+ $this->assertEquals($febRowCount, $this->_getTableCount($archiveTables['numeric'][1])); // February
+
+ // check the january blob count
+ $this->assertEquals($janBlobsRemaining, $this->_getTableCount($archiveTables['blob'][0])); // January
+
+ // check for no changes in the february blob table (1 blob for every period w/ visits in feb + 1 garbage report)
+ $this->assertEquals(self::FEB_METRIC_ARCHIVE_COUNT + 1, $this->_getTableCount($archiveTables['blob'][1])); // February
+ }
+
+ private function checkLogDataPurged()
+ {
+ // 3 days removed by purge, so 3 visits, 6 conversions, 6 visit actions, 3 e-commerce orders
+ // & 6 actions removed
+ $events = 11 - 3; // 3 deleted;
+ $this->assertEquals(8, $this->_getTableCount('log_visit'));
+ $this->assertEquals(16, $this->_getTableCount('log_conversion'));
+ $this->assertEquals(16 + $events, $this->_getTableCount('log_link_visit_action'));
+ $this->assertEquals(8, $this->_getTableCount('log_conversion_item'));
+
+ $eventsId = $this->getCountEventIdsNotPurged();
+ $this->assertEquals(21 + $eventsId, $this->_getTableCount('log_action'));
+ }
+
+ /**
+ * Event hook that adds a row into the DB that references unused idaction AFTER LogDataPurger
+ * does the insert into the temporary table. When log_actions are deleted, this idaction should still
+ * be kept. w/ the wrong strategy, it won't be and there will be a dangling reference
+ * in the log_link_visit_action table.
+ */
+ public function addReferenceToUnusedAction()
+ {
+ $unusedIdAction = $this->unusedIdAction;
+ if (empty($unusedIdAction)) // make sure we only do this for one test case
+ {
+ return;
+ }
+
+ $logLinkVisitActionTable = Common::prefixTable("log_link_visit_action");
+
+ $sql = "INSERT INTO $logLinkVisitActionTable
+ (idsite, idvisitor, server_time, idvisit, idaction_url, idaction_url_ref,
+ idaction_name, idaction_name_ref, time_spent_ref_action)
+ VALUES (1, 'abc', NOW(), 15, $unusedIdAction, $unusedIdAction,
+ $unusedIdAction, $unusedIdAction, 1000)";
+
+ Db::query($sql);
+ }
+
+ protected function _setTimeToRun()
+ {
+ $lastDateSecs = Date::factory('today')->subDay(8)->getTimestamp();
+
+ Option::set(PrivacyManager::OPTION_LAST_DELETE_PIWIK_LOGS_INITIAL, 1);
+ Option::set(PrivacyManager::OPTION_LAST_DELETE_PIWIK_LOGS, $lastDateSecs);
+ Option::set(PrivacyManager::OPTION_LAST_DELETE_PIWIK_REPORTS, $lastDateSecs);
+ }
+
+ protected function _getTableCount($tableName, $where = '')
+ {
+ $sql = "SELECT COUNT(*) FROM " . Common::prefixTable($tableName) . " $where";
+ return Db::fetchOne($sql);
+ }
+
+ protected function dumpTable($tableName, $where = '')
+ {
+ $sql = "SELECT * FROM " . Common::prefixTable($tableName) . " $where";
+ var_export(Db::fetchAll($sql));
+ }
+
+ protected function _tableExists($tableName)
+ {
+ $dbName = Config::getInstance()->database['dbname'];
+
+ $sql = "SELECT COUNT(*) FROM information_schema.tables WHERE table_schema = ? AND table_name = ?";
+ return Db::fetchOne($sql, array($dbName, Common::prefixTable($tableName))) == 1;
+ }
+
+ protected static function _getArchiveTableNames()
+ {
+ return array(
+ 'numeric' => array(
+ 'archive_numeric_2012_01',
+ 'archive_numeric_2012_02'
+ ),
+ 'blob' => array(
+ 'archive_blob_2012_01',
+ 'archive_blob_2012_02'
+ )
+ );
+ }
+
+ protected function _getExpectedNumericArchiveCountJan()
+ {
+ // 5 entries per period w/ visits
+ // + 1 entry for every period in the month (the 'done' rows)
+ // + 1 garbage metric
+ // log_link_visit_action+ 2 entries per range period (4 total) + 2 'done...' entries per range period (4 total)
+ // + 2 entries per segment (2 total) + 2 'done...' entries per segment (2 total)
+ return self::JAN_METRIC_ARCHIVE_COUNT * 5 + self::TOTAL_JAN_ARCHIVE_COUNT + 1 + 8 + 4;
+ }
+
+ protected function _getExpectedNumericArchiveCountFeb()
+ {
+ // (5 metrics per period w/ visits
+ // + 1 'done' archive for every period)
+ // + 1 garbage metric
+ return self::FEB_METRIC_ARCHIVE_COUNT * 5 + self::TOTAL_FEB_ARCHIVE_COUNT + 1;
+ }
+
+ /**
+ * @return int
+ */
+ private function getCountEventIdsNotPurged()
+ {
+ $eventsId = 11 /* days eventAction */ + 2 /* category+name */ + 1 /* event url */ - 3 /* days deleted */
+ ;
+ return $eventsId;
+ }
+} \ No newline at end of file
diff --git a/tests/PHPUnit/System/PurgeDataTest.php b/tests/PHPUnit/System/PurgeDataTest.php
new file mode 100755
index 0000000000..3e1d8f4b53
--- /dev/null
+++ b/tests/PHPUnit/System/PurgeDataTest.php
@@ -0,0 +1,194 @@
+<?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\System;
+
+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\Impl\SystemTestCase;
+use Piwik\Tests\Fixtures\OneVisitorTwoVisits;
+
+/**
+ * TODO: shouldn't this be merged w/ PrivacyManagerTest? the original data purging tests are there
+ *
+ * @group Core
+ * @group PurgeDataTest
+ */
+class PurgeDataTest extends SystemTestCase
+{
+ public static $fixture = null; // initialized below class definition
+
+ public static function setUpBeforeClass()
+ {
+
+ }
+ public static function tearDownBeforeClass()
+ {
+
+ }
+
+ public function setUp()
+ {
+ parent::setUpBeforeClass();
+ }
+
+ public function tearDown()
+ {
+ parent::tearDownAfterClass();
+ }
+
+ public function test_purgeData_keepAllExceptDay()
+ {
+ $this->assertHasOneDownload('day');
+ $this->assertHasOneDownload('week');
+ $this->assertHasOneDownload('month');
+ $this->assertHasOneDownload('year');
+
+ $deleteReportsOlderThan = 1;
+ $keepBasicMetrics = true;
+ $reportPeriodsToKeep = array(2,3,4,5);
+ $this->purgeData($deleteReportsOlderThan, $reportPeriodsToKeep, $keepBasicMetrics);
+
+ $this->assertHasNoDownload('day');
+ $this->assertHasOneDownload('week');
+ $this->assertHasOneDownload('month');
+ $this->assertHasOneDownload('year');
+ }
+
+ public function test_purgeData_keepOnlyDay()
+ {
+ $this->assertHasOneDownload('day');
+ $this->assertHasOneDownload('week');
+ $this->assertHasOneDownload('month');
+ $this->assertHasOneDownload('year');
+
+ $deleteReportsOlderThan = 1;
+ $keepBasicMetrics = true;
+ $reportPeriodsToKeep = array(1);
+ $this->purgeData($deleteReportsOlderThan, $reportPeriodsToKeep, $keepBasicMetrics);
+
+ $this->assertNumVisits(2, 'day');
+ $this->assertNumVisits(2, 'week');
+ $this->assertHasOneDownload('day');
+ $this->assertHasNoDownload('week');
+ $this->assertHasNoDownload('month');
+ $this->assertHasNoDownload('year');
+ }
+
+ public function test_purgeData_shouldNotPurgeAnything_IfDeleteReportsOlderThanIsFarBackInThePast()
+ {
+ $this->assertHasOneDownload('day');
+ $this->assertHasOneDownload('week');
+ $this->assertHasOneDownload('month');
+ $this->assertHasOneDownload('year');
+
+ $deleteReportsOlderThan = 1000;
+ $keepBasicMetrics = true;
+ $reportPeriodsToKeep = array(1,2,3,4,5);
+ $this->purgeData($deleteReportsOlderThan, $reportPeriodsToKeep, $keepBasicMetrics);
+
+ $this->assertHasOneDownload('day');
+ $this->assertHasOneDownload('week');
+ $this->assertHasOneDownload('month');
+ $this->assertHasOneDownload('year');
+ }
+
+ public function test_purgeData_shouldPurgeAllPeriodsExceptBasicMetrics_IfNoPeriodToKeepIsGiven()
+ {
+ $this->assertHasOneDownload('day');
+ $this->assertHasOneDownload('week');
+ $this->assertHasOneDownload('month');
+ $this->assertHasOneDownload('year');
+
+ $deleteReportsOlderThan = 1;
+ $keepBasicMetrics = true;
+ $reportPeriodsToKeep = array();
+ $this->purgeData($deleteReportsOlderThan, $reportPeriodsToKeep, $keepBasicMetrics);
+
+ $this->assertNumVisits(2, 'day');
+ $this->assertNumVisits(2, 'week');
+ $this->assertNumVisits(2, 'month');
+ $this->assertNumVisits(2, 'year');
+ $this->assertHasNoDownload('day');
+ $this->assertHasNoDownload('week');
+ $this->assertHasNoDownload('month');
+ $this->assertHasNoDownload('year');
+ }
+
+ public function test_purgeData_shouldPurgeEverything_IfNoPeriodToKeepIsGivenAndBasicMetricsNotKept()
+ {
+ $this->assertHasOneDownload('day');
+ $this->assertHasOneDownload('week');
+ $this->assertHasOneDownload('month');
+ $this->assertHasOneDownload('year');
+
+ $deleteReportsOlderThan = 1;
+ $keepBasicMetrics = false;
+ $reportPeriodsToKeep = array();
+ $this->purgeData($deleteReportsOlderThan, $reportPeriodsToKeep, $keepBasicMetrics);
+
+ $this->assertNumVisits(0, 'day');
+ $this->assertNumVisits(0, 'week');
+ $this->assertNumVisits(0, 'month');
+ $this->assertNumVisits(0, 'year');
+ $this->assertHasNoDownload('day');
+ $this->assertHasNoDownload('week');
+ $this->assertHasNoDownload('month');
+ $this->assertHasNoDownload('year');
+ }
+
+ private function assertNumVisits($expectedNumVisits, $period)
+ {
+ $url = 'method=VisitsSummary.getVisits'
+ . '&idSite=' . self::$fixture->idSite
+ . '&date=' . self::$fixture->dateTime
+ . '&period='. $period
+ . '&format=original';
+ $api = new Request($url);
+ $table = $api->process();
+ $this->assertEquals($expectedNumVisits, $table->getFirstRow()->getColumn('nb_visits'));
+ }
+
+ private function assertHasOneDownload($period)
+ {
+ $api = new Request($this->getDownloadApiRequestUrl($period));
+ $table = $api->process();
+ $this->assertEquals(1, $table->getRowsCount(), $period . ' should have one download but has not');
+ }
+
+ private function assertHasNoDownload($period)
+ {
+ $api = new Request($this->getDownloadApiRequestUrl($period));
+ $table = $api->process();
+ $this->assertEquals(0, $table->getRowsCount(), $period . ' should not have a download but has one');
+ }
+
+ private function getDownloadApiRequestUrl($period)
+ {
+ return 'method=Actions.getDownloads'
+ . '&idSite=' . self::$fixture->idSite
+ . '&date=' . self::$fixture->dateTime
+ . '&period='. $period
+ . '&format=original';
+ }
+
+ private function purgeData($deleteReportsOlderThan, $reportPeriodsToKeep, $keepBasicMetrics)
+ {
+ $metricsToKeep = PrivacyManager::getAllMetricsToKeep();
+ $maxRowsToDeletePerQuery = 100000;
+ $keepSegmentReports = false;
+
+ $purger = new ReportsPurger($deleteReportsOlderThan, $keepBasicMetrics, $reportPeriodsToKeep,
+ $keepSegmentReports, $metricsToKeep, $maxRowsToDeletePerQuery);
+ $purger->purgeData();
+ }
+}
+
+PurgeDataTest::$fixture = new OneVisitorTwoVisits();
diff --git a/tests/PHPUnit/System/RowEvolutionTest.php b/tests/PHPUnit/System/RowEvolutionTest.php
new file mode 100755
index 0000000000..e70379279f
--- /dev/null
+++ b/tests/PHPUnit/System/RowEvolutionTest.php
@@ -0,0 +1,239 @@
+<?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\System;
+
+use Piwik\Tests\Impl\SystemTestCase;
+use Piwik\Tests\Fixtures\TwoSitesManyVisitsOverSeveralDaysWithSearchEngineReferrers;
+
+/**
+ * Tests the method API.getRowEvolution
+ *
+ * @group RowEvolutionTest
+ * @group Plugins
+ */
+class RowEvolutionTest extends SystemTestCase
+{
+ public static $fixture = null; // initialized below class definition
+
+ /**
+ * @dataProvider getApiForTesting
+ */
+ public function testApi($api, $params)
+ {
+ $this->runApiTests($api, $params);
+ }
+
+ public function getApiForTesting()
+ {
+ $idSite = self::$fixture->idSite;
+ $idSite2 = self::$fixture->idSite2;
+ $dateTime = self::$fixture->dateTime;
+ $keywords = self::$fixture->keywords;
+
+ $return = array();
+
+ $config = array(
+ 'testSuffix' => '_referrer1',
+ 'idSite' => $idSite,
+ 'date' => $dateTime,
+ 'otherRequestParameters' => array(
+ 'date' => '2010-02-06,2010-03-06',
+ 'period' => 'day',
+ 'apiModule' => 'Referrers',
+ 'apiAction' => 'getWebsites',
+ 'label' => 'www.referrer2.com',
+ 'expanded' => 0
+ )
+ );
+
+ $return[] = array('API.getRowEvolution', $config);
+
+ // Websites, hierarchical
+ $config['testSuffix'] = '_referrer2';
+ $referrerLabel = urlencode('www.referrer0.com') . '>' . urlencode('theReferrerPage1.html');
+ $config['otherRequestParameters']['label'] = ($referrerLabel);
+ $return[] = array('API.getRowEvolution', $config);
+
+ // Websites, multiple labels including one hierarchical
+ $config['testSuffix'] = '_referrerMulti1';
+ $referrerLabel = $referrerLabel . ',' . urlencode('www.referrer2.com');
+ $config['otherRequestParameters']['label'] = ($referrerLabel);
+ $return[] = array('API.getRowEvolution', $config);
+
+ // Keywords, label containing > and ,
+ $config['otherRequestParameters']['apiAction'] = 'getKeywords';
+ $config['testSuffix'] = '_LabelReservedCharacters';
+ $keywordsStr = urlencode($keywords[0]) . ',' . urlencode($keywords[1]);
+ $config['otherRequestParameters']['label'] = ($keywordsStr);
+ $return[] = array('API.getRowEvolution', $config);
+
+ // Keywords, hierarchical
+ $config['otherRequestParameters']['apiAction'] = 'getSearchEngines';
+ $config['testSuffix'] = '_LabelReservedCharactersHierarchical';
+ $keywordsStr = "Google>" . urlencode(strtolower($keywords[0]))
+ . ',Google>' . urlencode(strtolower($keywords[1]))
+ . ',Google>' . urlencode(strtolower($keywords[2]));
+ // Test multiple labels search engines, Google should also have a 'logo' entry
+ $config['otherRequestParameters']['label'] = ($keywordsStr . ",Google");
+ $config['otherRequestParameters']['filter_limit'] = 1; // should have no effect
+ $return[] = array('API.getRowEvolution', $config);
+
+ // Actions > Pages titles, standard label
+ $config['testSuffix'] = '_pageTitles';
+ $config['periods'] = array('day', 'week');
+ $config['otherRequestParameters']['apiModule'] = 'Actions';
+ $config['otherRequestParameters']['apiAction'] = 'getPageTitles';
+ $config['otherRequestParameters']['label'] = ('incredible title 0');
+ $config['otherRequestParameters']['filter_limit'] = 1; // should have no effect
+ $return[] = array('API.getRowEvolution', $config);
+
+ // Actions > Page titles, multiple labels
+ $config['testSuffix'] = '_pageTitlesMulti';
+ $label = urlencode('incredible title 0') . ',' . urlencode('incredible title 2');
+ $config['otherRequestParameters']['label'] = ($label);
+ $return[] = array('API.getRowEvolution', $config);
+
+ // standard label, entry page titles
+ $config['testSuffix'] = '_entryPageTitles';
+ $config['periods'] = 'day';
+ $config['otherRequestParameters']['apiModule'] = 'Actions';
+ $config['otherRequestParameters']['apiAction'] = 'getEntryPageTitles';
+ $config['otherRequestParameters']['label'] = urlencode('incredible title 0');
+ $return[] = array('API.getRowEvolution', $config);
+
+ // Actions > Page URLS, hierarchical label
+ $config['testSuffix'] = '_pageUrls';
+ $config['periods'] = array('range');
+ $config['otherRequestParameters']['date'] = '2010-03-01,2010-03-06';
+ $config['otherRequestParameters']['apiModule'] = 'Actions';
+ $config['otherRequestParameters']['apiAction'] = 'getPageUrls';
+ $config['otherRequestParameters']['label'] = ('my>dir>' . urlencode('/page3?foo=bar&baz=bar'));
+ $return[] = array('API.getRowEvolution', $config);
+
+ // Goals > Visits Until Conversion, idGoal != 0
+ $config['testSuffix'] = '_goals_visitsUntilConversion';
+ $config['periods'] = array('day');
+ $config['otherRequestParameters']['date'] = '2010-02-06,2010-03-06';
+ $config['otherRequestParameters']['period'] = 'day';
+ $config['otherRequestParameters']['apiModule'] = 'Goals';
+ $config['otherRequestParameters']['apiAction'] = 'getVisitsUntilConversion';
+ $config['otherRequestParameters']['label'] = ('1 visit, 2 visits');
+ $config['otherRequestParameters']['idGoal'] = '2';
+ $return[] = array('API.getRowEvolution', $config);
+
+ // Goals > Visits Until Conversion, idGoal != 0, without specifying labels
+ $config['testSuffix'] = '_goals_visitsUntilConversion_WithoutLabels';
+ $config['periods'] = array('day');
+ $config['otherRequestParameters']['date'] = '2010-02-06,2010-03-06';
+ $config['otherRequestParameters']['period'] = 'day';
+ $config['otherRequestParameters']['apiModule'] = 'Goals';
+ $config['otherRequestParameters']['apiAction'] = 'getVisitsUntilConversion';
+ $config['otherRequestParameters']['label'] = false;
+ $config['otherRequestParameters']['filter_limit'] = 2;
+ $config['otherRequestParameters']['filter_sort_column'] = 'nb_conversions';
+ $config['otherRequestParameters']['idGoal'] = '2';
+ $return[] = array('API.getRowEvolution', $config);
+
+ // test date range where most recent date has no data (for #3465)
+ $return[] = array('API.getRowEvolution', array(
+ 'testSuffix' => '_multipleDates_lastNoData',
+ 'periods' => 'month',
+ 'idSite' => $idSite,
+ 'date' => $dateTime,
+ 'otherRequestParameters' => array(
+ 'date' => '2010-02-01,2010-04-08',
+ 'period' => 'month',
+ 'apiModule' => 'Referrers',
+ 'apiAction' => 'getKeywords',
+ // no label
+ )
+ ));
+
+ // test that reports that process row labels are treated correctly
+ $return[] = array('API.getRowEvolution', array(
+ 'testSuffix' => '_processedRowLabel',
+ 'periods' => 'day',
+ 'idSite' => $idSite2,
+ 'date' => $dateTime,
+ 'otherRequestParameters' => array(
+ 'date' => '2010-03-01,2010-03-06',
+ 'period' => 'month',
+ 'apiModule' => 'UserSettings',
+ 'apiAction' => 'getBrowser',
+ 'label' => 'Firefox,Chrome,Opera'
+ )
+ ));
+
+ // test Row Evolution on Desktop VS Mobile, special "view" report
+ $return[] = array('API.getRowEvolution', array(
+ 'testSuffix' => '_mobileDesktop',
+ 'periods' => 'day',
+ 'idSite' => $idSite2,
+ 'date' => $dateTime,
+ 'otherRequestParameters' => array(
+ 'date' => '2010-03-01,2010-03-06',
+ 'period' => 'month',
+ 'apiModule' => 'UserSettings',
+ 'apiAction' => 'getMobileVsDesktop',
+ 'label' => 'Desktop,Mobile'
+ )
+ ));
+
+ // test multi row evolution w/ filter_limit to limit all available labels
+ $return[] = array('API.getRowEvolution', array(
+ 'testSuffix' => '_multiWithFilterLimit',
+ 'periods' => 'day',
+ 'idSite' => $idSite,
+ 'date' => $dateTime,
+ 'otherRequestParameters' => array(
+ 'date' => '2010-03-01,2010-03-06',
+ 'period' => 'day',
+ 'apiModule' => 'Referrers',
+ 'apiAction' => 'getWebsites',
+ 'filter_limit' => 3, // only 3 labels should show up
+ )
+ ));
+
+ // test multi row evolution when there is no data
+ $return[] = array('API.getRowEvolution', array(
+ 'testSuffix' => '_multiWithNoData',
+ 'periods' => 'day',
+ 'idSite' => $idSite,
+ 'date' => $dateTime,
+ 'otherRequestParameters' => array(
+ 'date' => '2010-04-01,2010-04-06',
+ 'period' => 'day',
+ 'apiModule' => 'Referrers',
+ 'apiAction' => 'getWebsites',
+ // no label
+ )
+ ));
+
+ // (non-rowevolution test) test flattener w/ search engines to make sure
+ // queued filters are not applied twice
+ $return[] = array('Referrers.getSearchEngines', array(
+ 'testSuffix' => '_flatFilters',
+ 'periods' => 'month',
+ 'idSite' => $idSite,
+ 'date' => '2010-02-01',
+ 'otherRequestParameters' => array(
+ 'flat' => 1,
+ 'expanded' => '0'
+ )
+ ));
+
+ return $return;
+ }
+
+ public static function getOutputPrefix()
+ {
+ return 'RowEvolution';
+ }
+}
+
+RowEvolutionTest::$fixture = new TwoSitesManyVisitsOverSeveralDaysWithSearchEngineReferrers(); \ No newline at end of file
diff --git a/tests/PHPUnit/System/SiteSearchTest.php b/tests/PHPUnit/System/SiteSearchTest.php
new file mode 100755
index 0000000000..653d361951
--- /dev/null
+++ b/tests/PHPUnit/System/SiteSearchTest.php
@@ -0,0 +1,95 @@
+<?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\System;
+
+use Piwik\Tests\Impl\SystemTestCase;
+use Piwik\Tests\Fixtures\ThreeSitesWithManyVisitsWithSiteSearch;
+
+/**
+ * Testing the various use cases w/ internal Site Search tracking
+ *
+ * @group SiteSearchTest
+ * @group Plugins
+ */
+class SiteSearchTest extends SystemTestCase
+{
+ public static $fixture = null; // initialized below class definition
+
+ /**
+ * @dataProvider getApiForTesting
+ */
+ public function testApi($api, $params)
+ {
+ $this->runApiTests($api, $params);
+ }
+
+ protected function getApiToCall()
+ {
+ return array(
+ 'Actions.get',
+ 'Actions.getPageUrls',
+ 'Actions.getPageTitles',
+ 'CustomVariables.getCustomVariables',
+ 'Actions.getSiteSearchKeywords',
+ 'Actions.getSiteSearchCategories',
+ 'Actions.getSiteSearchNoResultKeywords',
+ 'Actions.getPageTitlesFollowingSiteSearch',
+ 'Actions.getPageUrlsFollowingSiteSearch',
+ );
+ }
+
+ public function getApiForTesting()
+ {
+ $dateTime = self::$fixture->dateTime;
+ $idSite1 = self::$fixture->idSite1;
+
+ $apiToCall = $this->getApiToCall();
+
+ $periods = array('day', 'month');
+
+ $result = array(
+ // Request data for the last 6 periods and idSite=all
+ array($apiToCall, array('idSite' => 'all',
+ 'date' => $dateTime,
+ 'periods' => $periods,
+ 'setDateLastN' => true,
+ 'testSuffix' => '_AllSites')),
+
+ // We also test a single period/single site to check that this use case (Reports per idSite in the response) works
+ array($apiToCall, array(
+ 'idSite' => $idSite1,
+ 'date' => $dateTime,
+ 'periods' => $periods,
+ 'setDateLastN' => false,
+ 'testSuffix' => '_NotLastNPeriods')),
+ );
+
+ // testing metadata API for multiple periods
+ foreach ($apiToCall as $api) {
+ list($apiModule, $apiAction) = explode(".", $api);
+
+ $result[] = array(
+ 'API.getProcessedReport', array('idSite' => $idSite1,
+ 'date' => $dateTime,
+ 'periods' => $periods,
+ 'setDateLastN' => true,
+ 'apiModule' => $apiModule,
+ 'apiAction' => $apiAction,
+ 'testSuffix' => '_' . $api . '_firstSite_lastN')
+ );
+ }
+ return $result;
+ }
+
+ public static function getOutputPrefix()
+ {
+ return 'SiteSearch';
+ }
+}
+
+SiteSearchTest::$fixture = new ThreeSitesWithManyVisitsWithSiteSearch(); \ No newline at end of file
diff --git a/tests/PHPUnit/System/TimezonesTest.php b/tests/PHPUnit/System/TimezonesTest.php
new file mode 100644
index 0000000000..952f045c16
--- /dev/null
+++ b/tests/PHPUnit/System/TimezonesTest.php
@@ -0,0 +1,58 @@
+<?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\System;
+
+use Piwik\Date;
+use Piwik\Tests\Impl\SystemTestCase;
+use Piwik\Tests\Fixtures\VisitsInDifferentTimezones;
+
+/**
+ * Test reports using visits for a site with a non-UTC timezone.
+ *
+ * @group TimezonesTest
+ * @group Core
+ */
+class TimezonesTest extends SystemTestCase
+{
+ public static $fixture = null; // initialized below class definition
+
+ public function getApiForTesting()
+ {
+ $idSite = self::$fixture->idSite;
+ $date = self::$fixture->date;
+
+ return array(
+ // should have 1 visit
+ array('Live.getLastVisitsDetails', array('idSite' => $idSite,
+ 'date' => $date,
+ 'period' => 'day')),
+
+ // should have 1 visit
+ array('VisitsSummary.get', array('idSite' => $idSite,
+ 'date' => $date,
+ 'period' => 'day',
+ 'testSuffix' => '_withVisit')),
+
+ // should have no visits
+ array('VisitsSummary.get', array('idSite' => $idSite,
+ 'date' => Date::factory($date)->addDay(1)->getDatetime(),
+ 'period' => 'day',
+ 'testSuffix' => '_dayAfterVisit')),
+ );
+ }
+
+ /**
+ * @dataProvider getApiForTesting
+ */
+ public function testApi($api, $params)
+ {
+ $this->runApiTests($api, $params);
+ }
+}
+
+TimezonesTest::$fixture = new VisitsInDifferentTimezones(); \ No newline at end of file
diff --git a/tests/PHPUnit/System/TrackCustomVariablesAndCampaignsForceUsingVisitIdNotHeuristicsTest.php b/tests/PHPUnit/System/TrackCustomVariablesAndCampaignsForceUsingVisitIdNotHeuristicsTest.php
new file mode 100755
index 0000000000..95da206c6a
--- /dev/null
+++ b/tests/PHPUnit/System/TrackCustomVariablesAndCampaignsForceUsingVisitIdNotHeuristicsTest.php
@@ -0,0 +1,49 @@
+<?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\System;
+
+use Piwik\Tests\Impl\SystemTestCase;
+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 Plugins
+ */
+class TrackCustomVariablesAndCampaignsForceUsingVisitIdNotHeuristicsTest extends SystemTestCase
+{
+ public static $fixture = null; // initialized below class definition
+
+ /**
+ * @dataProvider getApiForTesting
+ */
+ public function testApi($api, $params)
+ {
+ $this->runApiTests($api, $params);
+ }
+
+ public function getApiForTesting()
+ {
+ $apiToCall = array('VisitsSummary.get', 'Referrers.getCampaigns', 'Referrers.getWebsites');
+
+ return array(
+ // TOTAL should be: 1 visit, 1 converted goal, 1 page view
+ array($apiToCall, array('idSite' => self::$fixture->idSite, 'date' => self::$fixture->dateTime))
+ );
+ }
+
+ public static function getOutputPrefix()
+ {
+ return 'PiwikTracker_trackForceUsingVisitId_insteadOfHeuristics_alsoTestsCampaignTracking';
+ }
+}
+
+TrackCustomVariablesAndCampaignsForceUsingVisitIdNotHeuristicsTest::$fixture =
+ new SomeVisitsCustomVariablesCampaignsNotHeuristics(); \ No newline at end of file
diff --git a/tests/PHPUnit/System/TrackGoalsAllowMultipleConversionsPerVisitTest.php b/tests/PHPUnit/System/TrackGoalsAllowMultipleConversionsPerVisitTest.php
new file mode 100755
index 0000000000..ab345bee35
--- /dev/null
+++ b/tests/PHPUnit/System/TrackGoalsAllowMultipleConversionsPerVisitTest.php
@@ -0,0 +1,67 @@
+<?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\System;
+
+use Piwik\Plugins\Goals\API;
+use Piwik\Tests\Impl\SystemTestCase;
+use Piwik\Tests\Fixtures\SomeVisitsAllConversions;
+
+/**
+ * Tests API methods with goals that do and don't allow multiple
+ * conversions per visit.
+ *
+ * @group TrackGoalsAllowMultipleConversionsPerVisitTest
+ * @group Plugins
+ */
+class TrackGoalsAllowMultipleConversionsPerVisitTest extends SystemTestCase
+{
+ public static $fixture = null;
+
+ /**
+ * @dataProvider getApiForTesting
+ */
+ public function testApi($api, $params)
+ {
+ $this->runApiTests($api, $params);
+ }
+
+ /**
+ * @depends testApi
+ */
+ public function testCheck()
+ {
+ $idSite = self::$fixture->idSite;
+
+ // test delete is working as expected
+ $goals = API::getInstance()->getGoals($idSite);
+ $this->assertTrue(5 == count($goals));
+ API::getInstance()->deleteGoal($idSite, self::$fixture->idGoal_OneConversionPerVisit);
+ API::getInstance()->deleteGoal($idSite, self::$fixture->idGoal_MultipleConversionPerVisit);
+ $goals = API::getInstance()->getGoals($idSite);
+ $this->assertTrue(3 == count($goals));
+ }
+
+ public function getApiForTesting()
+ {
+ $apiToCall = array(
+ 'VisitTime.getVisitInformationPerServerTime',
+ 'VisitsSummary.get'
+ );
+
+ return array(
+ array($apiToCall, array('idSite' => self::$fixture->idSite, 'date' => self::$fixture->dateTime))
+ );
+ }
+
+ public static function getOutputPrefix()
+ {
+ return 'trackGoals_allowMultipleConversionsPerVisit';
+ }
+}
+
+TrackGoalsAllowMultipleConversionsPerVisitTest::$fixture = new SomeVisitsAllConversions(); \ No newline at end of file
diff --git a/tests/PHPUnit/System/TrackerWindowLookBackTest.php b/tests/PHPUnit/System/TrackerWindowLookBackTest.php
new file mode 100644
index 0000000000..aa908ab316
--- /dev/null
+++ b/tests/PHPUnit/System/TrackerWindowLookBackTest.php
@@ -0,0 +1,51 @@
+<?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\System;
+
+use Piwik\Tests\Impl\SystemTestCase;
+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 Plugins
+ */
+class TrackerWindowLookBackTest extends SystemTestCase
+{
+ public static $fixture = null; // initialized below class definition
+
+ /**
+ * @dataProvider getApiForTesting
+ */
+ public function testApi($api, $params)
+ {
+ $this->runApiTests($api, $params);
+ }
+
+ public function getApiForTesting()
+ {
+ $idSite = self::$fixture->idSite;
+
+ return array(
+ array('VisitsSummary.getVisits', array( 'date' => '2010-12-01,2011-01-31',
+ 'periods' => array('range'),
+ 'idSite' => $idSite,
+ ))
+ );
+ }
+
+ public static function getOutputPrefix()
+ {
+ return 'TrackerWindowLookBack';
+ }
+}
+
+TrackerWindowLookBackTest::$fixture = new VisitsOverSeveralDays();
+TrackerWindowLookBackTest::$fixture->forceLargeWindowLookBackForVisitor = true; \ No newline at end of file
diff --git a/tests/PHPUnit/System/TransitionsTest.php b/tests/PHPUnit/System/TransitionsTest.php
new file mode 100644
index 0000000000..fc0549bdbf
--- /dev/null
+++ b/tests/PHPUnit/System/TransitionsTest.php
@@ -0,0 +1,91 @@
+<?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\System;
+
+use Piwik\Tests\Impl\SystemTestCase;
+use Piwik\Tests\Fixtures\SomeVisitsManyPageviewsWithTransitions;
+
+/**
+ * Tests the transitions plugin.
+ *
+ * @group TransitionsTest
+ * @group Plugins
+ */
+class TransitionsTest extends SystemTestCase
+{
+ public static $fixture = null; // initialized below class definition
+
+ /**
+ * @dataProvider getApiForTesting
+ */
+ public function testApi($api, $params)
+ {
+ $this->runApiTests($api, $params);
+ }
+
+ public function getApiForTesting()
+ {
+ $return = array();
+ $return[] = array('Transitions.getTransitionsForPageUrl', array(
+ 'idSite' => self::$fixture->idSite,
+ 'date' => self::$fixture->dateTime,
+ 'periods' => array('day', 'month'),
+ 'testSuffix' => '_noLimit',
+ 'otherRequestParameters' => array(
+ 'pageUrl' => 'http://example.org/page/one.html',
+ )
+ ));
+ $return[] = array('Transitions.getTransitionsForPageTitle', array(
+ 'idSite' => self::$fixture->idSite,
+ 'date' => self::$fixture->dateTime,
+ 'periods' => array('day', 'month'),
+ 'testSuffix' => '_noLimit',
+ 'otherRequestParameters' => array(
+ 'pageTitle' => 'page title - page/one.html',
+ )
+ ));
+
+ // test w/ pages that don't exist
+ $return[] = array('Transitions.getTransitionsForPageUrl', array(
+ 'idSite' => self::$fixture->idSite,
+ 'date' => self::$fixture->dateTime,
+ 'periods' => array('day', 'month'),
+ 'testSuffix' => '_noData',
+ 'otherRequestParameters' => array(
+ 'pageUrl' => 'http://example.org/not/a/page.html',
+ )
+ ));
+ $return[] = array('Transitions.getTransitionsForPageTitle', array(
+ 'idSite' => self::$fixture->idSite,
+ 'date' => self::$fixture->dateTime,
+ 'periods' => array('day', 'month'),
+ 'testSuffix' => '_noData',
+ 'otherRequestParameters' => array(
+ 'pageTitle' => 'not a page title',
+ )
+ ));
+
+ $return[] = array('Transitions.getTransitionsForPageUrl', array( // test w/ limiting
+ 'idSite' => self::$fixture->idSite,
+ 'date' => self::$fixture->dateTime,
+ 'periods' => array('day', 'month'),
+ 'otherRequestParameters' => array(
+ 'pageUrl' => 'http://example.org/page/one.html',
+ 'limitBeforeGrouping' => 2
+ )
+ ));
+ return $return;
+ }
+
+ public static function getOutputPrefix()
+ {
+ return 'Transitions';
+ }
+}
+
+TransitionsTest::$fixture = new SomeVisitsManyPageviewsWithTransitions(); \ No newline at end of file
diff --git a/tests/PHPUnit/System/TwoVisitorsTwoWebsitesDifferentDaysArchivingDisabledTest.php b/tests/PHPUnit/System/TwoVisitorsTwoWebsitesDifferentDaysArchivingDisabledTest.php
new file mode 100755
index 0000000000..4755756614
--- /dev/null
+++ b/tests/PHPUnit/System/TwoVisitorsTwoWebsitesDifferentDaysArchivingDisabledTest.php
@@ -0,0 +1,89 @@
+<?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\System;
+
+use Piwik\Tests\Impl\SystemTestCase;
+use Piwik\Tests\Fixtures\TwoSitesTwoVisitorsDifferentDays;
+
+/**
+ * Tests IndexedBySite optimizations when archiving is disabled.
+ *
+ * @group TwoVisitorsTwoWebsitesDifferentDaysArchivingDisabledTest
+ * @group Plugins
+ */
+class TwoVisitorsTwoWebsitesDifferentDaysArchivingDisabledTest extends SystemTestCase
+{
+ public static $fixture = null; // initialized below class definition
+
+ /**
+ * @dataProvider getApiForTesting
+ */
+ public function testApi($api, $params)
+ {
+ $this->runApiTests($api, $params);
+ }
+
+ public function getApiForTesting()
+ {
+ $dateTime = self::$fixture->dateTime;
+
+ $periods = array('day', 'week', 'month', 'year');
+
+ $dateStart = \Piwik\Date::factory($dateTime)->subDay(10)->toString();
+ $dateEnd = \Piwik\Date::factory($dateTime)->addDay(15)->toString();
+ $dateRange = $dateStart . "," . $dateEnd;
+
+ return array(
+ // disable archiving & check that there is no archive data
+ array('VisitsSummary.get', array('idSite' => 'all',
+ 'date' => $dateTime,
+ 'periods' => $periods,
+ 'disableArchiving' => true,
+ 'testSuffix' => '_disabledBefore')),
+
+ // re-enable archiving & check the output
+ array('VisitsSummary.get', array('idSite' => 'all',
+ 'date' => $dateTime,
+ 'periods' => $periods,
+ 'disableArchiving' => false,
+ 'testSuffix' => '_enabled')),
+
+ // diable archiving again & check the output
+ array('VisitsSummary.get', array('idSite' => 'all',
+ 'date' => $dateTime,
+ 'periods' => $periods,
+ 'disableArchiving' => true,
+ 'testSuffix' => '_disabledAfter')),
+
+ // 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,
+ 'periods' => array('range'),
+ 'disableArchiving' => false,
+ 'testSuffix' => '_enabledBefore_isDateRange')),
+
+ // DISABLE Archiving + DELETE Date range archives before this test.
+ // This should return the same data as the test above!
+ array('VisitsSummary.get', array('idSite' => 'all',
+ 'date' => $dateRange,
+ 'periods' => array('range'),
+ 'disableArchiving' => true,
+ 'testSuffix' => '_disabledBefore_isDateRange')),
+
+ );
+ }
+
+ public static function getOutputPrefix()
+ {
+ return 'TwoVisitors_twoWebsites_differentDays_ArchivingDisabled';
+ }
+}
+
+TwoVisitorsTwoWebsitesDifferentDaysArchivingDisabledTest::$fixture = new TwoSitesTwoVisitorsDifferentDays();
+TwoVisitorsTwoWebsitesDifferentDaysArchivingDisabledTest::$fixture->allowConversions = true; \ No newline at end of file
diff --git a/tests/PHPUnit/System/TwoVisitorsTwoWebsitesDifferentDaysConversionsTest.php b/tests/PHPUnit/System/TwoVisitorsTwoWebsitesDifferentDaysConversionsTest.php
new file mode 100755
index 0000000000..8c64abce71
--- /dev/null
+++ b/tests/PHPUnit/System/TwoVisitorsTwoWebsitesDifferentDaysConversionsTest.php
@@ -0,0 +1,119 @@
+<?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\System;
+
+use Piwik\Plugins\Goals\Archiver;
+use Piwik\Tests\Impl\SystemTestCase;
+use Piwik\Tests\Fixtures\TwoSitesTwoVisitorsDifferentDays;
+
+require_once PIWIK_INCLUDE_PATH . '/plugins/Goals/Goals.php';
+
+/**
+ * Same as TwoVisitors_twoWebsites_differentDays but with goals that convert
+ * on every url.
+ *
+ * @group TwoVisitorsTwoWebsitesDifferentDaysConversionsTest
+ * @group Plugins
+ */
+class TwoVisitorsTwoWebsitesDifferentDaysConversionsTest extends SystemTestCase
+{
+ public static $fixture = null; // initialized below class definition
+
+ /**
+ * @dataProvider getApiForTesting
+ */
+ public function testApi($api, $params)
+ {
+ $this->runApiTests($api, $params);
+ }
+
+ public function getApiToCall()
+ {
+ return array('Goals.getDaysToConversion',
+ 'MultiSites.getAll'
+ );
+ }
+
+ public function getApiForTesting()
+ {
+ $dateTime = self::$fixture->dateTime;
+ $idSite1 = self::$fixture->idSite1;
+
+ // NOTE: copied from TwoVisitors_TwoWebsites_DifferentDays (including the test or inheriting means
+ // the test will get run by phpunit, even when we only want to run this one. should be put into
+ // non-test class later.)
+ $apiToCall = $this->getApiToCall();
+ $singlePeriodApi = array('VisitsSummary.get', 'Goals.get');
+
+ $periods = array(
+ 'day',
+ 'week',
+ 'month',
+ 'year'
+ );
+
+ $result = array(
+ // Request data for the last 6 periods and idSite=all
+ array($apiToCall, array('idSite' => 'all',
+ 'date' => $dateTime,
+ 'periods' => $periods,
+ 'setDateLastN' => true)),
+
+ // Request data for the last 6 periods and idSite=1
+ array($apiToCall, array('idSite' => $idSite1,
+ 'date' => $dateTime,
+ 'periods' => $periods,
+ 'setDateLastN' => true,
+ 'testSuffix' => '_idSiteOne_')),
+
+ // We also test a single period to check that this use case (Reports per idSite in the response) works
+ array($singlePeriodApi, array('idSite' => 'all',
+ 'date' => $dateTime,
+ 'periods' => array('day', 'month'),
+ 'setDateLastN' => false,
+ 'testSuffix' => '_NotLastNPeriods')),
+ );
+
+ // testing metadata API for multiple periods
+ $apiToCall = array_diff($apiToCall, array('Actions.getPageTitle', 'Actions.getPageUrl'));
+ foreach ($apiToCall as $api) {
+ list($apiModule, $apiAction) = explode(".", $api);
+
+ $result[] = array(
+ 'API.getProcessedReport', array('idSite' => $idSite1,
+ 'date' => $dateTime,
+ 'periods' => array('day'),
+ 'setDateLastN' => true,
+ 'apiModule' => $apiModule,
+ 'apiAction' => $apiAction,
+ 'testSuffix' => '_' . $api . '_firstSite_lastN')
+ );
+ }
+
+ // Tests that getting a visits summary metric (nb_visits) & a Goal's metric (Goal_revenue)
+ // at the same time works.
+ $dateTime = '2010-01-03,2010-01-06';
+ $columns = 'nb_visits,' . Archiver::getRecordName('conversion_rate');
+
+ $result[] = array(
+ 'VisitsSummary.get', array('idSite' => 'all', 'date' => $dateTime, 'periods' => 'range',
+ 'otherRequestParameters' => array('columns' => $columns),
+ 'testSuffix' => '_getMetricsFromDifferentReports')
+ );
+
+ return $result;
+ }
+
+ public static function getOutputPrefix()
+ {
+ return 'TwoVisitors_twoWebsites_differentDays_Conversions';
+ }
+}
+
+TwoVisitorsTwoWebsitesDifferentDaysConversionsTest::$fixture = new TwoSitesTwoVisitorsDifferentDays();
+TwoVisitorsTwoWebsitesDifferentDaysConversionsTest::$fixture->allowConversions = true; \ No newline at end of file
diff --git a/tests/PHPUnit/System/TwoVisitorsTwoWebsitesDifferentDaysTest.php b/tests/PHPUnit/System/TwoVisitorsTwoWebsitesDifferentDaysTest.php
new file mode 100755
index 0000000000..495ada90aa
--- /dev/null
+++ b/tests/PHPUnit/System/TwoVisitorsTwoWebsitesDifferentDaysTest.php
@@ -0,0 +1,112 @@
+<?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\System;
+
+use Piwik\Tests\Impl\SystemTestCase;
+use Piwik\Tests\Fixtures\TwoSitesTwoVisitorsDifferentDays;
+
+/**
+ * tests Tracker several websites, different days.
+ * tests API for period=day/week/month/year, requesting data for both websites,
+ * and requesting data for last N periods.
+ * Also tests a visit that spans over 2 days.
+ * 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 Plugins
+ */
+class TwoVisitorsTwoWebsitesDifferentDaysTest extends SystemTestCase
+{
+ public static $fixture = null; // initialized below class definition
+
+ public function testImagesIncludedInTests()
+ {
+ $this->alertWhenImagesExcludedFromTests();
+ }
+
+ /**
+ * @dataProvider getApiForTesting
+ */
+ public function testApi($api, $params)
+ {
+ $this->runApiTests($api, $params);
+ }
+
+ protected function getApiToCall()
+ {
+ return array('VisitFrequency.get',
+ 'VisitsSummary.get',
+ 'Referrers.getWebsites',
+ 'Actions.getPageUrls',
+ 'Actions.getPageTitles',
+ 'Actions.getOutlinks',
+ 'Actions.getPageTitle',
+ 'Actions.getPageUrl',
+ 'VisitorInterest.getNumberOfVisitsByDaysSinceLast');
+ }
+
+ public function getApiForTesting()
+ {
+ $idSite1 = self::$fixture->idSite1;
+ $dateTime = self::$fixture->dateTime;
+
+ $apiToCall = $this->getApiToCall();
+ $singlePeriodApi = array('VisitsSummary.get', 'Goals.get');
+
+ $periods = array('day', 'week', 'month', 'year');
+
+ $result = array(
+ // Request data for the last 6 periods and idSite=all
+ array($apiToCall, array('idSite' => 'all',
+ 'date' => $dateTime,
+ 'periods' => $periods,
+ 'setDateLastN' => true)),
+
+ // Request data for the last 6 periods and idSite=1
+ array($apiToCall, array('idSite' => $idSite1,
+ 'date' => $dateTime,
+ 'periods' => $periods,
+ 'setDateLastN' => true,
+ 'testSuffix' => '_idSiteOne_')),
+
+ // We also test a single period to check that this use case (Reports per idSite in the response) works
+ array($singlePeriodApi, array('idSite' => 'all',
+ 'date' => $dateTime,
+ 'periods' => array('day', 'month'),
+ 'setDateLastN' => false,
+ 'testSuffix' => '_NotLastNPeriods')),
+ );
+
+ // testing metadata API for multiple periods
+ $apiToCall = array_diff($apiToCall, array('Actions.getPageTitle', 'Actions.getPageUrl'));
+ foreach ($apiToCall as $api) {
+ list($apiModule, $apiAction) = explode(".", $api);
+
+ $result[] = array(
+ 'API.getProcessedReport', array('idSite' => $idSite1,
+ 'date' => $dateTime,
+ 'periods' => array('day'),
+ 'setDateLastN' => true,
+ 'apiModule' => $apiModule,
+ 'apiAction' => $apiAction,
+ 'testSuffix' => '_' . $api . '_firstSite_lastN')
+ );
+ }
+
+ return array_merge($result, self::getApiForTestingScheduledReports($dateTime, 'month'));
+ }
+
+ public static function getOutputPrefix()
+ {
+ return 'TwoVisitors_twoWebsites_differentDays';
+ }
+}
+
+TwoVisitorsTwoWebsitesDifferentDaysTest::$fixture = new TwoSitesTwoVisitorsDifferentDays(); \ No newline at end of file
diff --git a/tests/PHPUnit/System/TwoVisitsWithCustomVariablesSegmentContainsTest.php b/tests/PHPUnit/System/TwoVisitsWithCustomVariablesSegmentContainsTest.php
new file mode 100755
index 0000000000..b2d85a893b
--- /dev/null
+++ b/tests/PHPUnit/System/TwoVisitsWithCustomVariablesSegmentContainsTest.php
@@ -0,0 +1,67 @@
+<?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\System;
+
+use Piwik\Tests\Impl\SystemTestCase;
+use Piwik\Tests\Fixtures\TwoVisitsWithCustomVariables;
+
+/**
+ * Tests use of custom variable segments.
+ *
+ * @group Plugins
+ * @group TwoVisitsWithCustomVariablesSegmentContainsTest
+ */
+class TwoVisitsWithCustomVariablesSegmentContainsTest extends SystemTestCase
+{
+ public static $fixture = null; // initialized below class definition
+
+ public static function getOutputPrefix()
+ {
+ return 'twoVisitsWithCustomVariables';
+ }
+
+ /**
+ * @dataProvider getApiForTesting
+ */
+ public function testApi($api, $params)
+ {
+ $this->runApiTests($api, $params);
+ }
+
+ public function getApiForTesting()
+ {
+ $idSite = self::$fixture->idSite;
+ $dateTime = self::$fixture->dateTime;
+
+ $return = array();
+
+ $api = array('Actions.getPageUrls', 'Actions.getPageTitles', 'VisitsSummary.get');
+ $segmentsToTest = array(
+ // array( SegmentString , TestSuffix , Array of API to test)
+ array("pageTitle=@*_)%", '_SegmentPageTitleContainsStrangeCharacters', array('Actions.getPageTitles', 'VisitsSummary.get')),
+ array("pageUrl=@user/profile", '_SegmentPageUrlContains', $api),
+ array("pageTitle=@Profile pa", '_SegmentPageTitleContains', $api),
+ array("pageUrl!@user/profile", '_SegmentPageUrlExcludes', $api),
+ array("pageTitle!@Profile pa", '_SegmentPageTitleExcludes', $api),
+ );
+
+ foreach ($segmentsToTest as $segment) {
+ // Also test "Page URL / Page title CONTAINS string" feature
+ $return[] = array($segment[2],
+ array('idSite' => $idSite, 'date' => $dateTime, 'periods' => array('day'),
+ 'setDateLastN' => false,
+ 'segment' => $segment[0],
+ 'testSuffix' => $segment[1])
+ );
+ }
+ return $return;
+ }
+}
+
+TwoVisitsWithCustomVariablesSegmentContainsTest::$fixture = new TwoVisitsWithCustomVariables();
+TwoVisitsWithCustomVariablesSegmentContainsTest::$fixture->doExtraQuoteTests = false; \ No newline at end of file
diff --git a/tests/PHPUnit/System/TwoVisitsWithCustomVariablesSegmentMatchALLNoGoalDataTest.php b/tests/PHPUnit/System/TwoVisitsWithCustomVariablesSegmentMatchALLNoGoalDataTest.php
new file mode 100755
index 0000000000..e0f579782f
--- /dev/null
+++ b/tests/PHPUnit/System/TwoVisitsWithCustomVariablesSegmentMatchALLNoGoalDataTest.php
@@ -0,0 +1,54 @@
+<?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\System;
+
+use Piwik\Tests\Impl\SystemTestCase;
+use Piwik\Tests\Fixtures\TwoVisitsWithCustomVariables;
+
+/**
+ * @group Plugins
+ * @group TwoVisitsWithCustomVariablesSegmentMatchALLNoGoalDataTest
+ */
+class TwoVisitsWithCustomVariablesSegmentMatchALLNoGoalDataTest extends SystemTestCase
+{
+ public static $fixture = null; // initialized below class definition
+
+ /**
+ * @dataProvider getApiForTesting
+ */
+ public function testApi($api, $params)
+ {
+ $this->runApiTests($api, $params);
+ }
+
+ public function getApiForTesting()
+ {
+ $apiToCall = array('VisitsSummary.get', 'CustomVariables.getCustomVariables');
+
+ // Segment matching ALL
+ // + adding DOES NOT CONTAIN segment always matched, to test this particular operator
+ $resolution = self::$fixture->resolutionWidthToUse . 'x' . self::$fixture->resolutionHeightToUse;
+ $segment = 'resolution==' . $resolution . ';customVariableName1!@randomvalue does not exist';
+
+ return array(
+ array($apiToCall, array('idSite' => 'all',
+ 'date' => self::$fixture->dateTime,
+ 'periods' => array('day', 'week'),
+ 'setDateLastN' => true,
+ 'segment' => $segment))
+ );
+ }
+
+ public static function getOutputPrefix()
+ {
+ return 'twoVisitsWithCustomVariables_segmentMatchALL_noGoalData';
+ }
+}
+
+TwoVisitsWithCustomVariablesSegmentMatchALLNoGoalDataTest::$fixture = new TwoVisitsWithCustomVariables();
+TwoVisitsWithCustomVariablesSegmentMatchALLNoGoalDataTest::$fixture->doExtraQuoteTests = false; \ No newline at end of file
diff --git a/tests/PHPUnit/System/TwoVisitsWithCustomVariablesSegmentMatchNONETest.php b/tests/PHPUnit/System/TwoVisitsWithCustomVariablesSegmentMatchNONETest.php
new file mode 100755
index 0000000000..1aa078b5b1
--- /dev/null
+++ b/tests/PHPUnit/System/TwoVisitsWithCustomVariablesSegmentMatchNONETest.php
@@ -0,0 +1,93 @@
+<?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\System;
+
+use Piwik\Plugins\API\API;
+use Piwik\Tests\Impl\SystemTestCase;
+use Piwik\Tests\Fixtures\TwoVisitsWithCustomVariables;
+use Piwik\Tests\Impl\Fixture;
+
+/**
+ * testing a segment containing all supported fields
+ *
+ * @group Plugins
+ * @group TwoVisitsWithCustomVariablesSegmentMatchNONETest
+ */
+class TwoVisitsWithCustomVariablesSegmentMatchNONETest extends SystemTestCase
+{
+ public static $fixture = null; // initialized below class definition
+
+ /**
+ * @dataProvider getApiForTesting
+ */
+ public function testApi($api, $params)
+ {
+ $this->runApiTests($api, $params);
+ }
+
+ public function getApiForTesting()
+ {
+ // we will test all segments from all plugins
+ Fixture::loadAllPlugins();
+
+ $apiToCall = array('VisitsSummary.get', 'CustomVariables.getCustomVariables');
+
+ return array(
+ array($apiToCall, array('idSite' => 'all',
+ 'date' => self::$fixture->dateTime,
+ 'periods' => array('day', 'week'),
+ 'setDateLastN' => true,
+ 'segment' => $this->getSegmentToTest()))
+ );
+ }
+
+ public function getSegmentToTest()
+ {
+ // Segment matching NONE
+ $segments = API::getInstance()->getSegmentsMetadata(self::$fixture->idSite);
+
+ $minimumExpectedSegmentsCount = 55; // as of Piwik 1.12
+ $this->assertTrue( count($segments) >= $minimumExpectedSegmentsCount);
+ $segmentExpression = array();
+
+ $seenVisitorId = false;
+ foreach ($segments as $segment) {
+ $value = 'campaign';
+ if ($segment['segment'] == 'visitorId') {
+ $seenVisitorId = true;
+ $value = '34c31e04394bdc63';
+ }
+ if ($segment['segment'] == 'visitEcommerceStatus') {
+ $value = 'none';
+ }
+ $matchNone = $segment['segment'] . '!=' . $value;
+
+ // deviceType != campaign matches ALL visits, but we want to match None
+ if($segment['segment'] == 'deviceType') {
+ $matchNone = $segment['segment'] . '==car%20browser';
+ }
+ $segmentExpression[] = $matchNone;
+ }
+
+ $segment = implode(";", $segmentExpression);
+
+ // just checking that this segment was tested (as it has the only visible to admin flag)
+ $this->assertTrue($seenVisitorId);
+ $this->assertGreaterThan(100, strlen($segment));
+
+ return $segment;
+ }
+
+ public static function getOutputPrefix()
+ {
+ return 'twoVisitsWithCustomVariables_segmentMatchNONE';
+ }
+}
+
+TwoVisitsWithCustomVariablesSegmentMatchNONETest::$fixture = new TwoVisitsWithCustomVariables();
+TwoVisitsWithCustomVariablesSegmentMatchNONETest::$fixture->doExtraQuoteTests = false; \ No newline at end of file
diff --git a/tests/PHPUnit/System/TwoVisitsWithCustomVariablesSegmentMatchVisitorTypeTest.php b/tests/PHPUnit/System/TwoVisitsWithCustomVariablesSegmentMatchVisitorTypeTest.php
new file mode 100755
index 0000000000..01a5005278
--- /dev/null
+++ b/tests/PHPUnit/System/TwoVisitsWithCustomVariablesSegmentMatchVisitorTypeTest.php
@@ -0,0 +1,113 @@
+<?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\System;
+
+use Piwik\Common;
+use Piwik\Db;
+use Piwik\Tests\Impl\SystemTestCase;
+use Piwik\Tests\Fixtures\TwoVisitsWithCustomVariables;
+
+/**
+ * Tests use of custom variable segments.
+ *
+ * @group Plugins
+ * @group TwoVisitsWithCustomVariablesSegmentMatchVisitorTypeTest
+ */
+class TwoVisitsWithCustomVariablesSegmentMatchVisitorTypeTest extends SystemTestCase
+{
+ public static $fixture = null; // initialized below class definition
+
+ /**
+ * @dataProvider getApiForTesting
+ */
+ public function testApi($api, $params)
+ {
+ $this->runApiTests($api, $params);
+ }
+
+ public function getApiForTesting()
+ {
+ // Segment matching some
+ $segments = array('customVariableName1==VisitorType;customVariableValue1==LoggedIn',
+ 'customVariableName1==VisitorType;customVariableValue1=@LoggedI');
+
+ $apiToCall = array('Referrers.getKeywords', 'CustomVariables.getCustomVariables', 'VisitsSummary.get');
+
+ $periods = array('day', 'week');
+
+ // We run it twice just to check that running archiving twice for same input parameters doesn't create more records/overhead
+ $result = array();
+ for ($i = 1; $i <= 2; $i++) {
+ foreach ($segments as $segment) {
+ $result[] = array(
+ $apiToCall, array('idSite' => 'all',
+ 'date' => self::$fixture->dateTime,
+ 'periods' => $periods,
+ 'setDateLastN' => true,
+ 'segment' => $segment)
+ );
+ }
+ }
+
+ return $result;
+ }
+
+ /**
+ * @depends testApi
+ */
+ public function testCheck()
+ {
+ // ----------------------------------------------
+ // Implementation Checks
+ // ----------------------------------------------
+ // Verify that, when a segment is specified, only the requested report is processed
+ // In this case, check that only the Custom Variables blobs have been processed
+
+ $tests = array(
+ // 1) CHECK 'day' archive stored in January
+ // We expect 2 segments
+ // * (1 custom variable name + 2 ref metrics
+ // + 6 subtable for the custom var values + 5 Referrers blob
+ // )
+ 'archive_blob_2010_01' => 28,
+ // This contains all 'last N' weeks & days,
+ // (2 metrics
+ // + 2 referrer metrics
+ // + 3 done flag )
+ // * 2 segments
+ // + 1 Done flag per Plugin, for each "Last N" date
+ 'archive_numeric_2010_01' => 142,
+
+ // 2) CHECK 'week' archive stored in December (week starts the month before)
+ // We expect 2 segments * (1 custom variable name + 2 ref metrics + 5 subtable for the values of the name + 5 referrers blob)
+ 'archive_blob_2009_12' => 28,
+ // 7 metrics,
+ // 2 Referrer metrics (Referrers_distinctSearchEngines/Referrers_distinctKeywords),
+ // 3 done flag (referrers, CustomVar, VisitsSummary),
+ // X * 2 segments
+ 'archive_numeric_2009_12' => (6 + 2 + 3) * 2,
+ );
+ foreach ($tests as $table => $expectedRows) {
+ $sql = "SELECT count(*) FROM " . Common::prefixTable($table);
+ $countBlobs = Db::get()->fetchOne($sql);
+
+ if($expectedRows != $countBlobs) {
+ var_export(Db::get()->fetchAll("SELECT * FROM " . Common::prefixTable($table) . " ORDER BY name, idarchive ASC"));
+ }
+ $this->assertEquals($expectedRows, $countBlobs, "$table: %s");
+ }
+ }
+
+ public static function getOutputPrefix()
+ {
+ return 'twoVisitsWithCustomVariables_segmentMatchVisitorType';
+ }
+}
+
+TwoVisitsWithCustomVariablesSegmentMatchVisitorTypeTest::$fixture = new TwoVisitsWithCustomVariables();
+TwoVisitsWithCustomVariablesSegmentMatchVisitorTypeTest::$fixture->doExtraQuoteTests = false; \ No newline at end of file
diff --git a/tests/PHPUnit/System/TwoVisitsWithCustomVariablesTest.php b/tests/PHPUnit/System/TwoVisitsWithCustomVariablesTest.php
new file mode 100755
index 0000000000..7bc80d3ade
--- /dev/null
+++ b/tests/PHPUnit/System/TwoVisitsWithCustomVariablesTest.php
@@ -0,0 +1,63 @@
+<?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\System;
+
+use Piwik\Tests\Impl\SystemTestCase;
+use Piwik\Tests\Fixtures\TwoVisitsWithCustomVariables;
+
+/**
+ * Tests w/ two visits & custom variables.
+ *
+ * @group TwoVisitsWithCustomVariablesTest
+ * @group Plugins
+ */
+class TwoVisitsWithCustomVariablesTest extends SystemTestCase
+{
+ public static $fixture = null; // initialized below class definition
+
+ public function getApiForTesting()
+ {
+ $idSite = self::$fixture->idSite;
+ $dateTime = self::$fixture->dateTime;
+
+ $apiToCall = array('VisitsSummary.get', 'CustomVariables.getCustomVariables');
+
+ $return = array(
+ array($apiToCall, array('idSite' => 'all',
+ 'date' => $dateTime,
+ 'periods' => array('day', 'week'),
+ 'setDateLastN' => true)),
+
+ // test getProcessedReport w/ custom variables subtable
+ array('API.getProcessedReport', array('idSite' => $idSite,
+ 'date' => $dateTime,
+ 'periods' => 'day',
+ 'apiModule' => 'CustomVariables',
+ 'apiAction' => 'getCustomVariablesValuesFromNameId',
+ 'supertableApi' => 'CustomVariables.getCustomVariables',
+ 'testSuffix' => '__subtable')),
+ );
+
+ return $return;
+ }
+
+ /**
+ * @dataProvider getApiForTesting
+ */
+ public function testApi($api, $params)
+ {
+ $this->runApiTests($api, $params);
+ }
+
+ public static function getOutputPrefix()
+ {
+ return 'twoVisitsWithCustomVariables';
+ }
+}
+
+TwoVisitsWithCustomVariablesTest::$fixture = new TwoVisitsWithCustomVariables(); \ No newline at end of file
diff --git a/tests/PHPUnit/System/UrlNormalizationTest.php b/tests/PHPUnit/System/UrlNormalizationTest.php
new file mode 100644
index 0000000000..a91a01aad0
--- /dev/null
+++ b/tests/PHPUnit/System/UrlNormalizationTest.php
@@ -0,0 +1,123 @@
+<?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\System;
+
+use Piwik\Common;
+use Piwik\Db;
+use Piwik\Tracker\Action;
+use Piwik\Tests\Impl\SystemTestCase;
+use Piwik\Tests\Fixtures\OneVisitWithAbnormalPageviewUrls;
+
+/**
+ * Tests the URL normalization.
+ *
+ * @group Core
+ * @group UrlNormalizationTest
+ */
+class UrlNormalizationTest extends SystemTestCase
+{
+ public static $fixture = null; // initialized below class definition
+
+ /**
+ * @dataProvider getApiForTesting
+ */
+ public function testApi($api, $params)
+ {
+ $this->runApiTests($api, $params);
+ }
+
+ public function getApiForTesting()
+ {
+ $idSite = self::$fixture->idSite;
+ $dateTime = self::$fixture->dateTime;
+
+ $return = array();
+ $return[] = array('Actions.getPageUrls', array(
+ 'testSuffix' => '_urls',
+ 'idSite' => $idSite,
+ 'date' => $dateTime,
+ ));
+ $return[] = array('Actions.getPageTitles', array(
+ 'testSuffix' => '_titles',
+ 'idSite' => $idSite,
+ 'date' => $dateTime,
+ ));
+
+ $return[] = array('Actions.getPageUrls', array(
+ 'testSuffix' => '_pagesSegmented',
+ 'idSite' => $idSite,
+ 'date' => $dateTime,
+ 'segment' => 'pageUrl==https://WWw.example.org/foo/bar2.html',
+ ));
+ // Testing entryPageUrl with AND segment
+ $return[] = array('Actions.getPageUrls', array(
+ 'testSuffix' => '_pagesSegmented',
+ 'idSite' => $idSite,
+ 'date' => $dateTime,
+ 'segment' => 'entryPageUrl==http://example.org/foo/bar.html;pageUrl==https://WWw.example.org/foo/bar2.html',
+ ));
+ // Testing exitPageUrl with AND segment
+ $return[] = array('Actions.getPageUrls', array(
+ 'testSuffix' => '_pagesSegmented',
+ 'idSite' => $idSite,
+ 'date' => $dateTime,
+ 'segment' => 'exitPageUrl==example.org/foo/bar4.html;pageUrl==https://WWw.example.org/foo/bar2.html',
+ ));
+ $return[] = array('Actions.getPageUrls', array(
+ 'testSuffix' => '_pagesSegmented',
+ 'idSite' => $idSite,
+ 'date' => $dateTime,
+ 'segment' => 'pageUrl==example.org/foo/bar2.html',
+ ));
+ $return[] = array('Actions.getPageUrls', array(
+ 'testSuffix' => '_pagesSegmentedRef',
+ 'idSite' => $idSite,
+ 'date' => $dateTime,
+ 'segment' => 'referrerUrl==http://www.google.com/search?q=piwik',
+ ));
+ $return[] = array('Referrers.getKeywordsForPageUrl', array(
+ 'testSuffix' => '_keywords',
+ 'idSite' => $idSite,
+ 'date' => $dateTime,
+ 'otherRequestParameters' => array(
+ 'url' => 'http://WWW.example.org/foo/bar.html'
+ )
+ ));
+ return $return;
+ }
+
+ /**
+ * @depends testApi
+ */
+ public function testCheckPostConditions()
+ {
+ $sql = "SELECT count(*) FROM " . Common::prefixTable('log_action');
+ $count = Db::get()->fetchOne($sql);
+ $expected = 9; // 4 urls + 5 titles
+ $this->assertEquals($expected, $count, "only $expected actions expected");
+
+ $sql = "SELECT name, url_prefix FROM " . Common::prefixTable('log_action')
+ . " WHERE type = " . Action::TYPE_PAGE_URL
+ . " ORDER BY idaction ASC";
+ $urls = Db::get()->fetchAll($sql);
+ $expected = array(
+ array('name' => 'example.org/foo/bar.html', 'url_prefix' => 0),
+ array('name' => 'example.org/foo/bar2.html', 'url_prefix' => 3),
+ array('name' => 'example.org/foo/bar3.html', 'url_prefix' => 1),
+ array('name' => 'example.org/foo/bar4.html', 'url_prefix' => 2)
+ );
+ $this->assertEquals($expected, $urls, "normalization went wrong");
+ }
+
+ public static function getOutputPrefix()
+ {
+ return 'UrlNormalization';
+ }
+}
+
+UrlNormalizationTest::$fixture = new OneVisitWithAbnormalPageviewUrls(); \ No newline at end of file
diff --git a/tests/PHPUnit/System/UserIdAndVisitorIdTest.php b/tests/PHPUnit/System/UserIdAndVisitorIdTest.php
new file mode 100644
index 0000000000..4bc0700c08
--- /dev/null
+++ b/tests/PHPUnit/System/UserIdAndVisitorIdTest.php
@@ -0,0 +1,104 @@
+<?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\System;
+
+use Piwik\API\Proxy;
+use Piwik\Tests\Impl\SystemTestCase;
+use Piwik\Tests\Fixtures\FewVisitsWithSetVisitorId;
+
+/**
+ * This test tests that when using &cid=, the visitor ID is enforced
+ *
+ * @group UserIdAndVisitorIdTest
+ * @group Plugins
+ */
+class UserIdAndVisitorIdTest extends SystemTestCase
+{
+ public static $fixture = null; // initialized below class definition
+
+ public function setUp()
+ {
+ Proxy::getInstance()->setHideIgnoredFunctions(false);
+ }
+
+ public function tearDown()
+ {
+ Proxy::getInstance()->setHideIgnoredFunctions(true);
+ }
+
+ public static function getOutputPrefix()
+ {
+ return "UserId_VisitorId";
+ }
+
+ /**
+ * @dataProvider getApiForTesting
+ */
+ public function testApi($api, $params)
+ {
+ $this->runApiTests($api, $params);
+ }
+
+ public function getApiForTesting()
+ {
+ return array(
+ array(array('VisitsSummary.get', 'VisitsSummary.getUsers'),
+ array('idSite' => self::$fixture->idSite,
+ 'date' => self::$fixture->dateTime,
+ 'periods' => array( 'day', 'month', 'week', 'year' ),
+ 'testSuffix' => '',
+ )),
+
+ array('Live.getLastVisitsDetails',
+ array('idSite' => self::$fixture->idSite,
+ 'date' => self::$fixture->dateTime,
+ 'periods' => 'month',
+ 'keepLiveIds' => true,
+ 'keepLiveDates' => true,
+ 'otherRequestParameters' => array(
+ 'showColumns' => 'idVisit,visitorId,userId,lastActionDateTime,actions,actionDetails',
+ 'filter_sort_column' => 'idVisit',
+ 'filter_sort_order' => 'asc',
+ )
+ )),
+
+ // Testing userId segment matches both log_visits and log_conversion
+ array(array('VisitsSummary.get', 'Goals.get'),
+ array('idSite' => self::$fixture->idSite,
+ 'date' => self::$fixture->dateTime,
+ 'periods' => 'day',
+ 'segment' => 'userId==' . urlencode('new-email@example.com'),
+ 'testSuffix' => '_segmentUserId',
+ )),
+
+ // Test invalid segment match type throws exception
+ array('VisitsSummary.get',
+ array('idSite' => self::$fixture->idSite,
+ 'date' => self::$fixture->dateTime,
+ 'periods' => 'day',
+ 'segment' => 'userId=@invalidSegment',
+ 'testSuffix' => '_invalidSegmentUserId',
+ )),
+
+
+ // Testing userId segment matches both log_visits and log_conversion
+ array('Goals.getItemsName',
+ array('idSite' => self::$fixture->idSite,
+ 'date' => self::$fixture->dateTime,
+ 'periods' => 'day',
+ 'segment' => 'visitEcommerceStatus==abandonedCart;userId==' . urlencode('new-email@example.com'),
+ 'testSuffix' => '_segmentUserIdAndCartAbandoned_getAbandonedCartItems',
+ 'otherRequestParameters' => array(
+ 'abandonedCarts' => 1
+ ),
+ )),
+ );
+ }
+}
+
+UserIdAndVisitorIdTest::$fixture = new FewVisitsWithSetVisitorId(); \ No newline at end of file
diff --git a/tests/PHPUnit/System/VisitsInPastInvalidateOldReportsTest.php b/tests/PHPUnit/System/VisitsInPastInvalidateOldReportsTest.php
new file mode 100644
index 0000000000..d958dcc894
--- /dev/null
+++ b/tests/PHPUnit/System/VisitsInPastInvalidateOldReportsTest.php
@@ -0,0 +1,151 @@
+<?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\System;
+
+use Piwik\API\Request;
+use Piwik\Tests\Impl\SystemTestCase;
+use Piwik\Tests\Fixtures\TwoSitesVisitsInPast;
+use Exception;
+
+/**
+ * Track visits before website creation date and test that Piwik handles them correctly.
+ *
+ * See also other test: ArchiveInvalidationTest
+ *
+ * @group Core
+ * @group VisitsInPastInvalidateOldReportsTest
+ */
+class VisitsInPastInvalidateOldReportsTest extends SystemTestCase
+{
+ public static $fixture = null; // initialized below class definition
+
+ /**
+ * @dataProvider getApiForTesting
+ */
+ public function testApi($api, $params)
+ {
+ $this->runApiTests($api, $params);
+ }
+
+ /**
+ * This should NOT return data for old dates before website creation
+ */
+ public function getApiForTesting()
+ {
+ $idSite = self::$fixture->idSite;
+ $idSite2 = self::$fixture->idSite2;
+ $dateTimeDateInPastWebsite1 = self::$fixture->dateTimeDateInPastWebsite1;
+ $dateTimeDateInPastWebsite2 = self::$fixture->dateTimeDateInPastWebsite2;
+
+ // We test a typical Numeric and a Recursive blob reports
+ $apiToCall = array('VisitsSummary.get', 'Actions.getPageUrls');
+
+ // We also test a segment
+ //TODO
+
+ // Build tests for the 2 websites
+ return array(
+ array($apiToCall, array('idSite' => $idSite,
+ 'testSuffix' => 'Website' . $idSite . '_OldReportsShouldNotAppear',
+ 'date' => $dateTimeDateInPastWebsite1,
+ 'periods' => 'month',
+ 'setDateLastN' => 4, // 4months ahead
+ 'otherRequestParameters' => array('expanded' => 1))),
+ array($apiToCall, array('idSite' => $idSite2,
+ 'testSuffix' => 'Website' . $idSite2 . '_OldReportsShouldNotAppear',
+ 'date' => $dateTimeDateInPastWebsite2,
+ 'periods' => 'month',
+ 'setDateLastN' => 4, // 4months ahead
+ 'otherRequestParameters' => array('expanded' => 1))),
+ );
+ }
+
+ /**
+ * @depends testApi
+ * @dataProvider getAnotherApiForTesting
+ */
+ public function testAnotherApi($api, $params)
+ {
+ $idSite = self::$fixture->idSite;
+ $idSite2 = self::$fixture->idSite2;
+
+ // 1) Invalidate old reports for the 2 websites
+ // Test invalidate 1 date only
+ $r = new Request("module=API&method=CoreAdminHome.invalidateArchivedReports&idSites=4,5,6,55,-1,s',1&dates=2010-01-03");
+ $this->assertApiResponseHasNoError($r->process());
+
+ // Test invalidate comma separated dates
+ $r = new Request("module=API&method=CoreAdminHome.invalidateArchivedReports&idSites=" . $idSite . "," . $idSite2 . "&dates=2010-01-06,2009-10-30");
+ $this->assertApiResponseHasNoError($r->process());
+
+ // test invalidate date in the past
+ // Format=original will re-throw exception
+ $r = new Request("module=API&method=CoreAdminHome.invalidateArchivedReports&idSites=" . $idSite2 . "&dates=2009-06-29&format=original");
+ $this->assertApiResponseHasNoError($r->process());
+
+ // invalidate a date more recent to check the date is only updated when it's earlier than current
+ $r = new Request("module=API&method=CoreAdminHome.invalidateArchivedReports&idSites=" . $idSite2 . "&dates=2010-03-03");
+ $this->assertApiResponseHasNoError($r->process());
+
+
+ // Make an invalid call
+ $idSiteNoAccess = 777;
+ try {
+ $request = new Request("module=API&method=CoreAdminHome.invalidateArchivedReports&idSites=" . $idSiteNoAccess . "&dates=2010-03-03&format=original");
+ $request->process();
+ $this->fail();
+ } catch(Exception $e) {}
+
+ // test an invalidate period parameter
+ try {
+ $invalidPeriod = "day,month";
+ $request = new Request("module=API&method=CoreAdminHome.invalidateArchivedReports&period=$invalidPeriod&idSites=$idSite&dates=2010-03-03&format=original");
+ $request->process();
+ $this->fail();
+ } catch(Exception $e) {}
+
+ // 2) Call API again, with an older date, which should now return data
+ $this->runApiTests($api, $params);
+ }
+
+ /**
+ * This is called after getApiToTest()
+ * WE invalidate old reports and check that data is now returned for old dates
+ */
+ public function getAnotherApiForTesting()
+ {
+ $idSite = self::$fixture->idSite;
+ $idSite2 = self::$fixture->idSite2;
+ $dateTimeDateInPastWebsite1 = self::$fixture->dateTimeDateInPastWebsite1;
+ $dateTimeDateInPastWebsite2 = self::$fixture->dateTimeDateInPastWebsite2;
+
+ $apiToCall = array('VisitsSummary.get', 'Actions.getPageUrls');
+
+ return array(
+ array($apiToCall, array('idSite' => $idSite,
+ 'testSuffix' => 'Website' . $idSite . '_OldReportsShouldAppear',
+ 'date' => $dateTimeDateInPastWebsite1,
+ 'periods' => 'month',
+ 'setDateLastN' => 4, // 4months ahead
+ 'otherRequestParameters' => array('expanded' => 1))),
+ array($apiToCall, array('idSite' => $idSite2,
+ 'testSuffix' => 'Website' . $idSite2 . '_OldReportsShouldAppear',
+ 'date' => $dateTimeDateInPastWebsite2,
+ 'periods' => 'month',
+ 'setDateLastN' => 4, // 4months ahead
+ 'otherRequestParameters' => array('expanded' => 1))),
+ );
+ }
+
+ public static function getOutputPrefix()
+ {
+ return 'VisitsInPast_InvalidateOldReports';
+ }
+}
+
+VisitsInPastInvalidateOldReportsTest::$fixture = new TwoSitesVisitsInPast(); \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/expected/.gitkeep b/tests/PHPUnit/System/expected/.gitkeep
index e69de29bb2..e69de29bb2 100644
--- a/tests/PHPUnit/Integration/expected/.gitkeep
+++ b/tests/PHPUnit/System/expected/.gitkeep
diff --git a/tests/PHPUnit/Integration/expected/test_ArchiveCronTest_archive_php_cron_output.txt b/tests/PHPUnit/System/expected/test_ArchiveCronTest_archive_php_cron_output.txt
index 16bfe19f8c..16bfe19f8c 100644
--- a/tests/PHPUnit/Integration/expected/test_ArchiveCronTest_archive_php_cron_output.txt
+++ b/tests/PHPUnit/System/expected/test_ArchiveCronTest_archive_php_cron_output.txt
diff --git a/tests/PHPUnit/Integration/expected/test_ArchiveCronTest_noOptions__VisitsSummary.get_day.xml b/tests/PHPUnit/System/expected/test_ArchiveCronTest_noOptions__VisitsSummary.get_day.xml
index 32434a44f6..32434a44f6 100644
--- a/tests/PHPUnit/Integration/expected/test_ArchiveCronTest_noOptions__VisitsSummary.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_ArchiveCronTest_noOptions__VisitsSummary.get_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ArchiveCronTest_noOptions__VisitsSummary.get_month.xml b/tests/PHPUnit/System/expected/test_ArchiveCronTest_noOptions__VisitsSummary.get_month.xml
index 527a5d7177..527a5d7177 100644
--- a/tests/PHPUnit/Integration/expected/test_ArchiveCronTest_noOptions__VisitsSummary.get_month.xml
+++ b/tests/PHPUnit/System/expected/test_ArchiveCronTest_noOptions__VisitsSummary.get_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ArchiveCronTest_noOptions__VisitsSummary.get_week.xml b/tests/PHPUnit/System/expected/test_ArchiveCronTest_noOptions__VisitsSummary.get_week.xml
index 1c7f2179e5..1c7f2179e5 100644
--- a/tests/PHPUnit/Integration/expected/test_ArchiveCronTest_noOptions__VisitsSummary.get_week.xml
+++ b/tests/PHPUnit/System/expected/test_ArchiveCronTest_noOptions__VisitsSummary.get_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ArchiveCronTest_noOptions__VisitsSummary.get_year.xml b/tests/PHPUnit/System/expected/test_ArchiveCronTest_noOptions__VisitsSummary.get_year.xml
index 46ff0006a8..46ff0006a8 100644
--- a/tests/PHPUnit/Integration/expected/test_ArchiveCronTest_noOptions__VisitsSummary.get_year.xml
+++ b/tests/PHPUnit/System/expected/test_ArchiveCronTest_noOptions__VisitsSummary.get_year.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ArchiveCronTest_nonPreArchivedSegment_noOptions__VisitsSummary.get_day.xml b/tests/PHPUnit/System/expected/test_ArchiveCronTest_nonPreArchivedSegment_noOptions__VisitsSummary.get_day.xml
index 1c7f2179e5..1c7f2179e5 100644
--- a/tests/PHPUnit/Integration/expected/test_ArchiveCronTest_nonPreArchivedSegment_noOptions__VisitsSummary.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_ArchiveCronTest_nonPreArchivedSegment_noOptions__VisitsSummary.get_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ArchiveCronTest_nonPreArchivedSegment_noOptions__VisitsSummary.get_month.xml b/tests/PHPUnit/System/expected/test_ArchiveCronTest_nonPreArchivedSegment_noOptions__VisitsSummary.get_month.xml
index 1c7f2179e5..1c7f2179e5 100644
--- a/tests/PHPUnit/Integration/expected/test_ArchiveCronTest_nonPreArchivedSegment_noOptions__VisitsSummary.get_month.xml
+++ b/tests/PHPUnit/System/expected/test_ArchiveCronTest_nonPreArchivedSegment_noOptions__VisitsSummary.get_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ArchiveCronTest_nonPreArchivedSegment_noOptions__VisitsSummary.get_week.xml b/tests/PHPUnit/System/expected/test_ArchiveCronTest_nonPreArchivedSegment_noOptions__VisitsSummary.get_week.xml
index 1c7f2179e5..1c7f2179e5 100644
--- a/tests/PHPUnit/Integration/expected/test_ArchiveCronTest_nonPreArchivedSegment_noOptions__VisitsSummary.get_week.xml
+++ b/tests/PHPUnit/System/expected/test_ArchiveCronTest_nonPreArchivedSegment_noOptions__VisitsSummary.get_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ArchiveCronTest_nonPreArchivedSegment_noOptions__VisitsSummary.get_year.xml b/tests/PHPUnit/System/expected/test_ArchiveCronTest_nonPreArchivedSegment_noOptions__VisitsSummary.get_year.xml
index 1c7f2179e5..1c7f2179e5 100644
--- a/tests/PHPUnit/Integration/expected/test_ArchiveCronTest_nonPreArchivedSegment_noOptions__VisitsSummary.get_year.xml
+++ b/tests/PHPUnit/System/expected/test_ArchiveCronTest_nonPreArchivedSegment_noOptions__VisitsSummary.get_year.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ArchiveCronTest_preArchivedSegment_noOptions__Live.getLastVisitsDetails_day.xml b/tests/PHPUnit/System/expected/test_ArchiveCronTest_preArchivedSegment_noOptions__Live.getLastVisitsDetails_day.xml
index 9a6324b1bb..9a6324b1bb 100644
--- a/tests/PHPUnit/Integration/expected/test_ArchiveCronTest_preArchivedSegment_noOptions__Live.getLastVisitsDetails_day.xml
+++ b/tests/PHPUnit/System/expected/test_ArchiveCronTest_preArchivedSegment_noOptions__Live.getLastVisitsDetails_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ArchiveCronTest_preArchivedSegment_noOptions__Live.getLastVisitsDetails_year.xml b/tests/PHPUnit/System/expected/test_ArchiveCronTest_preArchivedSegment_noOptions__Live.getLastVisitsDetails_year.xml
index 17fe7bfe25..17fe7bfe25 100644
--- a/tests/PHPUnit/Integration/expected/test_ArchiveCronTest_preArchivedSegment_noOptions__Live.getLastVisitsDetails_year.xml
+++ b/tests/PHPUnit/System/expected/test_ArchiveCronTest_preArchivedSegment_noOptions__Live.getLastVisitsDetails_year.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ArchiveCronTest_preArchivedSegment_noOptions__VisitsSummary.get_day.xml b/tests/PHPUnit/System/expected/test_ArchiveCronTest_preArchivedSegment_noOptions__VisitsSummary.get_day.xml
index 7a7644b476..7a7644b476 100644
--- a/tests/PHPUnit/Integration/expected/test_ArchiveCronTest_preArchivedSegment_noOptions__VisitsSummary.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_ArchiveCronTest_preArchivedSegment_noOptions__VisitsSummary.get_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ArchiveCronTest_preArchivedSegment_noOptions__VisitsSummary.get_year.xml b/tests/PHPUnit/System/expected/test_ArchiveCronTest_preArchivedSegment_noOptions__VisitsSummary.get_year.xml
index d59560e4a4..d59560e4a4 100644
--- a/tests/PHPUnit/Integration/expected/test_ArchiveCronTest_preArchivedSegment_noOptions__VisitsSummary.get_year.xml
+++ b/tests/PHPUnit/System/expected/test_ArchiveCronTest_preArchivedSegment_noOptions__VisitsSummary.get_year.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ArchiveCronTest_segmentNoAutoArchive_noOptions__VisitsSummary.get_day.xml b/tests/PHPUnit/System/expected/test_ArchiveCronTest_segmentNoAutoArchive_noOptions__VisitsSummary.get_day.xml
index 1c7f2179e5..1c7f2179e5 100644
--- a/tests/PHPUnit/Integration/expected/test_ArchiveCronTest_segmentNoAutoArchive_noOptions__VisitsSummary.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_ArchiveCronTest_segmentNoAutoArchive_noOptions__VisitsSummary.get_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ArchiveCronTest_segmentNoAutoArchive_noOptions__VisitsSummary.get_month.xml b/tests/PHPUnit/System/expected/test_ArchiveCronTest_segmentNoAutoArchive_noOptions__VisitsSummary.get_month.xml
index 1c7f2179e5..1c7f2179e5 100644
--- a/tests/PHPUnit/Integration/expected/test_ArchiveCronTest_segmentNoAutoArchive_noOptions__VisitsSummary.get_month.xml
+++ b/tests/PHPUnit/System/expected/test_ArchiveCronTest_segmentNoAutoArchive_noOptions__VisitsSummary.get_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ArchiveCronTest_segmentNoAutoArchive_noOptions__VisitsSummary.get_week.xml b/tests/PHPUnit/System/expected/test_ArchiveCronTest_segmentNoAutoArchive_noOptions__VisitsSummary.get_week.xml
index 1c7f2179e5..1c7f2179e5 100644
--- a/tests/PHPUnit/Integration/expected/test_ArchiveCronTest_segmentNoAutoArchive_noOptions__VisitsSummary.get_week.xml
+++ b/tests/PHPUnit/System/expected/test_ArchiveCronTest_segmentNoAutoArchive_noOptions__VisitsSummary.get_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ArchiveCronTest_segmentNoAutoArchive_noOptions__VisitsSummary.get_year.xml b/tests/PHPUnit/System/expected/test_ArchiveCronTest_segmentNoAutoArchive_noOptions__VisitsSummary.get_year.xml
index 1c7f2179e5..1c7f2179e5 100644
--- a/tests/PHPUnit/Integration/expected/test_ArchiveCronTest_segmentNoAutoArchive_noOptions__VisitsSummary.get_year.xml
+++ b/tests/PHPUnit/System/expected/test_ArchiveCronTest_segmentNoAutoArchive_noOptions__VisitsSummary.get_year.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ArchiveCronTest_segmentOnlyOneSite_noOptions__VisitsSummary.get_day.xml b/tests/PHPUnit/System/expected/test_ArchiveCronTest_segmentOnlyOneSite_noOptions__VisitsSummary.get_day.xml
index 89cd627339..89cd627339 100644
--- a/tests/PHPUnit/Integration/expected/test_ArchiveCronTest_segmentOnlyOneSite_noOptions__VisitsSummary.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_ArchiveCronTest_segmentOnlyOneSite_noOptions__VisitsSummary.get_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ArchiveCronTest_segmentOnlyOneSite_noOptions__VisitsSummary.get_month.xml b/tests/PHPUnit/System/expected/test_ArchiveCronTest_segmentOnlyOneSite_noOptions__VisitsSummary.get_month.xml
index dc70f24c00..dc70f24c00 100644
--- a/tests/PHPUnit/Integration/expected/test_ArchiveCronTest_segmentOnlyOneSite_noOptions__VisitsSummary.get_month.xml
+++ b/tests/PHPUnit/System/expected/test_ArchiveCronTest_segmentOnlyOneSite_noOptions__VisitsSummary.get_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ArchiveCronTest_segmentOnlyOneSite_noOptions__VisitsSummary.get_week.xml b/tests/PHPUnit/System/expected/test_ArchiveCronTest_segmentOnlyOneSite_noOptions__VisitsSummary.get_week.xml
index 09a9dec19a..09a9dec19a 100644
--- a/tests/PHPUnit/Integration/expected/test_ArchiveCronTest_segmentOnlyOneSite_noOptions__VisitsSummary.get_week.xml
+++ b/tests/PHPUnit/System/expected/test_ArchiveCronTest_segmentOnlyOneSite_noOptions__VisitsSummary.get_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ArchiveCronTest_segmentOnlyOneSite_noOptions__VisitsSummary.get_year.xml b/tests/PHPUnit/System/expected/test_ArchiveCronTest_segmentOnlyOneSite_noOptions__VisitsSummary.get_year.xml
index 5596008ffe..5596008ffe 100644
--- a/tests/PHPUnit/Integration/expected/test_ArchiveCronTest_segmentOnlyOneSite_noOptions__VisitsSummary.get_year.xml
+++ b/tests/PHPUnit/System/expected/test_ArchiveCronTest_segmentOnlyOneSite_noOptions__VisitsSummary.get_year.xml
diff --git a/tests/PHPUnit/Integration/expected/test_Archive_InvalidationWebsite1_NewDataShouldAppear__Actions.getPageUrls_month.xml b/tests/PHPUnit/System/expected/test_Archive_InvalidationWebsite1_NewDataShouldAppear__Actions.getPageUrls_month.xml
index 823b29f7a5..823b29f7a5 100644
--- a/tests/PHPUnit/Integration/expected/test_Archive_InvalidationWebsite1_NewDataShouldAppear__Actions.getPageUrls_month.xml
+++ b/tests/PHPUnit/System/expected/test_Archive_InvalidationWebsite1_NewDataShouldAppear__Actions.getPageUrls_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_Archive_InvalidationWebsite1_NewDataShouldAppear__VisitsSummary.get_month.xml b/tests/PHPUnit/System/expected/test_Archive_InvalidationWebsite1_NewDataShouldAppear__VisitsSummary.get_month.xml
index d183cb915b..d183cb915b 100644
--- a/tests/PHPUnit/Integration/expected/test_Archive_InvalidationWebsite1_NewDataShouldAppear__VisitsSummary.get_month.xml
+++ b/tests/PHPUnit/System/expected/test_Archive_InvalidationWebsite1_NewDataShouldAppear__VisitsSummary.get_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_Archive_InvalidationWebsite1_NewDataShouldNotAppear__Actions.getPageUrls_month.xml b/tests/PHPUnit/System/expected/test_Archive_InvalidationWebsite1_NewDataShouldNotAppear__Actions.getPageUrls_month.xml
index d4056f1f70..d4056f1f70 100644
--- a/tests/PHPUnit/Integration/expected/test_Archive_InvalidationWebsite1_NewDataShouldNotAppear__Actions.getPageUrls_month.xml
+++ b/tests/PHPUnit/System/expected/test_Archive_InvalidationWebsite1_NewDataShouldNotAppear__Actions.getPageUrls_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_Archive_InvalidationWebsite1_NewDataShouldNotAppear__VisitsSummary.get_month.xml b/tests/PHPUnit/System/expected/test_Archive_InvalidationWebsite1_NewDataShouldNotAppear__VisitsSummary.get_month.xml
index 5d2578d36f..5d2578d36f 100644
--- a/tests/PHPUnit/Integration/expected/test_Archive_InvalidationWebsite1_NewDataShouldNotAppear__VisitsSummary.get_month.xml
+++ b/tests/PHPUnit/System/expected/test_Archive_InvalidationWebsite1_NewDataShouldNotAppear__VisitsSummary.get_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_Archive_InvalidationWebsite2NewDataShouldNotAppear_BecauseWeekWasNotInvalidated__Actions.getPageUrls_week.xml b/tests/PHPUnit/System/expected/test_Archive_InvalidationWebsite2NewDataShouldNotAppear_BecauseWeekWasNotInvalidated__Actions.getPageUrls_week.xml
index bcd758b7c5..bcd758b7c5 100644
--- a/tests/PHPUnit/Integration/expected/test_Archive_InvalidationWebsite2NewDataShouldNotAppear_BecauseWeekWasNotInvalidated__Actions.getPageUrls_week.xml
+++ b/tests/PHPUnit/System/expected/test_Archive_InvalidationWebsite2NewDataShouldNotAppear_BecauseWeekWasNotInvalidated__Actions.getPageUrls_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_Archive_InvalidationWebsite2NewDataShouldNotAppear_BecauseWeekWasNotInvalidated__VisitsSummary.get_week.xml b/tests/PHPUnit/System/expected/test_Archive_InvalidationWebsite2NewDataShouldNotAppear_BecauseWeekWasNotInvalidated__VisitsSummary.get_week.xml
index c494788d70..c494788d70 100644
--- a/tests/PHPUnit/Integration/expected/test_Archive_InvalidationWebsite2NewDataShouldNotAppear_BecauseWeekWasNotInvalidated__VisitsSummary.get_week.xml
+++ b/tests/PHPUnit/System/expected/test_Archive_InvalidationWebsite2NewDataShouldNotAppear_BecauseWeekWasNotInvalidated__VisitsSummary.get_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_Archive_InvalidationWebsite2_NewDataShouldAppear__Actions.getPageUrls_month.xml b/tests/PHPUnit/System/expected/test_Archive_InvalidationWebsite2_NewDataShouldAppear__Actions.getPageUrls_month.xml
index ad5d8b5c44..ad5d8b5c44 100644
--- a/tests/PHPUnit/Integration/expected/test_Archive_InvalidationWebsite2_NewDataShouldAppear__Actions.getPageUrls_month.xml
+++ b/tests/PHPUnit/System/expected/test_Archive_InvalidationWebsite2_NewDataShouldAppear__Actions.getPageUrls_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_Archive_InvalidationWebsite2_NewDataShouldAppear__VisitsSummary.get_month.xml b/tests/PHPUnit/System/expected/test_Archive_InvalidationWebsite2_NewDataShouldAppear__VisitsSummary.get_month.xml
index 1e897c6120..1e897c6120 100644
--- a/tests/PHPUnit/Integration/expected/test_Archive_InvalidationWebsite2_NewDataShouldAppear__VisitsSummary.get_month.xml
+++ b/tests/PHPUnit/System/expected/test_Archive_InvalidationWebsite2_NewDataShouldAppear__VisitsSummary.get_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_Archive_InvalidationWebsite2_NewDataShouldNotAppear_BecauseWeekWasNotInvalidated__Actions.getPageUrls_week.xml b/tests/PHPUnit/System/expected/test_Archive_InvalidationWebsite2_NewDataShouldNotAppear_BecauseWeekWasNotInvalidated__Actions.getPageUrls_week.xml
index 3f580dfcf7..3f580dfcf7 100644
--- a/tests/PHPUnit/Integration/expected/test_Archive_InvalidationWebsite2_NewDataShouldNotAppear_BecauseWeekWasNotInvalidated__Actions.getPageUrls_week.xml
+++ b/tests/PHPUnit/System/expected/test_Archive_InvalidationWebsite2_NewDataShouldNotAppear_BecauseWeekWasNotInvalidated__Actions.getPageUrls_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_Archive_InvalidationWebsite2_NewDataShouldNotAppear_BecauseWeekWasNotInvalidated__VisitsSummary.get_week.xml b/tests/PHPUnit/System/expected/test_Archive_InvalidationWebsite2_NewDataShouldNotAppear_BecauseWeekWasNotInvalidated__VisitsSummary.get_week.xml
index 75d267cfc4..75d267cfc4 100644
--- a/tests/PHPUnit/Integration/expected/test_Archive_InvalidationWebsite2_NewDataShouldNotAppear_BecauseWeekWasNotInvalidated__VisitsSummary.get_week.xml
+++ b/tests/PHPUnit/System/expected/test_Archive_InvalidationWebsite2_NewDataShouldNotAppear_BecauseWeekWasNotInvalidated__VisitsSummary.get_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_Archive_InvalidationWebsite2_NewDataShouldNotAppear__Actions.getPageUrls_month.xml b/tests/PHPUnit/System/expected/test_Archive_InvalidationWebsite2_NewDataShouldNotAppear__Actions.getPageUrls_month.xml
index 80d2fcadd7..80d2fcadd7 100644
--- a/tests/PHPUnit/Integration/expected/test_Archive_InvalidationWebsite2_NewDataShouldNotAppear__Actions.getPageUrls_month.xml
+++ b/tests/PHPUnit/System/expected/test_Archive_InvalidationWebsite2_NewDataShouldNotAppear__Actions.getPageUrls_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_Archive_InvalidationWebsite2_NewDataShouldNotAppear__VisitsSummary.get_month.xml b/tests/PHPUnit/System/expected/test_Archive_InvalidationWebsite2_NewDataShouldNotAppear__VisitsSummary.get_month.xml
index 4402121f8a..4402121f8a 100644
--- a/tests/PHPUnit/Integration/expected/test_Archive_InvalidationWebsite2_NewDataShouldNotAppear__VisitsSummary.get_month.xml
+++ b/tests/PHPUnit/System/expected/test_Archive_InvalidationWebsite2_NewDataShouldNotAppear__VisitsSummary.get_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest__Live.getLastVisitsDetails_range.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest__Live.getLastVisitsDetails_range.xml
index 6d211f0172..6d211f0172 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest__Live.getLastVisitsDetails_range.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest__Live.getLastVisitsDetails_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_actions__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_actions__API.getSuggestedValuesForSegment.xml
index 3dfaf6b4fe..3dfaf6b4fe 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_actions__API.getSuggestedValuesForSegment.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_actions__API.getSuggestedValuesForSegment.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_actions__VisitsSummary.get_range.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_actions__VisitsSummary.get_range.xml
index 7ace3fcbe7..7ace3fcbe7 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_actions__VisitsSummary.get_range.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_actions__VisitsSummary.get_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_browserCode__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_browserCode__API.getSuggestedValuesForSegment.xml
index 8626ac313b..8626ac313b 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_browserCode__API.getSuggestedValuesForSegment.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_browserCode__API.getSuggestedValuesForSegment.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_browserCode__VisitsSummary.get_range.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_browserCode__VisitsSummary.get_range.xml
index 5d07770e4e..5d07770e4e 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_browserCode__VisitsSummary.get_range.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_browserCode__VisitsSummary.get_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_browserVersion__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_browserVersion__API.getSuggestedValuesForSegment.xml
index abcc43c819..abcc43c819 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_browserVersion__API.getSuggestedValuesForSegment.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_browserVersion__API.getSuggestedValuesForSegment.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_browserVersion__VisitsSummary.get_range.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_browserVersion__VisitsSummary.get_range.xml
index 5d07770e4e..5d07770e4e 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_browserVersion__VisitsSummary.get_range.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_browserVersion__VisitsSummary.get_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_city__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_city__API.getSuggestedValuesForSegment.xml
index c5a7afa2b4..c5a7afa2b4 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_city__API.getSuggestedValuesForSegment.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_city__API.getSuggestedValuesForSegment.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_city__VisitsSummary.get_range.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_city__VisitsSummary.get_range.xml
index 0dadc8d4ed..0dadc8d4ed 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_city__VisitsSummary.get_range.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_city__VisitsSummary.get_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_contentInteraction__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_contentInteraction__API.getSuggestedValuesForSegment.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_contentInteraction__API.getSuggestedValuesForSegment.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_contentInteraction__API.getSuggestedValuesForSegment.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_contentName__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_contentName__API.getSuggestedValuesForSegment.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_contentName__API.getSuggestedValuesForSegment.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_contentName__API.getSuggestedValuesForSegment.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_contentPiece__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_contentPiece__API.getSuggestedValuesForSegment.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_contentPiece__API.getSuggestedValuesForSegment.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_contentPiece__API.getSuggestedValuesForSegment.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_contentTarget__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_contentTarget__API.getSuggestedValuesForSegment.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_contentTarget__API.getSuggestedValuesForSegment.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_contentTarget__API.getSuggestedValuesForSegment.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_continentCode__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_continentCode__API.getSuggestedValuesForSegment.xml
index f002a6ceae..f002a6ceae 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_continentCode__API.getSuggestedValuesForSegment.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_continentCode__API.getSuggestedValuesForSegment.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_continentCode__VisitsSummary.get_range.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_continentCode__VisitsSummary.get_range.xml
index 7c7cc211dd..7c7cc211dd 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_continentCode__VisitsSummary.get_range.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_continentCode__VisitsSummary.get_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_countryCode__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_countryCode__API.getSuggestedValuesForSegment.xml
index 949a6486de..949a6486de 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_countryCode__API.getSuggestedValuesForSegment.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_countryCode__API.getSuggestedValuesForSegment.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_countryCode__VisitsSummary.get_range.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_countryCode__VisitsSummary.get_range.xml
index 0dadc8d4ed..0dadc8d4ed 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_countryCode__VisitsSummary.get_range.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_countryCode__VisitsSummary.get_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariableName1__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariableName1__API.getSuggestedValuesForSegment.xml
index d301db94df..d301db94df 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariableName1__API.getSuggestedValuesForSegment.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariableName1__API.getSuggestedValuesForSegment.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariableName1__VisitsSummary.get_range.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariableName1__VisitsSummary.get_range.xml
index 47eec1002c..47eec1002c 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariableName1__VisitsSummary.get_range.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariableName1__VisitsSummary.get_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariableName2__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariableName2__API.getSuggestedValuesForSegment.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariableName2__API.getSuggestedValuesForSegment.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariableName2__API.getSuggestedValuesForSegment.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariableName3__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariableName3__API.getSuggestedValuesForSegment.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariableName3__API.getSuggestedValuesForSegment.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariableName3__API.getSuggestedValuesForSegment.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariableName4__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariableName4__API.getSuggestedValuesForSegment.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariableName4__API.getSuggestedValuesForSegment.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariableName4__API.getSuggestedValuesForSegment.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariableName5__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariableName5__API.getSuggestedValuesForSegment.xml
index 3b00ef3096..3b00ef3096 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariableName5__API.getSuggestedValuesForSegment.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariableName5__API.getSuggestedValuesForSegment.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariableName5__VisitsSummary.get_range.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariableName5__VisitsSummary.get_range.xml
index 47eec1002c..47eec1002c 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariableName5__VisitsSummary.get_range.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariableName5__VisitsSummary.get_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariablePageName1__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariablePageName1__API.getSuggestedValuesForSegment.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariablePageName1__API.getSuggestedValuesForSegment.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariablePageName1__API.getSuggestedValuesForSegment.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariablePageName2__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariablePageName2__API.getSuggestedValuesForSegment.xml
index 8698fbbd4d..8698fbbd4d 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariablePageName2__API.getSuggestedValuesForSegment.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariablePageName2__API.getSuggestedValuesForSegment.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariablePageName2__VisitsSummary.get_range.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariablePageName2__VisitsSummary.get_range.xml
index b72146a986..b72146a986 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariablePageName2__VisitsSummary.get_range.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariablePageName2__VisitsSummary.get_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariablePageName3__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariablePageName3__API.getSuggestedValuesForSegment.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariablePageName3__API.getSuggestedValuesForSegment.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariablePageName3__API.getSuggestedValuesForSegment.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariablePageName4__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariablePageName4__API.getSuggestedValuesForSegment.xml
index 522fc54866..522fc54866 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariablePageName4__API.getSuggestedValuesForSegment.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariablePageName4__API.getSuggestedValuesForSegment.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariablePageName4__VisitsSummary.get_range.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariablePageName4__VisitsSummary.get_range.xml
index d8bcdace18..d8bcdace18 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariablePageName4__VisitsSummary.get_range.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariablePageName4__VisitsSummary.get_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariablePageName5__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariablePageName5__API.getSuggestedValuesForSegment.xml
index 3e34700999..3e34700999 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariablePageName5__API.getSuggestedValuesForSegment.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariablePageName5__API.getSuggestedValuesForSegment.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariablePageName5__VisitsSummary.get_range.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariablePageName5__VisitsSummary.get_range.xml
index b72146a986..b72146a986 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariablePageName5__VisitsSummary.get_range.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariablePageName5__VisitsSummary.get_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariablePageValue1__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariablePageValue1__API.getSuggestedValuesForSegment.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariablePageValue1__API.getSuggestedValuesForSegment.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariablePageValue1__API.getSuggestedValuesForSegment.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariablePageValue2__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariablePageValue2__API.getSuggestedValuesForSegment.xml
index 18b4e9b372..18b4e9b372 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariablePageValue2__API.getSuggestedValuesForSegment.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariablePageValue2__API.getSuggestedValuesForSegment.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariablePageValue2__VisitsSummary.get_range.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariablePageValue2__VisitsSummary.get_range.xml
index 88dae8fd6c..88dae8fd6c 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariablePageValue2__VisitsSummary.get_range.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariablePageValue2__VisitsSummary.get_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariablePageValue3__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariablePageValue3__API.getSuggestedValuesForSegment.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariablePageValue3__API.getSuggestedValuesForSegment.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariablePageValue3__API.getSuggestedValuesForSegment.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariablePageValue4__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariablePageValue4__API.getSuggestedValuesForSegment.xml
index f7624776eb..f7624776eb 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariablePageValue4__API.getSuggestedValuesForSegment.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariablePageValue4__API.getSuggestedValuesForSegment.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariablePageValue4__VisitsSummary.get_range.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariablePageValue4__VisitsSummary.get_range.xml
index e0144ec833..e0144ec833 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariablePageValue4__VisitsSummary.get_range.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariablePageValue4__VisitsSummary.get_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariablePageValue5__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariablePageValue5__API.getSuggestedValuesForSegment.xml
index 0425837789..0425837789 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariablePageValue5__API.getSuggestedValuesForSegment.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariablePageValue5__API.getSuggestedValuesForSegment.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariablePageValue5__VisitsSummary.get_range.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariablePageValue5__VisitsSummary.get_range.xml
index 88dae8fd6c..88dae8fd6c 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariablePageValue5__VisitsSummary.get_range.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariablePageValue5__VisitsSummary.get_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariableValue1__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariableValue1__API.getSuggestedValuesForSegment.xml
index b157cb068a..b157cb068a 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariableValue1__API.getSuggestedValuesForSegment.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariableValue1__API.getSuggestedValuesForSegment.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariableValue1__VisitsSummary.get_range.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariableValue1__VisitsSummary.get_range.xml
index d4214faba0..d4214faba0 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariableValue1__VisitsSummary.get_range.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariableValue1__VisitsSummary.get_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariableValue2__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariableValue2__API.getSuggestedValuesForSegment.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariableValue2__API.getSuggestedValuesForSegment.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariableValue2__API.getSuggestedValuesForSegment.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariableValue3__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariableValue3__API.getSuggestedValuesForSegment.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariableValue3__API.getSuggestedValuesForSegment.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariableValue3__API.getSuggestedValuesForSegment.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariableValue4__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariableValue4__API.getSuggestedValuesForSegment.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariableValue4__API.getSuggestedValuesForSegment.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariableValue4__API.getSuggestedValuesForSegment.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariableValue5__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariableValue5__API.getSuggestedValuesForSegment.xml
index 40b2b0992a..40b2b0992a 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariableValue5__API.getSuggestedValuesForSegment.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariableValue5__API.getSuggestedValuesForSegment.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariableValue5__VisitsSummary.get_range.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariableValue5__VisitsSummary.get_range.xml
index d4214faba0..d4214faba0 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_customVariableValue5__VisitsSummary.get_range.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_customVariableValue5__VisitsSummary.get_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_daysSinceFirstVisit__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_daysSinceFirstVisit__API.getSuggestedValuesForSegment.xml
index 487ce13284..487ce13284 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_daysSinceFirstVisit__API.getSuggestedValuesForSegment.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_daysSinceFirstVisit__API.getSuggestedValuesForSegment.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_daysSinceFirstVisit__VisitsSummary.get_range.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_daysSinceFirstVisit__VisitsSummary.get_range.xml
index a0db0ecba0..a0db0ecba0 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_daysSinceFirstVisit__VisitsSummary.get_range.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_daysSinceFirstVisit__VisitsSummary.get_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_daysSinceLastEcommerceOrder__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_daysSinceLastEcommerceOrder__API.getSuggestedValuesForSegment.xml
index ab150e6b32..ab150e6b32 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_daysSinceLastEcommerceOrder__API.getSuggestedValuesForSegment.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_daysSinceLastEcommerceOrder__API.getSuggestedValuesForSegment.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_daysSinceLastEcommerceOrder__VisitsSummary.get_range.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_daysSinceLastEcommerceOrder__VisitsSummary.get_range.xml
index a0db0ecba0..a0db0ecba0 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_daysSinceLastEcommerceOrder__VisitsSummary.get_range.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_daysSinceLastEcommerceOrder__VisitsSummary.get_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_daysSinceLastVisit__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_daysSinceLastVisit__API.getSuggestedValuesForSegment.xml
index 9a04ddc8c8..9a04ddc8c8 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_daysSinceLastVisit__API.getSuggestedValuesForSegment.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_daysSinceLastVisit__API.getSuggestedValuesForSegment.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_daysSinceLastVisit__VisitsSummary.get_range.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_daysSinceLastVisit__VisitsSummary.get_range.xml
index a0db0ecba0..a0db0ecba0 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_daysSinceLastVisit__VisitsSummary.get_range.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_daysSinceLastVisit__VisitsSummary.get_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_deviceType__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_deviceType__API.getSuggestedValuesForSegment.xml
index 4f5796903a..4f5796903a 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_deviceType__API.getSuggestedValuesForSegment.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_deviceType__API.getSuggestedValuesForSegment.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_deviceType__VisitsSummary.get_range.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_deviceType__VisitsSummary.get_range.xml
index 5d07770e4e..5d07770e4e 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_deviceType__VisitsSummary.get_range.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_deviceType__VisitsSummary.get_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_entryPageTitle__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_entryPageTitle__API.getSuggestedValuesForSegment.xml
index 9916600524..9916600524 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_entryPageTitle__API.getSuggestedValuesForSegment.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_entryPageTitle__API.getSuggestedValuesForSegment.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_entryPageTitle__VisitsSummary.get_range.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_entryPageTitle__VisitsSummary.get_range.xml
index b72146a986..b72146a986 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_entryPageTitle__VisitsSummary.get_range.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_entryPageTitle__VisitsSummary.get_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_entryPageUrl__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_entryPageUrl__API.getSuggestedValuesForSegment.xml
index 4d3c877fce..4d3c877fce 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_entryPageUrl__API.getSuggestedValuesForSegment.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_entryPageUrl__API.getSuggestedValuesForSegment.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_entryPageUrl__VisitsSummary.get_range.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_entryPageUrl__VisitsSummary.get_range.xml
index 7ace3fcbe7..7ace3fcbe7 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_entryPageUrl__VisitsSummary.get_range.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_entryPageUrl__VisitsSummary.get_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_eventAction__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_eventAction__API.getSuggestedValuesForSegment.xml
index df2f6b2dac..df2f6b2dac 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_eventAction__API.getSuggestedValuesForSegment.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_eventAction__API.getSuggestedValuesForSegment.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_eventAction__VisitsSummary.get_range.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_eventAction__VisitsSummary.get_range.xml
index 1922b24059..1922b24059 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_eventAction__VisitsSummary.get_range.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_eventAction__VisitsSummary.get_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_eventCategory__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_eventCategory__API.getSuggestedValuesForSegment.xml
index 952a834c1a..952a834c1a 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_eventCategory__API.getSuggestedValuesForSegment.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_eventCategory__API.getSuggestedValuesForSegment.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_eventCategory__VisitsSummary.get_range.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_eventCategory__VisitsSummary.get_range.xml
index 1922b24059..1922b24059 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_eventCategory__VisitsSummary.get_range.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_eventCategory__VisitsSummary.get_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_eventName__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_eventName__API.getSuggestedValuesForSegment.xml
index fa8c853fcf..fa8c853fcf 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_eventName__API.getSuggestedValuesForSegment.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_eventName__API.getSuggestedValuesForSegment.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_eventName__VisitsSummary.get_range.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_eventName__VisitsSummary.get_range.xml
index 1922b24059..1922b24059 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_eventName__VisitsSummary.get_range.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_eventName__VisitsSummary.get_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_events__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_events__API.getSuggestedValuesForSegment.xml
index 727df89075..727df89075 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_events__API.getSuggestedValuesForSegment.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_events__API.getSuggestedValuesForSegment.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_events__VisitsSummary.get_range.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_events__VisitsSummary.get_range.xml
index 7ace3fcbe7..7ace3fcbe7 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_events__VisitsSummary.get_range.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_events__VisitsSummary.get_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_exitPageTitle__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_exitPageTitle__API.getSuggestedValuesForSegment.xml
index 9916600524..9916600524 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_exitPageTitle__API.getSuggestedValuesForSegment.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_exitPageTitle__API.getSuggestedValuesForSegment.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_exitPageTitle__VisitsSummary.get_range.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_exitPageTitle__VisitsSummary.get_range.xml
index b72146a986..b72146a986 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_exitPageTitle__VisitsSummary.get_range.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_exitPageTitle__VisitsSummary.get_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_exitPageUrl__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_exitPageUrl__API.getSuggestedValuesForSegment.xml
index 4d3c877fce..4d3c877fce 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_exitPageUrl__API.getSuggestedValuesForSegment.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_exitPageUrl__API.getSuggestedValuesForSegment.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_exitPageUrl__VisitsSummary.get_range.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_exitPageUrl__VisitsSummary.get_range.xml
index 7ace3fcbe7..7ace3fcbe7 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_exitPageUrl__VisitsSummary.get_range.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_exitPageUrl__VisitsSummary.get_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_latitude__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_latitude__API.getSuggestedValuesForSegment.xml
index d48ae32332..d48ae32332 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_latitude__API.getSuggestedValuesForSegment.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_latitude__API.getSuggestedValuesForSegment.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_latitude__VisitsSummary.get_range.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_latitude__VisitsSummary.get_range.xml
index e023a89081..e023a89081 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_latitude__VisitsSummary.get_range.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_latitude__VisitsSummary.get_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_longitude__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_longitude__API.getSuggestedValuesForSegment.xml
index 34b2e9333d..34b2e9333d 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_longitude__API.getSuggestedValuesForSegment.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_longitude__API.getSuggestedValuesForSegment.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_longitude__VisitsSummary.get_range.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_longitude__VisitsSummary.get_range.xml
index d8bcdace18..d8bcdace18 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_longitude__VisitsSummary.get_range.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_longitude__VisitsSummary.get_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_operatingSystemCode__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_operatingSystemCode__API.getSuggestedValuesForSegment.xml
index 1e74517256..1e74517256 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_operatingSystemCode__API.getSuggestedValuesForSegment.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_operatingSystemCode__API.getSuggestedValuesForSegment.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_operatingSystemCode__VisitsSummary.get_range.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_operatingSystemCode__VisitsSummary.get_range.xml
index 5d07770e4e..5d07770e4e 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_operatingSystemCode__VisitsSummary.get_range.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_operatingSystemCode__VisitsSummary.get_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_pageTitle__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_pageTitle__API.getSuggestedValuesForSegment.xml
index 9916600524..9916600524 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_pageTitle__API.getSuggestedValuesForSegment.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_pageTitle__API.getSuggestedValuesForSegment.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_pageTitle__VisitsSummary.get_range.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_pageTitle__VisitsSummary.get_range.xml
index b72146a986..b72146a986 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_pageTitle__VisitsSummary.get_range.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_pageTitle__VisitsSummary.get_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_pageUrl__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_pageUrl__API.getSuggestedValuesForSegment.xml
index 162ce8a72b..162ce8a72b 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_pageUrl__API.getSuggestedValuesForSegment.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_pageUrl__API.getSuggestedValuesForSegment.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_pageUrl__VisitsSummary.get_range.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_pageUrl__VisitsSummary.get_range.xml
index a0db0ecba0..a0db0ecba0 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_pageUrl__VisitsSummary.get_range.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_pageUrl__VisitsSummary.get_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_provider__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_provider__API.getSuggestedValuesForSegment.xml
index 6cf1af346e..6cf1af346e 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_provider__API.getSuggestedValuesForSegment.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_provider__API.getSuggestedValuesForSegment.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_provider__VisitsSummary.get_range.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_provider__VisitsSummary.get_range.xml
index c51a1bc13d..c51a1bc13d 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_provider__VisitsSummary.get_range.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_provider__VisitsSummary.get_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_referrerKeyword__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_referrerKeyword__API.getSuggestedValuesForSegment.xml
index 2959b13a9c..2959b13a9c 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_referrerKeyword__API.getSuggestedValuesForSegment.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_referrerKeyword__API.getSuggestedValuesForSegment.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_referrerKeyword__VisitsSummary.get_range.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_referrerKeyword__VisitsSummary.get_range.xml
index dfa3a20623..dfa3a20623 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_referrerKeyword__VisitsSummary.get_range.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_referrerKeyword__VisitsSummary.get_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_referrerName__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_referrerName__API.getSuggestedValuesForSegment.xml
index 6ca2019597..6ca2019597 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_referrerName__API.getSuggestedValuesForSegment.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_referrerName__API.getSuggestedValuesForSegment.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_referrerName__VisitsSummary.get_range.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_referrerName__VisitsSummary.get_range.xml
index dfa3a20623..dfa3a20623 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_referrerName__VisitsSummary.get_range.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_referrerName__VisitsSummary.get_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_referrerType__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_referrerType__API.getSuggestedValuesForSegment.xml
index 9b61eb17b1..9b61eb17b1 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_referrerType__API.getSuggestedValuesForSegment.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_referrerType__API.getSuggestedValuesForSegment.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_referrerType__VisitsSummary.get_range.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_referrerType__VisitsSummary.get_range.xml
index ce18f5b1dc..ce18f5b1dc 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_referrerType__VisitsSummary.get_range.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_referrerType__VisitsSummary.get_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_referrerUrl__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_referrerUrl__API.getSuggestedValuesForSegment.xml
index f7cd8deb3b..f7cd8deb3b 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_referrerUrl__API.getSuggestedValuesForSegment.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_referrerUrl__API.getSuggestedValuesForSegment.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_referrerUrl__VisitsSummary.get_range.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_referrerUrl__VisitsSummary.get_range.xml
index dfa3a20623..dfa3a20623 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_referrerUrl__VisitsSummary.get_range.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_referrerUrl__VisitsSummary.get_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_regionCode__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_regionCode__API.getSuggestedValuesForSegment.xml
index 68a8855109..68a8855109 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_regionCode__API.getSuggestedValuesForSegment.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_regionCode__API.getSuggestedValuesForSegment.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_regionCode__VisitsSummary.get_range.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_regionCode__VisitsSummary.get_range.xml
index e023a89081..e023a89081 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_regionCode__VisitsSummary.get_range.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_regionCode__VisitsSummary.get_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_resolution__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_resolution__API.getSuggestedValuesForSegment.xml
index 5a29930810..5a29930810 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_resolution__API.getSuggestedValuesForSegment.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_resolution__API.getSuggestedValuesForSegment.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_resolution__VisitsSummary.get_range.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_resolution__VisitsSummary.get_range.xml
index f52326b337..f52326b337 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_resolution__VisitsSummary.get_range.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_resolution__VisitsSummary.get_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_searches__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_searches__API.getSuggestedValuesForSegment.xml
index 727df89075..727df89075 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_searches__API.getSuggestedValuesForSegment.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_searches__API.getSuggestedValuesForSegment.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_searches__VisitsSummary.get_range.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_searches__VisitsSummary.get_range.xml
index 410df64fa3..410df64fa3 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_searches__VisitsSummary.get_range.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_searches__VisitsSummary.get_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_siteSearchKeyword__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_siteSearchKeyword__API.getSuggestedValuesForSegment.xml
index 0690d54c62..0690d54c62 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_siteSearchKeyword__API.getSuggestedValuesForSegment.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_siteSearchKeyword__API.getSuggestedValuesForSegment.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_siteSearchKeyword__VisitsSummary.get_range.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_siteSearchKeyword__VisitsSummary.get_range.xml
index e0144ec833..e0144ec833 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_siteSearchKeyword__VisitsSummary.get_range.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_siteSearchKeyword__VisitsSummary.get_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_userId__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_userId__API.getSuggestedValuesForSegment.xml
index 381e1be3af..381e1be3af 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_userId__API.getSuggestedValuesForSegment.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_userId__API.getSuggestedValuesForSegment.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_userId__VisitsSummary.get_range.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_userId__VisitsSummary.get_range.xml
index dfa3a20623..dfa3a20623 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_userId__VisitsSummary.get_range.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_userId__VisitsSummary.get_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_visitConvertedGoalId__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitConvertedGoalId__API.getSuggestedValuesForSegment.xml
index 1099070756..1099070756 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_visitConvertedGoalId__API.getSuggestedValuesForSegment.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitConvertedGoalId__API.getSuggestedValuesForSegment.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_visitConvertedGoalId__VisitsSummary.get_range.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitConvertedGoalId__VisitsSummary.get_range.xml
index f52326b337..f52326b337 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_visitConvertedGoalId__VisitsSummary.get_range.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitConvertedGoalId__VisitsSummary.get_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_visitConverted__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitConverted__API.getSuggestedValuesForSegment.xml
index 70bdb9e417..70bdb9e417 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_visitConverted__API.getSuggestedValuesForSegment.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitConverted__API.getSuggestedValuesForSegment.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_visitConverted__VisitsSummary.get_range.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitConverted__VisitsSummary.get_range.xml
index f52326b337..f52326b337 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_visitConverted__VisitsSummary.get_range.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitConverted__VisitsSummary.get_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_visitCount__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitCount__API.getSuggestedValuesForSegment.xml
index cec58f0121..cec58f0121 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_visitCount__API.getSuggestedValuesForSegment.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitCount__API.getSuggestedValuesForSegment.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_visitCount__VisitsSummary.get_range.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitCount__VisitsSummary.get_range.xml
index ce025f0a46..ce025f0a46 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_visitCount__VisitsSummary.get_range.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitCount__VisitsSummary.get_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_visitDuration__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitDuration__API.getSuggestedValuesForSegment.xml
index 66dead530e..66dead530e 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_visitDuration__API.getSuggestedValuesForSegment.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitDuration__API.getSuggestedValuesForSegment.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_visitDuration__VisitsSummary.get_range.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitDuration__VisitsSummary.get_range.xml
index 7ace3fcbe7..7ace3fcbe7 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_visitDuration__VisitsSummary.get_range.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitDuration__VisitsSummary.get_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_visitEcommerceStatus__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitEcommerceStatus__API.getSuggestedValuesForSegment.xml
index 405fd9750c..405fd9750c 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_visitEcommerceStatus__API.getSuggestedValuesForSegment.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitEcommerceStatus__API.getSuggestedValuesForSegment.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_visitEcommerceStatus__VisitsSummary.get_range.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitEcommerceStatus__VisitsSummary.get_range.xml
index f52326b337..f52326b337 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_visitEcommerceStatus__VisitsSummary.get_range.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitEcommerceStatus__VisitsSummary.get_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_visitId__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitId__API.getSuggestedValuesForSegment.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_visitId__API.getSuggestedValuesForSegment.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitId__API.getSuggestedValuesForSegment.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_visitIp__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitIp__API.getSuggestedValuesForSegment.xml
index e71397f869..e71397f869 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_visitIp__API.getSuggestedValuesForSegment.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitIp__API.getSuggestedValuesForSegment.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_visitIp__VisitsSummary.get_range.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitIp__VisitsSummary.get_range.xml
index 352cc69e4a..352cc69e4a 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_visitIp__VisitsSummary.get_range.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitIp__VisitsSummary.get_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_visitLocalHour__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitLocalHour__API.getSuggestedValuesForSegment.xml
index e8a749dda2..e8a749dda2 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_visitLocalHour__API.getSuggestedValuesForSegment.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitLocalHour__API.getSuggestedValuesForSegment.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_visitLocalHour__VisitsSummary.get_range.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitLocalHour__VisitsSummary.get_range.xml
index f52326b337..f52326b337 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_visitLocalHour__VisitsSummary.get_range.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitLocalHour__VisitsSummary.get_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_visitServerHour__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitServerHour__API.getSuggestedValuesForSegment.xml
index 727df89075..727df89075 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_visitServerHour__API.getSuggestedValuesForSegment.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitServerHour__API.getSuggestedValuesForSegment.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_visitServerHour__VisitsSummary.get_range.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitServerHour__VisitsSummary.get_range.xml
index 7ace3fcbe7..7ace3fcbe7 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_visitServerHour__VisitsSummary.get_range.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitServerHour__VisitsSummary.get_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_visitorId__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitorId__API.getSuggestedValuesForSegment.xml
index e21f421867..e21f421867 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_visitorId__API.getSuggestedValuesForSegment.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitorId__API.getSuggestedValuesForSegment.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_visitorId__VisitsSummary.get_range.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitorId__VisitsSummary.get_range.xml
index 64efc881e1..64efc881e1 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_visitorId__VisitsSummary.get_range.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitorId__VisitsSummary.get_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_visitorType__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitorType__API.getSuggestedValuesForSegment.xml
index 84613aaaf2..84613aaaf2 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_visitorType__API.getSuggestedValuesForSegment.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitorType__API.getSuggestedValuesForSegment.xml
diff --git a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_visitorType__VisitsSummary.get_range.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitorType__VisitsSummary.get_range.xml
index ce025f0a46..ce025f0a46 100644
--- a/tests/PHPUnit/Integration/expected/test_AutoSuggestAPITest_visitorType__VisitsSummary.get_range.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_visitorType__VisitsSummary.get_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_BackwardsCompatibility1XTest__VisitFrequency.get_day.xml b/tests/PHPUnit/System/expected/test_BackwardsCompatibility1XTest__VisitFrequency.get_day.xml
index 3633fe5914..3633fe5914 100644
--- a/tests/PHPUnit/Integration/expected/test_BackwardsCompatibility1XTest__VisitFrequency.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_BackwardsCompatibility1XTest__VisitFrequency.get_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_BackwardsCompatibility1XTest__VisitFrequency.get_month.xml b/tests/PHPUnit/System/expected/test_BackwardsCompatibility1XTest__VisitFrequency.get_month.xml
index 3c62d79738..3c62d79738 100644
--- a/tests/PHPUnit/Integration/expected/test_BackwardsCompatibility1XTest__VisitFrequency.get_month.xml
+++ b/tests/PHPUnit/System/expected/test_BackwardsCompatibility1XTest__VisitFrequency.get_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_BackwardsCompatibility1XTest__VisitFrequency.get_range.xml b/tests/PHPUnit/System/expected/test_BackwardsCompatibility1XTest__VisitFrequency.get_range.xml
index a232e03046..a232e03046 100644
--- a/tests/PHPUnit/Integration/expected/test_BackwardsCompatibility1XTest__VisitFrequency.get_range.xml
+++ b/tests/PHPUnit/System/expected/test_BackwardsCompatibility1XTest__VisitFrequency.get_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_BackwardsCompatibility1XTest__VisitFrequency.get_week.xml b/tests/PHPUnit/System/expected/test_BackwardsCompatibility1XTest__VisitFrequency.get_week.xml
index 3c62d79738..3c62d79738 100644
--- a/tests/PHPUnit/Integration/expected/test_BackwardsCompatibility1XTest__VisitFrequency.get_week.xml
+++ b/tests/PHPUnit/System/expected/test_BackwardsCompatibility1XTest__VisitFrequency.get_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_BackwardsCompatibility1XTest__VisitFrequency.get_year.xml b/tests/PHPUnit/System/expected/test_BackwardsCompatibility1XTest__VisitFrequency.get_year.xml
index a232e03046..a232e03046 100644
--- a/tests/PHPUnit/Integration/expected/test_BackwardsCompatibility1XTest__VisitFrequency.get_year.xml
+++ b/tests/PHPUnit/System/expected/test_BackwardsCompatibility1XTest__VisitFrequency.get_year.xml
diff --git a/tests/PHPUnit/Integration/expected/test_BackwardsCompatibility1XTest_multipleDates__VisitFrequency.get_day.xml b/tests/PHPUnit/System/expected/test_BackwardsCompatibility1XTest_multipleDates__VisitFrequency.get_day.xml
index b8e30312d7..b8e30312d7 100644
--- a/tests/PHPUnit/Integration/expected/test_BackwardsCompatibility1XTest_multipleDates__VisitFrequency.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_BackwardsCompatibility1XTest_multipleDates__VisitFrequency.get_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_BackwardsCompatibility1XTest_multipleOldNew__VisitFrequency.get_month.xml b/tests/PHPUnit/System/expected/test_BackwardsCompatibility1XTest_multipleOldNew__VisitFrequency.get_month.xml
index 9b5f22a3ea..9b5f22a3ea 100644
--- a/tests/PHPUnit/Integration/expected/test_BackwardsCompatibility1XTest_multipleOldNew__VisitFrequency.get_month.xml
+++ b/tests/PHPUnit/System/expected/test_BackwardsCompatibility1XTest_multipleOldNew__VisitFrequency.get_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_CustomEvents_Actions.getPageUrls_lastN__API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_CustomEvents_Actions.getPageUrls_lastN__API.getProcessedReport_day.xml
index 01171d06ab..01171d06ab 100644
--- a/tests/PHPUnit/Integration/expected/test_CustomEvents_Actions.getPageUrls_lastN__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_CustomEvents_Actions.getPageUrls_lastN__API.getProcessedReport_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_CustomEvents_Events.getAction_lastN__API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_CustomEvents_Events.getAction_lastN__API.getProcessedReport_day.xml
index ef94481043..ef94481043 100644
--- a/tests/PHPUnit/Integration/expected/test_CustomEvents_Events.getAction_lastN__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_CustomEvents_Events.getAction_lastN__API.getProcessedReport_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_CustomEvents_Events.getCategory_lastN__API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_CustomEvents_Events.getCategory_lastN__API.getProcessedReport_day.xml
index b503ab7292..b503ab7292 100644
--- a/tests/PHPUnit/Integration/expected/test_CustomEvents_Events.getCategory_lastN__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_CustomEvents_Events.getCategory_lastN__API.getProcessedReport_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_CustomEvents_Events.getName_lastN__API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_CustomEvents_Events.getName_lastN__API.getProcessedReport_day.xml
index 403acff85f..403acff85f 100644
--- a/tests/PHPUnit/Integration/expected/test_CustomEvents_Events.getName_lastN__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_CustomEvents_Events.getName_lastN__API.getProcessedReport_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_CustomEvents__Actions.getPageUrls_day.xml b/tests/PHPUnit/System/expected/test_CustomEvents__Actions.getPageUrls_day.xml
index b09bbc9e7f..b09bbc9e7f 100644
--- a/tests/PHPUnit/Integration/expected/test_CustomEvents__Actions.getPageUrls_day.xml
+++ b/tests/PHPUnit/System/expected/test_CustomEvents__Actions.getPageUrls_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_CustomEvents__Actions.getPageUrls_month.xml b/tests/PHPUnit/System/expected/test_CustomEvents__Actions.getPageUrls_month.xml
index 5e6a7b260b..5e6a7b260b 100644
--- a/tests/PHPUnit/Integration/expected/test_CustomEvents__Actions.getPageUrls_month.xml
+++ b/tests/PHPUnit/System/expected/test_CustomEvents__Actions.getPageUrls_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_CustomEvents__Actions.get_day.xml b/tests/PHPUnit/System/expected/test_CustomEvents__Actions.get_day.xml
index 65ae232e68..65ae232e68 100644
--- a/tests/PHPUnit/Integration/expected/test_CustomEvents__Actions.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_CustomEvents__Actions.get_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_CustomEvents__Actions.get_month.xml b/tests/PHPUnit/System/expected/test_CustomEvents__Actions.get_month.xml
index 65ae232e68..65ae232e68 100644
--- a/tests/PHPUnit/Integration/expected/test_CustomEvents__Actions.get_month.xml
+++ b/tests/PHPUnit/System/expected/test_CustomEvents__Actions.get_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_CustomEvents__Events.getAction_day.xml b/tests/PHPUnit/System/expected/test_CustomEvents__Events.getAction_day.xml
index 26752bbd7b..26752bbd7b 100644
--- a/tests/PHPUnit/Integration/expected/test_CustomEvents__Events.getAction_day.xml
+++ b/tests/PHPUnit/System/expected/test_CustomEvents__Events.getAction_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_CustomEvents__Events.getAction_month.xml b/tests/PHPUnit/System/expected/test_CustomEvents__Events.getAction_month.xml
index 9868947268..9868947268 100644
--- a/tests/PHPUnit/Integration/expected/test_CustomEvents__Events.getAction_month.xml
+++ b/tests/PHPUnit/System/expected/test_CustomEvents__Events.getAction_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_CustomEvents__Events.getCategory_day.xml b/tests/PHPUnit/System/expected/test_CustomEvents__Events.getCategory_day.xml
index 5f3469aa23..5f3469aa23 100644
--- a/tests/PHPUnit/Integration/expected/test_CustomEvents__Events.getCategory_day.xml
+++ b/tests/PHPUnit/System/expected/test_CustomEvents__Events.getCategory_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_CustomEvents__Events.getCategory_month.xml b/tests/PHPUnit/System/expected/test_CustomEvents__Events.getCategory_month.xml
index 1f8fdb7c02..1f8fdb7c02 100644
--- a/tests/PHPUnit/Integration/expected/test_CustomEvents__Events.getCategory_month.xml
+++ b/tests/PHPUnit/System/expected/test_CustomEvents__Events.getCategory_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_CustomEvents__Events.getName_day.xml b/tests/PHPUnit/System/expected/test_CustomEvents__Events.getName_day.xml
index 9461eeb42e..9461eeb42e 100644
--- a/tests/PHPUnit/Integration/expected/test_CustomEvents__Events.getName_day.xml
+++ b/tests/PHPUnit/System/expected/test_CustomEvents__Events.getName_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_CustomEvents__Events.getName_month.xml b/tests/PHPUnit/System/expected/test_CustomEvents__Events.getName_month.xml
index 5f8de9463f..5f8de9463f 100644
--- a/tests/PHPUnit/Integration/expected/test_CustomEvents__Events.getName_month.xml
+++ b/tests/PHPUnit/System/expected/test_CustomEvents__Events.getName_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_CustomEvents__Live.getLastVisitsDetails_day.xml b/tests/PHPUnit/System/expected/test_CustomEvents__Live.getLastVisitsDetails_day.xml
index a0cd8d2485..a0cd8d2485 100644
--- a/tests/PHPUnit/Integration/expected/test_CustomEvents__Live.getLastVisitsDetails_day.xml
+++ b/tests/PHPUnit/System/expected/test_CustomEvents__Live.getLastVisitsDetails_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_CustomEvents__Live.getLastVisitsDetails_month.xml b/tests/PHPUnit/System/expected/test_CustomEvents__Live.getLastVisitsDetails_month.xml
index a0cd8d2485..a0cd8d2485 100644
--- a/tests/PHPUnit/Integration/expected/test_CustomEvents__Live.getLastVisitsDetails_month.xml
+++ b/tests/PHPUnit/System/expected/test_CustomEvents__Live.getLastVisitsDetails_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_CustomEvents_eventCategoryOrNameMatch__Actions.getPageUrls_day.xml b/tests/PHPUnit/System/expected/test_CustomEvents_eventCategoryOrNameMatch__Actions.getPageUrls_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_CustomEvents_eventCategoryOrNameMatch__Actions.getPageUrls_day.xml
+++ b/tests/PHPUnit/System/expected/test_CustomEvents_eventCategoryOrNameMatch__Actions.getPageUrls_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_CustomEvents_eventCategoryOrNameMatch__Events.getAction_day.xml b/tests/PHPUnit/System/expected/test_CustomEvents_eventCategoryOrNameMatch__Events.getAction_day.xml
index d70e8c2950..d70e8c2950 100644
--- a/tests/PHPUnit/Integration/expected/test_CustomEvents_eventCategoryOrNameMatch__Events.getAction_day.xml
+++ b/tests/PHPUnit/System/expected/test_CustomEvents_eventCategoryOrNameMatch__Events.getAction_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_CustomEvents_eventCategoryOrNameMatch__Events.getCategory_day.xml b/tests/PHPUnit/System/expected/test_CustomEvents_eventCategoryOrNameMatch__Events.getCategory_day.xml
index d65a2784c3..d65a2784c3 100644
--- a/tests/PHPUnit/Integration/expected/test_CustomEvents_eventCategoryOrNameMatch__Events.getCategory_day.xml
+++ b/tests/PHPUnit/System/expected/test_CustomEvents_eventCategoryOrNameMatch__Events.getCategory_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_CustomEvents_eventCategoryOrNameMatch__Events.getName_day.xml b/tests/PHPUnit/System/expected/test_CustomEvents_eventCategoryOrNameMatch__Events.getName_day.xml
index 71ccc3d69b..71ccc3d69b 100644
--- a/tests/PHPUnit/Integration/expected/test_CustomEvents_eventCategoryOrNameMatch__Events.getName_day.xml
+++ b/tests/PHPUnit/System/expected/test_CustomEvents_eventCategoryOrNameMatch__Events.getName_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_CustomEvents_secondaryDimensionIsEventAction__Events.getAction_day.xml b/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventAction__Events.getAction_day.xml
index 098124ac66..098124ac66 100644
--- a/tests/PHPUnit/Integration/expected/test_CustomEvents_secondaryDimensionIsEventAction__Events.getAction_day.xml
+++ b/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventAction__Events.getAction_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_CustomEvents_secondaryDimensionIsEventAction__Events.getAction_month.xml b/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventAction__Events.getAction_month.xml
index 098124ac66..098124ac66 100644
--- a/tests/PHPUnit/Integration/expected/test_CustomEvents_secondaryDimensionIsEventAction__Events.getAction_month.xml
+++ b/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventAction__Events.getAction_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_CustomEvents_secondaryDimensionIsEventAction__Events.getCategory_day.xml b/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventAction__Events.getCategory_day.xml
index 5f3469aa23..5f3469aa23 100644
--- a/tests/PHPUnit/Integration/expected/test_CustomEvents_secondaryDimensionIsEventAction__Events.getCategory_day.xml
+++ b/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventAction__Events.getCategory_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_CustomEvents_secondaryDimensionIsEventAction__Events.getCategory_month.xml b/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventAction__Events.getCategory_month.xml
index 1f8fdb7c02..1f8fdb7c02 100644
--- a/tests/PHPUnit/Integration/expected/test_CustomEvents_secondaryDimensionIsEventAction__Events.getCategory_month.xml
+++ b/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventAction__Events.getCategory_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_CustomEvents_secondaryDimensionIsEventAction__Events.getName_day.xml b/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventAction__Events.getName_day.xml
index 9461eeb42e..9461eeb42e 100644
--- a/tests/PHPUnit/Integration/expected/test_CustomEvents_secondaryDimensionIsEventAction__Events.getName_day.xml
+++ b/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventAction__Events.getName_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_CustomEvents_secondaryDimensionIsEventAction__Events.getName_month.xml b/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventAction__Events.getName_month.xml
index 5f8de9463f..5f8de9463f 100644
--- a/tests/PHPUnit/Integration/expected/test_CustomEvents_secondaryDimensionIsEventAction__Events.getName_month.xml
+++ b/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventAction__Events.getName_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_CustomEvents_secondaryDimensionIsEventCategory__Events.getAction_day.xml b/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventCategory__Events.getAction_day.xml
index 8d225ad12f..8d225ad12f 100644
--- a/tests/PHPUnit/Integration/expected/test_CustomEvents_secondaryDimensionIsEventCategory__Events.getAction_day.xml
+++ b/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventCategory__Events.getAction_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_CustomEvents_secondaryDimensionIsEventCategory__Events.getAction_month.xml b/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventCategory__Events.getAction_month.xml
index f558d64451..f558d64451 100644
--- a/tests/PHPUnit/Integration/expected/test_CustomEvents_secondaryDimensionIsEventCategory__Events.getAction_month.xml
+++ b/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventCategory__Events.getAction_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_CustomEvents_secondaryDimensionIsEventCategory__Events.getCategory_day.xml b/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventCategory__Events.getCategory_day.xml
index 18cffa0445..18cffa0445 100644
--- a/tests/PHPUnit/Integration/expected/test_CustomEvents_secondaryDimensionIsEventCategory__Events.getCategory_day.xml
+++ b/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventCategory__Events.getCategory_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_CustomEvents_secondaryDimensionIsEventCategory__Events.getCategory_month.xml b/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventCategory__Events.getCategory_month.xml
index 18cffa0445..18cffa0445 100644
--- a/tests/PHPUnit/Integration/expected/test_CustomEvents_secondaryDimensionIsEventCategory__Events.getCategory_month.xml
+++ b/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventCategory__Events.getCategory_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_CustomEvents_secondaryDimensionIsEventCategory__Events.getName_day.xml b/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventCategory__Events.getName_day.xml
index 03b5718c7b..03b5718c7b 100644
--- a/tests/PHPUnit/Integration/expected/test_CustomEvents_secondaryDimensionIsEventCategory__Events.getName_day.xml
+++ b/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventCategory__Events.getName_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_CustomEvents_secondaryDimensionIsEventCategory__Events.getName_month.xml b/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventCategory__Events.getName_month.xml
index 54676e7511..54676e7511 100644
--- a/tests/PHPUnit/Integration/expected/test_CustomEvents_secondaryDimensionIsEventCategory__Events.getName_month.xml
+++ b/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventCategory__Events.getName_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_CustomEvents_secondaryDimensionIsEventName__Events.getAction_day.xml b/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventName__Events.getAction_day.xml
index 26752bbd7b..26752bbd7b 100644
--- a/tests/PHPUnit/Integration/expected/test_CustomEvents_secondaryDimensionIsEventName__Events.getAction_day.xml
+++ b/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventName__Events.getAction_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_CustomEvents_secondaryDimensionIsEventName__Events.getAction_month.xml b/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventName__Events.getAction_month.xml
index 9868947268..9868947268 100644
--- a/tests/PHPUnit/Integration/expected/test_CustomEvents_secondaryDimensionIsEventName__Events.getAction_month.xml
+++ b/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventName__Events.getAction_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_CustomEvents_secondaryDimensionIsEventName__Events.getCategory_day.xml b/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventName__Events.getCategory_day.xml
index d6f7a63bbe..d6f7a63bbe 100644
--- a/tests/PHPUnit/Integration/expected/test_CustomEvents_secondaryDimensionIsEventName__Events.getCategory_day.xml
+++ b/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventName__Events.getCategory_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_CustomEvents_secondaryDimensionIsEventName__Events.getCategory_month.xml b/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventName__Events.getCategory_month.xml
index 835e7cc629..835e7cc629 100644
--- a/tests/PHPUnit/Integration/expected/test_CustomEvents_secondaryDimensionIsEventName__Events.getCategory_month.xml
+++ b/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventName__Events.getCategory_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_CustomEvents_secondaryDimensionIsEventName__Events.getName_day.xml b/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventName__Events.getName_day.xml
index d2eee9f023..d2eee9f023 100644
--- a/tests/PHPUnit/Integration/expected/test_CustomEvents_secondaryDimensionIsEventName__Events.getName_day.xml
+++ b/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventName__Events.getName_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_CustomEvents_secondaryDimensionIsEventName__Events.getName_month.xml b/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventName__Events.getName_month.xml
index d2eee9f023..d2eee9f023 100644
--- a/tests/PHPUnit/Integration/expected/test_CustomEvents_secondaryDimensionIsEventName__Events.getName_month.xml
+++ b/tests/PHPUnit/System/expected/test_CustomEvents_secondaryDimensionIsEventName__Events.getName_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_CustomEvents_segmentMatchesEventActionPlay__Actions.getPageUrls_day.xml b/tests/PHPUnit/System/expected/test_CustomEvents_segmentMatchesEventActionPlay__Actions.getPageUrls_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_CustomEvents_segmentMatchesEventActionPlay__Actions.getPageUrls_day.xml
+++ b/tests/PHPUnit/System/expected/test_CustomEvents_segmentMatchesEventActionPlay__Actions.getPageUrls_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_CustomEvents_segmentMatchesEventActionPlay__Events.getAction_day.xml b/tests/PHPUnit/System/expected/test_CustomEvents_segmentMatchesEventActionPlay__Events.getAction_day.xml
index 609b2b8d6c..609b2b8d6c 100644
--- a/tests/PHPUnit/Integration/expected/test_CustomEvents_segmentMatchesEventActionPlay__Events.getAction_day.xml
+++ b/tests/PHPUnit/System/expected/test_CustomEvents_segmentMatchesEventActionPlay__Events.getAction_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_CustomEvents_segmentMatchesEventActionPlay__Events.getCategory_day.xml b/tests/PHPUnit/System/expected/test_CustomEvents_segmentMatchesEventActionPlay__Events.getCategory_day.xml
index 7582baa657..7582baa657 100644
--- a/tests/PHPUnit/Integration/expected/test_CustomEvents_segmentMatchesEventActionPlay__Events.getCategory_day.xml
+++ b/tests/PHPUnit/System/expected/test_CustomEvents_segmentMatchesEventActionPlay__Events.getCategory_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_CustomEvents_segmentMatchesEventActionPlay__Events.getName_day.xml b/tests/PHPUnit/System/expected/test_CustomEvents_segmentMatchesEventActionPlay__Events.getName_day.xml
index e1aa570c57..e1aa570c57 100644
--- a/tests/PHPUnit/Integration/expected/test_CustomEvents_segmentMatchesEventActionPlay__Events.getName_day.xml
+++ b/tests/PHPUnit/System/expected/test_CustomEvents_segmentMatchesEventActionPlay__Events.getName_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_FlattenReports__Actions.getPageUrls_week.xml b/tests/PHPUnit/System/expected/test_FlattenReports__Actions.getPageUrls_week.xml
index 2e48a2f945..2e48a2f945 100644
--- a/tests/PHPUnit/Integration/expected/test_FlattenReports__Actions.getPageUrls_week.xml
+++ b/tests/PHPUnit/System/expected/test_FlattenReports__Actions.getPageUrls_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_FlattenReports__CustomVariables.getCustomVariables_day.xml b/tests/PHPUnit/System/expected/test_FlattenReports__CustomVariables.getCustomVariables_day.xml
index 8a085297ce..8a085297ce 100644
--- a/tests/PHPUnit/Integration/expected/test_FlattenReports__CustomVariables.getCustomVariables_day.xml
+++ b/tests/PHPUnit/System/expected/test_FlattenReports__CustomVariables.getCustomVariables_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_FlattenReports__Referrers.getWebsites_day.xml b/tests/PHPUnit/System/expected/test_FlattenReports__Referrers.getWebsites_day.xml
index 8c9042be1c..8c9042be1c 100644
--- a/tests/PHPUnit/Integration/expected/test_FlattenReports__Referrers.getWebsites_day.xml
+++ b/tests/PHPUnit/System/expected/test_FlattenReports__Referrers.getWebsites_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_FlattenReports_expandedSubtable__Actions.getPageUrls_week.xml b/tests/PHPUnit/System/expected/test_FlattenReports_expandedSubtable__Actions.getPageUrls_week.xml
index a40bfb0dea..a40bfb0dea 100644
--- a/tests/PHPUnit/Integration/expected/test_FlattenReports_expandedSubtable__Actions.getPageUrls_week.xml
+++ b/tests/PHPUnit/System/expected/test_FlattenReports_expandedSubtable__Actions.getPageUrls_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_FlattenReports_expandedWithDepth__Actions.getPageUrls_week.xml b/tests/PHPUnit/System/expected/test_FlattenReports_expandedWithDepth__Actions.getPageUrls_week.xml
index 326bf6903d..326bf6903d 100644
--- a/tests/PHPUnit/Integration/expected/test_FlattenReports_expandedWithDepth__Actions.getPageUrls_week.xml
+++ b/tests/PHPUnit/System/expected/test_FlattenReports_expandedWithDepth__Actions.getPageUrls_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_FlattenReports_flatFilterPatternRecursive__Actions.getPageUrls_week.xml b/tests/PHPUnit/System/expected/test_FlattenReports_flatFilterPatternRecursive__Actions.getPageUrls_week.xml
index 6acf67f60c..6acf67f60c 100644
--- a/tests/PHPUnit/Integration/expected/test_FlattenReports_flatFilterPatternRecursive__Actions.getPageUrls_week.xml
+++ b/tests/PHPUnit/System/expected/test_FlattenReports_flatFilterPatternRecursive__Actions.getPageUrls_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_FlattenReports_withAggregate__Actions.getPageUrls_week.xml b/tests/PHPUnit/System/expected/test_FlattenReports_withAggregate__Actions.getPageUrls_week.xml
index fb09d47fce..fb09d47fce 100644
--- a/tests/PHPUnit/Integration/expected/test_FlattenReports_withAggregate__Actions.getPageUrls_week.xml
+++ b/tests/PHPUnit/System/expected/test_FlattenReports_withAggregate__Actions.getPageUrls_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getDownload_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getDownload_month.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getDownload_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getDownload_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getDownload_range.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getDownload_range.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getDownload_range.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getDownload_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getDownloads_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getDownloads_month.xml
index 5eb17eb532..5eb17eb532 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getDownloads_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getDownloads_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getDownloads_range.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getDownloads_range.xml
index 9c5b690268..9c5b690268 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getDownloads_range.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getDownloads_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getEntryPageTitles_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getEntryPageTitles_month.xml
index 77e2b64918..77e2b64918 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getEntryPageTitles_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getEntryPageTitles_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getEntryPageTitles_range.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getEntryPageTitles_range.xml
index d8014b0c28..d8014b0c28 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getEntryPageTitles_range.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getEntryPageTitles_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getEntryPageUrls_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getEntryPageUrls_month.xml
index 8845a80655..8845a80655 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getEntryPageUrls_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getEntryPageUrls_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getEntryPageUrls_range.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getEntryPageUrls_range.xml
index b8b7233c2e..b8b7233c2e 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getEntryPageUrls_range.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getEntryPageUrls_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getExitPageTitles_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getExitPageTitles_month.xml
index f1b90a5e1d..f1b90a5e1d 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getExitPageTitles_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getExitPageTitles_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getExitPageTitles_range.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getExitPageTitles_range.xml
index fbb87d260d..fbb87d260d 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getExitPageTitles_range.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getExitPageTitles_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getExitPageUrls_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getExitPageUrls_month.xml
index 28acca1242..28acca1242 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getExitPageUrls_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getExitPageUrls_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getExitPageUrls_range.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getExitPageUrls_range.xml
index ebf0fdffcf..ebf0fdffcf 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getExitPageUrls_range.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getExitPageUrls_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getOutlink_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getOutlink_month.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getOutlink_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getOutlink_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getOutlink_range.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getOutlink_range.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getOutlink_range.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getOutlink_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getOutlinks_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getOutlinks_month.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getOutlinks_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getOutlinks_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getOutlinks_range.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getOutlinks_range.xml
index d03b4e81bb..d03b4e81bb 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getOutlinks_range.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getOutlinks_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getPageTitle_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getPageTitle_month.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getPageTitle_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getPageTitle_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getPageTitle_range.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getPageTitle_range.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getPageTitle_range.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getPageTitle_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getPageTitlesFollowingSiteSearch_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getPageTitlesFollowingSiteSearch_month.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getPageTitlesFollowingSiteSearch_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getPageTitlesFollowingSiteSearch_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getPageTitlesFollowingSiteSearch_range.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getPageTitlesFollowingSiteSearch_range.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getPageTitlesFollowingSiteSearch_range.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getPageTitlesFollowingSiteSearch_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getPageTitles_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getPageTitles_month.xml
index 143229b5e7..143229b5e7 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getPageTitles_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getPageTitles_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getPageTitles_range.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getPageTitles_range.xml
index 6285169aa5..6285169aa5 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getPageTitles_range.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getPageTitles_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getPageUrl_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getPageUrl_month.xml
index c5d48fa621..c5d48fa621 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getPageUrl_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getPageUrl_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getPageUrl_range.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getPageUrl_range.xml
index c5d48fa621..c5d48fa621 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getPageUrl_range.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getPageUrl_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getPageUrlsFollowingSiteSearch_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getPageUrlsFollowingSiteSearch_month.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getPageUrlsFollowingSiteSearch_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getPageUrlsFollowingSiteSearch_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getPageUrlsFollowingSiteSearch_range.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getPageUrlsFollowingSiteSearch_range.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getPageUrlsFollowingSiteSearch_range.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getPageUrlsFollowingSiteSearch_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getPageUrls_day.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getPageUrls_day.xml
index 94423ac9d9..94423ac9d9 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getPageUrls_day.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getPageUrls_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getPageUrls_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getPageUrls_month.xml
index c3f7304c25..c3f7304c25 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getPageUrls_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getPageUrls_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getPageUrls_range.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getPageUrls_range.xml
index 4ce246f6cf..4ce246f6cf 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getPageUrls_range.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getPageUrls_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getSiteSearchCategories_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getSiteSearchCategories_month.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getSiteSearchCategories_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getSiteSearchCategories_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getSiteSearchCategories_range.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getSiteSearchCategories_range.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getSiteSearchCategories_range.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getSiteSearchCategories_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getSiteSearchKeywords_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getSiteSearchKeywords_month.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getSiteSearchKeywords_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getSiteSearchKeywords_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getSiteSearchKeywords_range.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getSiteSearchKeywords_range.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getSiteSearchKeywords_range.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getSiteSearchKeywords_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getSiteSearchNoResultKeywords_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getSiteSearchNoResultKeywords_month.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getSiteSearchNoResultKeywords_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getSiteSearchNoResultKeywords_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getSiteSearchNoResultKeywords_range.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getSiteSearchNoResultKeywords_range.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.getSiteSearchNoResultKeywords_range.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.getSiteSearchNoResultKeywords_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.get_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.get_month.xml
index 1f9e1351ba..1f9e1351ba 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.get_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.get_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.get_range.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.get_range.xml
index a87ec05ee3..a87ec05ee3 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__Actions.get_range.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Actions.get_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__Contents.getContentNames_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Contents.getContentNames_month.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__Contents.getContentNames_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Contents.getContentNames_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__Contents.getContentPieces_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Contents.getContentPieces_month.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__Contents.getContentPieces_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Contents.getContentPieces_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__CustomVariables.getCustomVariables_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__CustomVariables.getCustomVariables_month.xml
index 6f8a9a4c98..6f8a9a4c98 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__CustomVariables.getCustomVariables_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__CustomVariables.getCustomVariables_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__DevicesDetection.getBrand_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__DevicesDetection.getBrand_month.xml
index 38d80d2b64..38d80d2b64 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__DevicesDetection.getBrand_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__DevicesDetection.getBrand_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__DevicesDetection.getBrowserEngines_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__DevicesDetection.getBrowserEngines_month.xml
index bb6679c971..bb6679c971 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__DevicesDetection.getBrowserEngines_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__DevicesDetection.getBrowserEngines_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__DevicesDetection.getBrowserFamilies_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__DevicesDetection.getBrowserFamilies_month.xml
index 77308fd9e7..77308fd9e7 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__DevicesDetection.getBrowserFamilies_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__DevicesDetection.getBrowserFamilies_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__DevicesDetection.getBrowserVersions_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__DevicesDetection.getBrowserVersions_month.xml
index 80d06470a3..80d06470a3 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__DevicesDetection.getBrowserVersions_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__DevicesDetection.getBrowserVersions_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__DevicesDetection.getModel_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__DevicesDetection.getModel_month.xml
index b9bf650ebc..b9bf650ebc 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__DevicesDetection.getModel_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__DevicesDetection.getModel_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__DevicesDetection.getOsFamilies_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__DevicesDetection.getOsFamilies_month.xml
index 62d091d83d..62d091d83d 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__DevicesDetection.getOsFamilies_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__DevicesDetection.getOsFamilies_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__DevicesDetection.getOsVersions_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__DevicesDetection.getOsVersions_month.xml
index 7cad47e0a1..7cad47e0a1 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__DevicesDetection.getOsVersions_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__DevicesDetection.getOsVersions_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__DevicesDetection.getType_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__DevicesDetection.getType_month.xml
index 276e820253..276e820253 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__DevicesDetection.getType_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__DevicesDetection.getType_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__Events.getAction_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Events.getAction_month.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__Events.getAction_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Events.getAction_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__Events.getCategory_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Events.getCategory_month.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__Events.getCategory_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Events.getCategory_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__Events.getName_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Events.getName_month.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__Events.getName_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Events.getName_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__ExamplePlugin.getAnswerToLife.xml b/tests/PHPUnit/System/expected/test_ImportLogs__ExamplePlugin.getAnswerToLife.xml
index 36a787c47a..36a787c47a 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__ExamplePlugin.getAnswerToLife.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__ExamplePlugin.getAnswerToLife.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__ExamplePlugin.getExampleReport_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__ExamplePlugin.getExampleReport_month.xml
index 1b2fed39f9..1b2fed39f9 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__ExamplePlugin.getExampleReport_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__ExamplePlugin.getExampleReport_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__Goals.getDaysToConversion_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Goals.getDaysToConversion_month.xml
index 1ba1449d50..1ba1449d50 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__Goals.getDaysToConversion_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Goals.getDaysToConversion_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__Goals.getGoals.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Goals.getGoals.xml
index b33fbbd767..b33fbbd767 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__Goals.getGoals.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Goals.getGoals.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__Goals.getItemsCategory_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Goals.getItemsCategory_month.xml
index 89122851de..89122851de 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__Goals.getItemsCategory_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Goals.getItemsCategory_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__Goals.getItemsName_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Goals.getItemsName_month.xml
index 161d8ffeae..161d8ffeae 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__Goals.getItemsName_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Goals.getItemsName_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__Goals.getItemsSku_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Goals.getItemsSku_month.xml
index c5ee399492..c5ee399492 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__Goals.getItemsSku_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Goals.getItemsSku_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__Goals.getVisitsUntilConversion_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Goals.getVisitsUntilConversion_month.xml
index 0a94d5f36d..0a94d5f36d 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__Goals.getVisitsUntilConversion_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Goals.getVisitsUntilConversion_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__Goals.get_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Goals.get_month.xml
index fc80cf81c0..fc80cf81c0 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__Goals.get_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Goals.get_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__Live.getLastVisitsDetails_range.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Live.getLastVisitsDetails_range.xml
index cdcfa194b1..cdcfa194b1 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__Live.getLastVisitsDetails_range.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Live.getLastVisitsDetails_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__MultiSites.getAll_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__MultiSites.getAll_month.xml
index eb2209a224..eb2209a224 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__MultiSites.getAll_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__MultiSites.getAll_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__MultiSites.getOne_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__MultiSites.getOne_month.xml
index 1fb93e2a2a..1fb93e2a2a 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__MultiSites.getOne_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__MultiSites.getOne_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__Provider.getProvider_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Provider.getProvider_month.xml
index 8cc6494492..8cc6494492 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__Provider.getProvider_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Provider.getProvider_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__Referrers.getAll_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Referrers.getAll_month.xml
index 808d27a0c7..808d27a0c7 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__Referrers.getAll_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Referrers.getAll_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__Referrers.getCampaigns_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Referrers.getCampaigns_month.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__Referrers.getCampaigns_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Referrers.getCampaigns_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__Referrers.getKeywordsForPageUrl_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Referrers.getKeywordsForPageUrl_month.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__Referrers.getKeywordsForPageUrl_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Referrers.getKeywordsForPageUrl_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__Referrers.getKeywords_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Referrers.getKeywords_month.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__Referrers.getKeywords_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Referrers.getKeywords_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__Referrers.getNumberOfDistinctCampaigns_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Referrers.getNumberOfDistinctCampaigns_month.xml
index f5722c2b94..f5722c2b94 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__Referrers.getNumberOfDistinctCampaigns_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Referrers.getNumberOfDistinctCampaigns_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__Referrers.getNumberOfDistinctKeywords_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Referrers.getNumberOfDistinctKeywords_month.xml
index f5722c2b94..f5722c2b94 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__Referrers.getNumberOfDistinctKeywords_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Referrers.getNumberOfDistinctKeywords_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__Referrers.getNumberOfDistinctSearchEngines_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Referrers.getNumberOfDistinctSearchEngines_month.xml
index f5722c2b94..f5722c2b94 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__Referrers.getNumberOfDistinctSearchEngines_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Referrers.getNumberOfDistinctSearchEngines_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__Referrers.getNumberOfDistinctWebsitesUrls_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Referrers.getNumberOfDistinctWebsitesUrls_month.xml
index 13002b2017..13002b2017 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__Referrers.getNumberOfDistinctWebsitesUrls_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Referrers.getNumberOfDistinctWebsitesUrls_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__Referrers.getNumberOfDistinctWebsites_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Referrers.getNumberOfDistinctWebsites_month.xml
index 13002b2017..13002b2017 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__Referrers.getNumberOfDistinctWebsites_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Referrers.getNumberOfDistinctWebsites_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__Referrers.getReferrerType_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Referrers.getReferrerType_month.xml
index 80a6349ac1..80a6349ac1 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__Referrers.getReferrerType_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Referrers.getReferrerType_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__Referrers.getSearchEngines_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Referrers.getSearchEngines_month.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__Referrers.getSearchEngines_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Referrers.getSearchEngines_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__Referrers.getSocials_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Referrers.getSocials_month.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__Referrers.getSocials_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Referrers.getSocials_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__Referrers.getUrlsForSocial_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Referrers.getUrlsForSocial_month.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__Referrers.getUrlsForSocial_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Referrers.getUrlsForSocial_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__Referrers.getWebsites_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Referrers.getWebsites_month.xml
index bfba8f21af..bfba8f21af 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__Referrers.getWebsites_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__Referrers.getWebsites_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__UserCountry.getCity_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__UserCountry.getCity_month.xml
index a14f0cec91..a14f0cec91 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__UserCountry.getCity_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__UserCountry.getCity_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__UserCountry.getContinent_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__UserCountry.getContinent_month.xml
index 23e244b751..23e244b751 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__UserCountry.getContinent_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__UserCountry.getContinent_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__UserCountry.getCountry_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__UserCountry.getCountry_month.xml
index ce5523efde..ce5523efde 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__UserCountry.getCountry_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__UserCountry.getCountry_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__UserCountry.getNumberOfDistinctCountries_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__UserCountry.getNumberOfDistinctCountries_month.xml
index 17feb622cc..17feb622cc 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__UserCountry.getNumberOfDistinctCountries_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__UserCountry.getNumberOfDistinctCountries_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__UserCountry.getRegion_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__UserCountry.getRegion_month.xml
index 4067fb2618..4067fb2618 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__UserCountry.getRegion_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__UserCountry.getRegion_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__UserSettings.getBrowserVersion_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__UserSettings.getBrowserVersion_month.xml
index 4be2e497a2..4be2e497a2 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__UserSettings.getBrowserVersion_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__UserSettings.getBrowserVersion_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__UserSettings.getBrowser_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__UserSettings.getBrowser_month.xml
index 99d9c637a2..99d9c637a2 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__UserSettings.getBrowser_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__UserSettings.getBrowser_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__UserSettings.getConfiguration_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__UserSettings.getConfiguration_month.xml
index 99f2f8d770..99f2f8d770 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__UserSettings.getConfiguration_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__UserSettings.getConfiguration_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__UserSettings.getLanguageCode_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__UserSettings.getLanguageCode_month.xml
index fc37ec8a8f..fc37ec8a8f 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__UserSettings.getLanguageCode_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__UserSettings.getLanguageCode_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__UserSettings.getLanguage_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__UserSettings.getLanguage_month.xml
index 1f8c578db7..1f8c578db7 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__UserSettings.getLanguage_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__UserSettings.getLanguage_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__UserSettings.getMobileVsDesktop_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__UserSettings.getMobileVsDesktop_month.xml
index 27bfc099ba..27bfc099ba 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__UserSettings.getMobileVsDesktop_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__UserSettings.getMobileVsDesktop_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__UserSettings.getOSFamily_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__UserSettings.getOSFamily_month.xml
index cb47530ed2..cb47530ed2 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__UserSettings.getOSFamily_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__UserSettings.getOSFamily_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__UserSettings.getOS_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__UserSettings.getOS_month.xml
index 1ac05e3dda..1ac05e3dda 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__UserSettings.getOS_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__UserSettings.getOS_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__UserSettings.getPlugin_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__UserSettings.getPlugin_month.xml
index 7079af5413..7079af5413 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__UserSettings.getPlugin_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__UserSettings.getPlugin_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__UserSettings.getResolution_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__UserSettings.getResolution_month.xml
index 659d5beea1..659d5beea1 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__UserSettings.getResolution_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__UserSettings.getResolution_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__UserSettings.getWideScreen_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__UserSettings.getWideScreen_month.xml
index 2048a44e64..2048a44e64 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__UserSettings.getWideScreen_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__UserSettings.getWideScreen_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__VisitFrequency.get_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__VisitFrequency.get_month.xml
index 3633fe5914..3633fe5914 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__VisitFrequency.get_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__VisitFrequency.get_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__VisitFrequency.get_range.xml b/tests/PHPUnit/System/expected/test_ImportLogs__VisitFrequency.get_range.xml
index f301254690..f301254690 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__VisitFrequency.get_range.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__VisitFrequency.get_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__VisitTime.getByDayOfWeek_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__VisitTime.getByDayOfWeek_month.xml
index 1a729a8e26..1a729a8e26 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__VisitTime.getByDayOfWeek_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__VisitTime.getByDayOfWeek_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__VisitTime.getVisitInformationPerLocalTime_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__VisitTime.getVisitInformationPerLocalTime_month.xml
index 427319a89f..427319a89f 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__VisitTime.getVisitInformationPerLocalTime_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__VisitTime.getVisitInformationPerLocalTime_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__VisitTime.getVisitInformationPerServerTime_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__VisitTime.getVisitInformationPerServerTime_month.xml
index 515e54eb3b..515e54eb3b 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__VisitTime.getVisitInformationPerServerTime_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__VisitTime.getVisitInformationPerServerTime_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__VisitorInterest.getNumberOfVisitsByDaysSinceLast_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__VisitorInterest.getNumberOfVisitsByDaysSinceLast_month.xml
index c47de22fc4..c47de22fc4 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__VisitorInterest.getNumberOfVisitsByDaysSinceLast_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__VisitorInterest.getNumberOfVisitsByDaysSinceLast_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__VisitorInterest.getNumberOfVisitsByDaysSinceLast_range.xml b/tests/PHPUnit/System/expected/test_ImportLogs__VisitorInterest.getNumberOfVisitsByDaysSinceLast_range.xml
index c7ed81d100..c7ed81d100 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__VisitorInterest.getNumberOfVisitsByDaysSinceLast_range.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__VisitorInterest.getNumberOfVisitsByDaysSinceLast_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__VisitorInterest.getNumberOfVisitsByVisitCount_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__VisitorInterest.getNumberOfVisitsByVisitCount_month.xml
index 0830ca0d10..0830ca0d10 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__VisitorInterest.getNumberOfVisitsByVisitCount_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__VisitorInterest.getNumberOfVisitsByVisitCount_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__VisitorInterest.getNumberOfVisitsByVisitCount_range.xml b/tests/PHPUnit/System/expected/test_ImportLogs__VisitorInterest.getNumberOfVisitsByVisitCount_range.xml
index d7672ae30c..d7672ae30c 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__VisitorInterest.getNumberOfVisitsByVisitCount_range.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__VisitorInterest.getNumberOfVisitsByVisitCount_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__VisitorInterest.getNumberOfVisitsPerPage_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__VisitorInterest.getNumberOfVisitsPerPage_month.xml
index 4e6a9ab29e..4e6a9ab29e 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__VisitorInterest.getNumberOfVisitsPerPage_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__VisitorInterest.getNumberOfVisitsPerPage_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__VisitorInterest.getNumberOfVisitsPerPage_range.xml b/tests/PHPUnit/System/expected/test_ImportLogs__VisitorInterest.getNumberOfVisitsPerPage_range.xml
index 11e27426c0..11e27426c0 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__VisitorInterest.getNumberOfVisitsPerPage_range.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__VisitorInterest.getNumberOfVisitsPerPage_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__VisitorInterest.getNumberOfVisitsPerVisitDuration_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__VisitorInterest.getNumberOfVisitsPerVisitDuration_month.xml
index a64c14a967..a64c14a967 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__VisitorInterest.getNumberOfVisitsPerVisitDuration_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__VisitorInterest.getNumberOfVisitsPerVisitDuration_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__VisitorInterest.getNumberOfVisitsPerVisitDuration_range.xml b/tests/PHPUnit/System/expected/test_ImportLogs__VisitorInterest.getNumberOfVisitsPerVisitDuration_range.xml
index a0cba6d294..a0cba6d294 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__VisitorInterest.getNumberOfVisitsPerVisitDuration_range.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__VisitorInterest.getNumberOfVisitsPerVisitDuration_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__VisitsSummary.getActions_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__VisitsSummary.getActions_month.xml
index 3fb9469667..3fb9469667 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__VisitsSummary.getActions_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__VisitsSummary.getActions_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__VisitsSummary.getBounceCount_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__VisitsSummary.getBounceCount_month.xml
index 4c77f1f6e6..4c77f1f6e6 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__VisitsSummary.getBounceCount_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__VisitsSummary.getBounceCount_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__VisitsSummary.getMaxActions_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__VisitsSummary.getMaxActions_month.xml
index 15ef03fb49..15ef03fb49 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__VisitsSummary.getMaxActions_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__VisitsSummary.getMaxActions_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__VisitsSummary.getSumVisitsLengthPretty_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__VisitsSummary.getSumVisitsLengthPretty_month.xml
index 2c93902a53..2c93902a53 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__VisitsSummary.getSumVisitsLengthPretty_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__VisitsSummary.getSumVisitsLengthPretty_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__VisitsSummary.getSumVisitsLength_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__VisitsSummary.getSumVisitsLength_month.xml
index df25f1c1f3..df25f1c1f3 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__VisitsSummary.getSumVisitsLength_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__VisitsSummary.getSumVisitsLength_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__VisitsSummary.getUniqueVisitors_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__VisitsSummary.getUniqueVisitors_month.xml
index 40bd2e592a..40bd2e592a 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__VisitsSummary.getUniqueVisitors_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__VisitsSummary.getUniqueVisitors_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__VisitsSummary.getUsers_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__VisitsSummary.getUsers_month.xml
index f5722c2b94..f5722c2b94 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__VisitsSummary.getUsers_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__VisitsSummary.getUsers_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__VisitsSummary.getVisitsConverted_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__VisitsSummary.getVisitsConverted_month.xml
index 4c77f1f6e6..4c77f1f6e6 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__VisitsSummary.getVisitsConverted_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__VisitsSummary.getVisitsConverted_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__VisitsSummary.getVisits_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__VisitsSummary.getVisits_month.xml
index 40bd2e592a..40bd2e592a 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__VisitsSummary.getVisits_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__VisitsSummary.getVisits_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs__VisitsSummary.get_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs__VisitsSummary.get_month.xml
index 327d564f47..327d564f47 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs__VisitsSummary.get_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__VisitsSummary.get_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs_siteIdTwo_TrackedUsingLogReplay__VisitsSummary.get_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs_siteIdTwo_TrackedUsingLogReplay__VisitsSummary.get_month.xml
index b0e66b9280..b0e66b9280 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs_siteIdTwo_TrackedUsingLogReplay__VisitsSummary.get_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs_siteIdTwo_TrackedUsingLogReplay__VisitsSummary.get_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ImportLogs_withEnhancedAndLast7__MultiSites.getAll_month.xml b/tests/PHPUnit/System/expected/test_ImportLogs_withEnhancedAndLast7__MultiSites.getAll_month.xml
index 0fb183d46f..0fb183d46f 100644
--- a/tests/PHPUnit/Integration/expected/test_ImportLogs_withEnhancedAndLast7__MultiSites.getAll_month.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs_withEnhancedAndLast7__MultiSites.getAll_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_LabelFilter_0__Actions.getPageUrls_day.xml b/tests/PHPUnit/System/expected/test_LabelFilter_0__Actions.getPageUrls_day.xml
index 88bdbcf6cd..88bdbcf6cd 100644
--- a/tests/PHPUnit/Integration/expected/test_LabelFilter_0__Actions.getPageUrls_day.xml
+++ b/tests/PHPUnit/System/expected/test_LabelFilter_0__Actions.getPageUrls_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_LabelFilter_dir2sub0filephp__Actions.getPageUrls_day.xml b/tests/PHPUnit/System/expected/test_LabelFilter_dir2sub0filephp__Actions.getPageUrls_day.xml
index 8cedb2f9a9..8cedb2f9a9 100644
--- a/tests/PHPUnit/Integration/expected/test_LabelFilter_dir2sub0filephp__Actions.getPageUrls_day.xml
+++ b/tests/PHPUnit/System/expected/test_LabelFilter_dir2sub0filephp__Actions.getPageUrls_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_LabelFilter_dir__Actions.getPageUrls_day.xml b/tests/PHPUnit/System/expected/test_LabelFilter_dir__Actions.getPageUrls_day.xml
index 3634faa18a..3634faa18a 100644
--- a/tests/PHPUnit/Integration/expected/test_LabelFilter_dir__Actions.getPageUrls_day.xml
+++ b/tests/PHPUnit/System/expected/test_LabelFilter_dir__Actions.getPageUrls_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_LabelFilter_dir_range__Actions.getPageUrls_day.xml b/tests/PHPUnit/System/expected/test_LabelFilter_dir_range__Actions.getPageUrls_day.xml
index b648ce6807..b648ce6807 100644
--- a/tests/PHPUnit/Integration/expected/test_LabelFilter_dir_range__Actions.getPageUrls_day.xml
+++ b/tests/PHPUnit/System/expected/test_LabelFilter_dir_range__Actions.getPageUrls_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_LabelFilter_dirfilephpfoobarfoo2bar__Actions.getPageUrls_day.xml b/tests/PHPUnit/System/expected/test_LabelFilter_dirfilephpfoobarfoo2bar__Actions.getPageUrls_day.xml
index b557287b32..b557287b32 100644
--- a/tests/PHPUnit/Integration/expected/test_LabelFilter_dirfilephpfoobarfoo2bar__Actions.getPageUrls_day.xml
+++ b/tests/PHPUnit/System/expected/test_LabelFilter_dirfilephpfoobarfoo2bar__Actions.getPageUrls_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_LabelFilter_dirnonExistent__Actions.getPageUrls_day.xml b/tests/PHPUnit/System/expected/test_LabelFilter_dirnonExistent__Actions.getPageUrls_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_LabelFilter_dirnonExistent__Actions.getPageUrls_day.xml
+++ b/tests/PHPUnit/System/expected/test_LabelFilter_dirnonExistent__Actions.getPageUrls_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_LabelFilter_keywords_html__Referrers.getSearchEngines_day.xml b/tests/PHPUnit/System/expected/test_LabelFilter_keywords_html__Referrers.getSearchEngines_day.xml
index 411d2a2eb9..411d2a2eb9 100644
--- a/tests/PHPUnit/Integration/expected/test_LabelFilter_keywords_html__Referrers.getSearchEngines_day.xml
+++ b/tests/PHPUnit/System/expected/test_LabelFilter_keywords_html__Referrers.getSearchEngines_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_LabelFilter_shouldBeNoData__Actions.getPageUrls_day.xml b/tests/PHPUnit/System/expected/test_LabelFilter_shouldBeNoData__Actions.getPageUrls_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_LabelFilter_shouldBeNoData__Actions.getPageUrls_day.xml
+++ b/tests/PHPUnit/System/expected/test_LabelFilter_shouldBeNoData__Actions.getPageUrls_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_LabelFilter_terminalOperator_selectBranch__Actions.getPageTitles_day.xml b/tests/PHPUnit/System/expected/test_LabelFilter_terminalOperator_selectBranch__Actions.getPageTitles_day.xml
index 04dac45ecd..04dac45ecd 100644
--- a/tests/PHPUnit/Integration/expected/test_LabelFilter_terminalOperator_selectBranch__Actions.getPageTitles_day.xml
+++ b/tests/PHPUnit/System/expected/test_LabelFilter_terminalOperator_selectBranch__Actions.getPageTitles_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_LabelFilter_terminalOperator_selectTerminal__Actions.getPageTitles_day.xml b/tests/PHPUnit/System/expected/test_LabelFilter_terminalOperator_selectTerminal__Actions.getPageTitles_day.xml
index 1517efab30..1517efab30 100644
--- a/tests/PHPUnit/Integration/expected/test_LabelFilter_terminalOperator_selectTerminal__Actions.getPageTitles_day.xml
+++ b/tests/PHPUnit/System/expected/test_LabelFilter_terminalOperator_selectTerminal__Actions.getPageTitles_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_LabelFilter_terminalOperator_selectTerminal__Actions.getPageUrls_day.xml b/tests/PHPUnit/System/expected/test_LabelFilter_terminalOperator_selectTerminal__Actions.getPageUrls_day.xml
index 2a3958ceba..2a3958ceba 100644
--- a/tests/PHPUnit/Integration/expected/test_LabelFilter_terminalOperator_selectTerminal__Actions.getPageUrls_day.xml
+++ b/tests/PHPUnit/System/expected/test_LabelFilter_terminalOperator_selectTerminal__Actions.getPageUrls_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_LabelFilter_thisiscool__Actions.getPageUrls_day.xml b/tests/PHPUnit/System/expected/test_LabelFilter_thisiscool__Actions.getPageUrls_day.xml
index 4cec8aa9aa..4cec8aa9aa 100644
--- a/tests/PHPUnit/Integration/expected/test_LabelFilter_thisiscool__Actions.getPageUrls_day.xml
+++ b/tests/PHPUnit/System/expected/test_LabelFilter_thisiscool__Actions.getPageUrls_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_LabelFilter_titlesRecursive__Actions.getPageTitles_day.xml b/tests/PHPUnit/System/expected/test_LabelFilter_titlesRecursive__Actions.getPageTitles_day.xml
index 718edc60ac..718edc60ac 100644
--- a/tests/PHPUnit/Integration/expected/test_LabelFilter_titlesRecursive__Actions.getPageTitles_day.xml
+++ b/tests/PHPUnit/System/expected/test_LabelFilter_titlesRecursive__Actions.getPageTitles_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_LabelFilter_titles__Actions.getPageTitles_day.xml b/tests/PHPUnit/System/expected/test_LabelFilter_titles__Actions.getPageTitles_day.xml
index afffc60a48..afffc60a48 100644
--- a/tests/PHPUnit/Integration/expected/test_LabelFilter_titles__Actions.getPageTitles_day.xml
+++ b/tests/PHPUnit/System/expected/test_LabelFilter_titles__Actions.getPageTitles_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_Live.getLastVisitsDetails_sortAsc__Live.getLastVisitsDetails_month.xml b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_Live.getLastVisitsDetails_sortAsc__Live.getLastVisitsDetails_month.xml
index 4ca0871373..4ca0871373 100644
--- a/tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_Live.getLastVisitsDetails_sortAsc__Live.getLastVisitsDetails_month.xml
+++ b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_Live.getLastVisitsDetails_sortAsc__Live.getLastVisitsDetails_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_Live.getLastVisitsDetails_sortByIdVisitAsc__Live.getLastVisitsDetails_month.xml b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_Live.getLastVisitsDetails_sortByIdVisitAsc__Live.getLastVisitsDetails_month.xml
index 403004b58a..403004b58a 100644
--- a/tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_Live.getLastVisitsDetails_sortByIdVisitAsc__Live.getLastVisitsDetails_month.xml
+++ b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_Live.getLastVisitsDetails_sortByIdVisitAsc__Live.getLastVisitsDetails_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_Live.getLastVisitsDetails_sortByIdVisit__Live.getLastVisitsDetails_month.xml b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_Live.getLastVisitsDetails_sortByIdVisit__Live.getLastVisitsDetails_month.xml
index aefb7fd5a5..aefb7fd5a5 100644
--- a/tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_Live.getLastVisitsDetails_sortByIdVisit__Live.getLastVisitsDetails_month.xml
+++ b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_Live.getLastVisitsDetails_sortByIdVisit__Live.getLastVisitsDetails_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_Live.getLastVisitsDetails_sortByVisitCount__Live.getLastVisitsDetails_month.xml b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_Live.getLastVisitsDetails_sortByVisitCount__Live.getLastVisitsDetails_month.xml
index 04e4cca4b7..04e4cca4b7 100644
--- a/tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_Live.getLastVisitsDetails_sortByVisitCount__Live.getLastVisitsDetails_month.xml
+++ b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_Live.getLastVisitsDetails_sortByVisitCount__Live.getLastVisitsDetails_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_Live.getLastVisitsDetails_sortDesc__Live.getLastVisitsDetails_month.xml b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_Live.getLastVisitsDetails_sortDesc__Live.getLastVisitsDetails_month.xml
index aefb7fd5a5..aefb7fd5a5 100644
--- a/tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_Live.getLastVisitsDetails_sortDesc__Live.getLastVisitsDetails_month.xml
+++ b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_Live.getLastVisitsDetails_sortDesc__Live.getLastVisitsDetails_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest__Live.getLastVisitsDetails_month.xml b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest__Live.getLastVisitsDetails_month.xml
index 30ea0c1565..30ea0c1565 100644
--- a/tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest__Live.getLastVisitsDetails_month.xml
+++ b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest__Live.getLastVisitsDetails_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest__UserCountry.getCity_month.xml b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest__UserCountry.getCity_month.xml
index 15d7f11b70..15d7f11b70 100644
--- a/tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest__UserCountry.getCity_month.xml
+++ b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest__UserCountry.getCity_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest__UserCountry.getContinent_month.xml b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest__UserCountry.getContinent_month.xml
index 9572d1df13..9572d1df13 100644
--- a/tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest__UserCountry.getContinent_month.xml
+++ b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest__UserCountry.getContinent_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest__UserCountry.getCountry_month.xml b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest__UserCountry.getCountry_month.xml
index c37c6d773b..c37c6d773b 100644
--- a/tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest__UserCountry.getCountry_month.xml
+++ b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest__UserCountry.getCountry_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest__UserCountry.getLocationFromIP.xml b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest__UserCountry.getLocationFromIP.xml
index e3708f1486..e3708f1486 100644
--- a/tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest__UserCountry.getLocationFromIP.xml
+++ b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest__UserCountry.getLocationFromIP.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest__UserCountry.getNumberOfDistinctCountries_month.xml b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest__UserCountry.getNumberOfDistinctCountries_month.xml
index 5fec83d011..5fec83d011 100644
--- a/tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest__UserCountry.getNumberOfDistinctCountries_month.xml
+++ b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest__UserCountry.getNumberOfDistinctCountries_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest__UserCountry.getRegion_month.xml b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest__UserCountry.getRegion_month.xml
index dc3dfb8724..dc3dfb8724 100644
--- a/tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest__UserCountry.getRegion_month.xml
+++ b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest__UserCountry.getRegion_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_segment_city__UserCountry.getCity_month.xml b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_segment_city__UserCountry.getCity_month.xml
index 9f9d42d029..9f9d42d029 100644
--- a/tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_segment_city__UserCountry.getCity_month.xml
+++ b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_segment_city__UserCountry.getCity_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_segment_city__UserCountry.getContinent_month.xml b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_segment_city__UserCountry.getContinent_month.xml
index 0d795a3fdc..0d795a3fdc 100644
--- a/tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_segment_city__UserCountry.getContinent_month.xml
+++ b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_segment_city__UserCountry.getContinent_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_segment_city__UserCountry.getCountry_month.xml b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_segment_city__UserCountry.getCountry_month.xml
index 369a9aa0e0..369a9aa0e0 100644
--- a/tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_segment_city__UserCountry.getCountry_month.xml
+++ b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_segment_city__UserCountry.getCountry_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_segment_city__UserCountry.getNumberOfDistinctCountries_month.xml b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_segment_city__UserCountry.getNumberOfDistinctCountries_month.xml
index 606fbb5241..606fbb5241 100644
--- a/tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_segment_city__UserCountry.getNumberOfDistinctCountries_month.xml
+++ b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_segment_city__UserCountry.getNumberOfDistinctCountries_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_segment_city__UserCountry.getRegion_month.xml b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_segment_city__UserCountry.getRegion_month.xml
index 1324cdf0bc..1324cdf0bc 100644
--- a/tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_segment_city__UserCountry.getRegion_month.xml
+++ b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_segment_city__UserCountry.getRegion_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_segment_continent__UserCountry.getCountry_month.xml b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_segment_continent__UserCountry.getCountry_month.xml
index 18fe81f3a0..18fe81f3a0 100644
--- a/tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_segment_continent__UserCountry.getCountry_month.xml
+++ b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_segment_continent__UserCountry.getCountry_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_segment_lat_long__UserCountry.getCity_month.xml b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_segment_lat_long__UserCountry.getCity_month.xml
index 77c07df86f..77c07df86f 100644
--- a/tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_segment_lat_long__UserCountry.getCity_month.xml
+++ b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_segment_lat_long__UserCountry.getCity_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_segment_lat_long__UserCountry.getContinent_month.xml b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_segment_lat_long__UserCountry.getContinent_month.xml
index 6f06048a7f..6f06048a7f 100644
--- a/tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_segment_lat_long__UserCountry.getContinent_month.xml
+++ b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_segment_lat_long__UserCountry.getContinent_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_segment_lat_long__UserCountry.getCountry_month.xml b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_segment_lat_long__UserCountry.getCountry_month.xml
index f881b40d77..f881b40d77 100644
--- a/tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_segment_lat_long__UserCountry.getCountry_month.xml
+++ b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_segment_lat_long__UserCountry.getCountry_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_segment_lat_long__UserCountry.getNumberOfDistinctCountries_month.xml b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_segment_lat_long__UserCountry.getNumberOfDistinctCountries_month.xml
index 606fbb5241..606fbb5241 100644
--- a/tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_segment_lat_long__UserCountry.getNumberOfDistinctCountries_month.xml
+++ b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_segment_lat_long__UserCountry.getNumberOfDistinctCountries_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_segment_lat_long__UserCountry.getRegion_month.xml b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_segment_lat_long__UserCountry.getRegion_month.xml
index 16373b92ee..16373b92ee 100644
--- a/tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_segment_lat_long__UserCountry.getRegion_month.xml
+++ b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_segment_lat_long__UserCountry.getRegion_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_segment_region__UserCountry.getCity_month.xml b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_segment_region__UserCountry.getCity_month.xml
index 0f87ed59f3..0f87ed59f3 100644
--- a/tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_segment_region__UserCountry.getCity_month.xml
+++ b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_segment_region__UserCountry.getCity_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_segment_region__UserCountry.getContinent_month.xml b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_segment_region__UserCountry.getContinent_month.xml
index b5566a46cd..b5566a46cd 100644
--- a/tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_segment_region__UserCountry.getContinent_month.xml
+++ b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_segment_region__UserCountry.getContinent_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_segment_region__UserCountry.getCountry_month.xml b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_segment_region__UserCountry.getCountry_month.xml
index 48c3eea1ad..48c3eea1ad 100644
--- a/tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_segment_region__UserCountry.getCountry_month.xml
+++ b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_segment_region__UserCountry.getCountry_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_segment_region__UserCountry.getNumberOfDistinctCountries_month.xml b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_segment_region__UserCountry.getNumberOfDistinctCountries_month.xml
index 606fbb5241..606fbb5241 100644
--- a/tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_segment_region__UserCountry.getNumberOfDistinctCountries_month.xml
+++ b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_segment_region__UserCountry.getNumberOfDistinctCountries_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_segment_region__UserCountry.getRegion_month.xml b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_segment_region__UserCountry.getRegion_month.xml
index 5b3a0754a3..5b3a0754a3 100644
--- a/tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_segment_region__UserCountry.getRegion_month.xml
+++ b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_segment_region__UserCountry.getRegion_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_sortByProcessedMetric__API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_sortByProcessedMetric__API.getProcessedReport_day.xml
index ea574a289f..ea574a289f 100644
--- a/tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_sortByProcessedMetric__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_sortByProcessedMetric__API.getProcessedReport_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_sortByProcessedMetric_constantRowsCountShouldKeepEmptyRows__API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_sortByProcessedMetric_constantRowsCountShouldKeepEmptyRows__API.getProcessedReport_day.xml
index 3861e6c668..3861e6c668 100644
--- a/tests/PHPUnit/Integration/expected/test_ManyVisitorsOneWebsiteTest_sortByProcessedMetric_constantRowsCountShouldKeepEmptyRows__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest_sortByProcessedMetric_constantRowsCountShouldKeepEmptyRows__API.getProcessedReport_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_MultipleSitesArchivingTest_sitesGroup__VisitsSummary.get_day.xml b/tests/PHPUnit/System/expected/test_MultipleSitesArchivingTest_sitesGroup__VisitsSummary.get_day.xml
index 64e9c36af1..64e9c36af1 100644
--- a/tests/PHPUnit/Integration/expected/test_MultipleSitesArchivingTest_sitesGroup__VisitsSummary.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_MultipleSitesArchivingTest_sitesGroup__VisitsSummary.get_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_MultipleSitesArchivingTest_sitesGroup__VisitsSummary.get_month.xml b/tests/PHPUnit/System/expected/test_MultipleSitesArchivingTest_sitesGroup__VisitsSummary.get_month.xml
index 64e9c36af1..64e9c36af1 100644
--- a/tests/PHPUnit/Integration/expected/test_MultipleSitesArchivingTest_sitesGroup__VisitsSummary.get_month.xml
+++ b/tests/PHPUnit/System/expected/test_MultipleSitesArchivingTest_sitesGroup__VisitsSummary.get_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_NonUnicode__Actions.getPageTitles_day.xml b/tests/PHPUnit/System/expected/test_NonUnicode__Actions.getPageTitles_day.xml
index 008d9e87fb..008d9e87fb 100644
--- a/tests/PHPUnit/Integration/expected/test_NonUnicode__Actions.getPageTitles_day.xml
+++ b/tests/PHPUnit/System/expected/test_NonUnicode__Actions.getPageTitles_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_NonUnicode__Actions.getPageUrls_day.xml b/tests/PHPUnit/System/expected/test_NonUnicode__Actions.getPageUrls_day.xml
index 3b556b046b..3b556b046b 100644
--- a/tests/PHPUnit/Integration/expected/test_NonUnicode__Actions.getPageUrls_day.xml
+++ b/tests/PHPUnit/System/expected/test_NonUnicode__Actions.getPageUrls_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_NonUnicode__Actions.getSiteSearchKeywords_day.xml b/tests/PHPUnit/System/expected/test_NonUnicode__Actions.getSiteSearchKeywords_day.xml
index 9b4eb015d0..9b4eb015d0 100644
--- a/tests/PHPUnit/Integration/expected/test_NonUnicode__Actions.getSiteSearchKeywords_day.xml
+++ b/tests/PHPUnit/System/expected/test_NonUnicode__Actions.getSiteSearchKeywords_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_NonUnicode__Referrers.getWebsites_day.xml b/tests/PHPUnit/System/expected/test_NonUnicode__Referrers.getWebsites_day.xml
index bf07781a28..bf07781a28 100644
--- a/tests/PHPUnit/Integration/expected/test_NonUnicode__Referrers.getWebsites_day.xml
+++ b/tests/PHPUnit/System/expected/test_NonUnicode__Referrers.getWebsites_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Actions.getDownload_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getDownload_day.xml
index 32470e4bcb..32470e4bcb 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Actions.getDownload_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getDownload_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Actions.getDownloads_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getDownloads_day.xml
index c064136f43..c064136f43 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Actions.getDownloads_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getDownloads_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Actions.getEntryPageTitles_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getEntryPageTitles_day.xml
index 124e271777..124e271777 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Actions.getEntryPageTitles_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getEntryPageTitles_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Actions.getEntryPageUrls_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getEntryPageUrls_day.xml
index 5b3878f7b2..5b3878f7b2 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Actions.getEntryPageUrls_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getEntryPageUrls_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Actions.getExitPageTitles_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getExitPageTitles_day.xml
index f80bfdd222..f80bfdd222 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Actions.getExitPageTitles_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getExitPageTitles_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Actions.getExitPageUrls_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getExitPageUrls_day.xml
index 3986b5b44b..3986b5b44b 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Actions.getExitPageUrls_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getExitPageUrls_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Actions.getOutlink_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getOutlink_day.xml
index 5971863326..5971863326 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Actions.getOutlink_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getOutlink_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Actions.getOutlinks_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getOutlinks_day.xml
index 539d798e9b..539d798e9b 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Actions.getOutlinks_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getOutlinks_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Actions.getPageTitle_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getPageTitle_day.xml
index 629847ae61..629847ae61 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Actions.getPageTitle_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getPageTitle_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Actions.getPageTitlesFollowingSiteSearch_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getPageTitlesFollowingSiteSearch_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Actions.getPageTitlesFollowingSiteSearch_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getPageTitlesFollowingSiteSearch_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Actions.getPageTitles_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getPageTitles_day.xml
index 510f81282a..510f81282a 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Actions.getPageTitles_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getPageTitles_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Actions.getPageUrl_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getPageUrl_day.xml
index 0880f58750..0880f58750 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Actions.getPageUrl_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getPageUrl_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Actions.getPageUrlsFollowingSiteSearch_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getPageUrlsFollowingSiteSearch_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Actions.getPageUrlsFollowingSiteSearch_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getPageUrlsFollowingSiteSearch_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Actions.getPageUrls_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getPageUrls_day.xml
index 62c8fa6fc8..62c8fa6fc8 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Actions.getPageUrls_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getPageUrls_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Actions.getSiteSearchCategories_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getSiteSearchCategories_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Actions.getSiteSearchCategories_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getSiteSearchCategories_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Actions.getSiteSearchKeywords_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getSiteSearchKeywords_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Actions.getSiteSearchKeywords_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getSiteSearchKeywords_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Actions.getSiteSearchNoResultKeywords_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getSiteSearchNoResultKeywords_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Actions.getSiteSearchNoResultKeywords_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.getSiteSearchNoResultKeywords_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Actions.get_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.get_day.xml
index e04ea4296d..e04ea4296d 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Actions.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Actions.get_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Contents.getContentNames_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Contents.getContentNames_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Contents.getContentNames_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Contents.getContentNames_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Contents.getContentPieces_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Contents.getContentPieces_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Contents.getContentPieces_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Contents.getContentPieces_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__CoreAdminHome.getKnownSegmentsToArchive.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__CoreAdminHome.getKnownSegmentsToArchive.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__CoreAdminHome.getKnownSegmentsToArchive.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__CoreAdminHome.getKnownSegmentsToArchive.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__CoreAdminHome.getWebsiteIdsToInvalidate.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__CoreAdminHome.getWebsiteIdsToInvalidate.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__CoreAdminHome.getWebsiteIdsToInvalidate.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__CoreAdminHome.getWebsiteIdsToInvalidate.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__CustomVariables.getCustomVariables_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__CustomVariables.getCustomVariables_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__CustomVariables.getCustomVariables_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__CustomVariables.getCustomVariables_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__CustomVariables.getReservedCustomVariableKeys.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__CustomVariables.getReservedCustomVariableKeys.xml
index f10505afcc..f10505afcc 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__CustomVariables.getReservedCustomVariableKeys.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__CustomVariables.getReservedCustomVariableKeys.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__DevicesDetection.getBrand_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__DevicesDetection.getBrand_day.xml
index 8b154c9334..8b154c9334 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__DevicesDetection.getBrand_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__DevicesDetection.getBrand_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__DevicesDetection.getBrowserEngines_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__DevicesDetection.getBrowserEngines_day.xml
index 935548a360..935548a360 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__DevicesDetection.getBrowserEngines_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__DevicesDetection.getBrowserEngines_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__DevicesDetection.getBrowserFamilies_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__DevicesDetection.getBrowserFamilies_day.xml
index 84860eba92..84860eba92 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__DevicesDetection.getBrowserFamilies_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__DevicesDetection.getBrowserFamilies_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__DevicesDetection.getBrowserVersions_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__DevicesDetection.getBrowserVersions_day.xml
index 6f656fdf68..6f656fdf68 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__DevicesDetection.getBrowserVersions_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__DevicesDetection.getBrowserVersions_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__DevicesDetection.getModel_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__DevicesDetection.getModel_day.xml
index 050a4cc6c8..050a4cc6c8 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__DevicesDetection.getModel_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__DevicesDetection.getModel_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__DevicesDetection.getOsFamilies_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__DevicesDetection.getOsFamilies_day.xml
index 379e429ee3..379e429ee3 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__DevicesDetection.getOsFamilies_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__DevicesDetection.getOsFamilies_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__DevicesDetection.getOsVersions_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__DevicesDetection.getOsVersions_day.xml
index 4e417535ae..4e417535ae 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__DevicesDetection.getOsVersions_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__DevicesDetection.getOsVersions_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__DevicesDetection.getType_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__DevicesDetection.getType_day.xml
index 347eac465f..347eac465f 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__DevicesDetection.getType_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__DevicesDetection.getType_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Events.getAction_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Events.getAction_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Events.getAction_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Events.getAction_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Events.getCategory_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Events.getCategory_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Events.getCategory_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Events.getCategory_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Events.getName_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Events.getName_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Events.getName_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Events.getName_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__ExamplePlugin.getAnswerToLife.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__ExamplePlugin.getAnswerToLife.xml
index 36a787c47a..36a787c47a 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__ExamplePlugin.getAnswerToLife.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__ExamplePlugin.getAnswerToLife.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__ExamplePlugin.getExampleReport_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__ExamplePlugin.getExampleReport_day.xml
index 1b2fed39f9..1b2fed39f9 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__ExamplePlugin.getExampleReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__ExamplePlugin.getExampleReport_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Goals.getConversionRate_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Goals.getConversionRate_day.xml
index dff1089a71..dff1089a71 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Goals.getConversionRate_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Goals.getConversionRate_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Goals.getConversions_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Goals.getConversions_day.xml
index 13002b2017..13002b2017 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Goals.getConversions_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Goals.getConversions_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Goals.getDaysToConversion_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Goals.getDaysToConversion_day.xml
index 3c241e5091..3c241e5091 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Goals.getDaysToConversion_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Goals.getDaysToConversion_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Goals.getGoals.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Goals.getGoals.xml
index c9cc82f044..c9cc82f044 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Goals.getGoals.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Goals.getGoals.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Goals.getItemsCategory_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Goals.getItemsCategory_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Goals.getItemsCategory_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Goals.getItemsCategory_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Goals.getItemsName_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Goals.getItemsName_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Goals.getItemsName_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Goals.getItemsName_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Goals.getItemsSku_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Goals.getItemsSku_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Goals.getItemsSku_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Goals.getItemsSku_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Goals.getNbVisitsConverted_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Goals.getNbVisitsConverted_day.xml
index 13002b2017..13002b2017 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Goals.getNbVisitsConverted_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Goals.getNbVisitsConverted_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Goals.getRevenue_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Goals.getRevenue_day.xml
index 4ca6db758a..4ca6db758a 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Goals.getRevenue_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Goals.getRevenue_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Goals.getVisitsUntilConversion_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Goals.getVisitsUntilConversion_day.xml
index ec350f6b48..ec350f6b48 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Goals.getVisitsUntilConversion_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Goals.getVisitsUntilConversion_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Goals.get_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Goals.get_day.xml
index d0e395f9e8..d0e395f9e8 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Goals.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Goals.get_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__MultiSites.getAll_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__MultiSites.getAll_day.xml
index 0ecae3aea1..0ecae3aea1 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__MultiSites.getAll_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__MultiSites.getAll_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__MultiSites.getOne_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__MultiSites.getOne_day.xml
index b76e6ee906..b76e6ee906 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__MultiSites.getOne_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__MultiSites.getOne_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Provider.getProvider_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Provider.getProvider_day.xml
index 6ca6cdbd81..6ca6cdbd81 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Provider.getProvider_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Provider.getProvider_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Referrers.getAll_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Referrers.getAll_day.xml
index 0e80bf7ceb..0e80bf7ceb 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Referrers.getAll_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Referrers.getAll_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Referrers.getCampaigns_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Referrers.getCampaigns_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Referrers.getCampaigns_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Referrers.getCampaigns_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Referrers.getCleanKeyword.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Referrers.getCleanKeyword.xml
index 3ad4041057..3ad4041057 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Referrers.getCleanKeyword.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Referrers.getCleanKeyword.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Referrers.getKeywordNotDefinedString.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Referrers.getKeywordNotDefinedString.xml
index 60b9a623a5..60b9a623a5 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Referrers.getKeywordNotDefinedString.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Referrers.getKeywordNotDefinedString.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Referrers.getKeywordsForPageUrl_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Referrers.getKeywordsForPageUrl_day.xml
index 7ade91cdb5..7ade91cdb5 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Referrers.getKeywordsForPageUrl_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Referrers.getKeywordsForPageUrl_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Referrers.getKeywords_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Referrers.getKeywords_day.xml
index e5e6ad0926..e5e6ad0926 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Referrers.getKeywords_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Referrers.getKeywords_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Referrers.getNumberOfDistinctCampaigns_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Referrers.getNumberOfDistinctCampaigns_day.xml
index 606fbb5241..606fbb5241 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Referrers.getNumberOfDistinctCampaigns_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Referrers.getNumberOfDistinctCampaigns_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Referrers.getNumberOfDistinctKeywords_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Referrers.getNumberOfDistinctKeywords_day.xml
index 606fbb5241..606fbb5241 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Referrers.getNumberOfDistinctKeywords_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Referrers.getNumberOfDistinctKeywords_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Referrers.getNumberOfDistinctSearchEngines_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Referrers.getNumberOfDistinctSearchEngines_day.xml
index 606fbb5241..606fbb5241 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Referrers.getNumberOfDistinctSearchEngines_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Referrers.getNumberOfDistinctSearchEngines_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Referrers.getNumberOfDistinctWebsitesUrls_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Referrers.getNumberOfDistinctWebsitesUrls_day.xml
index 606fbb5241..606fbb5241 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Referrers.getNumberOfDistinctWebsitesUrls_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Referrers.getNumberOfDistinctWebsitesUrls_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Referrers.getNumberOfDistinctWebsites_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Referrers.getNumberOfDistinctWebsites_day.xml
index 606fbb5241..606fbb5241 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Referrers.getNumberOfDistinctWebsites_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Referrers.getNumberOfDistinctWebsites_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Referrers.getReferrerType_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Referrers.getReferrerType_day.xml
index deb88da799..deb88da799 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Referrers.getReferrerType_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Referrers.getReferrerType_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Referrers.getSearchEngines_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Referrers.getSearchEngines_day.xml
index 8a34da6deb..8a34da6deb 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Referrers.getSearchEngines_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Referrers.getSearchEngines_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Referrers.getSocials_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Referrers.getSocials_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Referrers.getSocials_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Referrers.getSocials_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Referrers.getUrlsForSocial_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Referrers.getUrlsForSocial_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Referrers.getUrlsForSocial_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Referrers.getUrlsForSocial_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Referrers.getWebsites_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Referrers.getWebsites_day.xml
index 5d8d25b332..5d8d25b332 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__Referrers.getWebsites_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Referrers.getWebsites_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__UserCountry.getCity_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__UserCountry.getCity_day.xml
index e2562def53..e2562def53 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__UserCountry.getCity_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__UserCountry.getCity_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__UserCountry.getContinent_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__UserCountry.getContinent_day.xml
index 280b7fd6fc..280b7fd6fc 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__UserCountry.getContinent_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__UserCountry.getContinent_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__UserCountry.getCountry_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__UserCountry.getCountry_day.xml
index 86f61ceeba..86f61ceeba 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__UserCountry.getCountry_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__UserCountry.getCountry_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__UserCountry.getNumberOfDistinctCountries_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__UserCountry.getNumberOfDistinctCountries_day.xml
index 606fbb5241..606fbb5241 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__UserCountry.getNumberOfDistinctCountries_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__UserCountry.getNumberOfDistinctCountries_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__UserCountry.getRegion_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__UserCountry.getRegion_day.xml
index a32f142d6e..a32f142d6e 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__UserCountry.getRegion_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__UserCountry.getRegion_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__UserSettings.getBrowserVersion_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__UserSettings.getBrowserVersion_day.xml
index 8210497910..8210497910 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__UserSettings.getBrowserVersion_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__UserSettings.getBrowserVersion_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__UserSettings.getBrowser_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__UserSettings.getBrowser_day.xml
index 84860eba92..84860eba92 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__UserSettings.getBrowser_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__UserSettings.getBrowser_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__UserSettings.getConfiguration_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__UserSettings.getConfiguration_day.xml
index 1a63f1933a..1a63f1933a 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__UserSettings.getConfiguration_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__UserSettings.getConfiguration_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__UserSettings.getLanguageCode_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__UserSettings.getLanguageCode_day.xml
index b5d5e44542..b5d5e44542 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__UserSettings.getLanguageCode_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__UserSettings.getLanguageCode_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__UserSettings.getLanguage_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__UserSettings.getLanguage_day.xml
index a1a81bcc68..a1a81bcc68 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__UserSettings.getLanguage_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__UserSettings.getLanguage_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__UserSettings.getMobileVsDesktop_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__UserSettings.getMobileVsDesktop_day.xml
index fe566ebe7c..fe566ebe7c 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__UserSettings.getMobileVsDesktop_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__UserSettings.getMobileVsDesktop_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__UserSettings.getOSFamily_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__UserSettings.getOSFamily_day.xml
index 5c3a3311e3..5c3a3311e3 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__UserSettings.getOSFamily_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__UserSettings.getOSFamily_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__UserSettings.getOS_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__UserSettings.getOS_day.xml
index 32ec517b60..32ec517b60 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__UserSettings.getOS_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__UserSettings.getOS_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__UserSettings.getPlugin_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__UserSettings.getPlugin_day.xml
index 9ddd1bed44..9ddd1bed44 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__UserSettings.getPlugin_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__UserSettings.getPlugin_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__UserSettings.getResolution_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__UserSettings.getResolution_day.xml
index ede209680d..ede209680d 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__UserSettings.getResolution_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__UserSettings.getResolution_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__UserSettings.getWideScreen_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__UserSettings.getWideScreen_day.xml
index f1acb38cb9..f1acb38cb9 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__UserSettings.getWideScreen_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__UserSettings.getWideScreen_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__VisitFrequency.get_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__VisitFrequency.get_day.xml
index eb4e37fdf7..eb4e37fdf7 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__VisitFrequency.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__VisitFrequency.get_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__VisitTime.getByDayOfWeek_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__VisitTime.getByDayOfWeek_day.xml
index e715309206..e715309206 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__VisitTime.getByDayOfWeek_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__VisitTime.getByDayOfWeek_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__VisitTime.getVisitInformationPerLocalTime_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__VisitTime.getVisitInformationPerLocalTime_day.xml
index b95f277bfc..b95f277bfc 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__VisitTime.getVisitInformationPerLocalTime_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__VisitTime.getVisitInformationPerLocalTime_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__VisitTime.getVisitInformationPerServerTime_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__VisitTime.getVisitInformationPerServerTime_day.xml
index 5f96c55a5b..5f96c55a5b 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__VisitTime.getVisitInformationPerServerTime_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__VisitTime.getVisitInformationPerServerTime_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__VisitorInterest.getNumberOfVisitsByDaysSinceLast_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__VisitorInterest.getNumberOfVisitsByDaysSinceLast_day.xml
index ce8a1e0b00..ce8a1e0b00 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__VisitorInterest.getNumberOfVisitsByDaysSinceLast_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__VisitorInterest.getNumberOfVisitsByDaysSinceLast_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__VisitorInterest.getNumberOfVisitsByVisitCount_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__VisitorInterest.getNumberOfVisitsByVisitCount_day.xml
index eefa7f6d38..eefa7f6d38 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__VisitorInterest.getNumberOfVisitsByVisitCount_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__VisitorInterest.getNumberOfVisitsByVisitCount_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__VisitorInterest.getNumberOfVisitsPerPage_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__VisitorInterest.getNumberOfVisitsPerPage_day.xml
index 30a3a7f161..30a3a7f161 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__VisitorInterest.getNumberOfVisitsPerPage_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__VisitorInterest.getNumberOfVisitsPerPage_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__VisitorInterest.getNumberOfVisitsPerVisitDuration_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__VisitorInterest.getNumberOfVisitsPerVisitDuration_day.xml
index 730677c405..730677c405 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__VisitorInterest.getNumberOfVisitsPerVisitDuration_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__VisitorInterest.getNumberOfVisitsPerVisitDuration_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__VisitsSummary.getActions_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__VisitsSummary.getActions_day.xml
index e52ca0ecb1..e52ca0ecb1 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__VisitsSummary.getActions_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__VisitsSummary.getActions_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__VisitsSummary.getBounceCount_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__VisitsSummary.getBounceCount_day.xml
index 606fbb5241..606fbb5241 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__VisitsSummary.getBounceCount_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__VisitsSummary.getBounceCount_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__VisitsSummary.getColumns_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__VisitsSummary.getColumns_day.xml
index e8e90f91e7..e8e90f91e7 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__VisitsSummary.getColumns_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__VisitsSummary.getColumns_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__VisitsSummary.getMaxActions_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__VisitsSummary.getMaxActions_day.xml
index 773871bab0..773871bab0 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__VisitsSummary.getMaxActions_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__VisitsSummary.getMaxActions_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__VisitsSummary.getSumVisitsLengthPretty_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__VisitsSummary.getSumVisitsLengthPretty_day.xml
index 3912ba15a2..3912ba15a2 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__VisitsSummary.getSumVisitsLengthPretty_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__VisitsSummary.getSumVisitsLengthPretty_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__VisitsSummary.getSumVisitsLength_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__VisitsSummary.getSumVisitsLength_day.xml
index f7692644ac..f7692644ac 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__VisitsSummary.getSumVisitsLength_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__VisitsSummary.getSumVisitsLength_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__VisitsSummary.getUniqueVisitors_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__VisitsSummary.getUniqueVisitors_day.xml
index 606fbb5241..606fbb5241 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__VisitsSummary.getUniqueVisitors_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__VisitsSummary.getUniqueVisitors_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__VisitsSummary.getUsers_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__VisitsSummary.getUsers_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__VisitsSummary.getUsers_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__VisitsSummary.getUsers_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__VisitsSummary.getVisitsConverted_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__VisitsSummary.getVisitsConverted_day.xml
index 13002b2017..13002b2017 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__VisitsSummary.getVisitsConverted_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__VisitsSummary.getVisitsConverted_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__VisitsSummary.getVisits_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__VisitsSummary.getVisits_day.xml
index 13002b2017..13002b2017 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__VisitsSummary.getVisits_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__VisitsSummary.getVisits_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__VisitsSummary.get_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__VisitsSummary.get_day.xml
index 40498bf45d..40498bf45d 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__VisitsSummary.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__VisitsSummary.get_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__subtable__API.getProcessedReport_week.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__subtable__API.getProcessedReport_week.xml
index 7279329235..7279329235 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits__subtable__API.getProcessedReport_week.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__subtable__API.getProcessedReport_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_bulk_json__API.getBulkRequest.json b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_bulk_json__API.getBulkRequest.json
index 54eec7681d..54eec7681d 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_bulk_json__API.getBulkRequest.json
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_bulk_json__API.getBulkRequest.json
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_bulk_xml__API.getBulkRequest.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_bulk_xml__API.getBulkRequest.xml
index e3455beeec..e3455beeec 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_bulk_xml__API.getBulkRequest.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_bulk_xml__API.getBulkRequest.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_csv__API.get_month.csv b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_csv__API.get_month.csv
index 6fed0a71f2..6fed0a71f2 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_csv__API.get_month.csv
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_csv__API.get_month.csv
Binary files differ
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_hideAllColumns___VisitsSummary.get_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_hideAllColumns___VisitsSummary.get_day.xml
index f5722c2b94..f5722c2b94 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_hideAllColumns___VisitsSummary.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_hideAllColumns___VisitsSummary.get_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_hideColumns___API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_hideColumns___API.getProcessedReport_day.xml
index fe3da65352..fe3da65352 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_hideColumns___API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_hideColumns___API.getProcessedReport_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_hideColumns___Actions.getPageTitles_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_hideColumns___Actions.getPageTitles_day.xml
index 793f02d8be..793f02d8be 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_hideColumns___Actions.getPageTitles_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_hideColumns___Actions.getPageTitles_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_hideColumns___VisitsSummary.get_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_hideColumns___VisitsSummary.get_day.xml
index e84bd27189..e84bd27189 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_hideColumns___VisitsSummary.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_hideColumns___VisitsSummary.get_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_showColumnsWithProcessedMetrics___API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_showColumnsWithProcessedMetrics___API.getProcessedReport_day.xml
index 1a1180bbff..1a1180bbff 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_showColumnsWithProcessedMetrics___API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_showColumnsWithProcessedMetrics___API.getProcessedReport_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_showColumns__API.get_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_showColumns__API.get_day.xml
index cdd370d354..cdd370d354 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_showColumns__API.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_showColumns__API.get_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_showColumns___API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_showColumns___API.getProcessedReport_day.xml
index 6c94a197f7..6c94a197f7 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_showColumns___API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_showColumns___API.getProcessedReport_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_showColumns___VisitsSummary.get_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_showColumns___VisitsSummary.get_day.xml
index 4d2a909a67..4d2a909a67 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_showColumns___VisitsSummary.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_showColumns___VisitsSummary.get_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_showColumns_onlyOne__API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_showColumns_onlyOne__API.getProcessedReport_day.xml
index 7484c9c620..7484c9c620 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_showColumns_onlyOne__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_showColumns_onlyOne__API.getProcessedReport_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getDownload_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getDownload_day.xml
index 32470e4bcb..32470e4bcb 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getDownload_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getDownload_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getDownloads_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getDownloads_day.xml
index c064136f43..c064136f43 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getDownloads_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getDownloads_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getEntryPageTitles_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getEntryPageTitles_day.xml
index 9493eb4991..9493eb4991 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getEntryPageTitles_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getEntryPageTitles_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getEntryPageUrls_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getEntryPageUrls_day.xml
index 5e51da8014..5e51da8014 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getEntryPageUrls_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getEntryPageUrls_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getExitPageTitles_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getExitPageTitles_day.xml
index 64b810c76b..64b810c76b 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getExitPageTitles_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getExitPageTitles_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getExitPageUrls_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getExitPageUrls_day.xml
index ef8f599623..ef8f599623 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getExitPageUrls_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getExitPageUrls_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getOutlink_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getOutlink_day.xml
index 0f328b414d..0f328b414d 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getOutlink_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getOutlink_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getOutlinks_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getOutlinks_day.xml
index 1767641648..1767641648 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getOutlinks_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getOutlinks_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getPageTitle_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getPageTitle_day.xml
index 629847ae61..629847ae61 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getPageTitle_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getPageTitle_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getPageTitlesFollowingSiteSearch_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getPageTitlesFollowingSiteSearch_day.xml
index da8ea736e7..da8ea736e7 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getPageTitlesFollowingSiteSearch_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getPageTitlesFollowingSiteSearch_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getPageTitles_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getPageTitles_day.xml
index cd205048c8..cd205048c8 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getPageTitles_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getPageTitles_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getPageUrl_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getPageUrl_day.xml
index 46a13d42c3..46a13d42c3 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getPageUrl_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getPageUrl_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getPageUrlsFollowingSiteSearch_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getPageUrlsFollowingSiteSearch_day.xml
index 46a13d42c3..46a13d42c3 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getPageUrlsFollowingSiteSearch_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getPageUrlsFollowingSiteSearch_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getPageUrls_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getPageUrls_day.xml
index ad64d61bfe..ad64d61bfe 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getPageUrls_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getPageUrls_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getSiteSearchCategories_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getSiteSearchCategories_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getSiteSearchCategories_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getSiteSearchCategories_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getSiteSearchKeywords_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getSiteSearchKeywords_day.xml
index fde425ab9e..fde425ab9e 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getSiteSearchKeywords_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getSiteSearchKeywords_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getSiteSearchNoResultKeywords_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getSiteSearchNoResultKeywords_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getSiteSearchNoResultKeywords_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.getSiteSearchNoResultKeywords_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.get_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.get_day.xml
index 0eea12ac0b..0eea12ac0b 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Actions.get_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__CustomVariables.getCustomVariables_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__CustomVariables.getCustomVariables_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__CustomVariables.getCustomVariables_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__CustomVariables.getCustomVariables_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Goals.getDaysToConversion_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Goals.getDaysToConversion_day.xml
index 3c241e5091..3c241e5091 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Goals.getDaysToConversion_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Goals.getDaysToConversion_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Goals.getGoals.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Goals.getGoals.xml
index c9cc82f044..c9cc82f044 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Goals.getGoals.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Goals.getGoals.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Goals.getItemsCategory_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Goals.getItemsCategory_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Goals.getItemsCategory_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Goals.getItemsCategory_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Goals.getItemsName_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Goals.getItemsName_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Goals.getItemsName_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Goals.getItemsName_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Goals.getItemsSku_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Goals.getItemsSku_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Goals.getItemsSku_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Goals.getItemsSku_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Goals.getVisitsUntilConversion_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Goals.getVisitsUntilConversion_day.xml
index ec350f6b48..ec350f6b48 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Goals.getVisitsUntilConversion_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Goals.getVisitsUntilConversion_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Goals.get_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Goals.get_day.xml
index d0e395f9e8..d0e395f9e8 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Goals.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Goals.get_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Live.getLastVisitsDetails_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Live.getLastVisitsDetails_day.xml
index 4297f03270..4297f03270 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Live.getLastVisitsDetails_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Live.getLastVisitsDetails_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Provider.getProvider_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Provider.getProvider_day.xml
index 039448a1aa..039448a1aa 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Provider.getProvider_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Provider.getProvider_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getAll_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getAll_day.xml
index fd61a97675..fd61a97675 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getAll_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getAll_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getCampaigns_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getCampaigns_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getCampaigns_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getCampaigns_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getKeywordsForPageUrl_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getKeywordsForPageUrl_day.xml
index 7ade91cdb5..7ade91cdb5 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getKeywordsForPageUrl_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getKeywordsForPageUrl_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getKeywords_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getKeywords_day.xml
index 52501d1f57..52501d1f57 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getKeywords_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getKeywords_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getNumberOfDistinctCampaigns_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getNumberOfDistinctCampaigns_day.xml
index 606fbb5241..606fbb5241 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getNumberOfDistinctCampaigns_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getNumberOfDistinctCampaigns_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getNumberOfDistinctKeywords_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getNumberOfDistinctKeywords_day.xml
index 606fbb5241..606fbb5241 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getNumberOfDistinctKeywords_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getNumberOfDistinctKeywords_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getNumberOfDistinctSearchEngines_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getNumberOfDistinctSearchEngines_day.xml
index 606fbb5241..606fbb5241 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getNumberOfDistinctSearchEngines_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getNumberOfDistinctSearchEngines_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getNumberOfDistinctWebsitesUrls_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getNumberOfDistinctWebsitesUrls_day.xml
index 606fbb5241..606fbb5241 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getNumberOfDistinctWebsitesUrls_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getNumberOfDistinctWebsitesUrls_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getNumberOfDistinctWebsites_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getNumberOfDistinctWebsites_day.xml
index 606fbb5241..606fbb5241 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getNumberOfDistinctWebsites_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getNumberOfDistinctWebsites_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getReferrerType_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getReferrerType_day.xml
index 2225e62fa0..2225e62fa0 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getReferrerType_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getReferrerType_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getSearchEngines_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getSearchEngines_day.xml
index 325ad6ac4f..325ad6ac4f 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getSearchEngines_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getSearchEngines_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getSocials_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getSocials_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getSocials_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getSocials_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getUrlsForSocial_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getUrlsForSocial_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getUrlsForSocial_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getUrlsForSocial_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getWebsites_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getWebsites_day.xml
index b3100810b3..b3100810b3 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getWebsites_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Referrers.getWebsites_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserCountry.getCity_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__UserCountry.getCity_day.xml
index 0c927196d9..0c927196d9 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserCountry.getCity_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__UserCountry.getCity_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserCountry.getContinent_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__UserCountry.getContinent_day.xml
index dd647ae66e..dd647ae66e 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserCountry.getContinent_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__UserCountry.getContinent_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserCountry.getCountry_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__UserCountry.getCountry_day.xml
index c7cdb13402..c7cdb13402 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserCountry.getCountry_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__UserCountry.getCountry_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserCountry.getNumberOfDistinctCountries_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__UserCountry.getNumberOfDistinctCountries_day.xml
index 606fbb5241..606fbb5241 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserCountry.getNumberOfDistinctCountries_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__UserCountry.getNumberOfDistinctCountries_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserCountry.getRegion_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__UserCountry.getRegion_day.xml
index 2a364cd566..2a364cd566 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserCountry.getRegion_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__UserCountry.getRegion_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getBrowserVersion_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getBrowserVersion_day.xml
index 6451b5cbbb..6451b5cbbb 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getBrowserVersion_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getBrowserVersion_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getBrowser_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getBrowser_day.xml
index 968ffc7d90..968ffc7d90 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getBrowser_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getBrowser_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getConfiguration_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getConfiguration_day.xml
index 7ce7628e83..7ce7628e83 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getConfiguration_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getConfiguration_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getLanguageCode_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getLanguageCode_day.xml
index 7ae1dc2443..7ae1dc2443 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getLanguageCode_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getLanguageCode_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getLanguage_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getLanguage_day.xml
index e03cfdd581..e03cfdd581 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getLanguage_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getLanguage_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getMobileVsDesktop_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getMobileVsDesktop_day.xml
index 1456e8c033..1456e8c033 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getMobileVsDesktop_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getMobileVsDesktop_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getOSFamily_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getOSFamily_day.xml
index 63f67f61ca..63f67f61ca 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getOSFamily_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getOSFamily_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getOS_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getOS_day.xml
index e041ea2409..e041ea2409 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getOS_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getOS_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getPlugin_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getPlugin_day.xml
index 9ddd1bed44..9ddd1bed44 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getPlugin_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getPlugin_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getResolution_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getResolution_day.xml
index 05f05aaf02..05f05aaf02 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getResolution_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getResolution_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getWideScreen_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getWideScreen_day.xml
index 1aa955af66..1aa955af66 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getWideScreen_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__UserSettings.getWideScreen_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitFrequency.get_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitFrequency.get_day.xml
index 3633fe5914..3633fe5914 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitFrequency.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitFrequency.get_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitTime.getByDayOfWeek_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitTime.getByDayOfWeek_day.xml
index 16a8a552ba..16a8a552ba 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitTime.getByDayOfWeek_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitTime.getByDayOfWeek_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitTime.getVisitInformationPerLocalTime_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitTime.getVisitInformationPerLocalTime_day.xml
index 09556822a9..09556822a9 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitTime.getVisitInformationPerLocalTime_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitTime.getVisitInformationPerLocalTime_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitTime.getVisitInformationPerServerTime_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitTime.getVisitInformationPerServerTime_day.xml
index 9ded5c32c2..9ded5c32c2 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitTime.getVisitInformationPerServerTime_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitTime.getVisitInformationPerServerTime_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitorInterest.getNumberOfVisitsByDaysSinceLast_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitorInterest.getNumberOfVisitsByDaysSinceLast_day.xml
index ce8a1e0b00..ce8a1e0b00 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitorInterest.getNumberOfVisitsByDaysSinceLast_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitorInterest.getNumberOfVisitsByDaysSinceLast_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitorInterest.getNumberOfVisitsByVisitCount_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitorInterest.getNumberOfVisitsByVisitCount_day.xml
index eefa7f6d38..eefa7f6d38 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitorInterest.getNumberOfVisitsByVisitCount_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitorInterest.getNumberOfVisitsByVisitCount_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitorInterest.getNumberOfVisitsPerPage_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitorInterest.getNumberOfVisitsPerPage_day.xml
index 5a89cd9c00..5a89cd9c00 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitorInterest.getNumberOfVisitsPerPage_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitorInterest.getNumberOfVisitsPerPage_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitorInterest.getNumberOfVisitsPerVisitDuration_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitorInterest.getNumberOfVisitsPerVisitDuration_day.xml
index 730677c405..730677c405 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitorInterest.getNumberOfVisitsPerVisitDuration_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitorInterest.getNumberOfVisitsPerVisitDuration_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitsSummary.getActions_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitsSummary.getActions_day.xml
index 39535fab28..39535fab28 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitsSummary.getActions_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitsSummary.getActions_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitsSummary.getBounceCount_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitsSummary.getBounceCount_day.xml
index 606fbb5241..606fbb5241 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitsSummary.getBounceCount_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitsSummary.getBounceCount_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitsSummary.getMaxActions_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitsSummary.getMaxActions_day.xml
index e52ca0ecb1..e52ca0ecb1 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitsSummary.getMaxActions_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitsSummary.getMaxActions_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitsSummary.getSumVisitsLengthPretty_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitsSummary.getSumVisitsLengthPretty_day.xml
index 3912ba15a2..3912ba15a2 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitsSummary.getSumVisitsLengthPretty_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitsSummary.getSumVisitsLengthPretty_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitsSummary.getSumVisitsLength_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitsSummary.getSumVisitsLength_day.xml
index f7692644ac..f7692644ac 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitsSummary.getSumVisitsLength_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitsSummary.getSumVisitsLength_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitsSummary.getUniqueVisitors_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitsSummary.getUniqueVisitors_day.xml
index 606fbb5241..606fbb5241 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitsSummary.getUniqueVisitors_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitsSummary.getUniqueVisitors_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitsSummary.getUsers_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitsSummary.getUsers_day.xml
index f5722c2b94..f5722c2b94 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitsSummary.getUsers_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitsSummary.getUsers_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitsSummary.getVisitsConverted_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitsSummary.getVisitsConverted_day.xml
index 13002b2017..13002b2017 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitsSummary.getVisitsConverted_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitsSummary.getVisitsConverted_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitsSummary.getVisits_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitsSummary.getVisits_day.xml
index 13002b2017..13002b2017 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitsSummary.getVisits_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitsSummary.getVisits_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitsSummary.get_day.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitsSummary.get_day.xml
index 9f63db28ef..9f63db28ef 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitsSummary.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__VisitsSummary.get_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitor_LongUrlsTruncated__Actions.getPageUrls_day.xml b/tests/PHPUnit/System/expected/test_OneVisitor_LongUrlsTruncated__Actions.getPageUrls_day.xml
index d1914d0e11..d1914d0e11 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitor_LongUrlsTruncated__Actions.getPageUrls_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitor_LongUrlsTruncated__Actions.getPageUrls_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitor_LongUrlsTruncated__Referrers.getKeywords_day.xml b/tests/PHPUnit/System/expected/test_OneVisitor_LongUrlsTruncated__Referrers.getKeywords_day.xml
index aa89682153..aa89682153 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitor_LongUrlsTruncated__Referrers.getKeywords_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitor_LongUrlsTruncated__Referrers.getKeywords_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitor_LongUrlsTruncated__UserSettings.getPlugin_day.xml b/tests/PHPUnit/System/expected/test_OneVisitor_LongUrlsTruncated__UserSettings.getPlugin_day.xml
index 1058fa4e08..1058fa4e08 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitor_LongUrlsTruncated__UserSettings.getPlugin_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitor_LongUrlsTruncated__UserSettings.getPlugin_day.xml
diff --git a/tests/PHPUnit/System/expected/test_OneVisitor_NoKeywordSpecified__Live.getLastVisitsDetails_day.xml b/tests/PHPUnit/System/expected/test_OneVisitor_NoKeywordSpecified__Live.getLastVisitsDetails_day.xml
new file mode 100644
index 0000000000..242012e9c7
--- /dev/null
+++ b/tests/PHPUnit/System/expected/test_OneVisitor_NoKeywordSpecified__Live.getLastVisitsDetails_day.xml
@@ -0,0 +1,231 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<result>
+ <row>
+ <idSite>1</idSite>
+ <idVisit>2</idVisit>
+ <visitIp>156.5.0.0</visitIp>
+
+ <actionDetails>
+ <row>
+ <type>action</type>
+ <url>http://example.org/this%20is%20cool!</url>
+ <pageTitle />
+ <pageIdAction>2</pageIdAction>
+
+ <pageId>2</pageId>
+ <icon />
+ </row>
+ </actionDetails>
+ <goalConversions>0</goalConversions>
+ <siteCurrency>USD</siteCurrency>
+ <siteCurrencySymbol>$</siteCurrencySymbol>
+
+
+
+
+ <userId />
+ <visitorType>new</visitorType>
+ <visitorTypeIcon />
+ <visitConverted>0</visitConverted>
+ <visitConvertedIcon />
+ <visitCount>1</visitCount>
+
+ <visitEcommerceStatus>none</visitEcommerceStatus>
+ <visitEcommerceStatusIcon />
+ <daysSinceFirstVisit>0</daysSinceFirstVisit>
+ <daysSinceLastEcommerceOrder>0</daysSinceLastEcommerceOrder>
+ <visitDuration>0</visitDuration>
+ <visitDurationPretty>0s</visitDurationPretty>
+ <customVariables>
+ </customVariables>
+ <deviceType>Inconnu</deviceType>
+ <browserFamily>unknown</browserFamily>
+ <browserFamilyDescription>Inconnu</browserFamilyDescription>
+ <events>0</events>
+ <provider>Inconnu</provider>
+ <providerName>Inconnu</providerName>
+ <providerUrl />
+ <referrerType>search</referrerType>
+ <referrerTypeName>Moteurs de recherche</referrerTypeName>
+ <referrerName>Google</referrerName>
+ <referrerKeyword>&lt;&gt;&amp;\&quot;the pdo extension is required for this adapter but the extension is not loaded</referrerKeyword>
+ <referrerKeywordPosition>4</referrerKeywordPosition>
+ <referrerUrl>http://www.google.com.vn/search?q=%3C%3E%26%5C%22the+pdo+extension+is+required+for+this+adapter+but+the+extension+is+not+loaded</referrerUrl>
+ <referrerSearchEngineUrl>http://google.com</referrerSearchEngineUrl>
+ <referrerSearchEngineIcon>plugins/Referrers/images/searchEngines/google.com.png</referrerSearchEngineIcon>
+ <continent>Europe</continent>
+ <continentCode>eur</continentCode>
+ <country>France</country>
+ <countryCode>fr</countryCode>
+ <countryFlag>plugins/UserCountry/images/flags/fr.png</countryFlag>
+ <region />
+ <regionCode />
+ <city />
+ <location>France</location>
+ <latitude />
+ <longitude />
+ <operatingSystem>Bot</operatingSystem>
+ <operatingSystemCode>BOT</operatingSystemCode>
+ <operatingSystemShortName>BOT</operatingSystemShortName>
+ <operatingSystemIcon>plugins/UserSettings/images/os/UNK.gif</operatingSystemIcon>
+ <browserName>Inconnu</browserName>
+ <browserIcon>plugins/UserSettings/images/browsers/UNK.gif</browserIcon>
+ <browserCode>UNK</browserCode>
+ <browserVersion />
+ <screenType>normal</screenType>
+ <resolution>1024x768</resolution>
+ <screenTypeIcon>plugins/UserSettings/images/screens/normal.gif</screenTypeIcon>
+ <plugins>flash, java</plugins>
+ <pluginsIcons>
+ <row>
+ <pluginIcon>plugins/UserSettings/images/plugins/flash.gif</pluginIcon>
+ <pluginName>flash</pluginName>
+ </row>
+ <row>
+ <pluginIcon>plugins/UserSettings/images/plugins/java.gif</pluginIcon>
+ <pluginName>java</pluginName>
+ </row>
+ </pluginsIcons>
+ <deviceType>Inconnu</deviceType>
+ <events>0</events>
+ <continent>Europe</continent>
+ <continentCode>eur</continentCode>
+ <country>France</country>
+ <countryCode>fr</countryCode>
+ <countryFlag>plugins/UserCountry/images/flags/fr.png</countryFlag>
+ <region />
+ <regionCode />
+ <city />
+ <location>France</location>
+ <latitude />
+ <longitude />
+ <visitLocalTime>12:34:06</visitLocalTime>
+ <visitLocalHour>12</visitLocalHour>
+ <daysSinceLastVisit>0</daysSinceLastVisit>
+
+
+
+
+
+ </row>
+ <row>
+ <idSite>1</idSite>
+ <idVisit>1</idVisit>
+ <visitIp>156.5.0.0</visitIp>
+
+ <actionDetails>
+ <row>
+ <type>action</type>
+ <url>http://example.org/this%20is%20cool!</url>
+ <pageTitle>incredible title!</pageTitle>
+ <pageIdAction>2</pageIdAction>
+
+ <pageId>1</pageId>
+ <icon />
+ </row>
+ <row>
+ <type>goal</type>
+ <goalName>triggered js</goalName>
+ <goalId>1</goalId>
+ <revenue>0</revenue>
+ <goalPageId />
+
+ <url>http://example.org/this%20is%20cool!</url>
+ <icon>plugins/Morpheus/images/goal.png</icon>
+ </row>
+ </actionDetails>
+ <goalConversions>1</goalConversions>
+ <siteCurrency>USD</siteCurrency>
+ <siteCurrencySymbol>$</siteCurrencySymbol>
+
+
+
+
+ <searches>0</searches>
+ <actions>1</actions>
+ <userId />
+ <visitorType>new</visitorType>
+ <visitorTypeIcon />
+ <visitConverted>1</visitConverted>
+ <visitConvertedIcon>plugins/Morpheus/images/goal.png</visitConvertedIcon>
+ <visitCount>1</visitCount>
+
+ <visitEcommerceStatus>none</visitEcommerceStatus>
+ <visitEcommerceStatusIcon />
+ <daysSinceFirstVisit>0</daysSinceFirstVisit>
+ <daysSinceLastEcommerceOrder>0</daysSinceLastEcommerceOrder>
+ <visitDuration>1084</visitDuration>
+ <visitDurationPretty>18 min 4s</visitDurationPretty>
+ <customVariables>
+ </customVariables>
+ <deviceType>Inconnu</deviceType>
+ <browserFamily>unknown</browserFamily>
+ <browserFamilyDescription>Inconnu</browserFamilyDescription>
+ <events>0</events>
+ <provider>Inconnu</provider>
+ <providerName>Inconnu</providerName>
+ <providerUrl />
+ <referrerType>search</referrerType>
+ <referrerTypeName>Moteurs de recherche</referrerTypeName>
+ <referrerName>Google</referrerName>
+ <referrerKeyword>Mot clef indéfini</referrerKeyword>
+ <referrerKeywordPosition>1</referrerKeywordPosition>
+ <referrerUrl>http://piwik.org/faq/general/#faq_144</referrerUrl>
+ <referrerSearchEngineUrl>http://google.com</referrerSearchEngineUrl>
+ <referrerSearchEngineIcon>plugins/Referrers/images/searchEngines/google.com.png</referrerSearchEngineIcon>
+ <continent>Europe</continent>
+ <continentCode>eur</continentCode>
+ <country>France</country>
+ <countryCode>fr</countryCode>
+ <countryFlag>plugins/UserCountry/images/flags/fr.png</countryFlag>
+ <region />
+ <regionCode />
+ <city />
+ <location>France</location>
+ <latitude />
+ <longitude />
+ <operatingSystem>Bot</operatingSystem>
+ <operatingSystemCode>BOT</operatingSystemCode>
+ <operatingSystemShortName>BOT</operatingSystemShortName>
+ <operatingSystemIcon>plugins/UserSettings/images/os/UNK.gif</operatingSystemIcon>
+ <browserName>Inconnu</browserName>
+ <browserIcon>plugins/UserSettings/images/browsers/UNK.gif</browserIcon>
+ <browserCode>UNK</browserCode>
+ <browserVersion />
+ <screenType>normal</screenType>
+ <resolution>1024x768</resolution>
+ <screenTypeIcon>plugins/UserSettings/images/screens/normal.gif</screenTypeIcon>
+ <plugins>flash, java</plugins>
+ <pluginsIcons>
+ <row>
+ <pluginIcon>plugins/UserSettings/images/plugins/flash.gif</pluginIcon>
+ <pluginName>flash</pluginName>
+ </row>
+ <row>
+ <pluginIcon>plugins/UserSettings/images/plugins/java.gif</pluginIcon>
+ <pluginName>java</pluginName>
+ </row>
+ </pluginsIcons>
+ <deviceType>Inconnu</deviceType>
+ <events>0</events>
+ <continent>Europe</continent>
+ <continentCode>eur</continentCode>
+ <country>France</country>
+ <countryCode>fr</countryCode>
+ <countryFlag>plugins/UserCountry/images/flags/fr.png</countryFlag>
+ <region />
+ <regionCode />
+ <city />
+ <location>France</location>
+ <latitude />
+ <longitude />
+ <visitLocalTime>12:34:06</visitLocalTime>
+ <visitLocalHour>12</visitLocalHour>
+ <daysSinceLastVisit>0</daysSinceLastVisit>
+
+
+
+
+
+ </row>
+</result> \ No newline at end of file
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitor_NoKeywordSpecified__Referrers.getKeywords_day.xml b/tests/PHPUnit/System/expected/test_OneVisitor_NoKeywordSpecified__Referrers.getKeywords_day.xml
index 9b2a6b9b0e..9b2a6b9b0e 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitor_NoKeywordSpecified__Referrers.getKeywords_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitor_NoKeywordSpecified__Referrers.getKeywords_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitor_SeveralDays_ImportedInRandomOrderTest_shouldShowOneVisit_InEachOfThreeDays__Live.getLastVisitsDetails_month.xml b/tests/PHPUnit/System/expected/test_OneVisitor_SeveralDays_ImportedInRandomOrderTest_shouldShowOneVisit_InEachOfThreeDays__Live.getLastVisitsDetails_month.xml
index e38d88d7f5..e38d88d7f5 100644
--- a/tests/PHPUnit/Integration/expected/test_OneVisitor_SeveralDays_ImportedInRandomOrderTest_shouldShowOneVisit_InEachOfThreeDays__Live.getLastVisitsDetails_month.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitor_SeveralDays_ImportedInRandomOrderTest_shouldShowOneVisit_InEachOfThreeDays__Live.getLastVisitsDetails_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_PivotByQueryParamTest_test_PivotByParam_PlaysNiceWithDataTableMaps__Referrers.getKeywords_day.xml b/tests/PHPUnit/System/expected/test_PivotByQueryParamTest_test_PivotByParam_PlaysNiceWithDataTableMaps__Referrers.getKeywords_day.xml
index d98cace554..d98cace554 100644
--- a/tests/PHPUnit/Integration/expected/test_PivotByQueryParamTest_test_PivotByParam_PlaysNiceWithDataTableMaps__Referrers.getKeywords_day.xml
+++ b/tests/PHPUnit/System/expected/test_PivotByQueryParamTest_test_PivotByParam_PlaysNiceWithDataTableMaps__Referrers.getKeywords_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_PivotByQueryParamTest_test_PivotByParam_PlaysNiceWithOtherQueryParams__Referrers.getKeywords_week.xml b/tests/PHPUnit/System/expected/test_PivotByQueryParamTest_test_PivotByParam_PlaysNiceWithOtherQueryParams__Referrers.getKeywords_week.xml
index 05553ef4f8..05553ef4f8 100644
--- a/tests/PHPUnit/Integration/expected/test_PivotByQueryParamTest_test_PivotByParam_PlaysNiceWithOtherQueryParams__Referrers.getKeywords_week.xml
+++ b/tests/PHPUnit/System/expected/test_PivotByQueryParamTest_test_PivotByParam_PlaysNiceWithOtherQueryParams__Referrers.getKeywords_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_PivotByQueryParamTest_test_PivotByParam_WorksWithColumnLimiting__Referrers.getKeywords_week.xml b/tests/PHPUnit/System/expected/test_PivotByQueryParamTest_test_PivotByParam_WorksWithColumnLimiting__Referrers.getKeywords_week.xml
index ac43686db0..ac43686db0 100644
--- a/tests/PHPUnit/Integration/expected/test_PivotByQueryParamTest_test_PivotByParam_WorksWithColumnLimiting__Referrers.getKeywords_week.xml
+++ b/tests/PHPUnit/System/expected/test_PivotByQueryParamTest_test_PivotByParam_WorksWithColumnLimiting__Referrers.getKeywords_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_PivotByQueryParamTest_test_PivotByParam_WorksWithCsvOutput__Referrers.getKeywords_week.csv b/tests/PHPUnit/System/expected/test_PivotByQueryParamTest_test_PivotByParam_WorksWithCsvOutput__Referrers.getKeywords_week.csv
index a465a67a14..a465a67a14 100644
--- a/tests/PHPUnit/Integration/expected/test_PivotByQueryParamTest_test_PivotByParam_WorksWithCsvOutput__Referrers.getKeywords_week.csv
+++ b/tests/PHPUnit/System/expected/test_PivotByQueryParamTest_test_PivotByParam_WorksWithCsvOutput__Referrers.getKeywords_week.csv
Binary files differ
diff --git a/tests/PHPUnit/Integration/expected/test_PivotByQueryParamTest_test_PivotByParam_WorksWithJsonOutput__Referrers.getKeywords_week.json b/tests/PHPUnit/System/expected/test_PivotByQueryParamTest_test_PivotByParam_WorksWithJsonOutput__Referrers.getKeywords_week.json
index 25e1824fc6..25e1824fc6 100644
--- a/tests/PHPUnit/Integration/expected/test_PivotByQueryParamTest_test_PivotByParam_WorksWithJsonOutput__Referrers.getKeywords_week.json
+++ b/tests/PHPUnit/System/expected/test_PivotByQueryParamTest_test_PivotByParam_WorksWithJsonOutput__Referrers.getKeywords_week.json
diff --git a/tests/PHPUnit/Integration/expected/test_PivotByQueryParamTest_test_PivotByParam_WorksWithReportWhoseSubtableIsSelf__Actions.getPageUrls_week.xml b/tests/PHPUnit/System/expected/test_PivotByQueryParamTest_test_PivotByParam_WorksWithReportWhoseSubtableIsSelf__Actions.getPageUrls_week.xml
index 0b88c2ff59..0b88c2ff59 100644
--- a/tests/PHPUnit/Integration/expected/test_PivotByQueryParamTest_test_PivotByParam_WorksWithReportWhoseSubtableIsSelf__Actions.getPageUrls_week.xml
+++ b/tests/PHPUnit/System/expected/test_PivotByQueryParamTest_test_PivotByParam_WorksWithReportWhoseSubtableIsSelf__Actions.getPageUrls_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_PivotByQueryParamTest_test_PivotBySegment_CreatesCorrectPivotTable_WhenSegmentUsedInRequest__Referrers.getKeywords_week.xml b/tests/PHPUnit/System/expected/test_PivotByQueryParamTest_test_PivotBySegment_CreatesCorrectPivotTable_WhenSegmentUsedInRequest__Referrers.getKeywords_week.xml
index 52686d6610..52686d6610 100644
--- a/tests/PHPUnit/Integration/expected/test_PivotByQueryParamTest_test_PivotBySegment_CreatesCorrectPivotTable_WhenSegmentUsedInRequest__Referrers.getKeywords_week.xml
+++ b/tests/PHPUnit/System/expected/test_PivotByQueryParamTest_test_PivotBySegment_CreatesCorrectPivotTable_WhenSegmentUsedInRequest__Referrers.getKeywords_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_PivotByQueryParamTest_test_PivotBySegment_CreatesCorrectPivotTable__Referrers.getKeywords_week.xml b/tests/PHPUnit/System/expected/test_PivotByQueryParamTest_test_PivotBySegment_CreatesCorrectPivotTable__Referrers.getKeywords_week.xml
index 8112e991f5..8112e991f5 100644
--- a/tests/PHPUnit/Integration/expected/test_PivotByQueryParamTest_test_PivotBySegment_CreatesCorrectPivotTable__Referrers.getKeywords_week.xml
+++ b/tests/PHPUnit/System/expected/test_PivotByQueryParamTest_test_PivotBySegment_CreatesCorrectPivotTable__Referrers.getKeywords_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_PivotByQueryParamTest_test_PivotBySubtableDimension_CreatesCorrectPivotTable__Referrers.getKeywords_week.xml b/tests/PHPUnit/System/expected/test_PivotByQueryParamTest_test_PivotBySubtableDimension_CreatesCorrectPivotTable__Referrers.getKeywords_week.xml
index 1adf9d722a..1adf9d722a 100644
--- a/tests/PHPUnit/Integration/expected/test_PivotByQueryParamTest_test_PivotBySubtableDimension_CreatesCorrectPivotTable__Referrers.getKeywords_week.xml
+++ b/tests/PHPUnit/System/expected/test_PivotByQueryParamTest_test_PivotBySubtableDimension_CreatesCorrectPivotTable__Referrers.getKeywords_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_PivotByQueryParamTest_test_PivotBySubtableDimension_WhenEntireHirearchyIsNotLoaded__Referrers.getKeywords_week.xml b/tests/PHPUnit/System/expected/test_PivotByQueryParamTest_test_PivotBySubtableDimension_WhenEntireHirearchyIsNotLoaded__Referrers.getKeywords_week.xml
index 6ab5630422..6ab5630422 100644
--- a/tests/PHPUnit/Integration/expected/test_PivotByQueryParamTest_test_PivotBySubtableDimension_WhenEntireHirearchyIsNotLoaded__Referrers.getKeywords_week.xml
+++ b/tests/PHPUnit/System/expected/test_PivotByQueryParamTest_test_PivotBySubtableDimension_WhenEntireHirearchyIsNotLoaded__Referrers.getKeywords_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_PiwikTracker_trackForceUsingVisitId_insteadOfHeuristics_alsoTestsCampaignTracking__Referrers.getCampaigns_day.xml b/tests/PHPUnit/System/expected/test_PiwikTracker_trackForceUsingVisitId_insteadOfHeuristics_alsoTestsCampaignTracking__Referrers.getCampaigns_day.xml
index 0ad33169a4..0ad33169a4 100644
--- a/tests/PHPUnit/Integration/expected/test_PiwikTracker_trackForceUsingVisitId_insteadOfHeuristics_alsoTestsCampaignTracking__Referrers.getCampaigns_day.xml
+++ b/tests/PHPUnit/System/expected/test_PiwikTracker_trackForceUsingVisitId_insteadOfHeuristics_alsoTestsCampaignTracking__Referrers.getCampaigns_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_PiwikTracker_trackForceUsingVisitId_insteadOfHeuristics_alsoTestsCampaignTracking__Referrers.getWebsites_day.xml b/tests/PHPUnit/System/expected/test_PiwikTracker_trackForceUsingVisitId_insteadOfHeuristics_alsoTestsCampaignTracking__Referrers.getWebsites_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_PiwikTracker_trackForceUsingVisitId_insteadOfHeuristics_alsoTestsCampaignTracking__Referrers.getWebsites_day.xml
+++ b/tests/PHPUnit/System/expected/test_PiwikTracker_trackForceUsingVisitId_insteadOfHeuristics_alsoTestsCampaignTracking__Referrers.getWebsites_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_PiwikTracker_trackForceUsingVisitId_insteadOfHeuristics_alsoTestsCampaignTracking__VisitsSummary.get_day.xml b/tests/PHPUnit/System/expected/test_PiwikTracker_trackForceUsingVisitId_insteadOfHeuristics_alsoTestsCampaignTracking__VisitsSummary.get_day.xml
index 78c6610886..78c6610886 100644
--- a/tests/PHPUnit/Integration/expected/test_PiwikTracker_trackForceUsingVisitId_insteadOfHeuristics_alsoTestsCampaignTracking__VisitsSummary.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_PiwikTracker_trackForceUsingVisitId_insteadOfHeuristics_alsoTestsCampaignTracking__VisitsSummary.get_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_RowEvolution_LabelReservedCharactersHierarchical__API.getRowEvolution_day.xml b/tests/PHPUnit/System/expected/test_RowEvolution_LabelReservedCharactersHierarchical__API.getRowEvolution_day.xml
index 7295efb518..7295efb518 100644
--- a/tests/PHPUnit/Integration/expected/test_RowEvolution_LabelReservedCharactersHierarchical__API.getRowEvolution_day.xml
+++ b/tests/PHPUnit/System/expected/test_RowEvolution_LabelReservedCharactersHierarchical__API.getRowEvolution_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_RowEvolution_LabelReservedCharacters__API.getRowEvolution_day.xml b/tests/PHPUnit/System/expected/test_RowEvolution_LabelReservedCharacters__API.getRowEvolution_day.xml
index b0534b1fd1..b0534b1fd1 100644
--- a/tests/PHPUnit/Integration/expected/test_RowEvolution_LabelReservedCharacters__API.getRowEvolution_day.xml
+++ b/tests/PHPUnit/System/expected/test_RowEvolution_LabelReservedCharacters__API.getRowEvolution_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_RowEvolution_entryPageTitles__API.getRowEvolution_day.xml b/tests/PHPUnit/System/expected/test_RowEvolution_entryPageTitles__API.getRowEvolution_day.xml
index e73ba39d1d..e73ba39d1d 100644
--- a/tests/PHPUnit/Integration/expected/test_RowEvolution_entryPageTitles__API.getRowEvolution_day.xml
+++ b/tests/PHPUnit/System/expected/test_RowEvolution_entryPageTitles__API.getRowEvolution_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_RowEvolution_flatFilters__Referrers.getSearchEngines_month.xml b/tests/PHPUnit/System/expected/test_RowEvolution_flatFilters__Referrers.getSearchEngines_month.xml
index e1f0382dda..e1f0382dda 100644
--- a/tests/PHPUnit/Integration/expected/test_RowEvolution_flatFilters__Referrers.getSearchEngines_month.xml
+++ b/tests/PHPUnit/System/expected/test_RowEvolution_flatFilters__Referrers.getSearchEngines_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_RowEvolution_goals_visitsUntilConversion_WithoutLabels__API.getRowEvolution_day.xml b/tests/PHPUnit/System/expected/test_RowEvolution_goals_visitsUntilConversion_WithoutLabels__API.getRowEvolution_day.xml
index bed5b4c44e..bed5b4c44e 100644
--- a/tests/PHPUnit/Integration/expected/test_RowEvolution_goals_visitsUntilConversion_WithoutLabels__API.getRowEvolution_day.xml
+++ b/tests/PHPUnit/System/expected/test_RowEvolution_goals_visitsUntilConversion_WithoutLabels__API.getRowEvolution_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_RowEvolution_goals_visitsUntilConversion__API.getRowEvolution_day.xml b/tests/PHPUnit/System/expected/test_RowEvolution_goals_visitsUntilConversion__API.getRowEvolution_day.xml
index 6b29ea0e98..6b29ea0e98 100644
--- a/tests/PHPUnit/Integration/expected/test_RowEvolution_goals_visitsUntilConversion__API.getRowEvolution_day.xml
+++ b/tests/PHPUnit/System/expected/test_RowEvolution_goals_visitsUntilConversion__API.getRowEvolution_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_RowEvolution_mobileDesktop__API.getRowEvolution_day.xml b/tests/PHPUnit/System/expected/test_RowEvolution_mobileDesktop__API.getRowEvolution_day.xml
index 86026aff84..86026aff84 100644
--- a/tests/PHPUnit/Integration/expected/test_RowEvolution_mobileDesktop__API.getRowEvolution_day.xml
+++ b/tests/PHPUnit/System/expected/test_RowEvolution_mobileDesktop__API.getRowEvolution_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_RowEvolution_multiWithFilterLimit__API.getRowEvolution_day.xml b/tests/PHPUnit/System/expected/test_RowEvolution_multiWithFilterLimit__API.getRowEvolution_day.xml
index 29f0426935..29f0426935 100644
--- a/tests/PHPUnit/Integration/expected/test_RowEvolution_multiWithFilterLimit__API.getRowEvolution_day.xml
+++ b/tests/PHPUnit/System/expected/test_RowEvolution_multiWithFilterLimit__API.getRowEvolution_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_RowEvolution_multiWithNoData__API.getRowEvolution_day.xml b/tests/PHPUnit/System/expected/test_RowEvolution_multiWithNoData__API.getRowEvolution_day.xml
index 9a1a1b9d35..9a1a1b9d35 100644
--- a/tests/PHPUnit/Integration/expected/test_RowEvolution_multiWithNoData__API.getRowEvolution_day.xml
+++ b/tests/PHPUnit/System/expected/test_RowEvolution_multiWithNoData__API.getRowEvolution_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_RowEvolution_multipleDates_lastNoData__API.getRowEvolution_month.xml b/tests/PHPUnit/System/expected/test_RowEvolution_multipleDates_lastNoData__API.getRowEvolution_month.xml
index ff4f69a79d..ff4f69a79d 100644
--- a/tests/PHPUnit/Integration/expected/test_RowEvolution_multipleDates_lastNoData__API.getRowEvolution_month.xml
+++ b/tests/PHPUnit/System/expected/test_RowEvolution_multipleDates_lastNoData__API.getRowEvolution_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_RowEvolution_pageTitlesMulti__API.getRowEvolution_day.xml b/tests/PHPUnit/System/expected/test_RowEvolution_pageTitlesMulti__API.getRowEvolution_day.xml
index 67f2b8e444..67f2b8e444 100644
--- a/tests/PHPUnit/Integration/expected/test_RowEvolution_pageTitlesMulti__API.getRowEvolution_day.xml
+++ b/tests/PHPUnit/System/expected/test_RowEvolution_pageTitlesMulti__API.getRowEvolution_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_RowEvolution_pageTitlesMulti__API.getRowEvolution_week.xml b/tests/PHPUnit/System/expected/test_RowEvolution_pageTitlesMulti__API.getRowEvolution_week.xml
index 49ee397bd0..49ee397bd0 100644
--- a/tests/PHPUnit/Integration/expected/test_RowEvolution_pageTitlesMulti__API.getRowEvolution_week.xml
+++ b/tests/PHPUnit/System/expected/test_RowEvolution_pageTitlesMulti__API.getRowEvolution_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_RowEvolution_pageTitles__API.getRowEvolution_day.xml b/tests/PHPUnit/System/expected/test_RowEvolution_pageTitles__API.getRowEvolution_day.xml
index 00281d68e1..00281d68e1 100644
--- a/tests/PHPUnit/Integration/expected/test_RowEvolution_pageTitles__API.getRowEvolution_day.xml
+++ b/tests/PHPUnit/System/expected/test_RowEvolution_pageTitles__API.getRowEvolution_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_RowEvolution_pageTitles__API.getRowEvolution_week.xml b/tests/PHPUnit/System/expected/test_RowEvolution_pageTitles__API.getRowEvolution_week.xml
index ffd938a2fb..ffd938a2fb 100644
--- a/tests/PHPUnit/Integration/expected/test_RowEvolution_pageTitles__API.getRowEvolution_week.xml
+++ b/tests/PHPUnit/System/expected/test_RowEvolution_pageTitles__API.getRowEvolution_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_RowEvolution_pageUrls__API.getRowEvolution_range.xml b/tests/PHPUnit/System/expected/test_RowEvolution_pageUrls__API.getRowEvolution_range.xml
index c58ead4c78..c58ead4c78 100644
--- a/tests/PHPUnit/Integration/expected/test_RowEvolution_pageUrls__API.getRowEvolution_range.xml
+++ b/tests/PHPUnit/System/expected/test_RowEvolution_pageUrls__API.getRowEvolution_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_RowEvolution_processedRowLabel__API.getRowEvolution_day.xml b/tests/PHPUnit/System/expected/test_RowEvolution_processedRowLabel__API.getRowEvolution_day.xml
index 68837cb7a6..68837cb7a6 100644
--- a/tests/PHPUnit/Integration/expected/test_RowEvolution_processedRowLabel__API.getRowEvolution_day.xml
+++ b/tests/PHPUnit/System/expected/test_RowEvolution_processedRowLabel__API.getRowEvolution_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_RowEvolution_referrer1__API.getRowEvolution_day.xml b/tests/PHPUnit/System/expected/test_RowEvolution_referrer1__API.getRowEvolution_day.xml
index f75c05f7f8..f75c05f7f8 100644
--- a/tests/PHPUnit/Integration/expected/test_RowEvolution_referrer1__API.getRowEvolution_day.xml
+++ b/tests/PHPUnit/System/expected/test_RowEvolution_referrer1__API.getRowEvolution_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_RowEvolution_referrer2__API.getRowEvolution_day.xml b/tests/PHPUnit/System/expected/test_RowEvolution_referrer2__API.getRowEvolution_day.xml
index c424df6d30..c424df6d30 100644
--- a/tests/PHPUnit/Integration/expected/test_RowEvolution_referrer2__API.getRowEvolution_day.xml
+++ b/tests/PHPUnit/System/expected/test_RowEvolution_referrer2__API.getRowEvolution_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_RowEvolution_referrerMulti1__API.getRowEvolution_day.xml b/tests/PHPUnit/System/expected/test_RowEvolution_referrerMulti1__API.getRowEvolution_day.xml
index 01184a360d..01184a360d 100644
--- a/tests/PHPUnit/Integration/expected/test_RowEvolution_referrerMulti1__API.getRowEvolution_day.xml
+++ b/tests/PHPUnit/System/expected/test_RowEvolution_referrerMulti1__API.getRowEvolution_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getPageTitlesFollowingSiteSearch_firstSite_lastN__API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_SiteSearch_Actions.getPageTitlesFollowingSiteSearch_firstSite_lastN__API.getProcessedReport_day.xml
index e1254c611b..e1254c611b 100644
--- a/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getPageTitlesFollowingSiteSearch_firstSite_lastN__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_SiteSearch_Actions.getPageTitlesFollowingSiteSearch_firstSite_lastN__API.getProcessedReport_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getPageTitlesFollowingSiteSearch_firstSite_lastN__API.getProcessedReport_month.xml b/tests/PHPUnit/System/expected/test_SiteSearch_Actions.getPageTitlesFollowingSiteSearch_firstSite_lastN__API.getProcessedReport_month.xml
index 358b09c180..358b09c180 100644
--- a/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getPageTitlesFollowingSiteSearch_firstSite_lastN__API.getProcessedReport_month.xml
+++ b/tests/PHPUnit/System/expected/test_SiteSearch_Actions.getPageTitlesFollowingSiteSearch_firstSite_lastN__API.getProcessedReport_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getPageTitles_firstSite_lastN__API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_SiteSearch_Actions.getPageTitles_firstSite_lastN__API.getProcessedReport_day.xml
index c1f7037343..c1f7037343 100644
--- a/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getPageTitles_firstSite_lastN__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_SiteSearch_Actions.getPageTitles_firstSite_lastN__API.getProcessedReport_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getPageTitles_firstSite_lastN__API.getProcessedReport_month.xml b/tests/PHPUnit/System/expected/test_SiteSearch_Actions.getPageTitles_firstSite_lastN__API.getProcessedReport_month.xml
index 33516984c8..33516984c8 100644
--- a/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getPageTitles_firstSite_lastN__API.getProcessedReport_month.xml
+++ b/tests/PHPUnit/System/expected/test_SiteSearch_Actions.getPageTitles_firstSite_lastN__API.getProcessedReport_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getPageUrlsFollowingSiteSearch_firstSite_lastN__API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_SiteSearch_Actions.getPageUrlsFollowingSiteSearch_firstSite_lastN__API.getProcessedReport_day.xml
index a139b8c186..a139b8c186 100644
--- a/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getPageUrlsFollowingSiteSearch_firstSite_lastN__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_SiteSearch_Actions.getPageUrlsFollowingSiteSearch_firstSite_lastN__API.getProcessedReport_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getPageUrlsFollowingSiteSearch_firstSite_lastN__API.getProcessedReport_month.xml b/tests/PHPUnit/System/expected/test_SiteSearch_Actions.getPageUrlsFollowingSiteSearch_firstSite_lastN__API.getProcessedReport_month.xml
index ddbfc27323..ddbfc27323 100644
--- a/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getPageUrlsFollowingSiteSearch_firstSite_lastN__API.getProcessedReport_month.xml
+++ b/tests/PHPUnit/System/expected/test_SiteSearch_Actions.getPageUrlsFollowingSiteSearch_firstSite_lastN__API.getProcessedReport_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getPageUrls_firstSite_lastN__API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_SiteSearch_Actions.getPageUrls_firstSite_lastN__API.getProcessedReport_day.xml
index 3778066188..3778066188 100644
--- a/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getPageUrls_firstSite_lastN__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_SiteSearch_Actions.getPageUrls_firstSite_lastN__API.getProcessedReport_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getPageUrls_firstSite_lastN__API.getProcessedReport_month.xml b/tests/PHPUnit/System/expected/test_SiteSearch_Actions.getPageUrls_firstSite_lastN__API.getProcessedReport_month.xml
index c4d5795571..c4d5795571 100644
--- a/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getPageUrls_firstSite_lastN__API.getProcessedReport_month.xml
+++ b/tests/PHPUnit/System/expected/test_SiteSearch_Actions.getPageUrls_firstSite_lastN__API.getProcessedReport_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getSiteSearchCategories_firstSite_lastN__API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_SiteSearch_Actions.getSiteSearchCategories_firstSite_lastN__API.getProcessedReport_day.xml
index 48dec5534c..48dec5534c 100644
--- a/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getSiteSearchCategories_firstSite_lastN__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_SiteSearch_Actions.getSiteSearchCategories_firstSite_lastN__API.getProcessedReport_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getSiteSearchCategories_firstSite_lastN__API.getProcessedReport_month.xml b/tests/PHPUnit/System/expected/test_SiteSearch_Actions.getSiteSearchCategories_firstSite_lastN__API.getProcessedReport_month.xml
index cb33390062..cb33390062 100644
--- a/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getSiteSearchCategories_firstSite_lastN__API.getProcessedReport_month.xml
+++ b/tests/PHPUnit/System/expected/test_SiteSearch_Actions.getSiteSearchCategories_firstSite_lastN__API.getProcessedReport_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getSiteSearchKeywords_firstSite_lastN__API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_SiteSearch_Actions.getSiteSearchKeywords_firstSite_lastN__API.getProcessedReport_day.xml
index 84b4b19ea1..84b4b19ea1 100644
--- a/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getSiteSearchKeywords_firstSite_lastN__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_SiteSearch_Actions.getSiteSearchKeywords_firstSite_lastN__API.getProcessedReport_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getSiteSearchKeywords_firstSite_lastN__API.getProcessedReport_month.xml b/tests/PHPUnit/System/expected/test_SiteSearch_Actions.getSiteSearchKeywords_firstSite_lastN__API.getProcessedReport_month.xml
index 133ef2f538..133ef2f538 100644
--- a/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getSiteSearchKeywords_firstSite_lastN__API.getProcessedReport_month.xml
+++ b/tests/PHPUnit/System/expected/test_SiteSearch_Actions.getSiteSearchKeywords_firstSite_lastN__API.getProcessedReport_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getSiteSearchNoResultKeywords_firstSite_lastN__API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_SiteSearch_Actions.getSiteSearchNoResultKeywords_firstSite_lastN__API.getProcessedReport_day.xml
index e52d6cd8f3..e52d6cd8f3 100644
--- a/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getSiteSearchNoResultKeywords_firstSite_lastN__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_SiteSearch_Actions.getSiteSearchNoResultKeywords_firstSite_lastN__API.getProcessedReport_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getSiteSearchNoResultKeywords_firstSite_lastN__API.getProcessedReport_month.xml b/tests/PHPUnit/System/expected/test_SiteSearch_Actions.getSiteSearchNoResultKeywords_firstSite_lastN__API.getProcessedReport_month.xml
index 63ba94eaf9..63ba94eaf9 100644
--- a/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.getSiteSearchNoResultKeywords_firstSite_lastN__API.getProcessedReport_month.xml
+++ b/tests/PHPUnit/System/expected/test_SiteSearch_Actions.getSiteSearchNoResultKeywords_firstSite_lastN__API.getProcessedReport_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.get_firstSite_lastN__API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_SiteSearch_Actions.get_firstSite_lastN__API.getProcessedReport_day.xml
index 77af413fc5..77af413fc5 100644
--- a/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.get_firstSite_lastN__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_SiteSearch_Actions.get_firstSite_lastN__API.getProcessedReport_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.get_firstSite_lastN__API.getProcessedReport_month.xml b/tests/PHPUnit/System/expected/test_SiteSearch_Actions.get_firstSite_lastN__API.getProcessedReport_month.xml
index 1b0f9d2bec..1b0f9d2bec 100644
--- a/tests/PHPUnit/Integration/expected/test_SiteSearch_Actions.get_firstSite_lastN__API.getProcessedReport_month.xml
+++ b/tests/PHPUnit/System/expected/test_SiteSearch_Actions.get_firstSite_lastN__API.getProcessedReport_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_SiteSearch_AllSites__Actions.getPageTitlesFollowingSiteSearch_day.xml b/tests/PHPUnit/System/expected/test_SiteSearch_AllSites__Actions.getPageTitlesFollowingSiteSearch_day.xml
index 7ea5167dfd..7ea5167dfd 100644
--- a/tests/PHPUnit/Integration/expected/test_SiteSearch_AllSites__Actions.getPageTitlesFollowingSiteSearch_day.xml
+++ b/tests/PHPUnit/System/expected/test_SiteSearch_AllSites__Actions.getPageTitlesFollowingSiteSearch_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_SiteSearch_AllSites__Actions.getPageTitlesFollowingSiteSearch_month.xml b/tests/PHPUnit/System/expected/test_SiteSearch_AllSites__Actions.getPageTitlesFollowingSiteSearch_month.xml
index 86ae401b60..86ae401b60 100644
--- a/tests/PHPUnit/Integration/expected/test_SiteSearch_AllSites__Actions.getPageTitlesFollowingSiteSearch_month.xml
+++ b/tests/PHPUnit/System/expected/test_SiteSearch_AllSites__Actions.getPageTitlesFollowingSiteSearch_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_SiteSearch_AllSites__Actions.getPageTitles_day.xml b/tests/PHPUnit/System/expected/test_SiteSearch_AllSites__Actions.getPageTitles_day.xml
index 9dc49472a7..9dc49472a7 100644
--- a/tests/PHPUnit/Integration/expected/test_SiteSearch_AllSites__Actions.getPageTitles_day.xml
+++ b/tests/PHPUnit/System/expected/test_SiteSearch_AllSites__Actions.getPageTitles_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_SiteSearch_AllSites__Actions.getPageTitles_month.xml b/tests/PHPUnit/System/expected/test_SiteSearch_AllSites__Actions.getPageTitles_month.xml
index d9462f0f36..d9462f0f36 100644
--- a/tests/PHPUnit/Integration/expected/test_SiteSearch_AllSites__Actions.getPageTitles_month.xml
+++ b/tests/PHPUnit/System/expected/test_SiteSearch_AllSites__Actions.getPageTitles_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_SiteSearch_AllSites__Actions.getPageUrlsFollowingSiteSearch_day.xml b/tests/PHPUnit/System/expected/test_SiteSearch_AllSites__Actions.getPageUrlsFollowingSiteSearch_day.xml
index 74ece58337..74ece58337 100644
--- a/tests/PHPUnit/Integration/expected/test_SiteSearch_AllSites__Actions.getPageUrlsFollowingSiteSearch_day.xml
+++ b/tests/PHPUnit/System/expected/test_SiteSearch_AllSites__Actions.getPageUrlsFollowingSiteSearch_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_SiteSearch_AllSites__Actions.getPageUrlsFollowingSiteSearch_month.xml b/tests/PHPUnit/System/expected/test_SiteSearch_AllSites__Actions.getPageUrlsFollowingSiteSearch_month.xml
index 1c66040802..1c66040802 100644
--- a/tests/PHPUnit/Integration/expected/test_SiteSearch_AllSites__Actions.getPageUrlsFollowingSiteSearch_month.xml
+++ b/tests/PHPUnit/System/expected/test_SiteSearch_AllSites__Actions.getPageUrlsFollowingSiteSearch_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_SiteSearch_AllSites__Actions.getPageUrls_day.xml b/tests/PHPUnit/System/expected/test_SiteSearch_AllSites__Actions.getPageUrls_day.xml
index ff058d70eb..ff058d70eb 100644
--- a/tests/PHPUnit/Integration/expected/test_SiteSearch_AllSites__Actions.getPageUrls_day.xml
+++ b/tests/PHPUnit/System/expected/test_SiteSearch_AllSites__Actions.getPageUrls_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_SiteSearch_AllSites__Actions.getPageUrls_month.xml b/tests/PHPUnit/System/expected/test_SiteSearch_AllSites__Actions.getPageUrls_month.xml
index 87e23ee986..87e23ee986 100644
--- a/tests/PHPUnit/Integration/expected/test_SiteSearch_AllSites__Actions.getPageUrls_month.xml
+++ b/tests/PHPUnit/System/expected/test_SiteSearch_AllSites__Actions.getPageUrls_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_SiteSearch_AllSites__Actions.getSiteSearchCategories_day.xml b/tests/PHPUnit/System/expected/test_SiteSearch_AllSites__Actions.getSiteSearchCategories_day.xml
index a91076f826..a91076f826 100644
--- a/tests/PHPUnit/Integration/expected/test_SiteSearch_AllSites__Actions.getSiteSearchCategories_day.xml
+++ b/tests/PHPUnit/System/expected/test_SiteSearch_AllSites__Actions.getSiteSearchCategories_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_SiteSearch_AllSites__Actions.getSiteSearchCategories_month.xml b/tests/PHPUnit/System/expected/test_SiteSearch_AllSites__Actions.getSiteSearchCategories_month.xml
index a91076f826..a91076f826 100644
--- a/tests/PHPUnit/Integration/expected/test_SiteSearch_AllSites__Actions.getSiteSearchCategories_month.xml
+++ b/tests/PHPUnit/System/expected/test_SiteSearch_AllSites__Actions.getSiteSearchCategories_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_SiteSearch_AllSites__Actions.getSiteSearchKeywords_day.xml b/tests/PHPUnit/System/expected/test_SiteSearch_AllSites__Actions.getSiteSearchKeywords_day.xml
index 4798b08e6e..4798b08e6e 100644
--- a/tests/PHPUnit/Integration/expected/test_SiteSearch_AllSites__Actions.getSiteSearchKeywords_day.xml
+++ b/tests/PHPUnit/System/expected/test_SiteSearch_AllSites__Actions.getSiteSearchKeywords_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_SiteSearch_AllSites__Actions.getSiteSearchKeywords_month.xml b/tests/PHPUnit/System/expected/test_SiteSearch_AllSites__Actions.getSiteSearchKeywords_month.xml
index 5b6e7c4828..5b6e7c4828 100644
--- a/tests/PHPUnit/Integration/expected/test_SiteSearch_AllSites__Actions.getSiteSearchKeywords_month.xml
+++ b/tests/PHPUnit/System/expected/test_SiteSearch_AllSites__Actions.getSiteSearchKeywords_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_SiteSearch_AllSites__Actions.getSiteSearchNoResultKeywords_day.xml b/tests/PHPUnit/System/expected/test_SiteSearch_AllSites__Actions.getSiteSearchNoResultKeywords_day.xml
index b30ddb01d7..b30ddb01d7 100644
--- a/tests/PHPUnit/Integration/expected/test_SiteSearch_AllSites__Actions.getSiteSearchNoResultKeywords_day.xml
+++ b/tests/PHPUnit/System/expected/test_SiteSearch_AllSites__Actions.getSiteSearchNoResultKeywords_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_SiteSearch_AllSites__Actions.getSiteSearchNoResultKeywords_month.xml b/tests/PHPUnit/System/expected/test_SiteSearch_AllSites__Actions.getSiteSearchNoResultKeywords_month.xml
index 4f8b06fb5b..4f8b06fb5b 100644
--- a/tests/PHPUnit/Integration/expected/test_SiteSearch_AllSites__Actions.getSiteSearchNoResultKeywords_month.xml
+++ b/tests/PHPUnit/System/expected/test_SiteSearch_AllSites__Actions.getSiteSearchNoResultKeywords_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_SiteSearch_AllSites__Actions.get_day.xml b/tests/PHPUnit/System/expected/test_SiteSearch_AllSites__Actions.get_day.xml
index 13c2a7e8ac..13c2a7e8ac 100644
--- a/tests/PHPUnit/Integration/expected/test_SiteSearch_AllSites__Actions.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_SiteSearch_AllSites__Actions.get_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_SiteSearch_AllSites__Actions.get_month.xml b/tests/PHPUnit/System/expected/test_SiteSearch_AllSites__Actions.get_month.xml
index d078913108..d078913108 100644
--- a/tests/PHPUnit/Integration/expected/test_SiteSearch_AllSites__Actions.get_month.xml
+++ b/tests/PHPUnit/System/expected/test_SiteSearch_AllSites__Actions.get_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_SiteSearch_AllSites__CustomVariables.getCustomVariables_day.xml b/tests/PHPUnit/System/expected/test_SiteSearch_AllSites__CustomVariables.getCustomVariables_day.xml
index 55f9028117..55f9028117 100644
--- a/tests/PHPUnit/Integration/expected/test_SiteSearch_AllSites__CustomVariables.getCustomVariables_day.xml
+++ b/tests/PHPUnit/System/expected/test_SiteSearch_AllSites__CustomVariables.getCustomVariables_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_SiteSearch_AllSites__CustomVariables.getCustomVariables_month.xml b/tests/PHPUnit/System/expected/test_SiteSearch_AllSites__CustomVariables.getCustomVariables_month.xml
index 1a0871477a..1a0871477a 100644
--- a/tests/PHPUnit/Integration/expected/test_SiteSearch_AllSites__CustomVariables.getCustomVariables_month.xml
+++ b/tests/PHPUnit/System/expected/test_SiteSearch_AllSites__CustomVariables.getCustomVariables_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_SiteSearch_CustomVariables.getCustomVariables_firstSite_lastN__API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_SiteSearch_CustomVariables.getCustomVariables_firstSite_lastN__API.getProcessedReport_day.xml
index 349f30ef0e..349f30ef0e 100644
--- a/tests/PHPUnit/Integration/expected/test_SiteSearch_CustomVariables.getCustomVariables_firstSite_lastN__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_SiteSearch_CustomVariables.getCustomVariables_firstSite_lastN__API.getProcessedReport_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_SiteSearch_CustomVariables.getCustomVariables_firstSite_lastN__API.getProcessedReport_month.xml b/tests/PHPUnit/System/expected/test_SiteSearch_CustomVariables.getCustomVariables_firstSite_lastN__API.getProcessedReport_month.xml
index d2c8572231..d2c8572231 100644
--- a/tests/PHPUnit/Integration/expected/test_SiteSearch_CustomVariables.getCustomVariables_firstSite_lastN__API.getProcessedReport_month.xml
+++ b/tests/PHPUnit/System/expected/test_SiteSearch_CustomVariables.getCustomVariables_firstSite_lastN__API.getProcessedReport_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_SiteSearch_NotLastNPeriods__Actions.getPageTitlesFollowingSiteSearch_day.xml b/tests/PHPUnit/System/expected/test_SiteSearch_NotLastNPeriods__Actions.getPageTitlesFollowingSiteSearch_day.xml
index 66f8e8a41d..66f8e8a41d 100644
--- a/tests/PHPUnit/Integration/expected/test_SiteSearch_NotLastNPeriods__Actions.getPageTitlesFollowingSiteSearch_day.xml
+++ b/tests/PHPUnit/System/expected/test_SiteSearch_NotLastNPeriods__Actions.getPageTitlesFollowingSiteSearch_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_SiteSearch_NotLastNPeriods__Actions.getPageTitlesFollowingSiteSearch_month.xml b/tests/PHPUnit/System/expected/test_SiteSearch_NotLastNPeriods__Actions.getPageTitlesFollowingSiteSearch_month.xml
index 450ab9b87a..450ab9b87a 100644
--- a/tests/PHPUnit/Integration/expected/test_SiteSearch_NotLastNPeriods__Actions.getPageTitlesFollowingSiteSearch_month.xml
+++ b/tests/PHPUnit/System/expected/test_SiteSearch_NotLastNPeriods__Actions.getPageTitlesFollowingSiteSearch_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_SiteSearch_NotLastNPeriods__Actions.getPageTitles_day.xml b/tests/PHPUnit/System/expected/test_SiteSearch_NotLastNPeriods__Actions.getPageTitles_day.xml
index 200b1c3565..200b1c3565 100644
--- a/tests/PHPUnit/Integration/expected/test_SiteSearch_NotLastNPeriods__Actions.getPageTitles_day.xml
+++ b/tests/PHPUnit/System/expected/test_SiteSearch_NotLastNPeriods__Actions.getPageTitles_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_SiteSearch_NotLastNPeriods__Actions.getPageTitles_month.xml b/tests/PHPUnit/System/expected/test_SiteSearch_NotLastNPeriods__Actions.getPageTitles_month.xml
index 3adcd2fca8..3adcd2fca8 100644
--- a/tests/PHPUnit/Integration/expected/test_SiteSearch_NotLastNPeriods__Actions.getPageTitles_month.xml
+++ b/tests/PHPUnit/System/expected/test_SiteSearch_NotLastNPeriods__Actions.getPageTitles_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_SiteSearch_NotLastNPeriods__Actions.getPageUrlsFollowingSiteSearch_day.xml b/tests/PHPUnit/System/expected/test_SiteSearch_NotLastNPeriods__Actions.getPageUrlsFollowingSiteSearch_day.xml
index 3fbf138c64..3fbf138c64 100644
--- a/tests/PHPUnit/Integration/expected/test_SiteSearch_NotLastNPeriods__Actions.getPageUrlsFollowingSiteSearch_day.xml
+++ b/tests/PHPUnit/System/expected/test_SiteSearch_NotLastNPeriods__Actions.getPageUrlsFollowingSiteSearch_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_SiteSearch_NotLastNPeriods__Actions.getPageUrlsFollowingSiteSearch_month.xml b/tests/PHPUnit/System/expected/test_SiteSearch_NotLastNPeriods__Actions.getPageUrlsFollowingSiteSearch_month.xml
index 77a97cfa0b..77a97cfa0b 100644
--- a/tests/PHPUnit/Integration/expected/test_SiteSearch_NotLastNPeriods__Actions.getPageUrlsFollowingSiteSearch_month.xml
+++ b/tests/PHPUnit/System/expected/test_SiteSearch_NotLastNPeriods__Actions.getPageUrlsFollowingSiteSearch_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_SiteSearch_NotLastNPeriods__Actions.getPageUrls_day.xml b/tests/PHPUnit/System/expected/test_SiteSearch_NotLastNPeriods__Actions.getPageUrls_day.xml
index f709bef598..f709bef598 100644
--- a/tests/PHPUnit/Integration/expected/test_SiteSearch_NotLastNPeriods__Actions.getPageUrls_day.xml
+++ b/tests/PHPUnit/System/expected/test_SiteSearch_NotLastNPeriods__Actions.getPageUrls_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_SiteSearch_NotLastNPeriods__Actions.getPageUrls_month.xml b/tests/PHPUnit/System/expected/test_SiteSearch_NotLastNPeriods__Actions.getPageUrls_month.xml
index a7eeb309c9..a7eeb309c9 100644
--- a/tests/PHPUnit/Integration/expected/test_SiteSearch_NotLastNPeriods__Actions.getPageUrls_month.xml
+++ b/tests/PHPUnit/System/expected/test_SiteSearch_NotLastNPeriods__Actions.getPageUrls_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_SiteSearch_NotLastNPeriods__Actions.getSiteSearchCategories_day.xml b/tests/PHPUnit/System/expected/test_SiteSearch_NotLastNPeriods__Actions.getSiteSearchCategories_day.xml
index 4dc5305623..4dc5305623 100644
--- a/tests/PHPUnit/Integration/expected/test_SiteSearch_NotLastNPeriods__Actions.getSiteSearchCategories_day.xml
+++ b/tests/PHPUnit/System/expected/test_SiteSearch_NotLastNPeriods__Actions.getSiteSearchCategories_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_SiteSearch_NotLastNPeriods__Actions.getSiteSearchCategories_month.xml b/tests/PHPUnit/System/expected/test_SiteSearch_NotLastNPeriods__Actions.getSiteSearchCategories_month.xml
index 26395c7055..26395c7055 100644
--- a/tests/PHPUnit/Integration/expected/test_SiteSearch_NotLastNPeriods__Actions.getSiteSearchCategories_month.xml
+++ b/tests/PHPUnit/System/expected/test_SiteSearch_NotLastNPeriods__Actions.getSiteSearchCategories_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_SiteSearch_NotLastNPeriods__Actions.getSiteSearchKeywords_day.xml b/tests/PHPUnit/System/expected/test_SiteSearch_NotLastNPeriods__Actions.getSiteSearchKeywords_day.xml
index 588feafeea..588feafeea 100644
--- a/tests/PHPUnit/Integration/expected/test_SiteSearch_NotLastNPeriods__Actions.getSiteSearchKeywords_day.xml
+++ b/tests/PHPUnit/System/expected/test_SiteSearch_NotLastNPeriods__Actions.getSiteSearchKeywords_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_SiteSearch_NotLastNPeriods__Actions.getSiteSearchKeywords_month.xml b/tests/PHPUnit/System/expected/test_SiteSearch_NotLastNPeriods__Actions.getSiteSearchKeywords_month.xml
index 3e1015bd31..3e1015bd31 100644
--- a/tests/PHPUnit/Integration/expected/test_SiteSearch_NotLastNPeriods__Actions.getSiteSearchKeywords_month.xml
+++ b/tests/PHPUnit/System/expected/test_SiteSearch_NotLastNPeriods__Actions.getSiteSearchKeywords_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_SiteSearch_NotLastNPeriods__Actions.getSiteSearchNoResultKeywords_day.xml b/tests/PHPUnit/System/expected/test_SiteSearch_NotLastNPeriods__Actions.getSiteSearchNoResultKeywords_day.xml
index 7eb0674f50..7eb0674f50 100644
--- a/tests/PHPUnit/Integration/expected/test_SiteSearch_NotLastNPeriods__Actions.getSiteSearchNoResultKeywords_day.xml
+++ b/tests/PHPUnit/System/expected/test_SiteSearch_NotLastNPeriods__Actions.getSiteSearchNoResultKeywords_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_SiteSearch_NotLastNPeriods__Actions.getSiteSearchNoResultKeywords_month.xml b/tests/PHPUnit/System/expected/test_SiteSearch_NotLastNPeriods__Actions.getSiteSearchNoResultKeywords_month.xml
index f1569434b4..f1569434b4 100644
--- a/tests/PHPUnit/Integration/expected/test_SiteSearch_NotLastNPeriods__Actions.getSiteSearchNoResultKeywords_month.xml
+++ b/tests/PHPUnit/System/expected/test_SiteSearch_NotLastNPeriods__Actions.getSiteSearchNoResultKeywords_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_SiteSearch_NotLastNPeriods__Actions.get_day.xml b/tests/PHPUnit/System/expected/test_SiteSearch_NotLastNPeriods__Actions.get_day.xml
index f125336842..f125336842 100644
--- a/tests/PHPUnit/Integration/expected/test_SiteSearch_NotLastNPeriods__Actions.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_SiteSearch_NotLastNPeriods__Actions.get_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_SiteSearch_NotLastNPeriods__Actions.get_month.xml b/tests/PHPUnit/System/expected/test_SiteSearch_NotLastNPeriods__Actions.get_month.xml
index 9d598b649a..9d598b649a 100644
--- a/tests/PHPUnit/Integration/expected/test_SiteSearch_NotLastNPeriods__Actions.get_month.xml
+++ b/tests/PHPUnit/System/expected/test_SiteSearch_NotLastNPeriods__Actions.get_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_SiteSearch_NotLastNPeriods__CustomVariables.getCustomVariables_day.xml b/tests/PHPUnit/System/expected/test_SiteSearch_NotLastNPeriods__CustomVariables.getCustomVariables_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_SiteSearch_NotLastNPeriods__CustomVariables.getCustomVariables_day.xml
+++ b/tests/PHPUnit/System/expected/test_SiteSearch_NotLastNPeriods__CustomVariables.getCustomVariables_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_SiteSearch_NotLastNPeriods__CustomVariables.getCustomVariables_month.xml b/tests/PHPUnit/System/expected/test_SiteSearch_NotLastNPeriods__CustomVariables.getCustomVariables_month.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_SiteSearch_NotLastNPeriods__CustomVariables.getCustomVariables_month.xml
+++ b/tests/PHPUnit/System/expected/test_SiteSearch_NotLastNPeriods__CustomVariables.getCustomVariables_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TimezonesTest__Live.getLastVisitsDetails_day.xml b/tests/PHPUnit/System/expected/test_TimezonesTest__Live.getLastVisitsDetails_day.xml
index c828bbb0e6..c828bbb0e6 100644
--- a/tests/PHPUnit/Integration/expected/test_TimezonesTest__Live.getLastVisitsDetails_day.xml
+++ b/tests/PHPUnit/System/expected/test_TimezonesTest__Live.getLastVisitsDetails_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TimezonesTest_dayAfterVisit__VisitsSummary.get_day.xml b/tests/PHPUnit/System/expected/test_TimezonesTest_dayAfterVisit__VisitsSummary.get_day.xml
index 32b66284be..32b66284be 100644
--- a/tests/PHPUnit/Integration/expected/test_TimezonesTest_dayAfterVisit__VisitsSummary.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_TimezonesTest_dayAfterVisit__VisitsSummary.get_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TimezonesTest_withVisit__VisitsSummary.get_day.xml b/tests/PHPUnit/System/expected/test_TimezonesTest_withVisit__VisitsSummary.get_day.xml
index b0e66b9280..b0e66b9280 100644
--- a/tests/PHPUnit/Integration/expected/test_TimezonesTest_withVisit__VisitsSummary.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_TimezonesTest_withVisit__VisitsSummary.get_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TrackerWindowLookBack__VisitsSummary.getVisits_range.xml b/tests/PHPUnit/System/expected/test_TrackerWindowLookBack__VisitsSummary.getVisits_range.xml
index 5fec83d011..5fec83d011 100644
--- a/tests/PHPUnit/Integration/expected/test_TrackerWindowLookBack__VisitsSummary.getVisits_range.xml
+++ b/tests/PHPUnit/System/expected/test_TrackerWindowLookBack__VisitsSummary.getVisits_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_Transitions__Transitions.getTransitionsForPageUrl_day.xml b/tests/PHPUnit/System/expected/test_Transitions__Transitions.getTransitionsForPageUrl_day.xml
index 55793129f6..55793129f6 100644
--- a/tests/PHPUnit/Integration/expected/test_Transitions__Transitions.getTransitionsForPageUrl_day.xml
+++ b/tests/PHPUnit/System/expected/test_Transitions__Transitions.getTransitionsForPageUrl_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_Transitions__Transitions.getTransitionsForPageUrl_month.xml b/tests/PHPUnit/System/expected/test_Transitions__Transitions.getTransitionsForPageUrl_month.xml
index 5ed9538508..5ed9538508 100644
--- a/tests/PHPUnit/Integration/expected/test_Transitions__Transitions.getTransitionsForPageUrl_month.xml
+++ b/tests/PHPUnit/System/expected/test_Transitions__Transitions.getTransitionsForPageUrl_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_Transitions_noData__Transitions.getTransitionsForPageTitle_day.xml b/tests/PHPUnit/System/expected/test_Transitions_noData__Transitions.getTransitionsForPageTitle_day.xml
index a0995fa6e9..a0995fa6e9 100644
--- a/tests/PHPUnit/Integration/expected/test_Transitions_noData__Transitions.getTransitionsForPageTitle_day.xml
+++ b/tests/PHPUnit/System/expected/test_Transitions_noData__Transitions.getTransitionsForPageTitle_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_Transitions_noData__Transitions.getTransitionsForPageTitle_month.xml b/tests/PHPUnit/System/expected/test_Transitions_noData__Transitions.getTransitionsForPageTitle_month.xml
index a0995fa6e9..a0995fa6e9 100644
--- a/tests/PHPUnit/Integration/expected/test_Transitions_noData__Transitions.getTransitionsForPageTitle_month.xml
+++ b/tests/PHPUnit/System/expected/test_Transitions_noData__Transitions.getTransitionsForPageTitle_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_Transitions_noData__Transitions.getTransitionsForPageUrl_day.xml b/tests/PHPUnit/System/expected/test_Transitions_noData__Transitions.getTransitionsForPageUrl_day.xml
index a0995fa6e9..a0995fa6e9 100644
--- a/tests/PHPUnit/Integration/expected/test_Transitions_noData__Transitions.getTransitionsForPageUrl_day.xml
+++ b/tests/PHPUnit/System/expected/test_Transitions_noData__Transitions.getTransitionsForPageUrl_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_Transitions_noData__Transitions.getTransitionsForPageUrl_month.xml b/tests/PHPUnit/System/expected/test_Transitions_noData__Transitions.getTransitionsForPageUrl_month.xml
index a0995fa6e9..a0995fa6e9 100644
--- a/tests/PHPUnit/Integration/expected/test_Transitions_noData__Transitions.getTransitionsForPageUrl_month.xml
+++ b/tests/PHPUnit/System/expected/test_Transitions_noData__Transitions.getTransitionsForPageUrl_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_Transitions_noLimit__Transitions.getTransitionsForPageTitle_day.xml b/tests/PHPUnit/System/expected/test_Transitions_noLimit__Transitions.getTransitionsForPageTitle_day.xml
index 380f8c0fe5..380f8c0fe5 100644
--- a/tests/PHPUnit/Integration/expected/test_Transitions_noLimit__Transitions.getTransitionsForPageTitle_day.xml
+++ b/tests/PHPUnit/System/expected/test_Transitions_noLimit__Transitions.getTransitionsForPageTitle_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_Transitions_noLimit__Transitions.getTransitionsForPageTitle_month.xml b/tests/PHPUnit/System/expected/test_Transitions_noLimit__Transitions.getTransitionsForPageTitle_month.xml
index 2e262a752e..2e262a752e 100644
--- a/tests/PHPUnit/Integration/expected/test_Transitions_noLimit__Transitions.getTransitionsForPageTitle_month.xml
+++ b/tests/PHPUnit/System/expected/test_Transitions_noLimit__Transitions.getTransitionsForPageTitle_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_Transitions_noLimit__Transitions.getTransitionsForPageUrl_day.xml b/tests/PHPUnit/System/expected/test_Transitions_noLimit__Transitions.getTransitionsForPageUrl_day.xml
index f69f385cb8..f69f385cb8 100644
--- a/tests/PHPUnit/Integration/expected/test_Transitions_noLimit__Transitions.getTransitionsForPageUrl_day.xml
+++ b/tests/PHPUnit/System/expected/test_Transitions_noLimit__Transitions.getTransitionsForPageUrl_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_Transitions_noLimit__Transitions.getTransitionsForPageUrl_month.xml b/tests/PHPUnit/System/expected/test_Transitions_noLimit__Transitions.getTransitionsForPageUrl_month.xml
index 8a14c26ccf..8a14c26ccf 100644
--- a/tests/PHPUnit/Integration/expected/test_Transitions_noLimit__Transitions.getTransitionsForPageUrl_month.xml
+++ b/tests/PHPUnit/System/expected/test_Transitions_noLimit__Transitions.getTransitionsForPageUrl_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Actions.getOutlinks_firstSite_lastN__API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Actions.getOutlinks_firstSite_lastN__API.getProcessedReport_day.xml
index 85885d4462..85885d4462 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Actions.getOutlinks_firstSite_lastN__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Actions.getOutlinks_firstSite_lastN__API.getProcessedReport_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Actions.getPageTitles_firstSite_lastN__API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Actions.getPageTitles_firstSite_lastN__API.getProcessedReport_day.xml
index 7d8be22272..7d8be22272 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Actions.getPageTitles_firstSite_lastN__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Actions.getPageTitles_firstSite_lastN__API.getProcessedReport_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Actions.getPageUrls_firstSite_lastN__API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Actions.getPageUrls_firstSite_lastN__API.getProcessedReport_day.xml
index dfccc81659..dfccc81659 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Actions.getPageUrls_firstSite_lastN__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Actions.getPageUrls_firstSite_lastN__API.getProcessedReport_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_disabledAfter__VisitsSummary.get_day.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_disabledAfter__VisitsSummary.get_day.xml
index 89cd627339..89cd627339 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_disabledAfter__VisitsSummary.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_disabledAfter__VisitsSummary.get_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_disabledAfter__VisitsSummary.get_month.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_disabledAfter__VisitsSummary.get_month.xml
index 50c77f2755..50c77f2755 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_disabledAfter__VisitsSummary.get_month.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_disabledAfter__VisitsSummary.get_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_disabledAfter__VisitsSummary.get_week.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_disabledAfter__VisitsSummary.get_week.xml
index 89cd627339..89cd627339 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_disabledAfter__VisitsSummary.get_week.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_disabledAfter__VisitsSummary.get_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_disabledAfter__VisitsSummary.get_year.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_disabledAfter__VisitsSummary.get_year.xml
index f520263652..f520263652 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_disabledAfter__VisitsSummary.get_year.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_disabledAfter__VisitsSummary.get_year.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_disabledBefore__VisitsSummary.get_day.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_disabledBefore__VisitsSummary.get_day.xml
index 1c7f2179e5..1c7f2179e5 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_disabledBefore__VisitsSummary.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_disabledBefore__VisitsSummary.get_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_disabledBefore__VisitsSummary.get_month.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_disabledBefore__VisitsSummary.get_month.xml
index 1c7f2179e5..1c7f2179e5 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_disabledBefore__VisitsSummary.get_month.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_disabledBefore__VisitsSummary.get_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_disabledBefore__VisitsSummary.get_week.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_disabledBefore__VisitsSummary.get_week.xml
index 1c7f2179e5..1c7f2179e5 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_disabledBefore__VisitsSummary.get_week.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_disabledBefore__VisitsSummary.get_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_disabledBefore__VisitsSummary.get_year.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_disabledBefore__VisitsSummary.get_year.xml
index 1c7f2179e5..1c7f2179e5 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_disabledBefore__VisitsSummary.get_year.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_disabledBefore__VisitsSummary.get_year.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_disabledBefore_isDateRange__VisitsSummary.get_range.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_disabledBefore_isDateRange__VisitsSummary.get_range.xml
index f520263652..f520263652 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_disabledBefore_isDateRange__VisitsSummary.get_range.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_disabledBefore_isDateRange__VisitsSummary.get_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_enabledBefore_isDateRange__VisitsSummary.get_range.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_enabledBefore_isDateRange__VisitsSummary.get_range.xml
index f520263652..f520263652 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_enabledBefore_isDateRange__VisitsSummary.get_range.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_enabledBefore_isDateRange__VisitsSummary.get_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_enabled__VisitsSummary.get_day.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_enabled__VisitsSummary.get_day.xml
index 89cd627339..89cd627339 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_enabled__VisitsSummary.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_enabled__VisitsSummary.get_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_enabled__VisitsSummary.get_month.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_enabled__VisitsSummary.get_month.xml
index 50c77f2755..50c77f2755 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_enabled__VisitsSummary.get_month.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_enabled__VisitsSummary.get_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_enabled__VisitsSummary.get_week.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_enabled__VisitsSummary.get_week.xml
index 89cd627339..89cd627339 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_enabled__VisitsSummary.get_week.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_enabled__VisitsSummary.get_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_enabled__VisitsSummary.get_year.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_enabled__VisitsSummary.get_year.xml
index f520263652..f520263652 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_enabled__VisitsSummary.get_year.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_ArchivingDisabled_enabled__VisitsSummary.get_year.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_Goals.getDaysToConversion_firstSite_lastN__API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_Goals.getDaysToConversion_firstSite_lastN__API.getProcessedReport_day.xml
index 5518322f9d..5518322f9d 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_Goals.getDaysToConversion_firstSite_lastN__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_Goals.getDaysToConversion_firstSite_lastN__API.getProcessedReport_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_MultiSites.getAll_firstSite_lastN__API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_MultiSites.getAll_firstSite_lastN__API.getProcessedReport_day.xml
index 31f9f11927..31f9f11927 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_MultiSites.getAll_firstSite_lastN__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_MultiSites.getAll_firstSite_lastN__API.getProcessedReport_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_NotLastNPeriods__Goals.get_day.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_NotLastNPeriods__Goals.get_day.xml
index 6dc2190ded..6dc2190ded 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_NotLastNPeriods__Goals.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_NotLastNPeriods__Goals.get_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_NotLastNPeriods__Goals.get_month.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_NotLastNPeriods__Goals.get_month.xml
index b22657ae32..b22657ae32 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_NotLastNPeriods__Goals.get_month.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_NotLastNPeriods__Goals.get_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_NotLastNPeriods__VisitsSummary.get_day.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_NotLastNPeriods__VisitsSummary.get_day.xml
index 89cd627339..89cd627339 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_NotLastNPeriods__VisitsSummary.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_NotLastNPeriods__VisitsSummary.get_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_NotLastNPeriods__VisitsSummary.get_month.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_NotLastNPeriods__VisitsSummary.get_month.xml
index 50c77f2755..50c77f2755 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_NotLastNPeriods__VisitsSummary.get_month.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_NotLastNPeriods__VisitsSummary.get_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions__Goals.getDaysToConversion_day.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions__Goals.getDaysToConversion_day.xml
index 6812efd47b..6812efd47b 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions__Goals.getDaysToConversion_day.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions__Goals.getDaysToConversion_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions__Goals.getDaysToConversion_month.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions__Goals.getDaysToConversion_month.xml
index ea5ebdc416..ea5ebdc416 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions__Goals.getDaysToConversion_month.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions__Goals.getDaysToConversion_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions__Goals.getDaysToConversion_week.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions__Goals.getDaysToConversion_week.xml
index e64f82133c..e64f82133c 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions__Goals.getDaysToConversion_week.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions__Goals.getDaysToConversion_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions__Goals.getDaysToConversion_year.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions__Goals.getDaysToConversion_year.xml
index aec231ccd9..aec231ccd9 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions__Goals.getDaysToConversion_year.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions__Goals.getDaysToConversion_year.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions__MultiSites.getAll_day.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions__MultiSites.getAll_day.xml
index cb0f03a1ca..cb0f03a1ca 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions__MultiSites.getAll_day.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions__MultiSites.getAll_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions__MultiSites.getAll_month.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions__MultiSites.getAll_month.xml
index 7abc0f83ec..7abc0f83ec 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions__MultiSites.getAll_month.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions__MultiSites.getAll_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions__MultiSites.getAll_week.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions__MultiSites.getAll_week.xml
index 8283409adb..8283409adb 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions__MultiSites.getAll_week.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions__MultiSites.getAll_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions__MultiSites.getAll_year.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions__MultiSites.getAll_year.xml
index 9feb3bf709..9feb3bf709 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions__MultiSites.getAll_year.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions__MultiSites.getAll_year.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_getMetricsFromDifferentReports__VisitsSummary.get_range.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_getMetricsFromDifferentReports__VisitsSummary.get_range.xml
index 16cafd4926..16cafd4926 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_getMetricsFromDifferentReports__VisitsSummary.get_range.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_getMetricsFromDifferentReports__VisitsSummary.get_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_idSiteOne___Goals.getDaysToConversion_day.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_idSiteOne___Goals.getDaysToConversion_day.xml
index 3028f63bd5..3028f63bd5 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_idSiteOne___Goals.getDaysToConversion_day.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_idSiteOne___Goals.getDaysToConversion_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_idSiteOne___Goals.getDaysToConversion_month.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_idSiteOne___Goals.getDaysToConversion_month.xml
index 4c4cde2aaa..4c4cde2aaa 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_idSiteOne___Goals.getDaysToConversion_month.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_idSiteOne___Goals.getDaysToConversion_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_idSiteOne___Goals.getDaysToConversion_week.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_idSiteOne___Goals.getDaysToConversion_week.xml
index d14e5969a6..d14e5969a6 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_idSiteOne___Goals.getDaysToConversion_week.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_idSiteOne___Goals.getDaysToConversion_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_idSiteOne___Goals.getDaysToConversion_year.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_idSiteOne___Goals.getDaysToConversion_year.xml
index 5b7b43f93c..5b7b43f93c 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_idSiteOne___Goals.getDaysToConversion_year.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_idSiteOne___Goals.getDaysToConversion_year.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_idSiteOne___MultiSites.getAll_day.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_idSiteOne___MultiSites.getAll_day.xml
index cb0f03a1ca..cb0f03a1ca 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_idSiteOne___MultiSites.getAll_day.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_idSiteOne___MultiSites.getAll_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_idSiteOne___MultiSites.getAll_month.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_idSiteOne___MultiSites.getAll_month.xml
index 7abc0f83ec..7abc0f83ec 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_idSiteOne___MultiSites.getAll_month.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_idSiteOne___MultiSites.getAll_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_idSiteOne___MultiSites.getAll_week.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_idSiteOne___MultiSites.getAll_week.xml
index 8283409adb..8283409adb 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_idSiteOne___MultiSites.getAll_week.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_idSiteOne___MultiSites.getAll_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_idSiteOne___MultiSites.getAll_year.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_idSiteOne___MultiSites.getAll_year.xml
index 9feb3bf709..9feb3bf709 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_idSiteOne___MultiSites.getAll_year.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Conversions_idSiteOne___MultiSites.getAll_year.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_NotLastNPeriods__Goals.get_day.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_NotLastNPeriods__Goals.get_day.xml
index 1c7f2179e5..1c7f2179e5 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_NotLastNPeriods__Goals.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_NotLastNPeriods__Goals.get_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_NotLastNPeriods__Goals.get_month.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_NotLastNPeriods__Goals.get_month.xml
index 1c7f2179e5..1c7f2179e5 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_NotLastNPeriods__Goals.get_month.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_NotLastNPeriods__Goals.get_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_NotLastNPeriods__VisitsSummary.get_day.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_NotLastNPeriods__VisitsSummary.get_day.xml
index 296741c7a0..296741c7a0 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_NotLastNPeriods__VisitsSummary.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_NotLastNPeriods__VisitsSummary.get_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_NotLastNPeriods__VisitsSummary.get_month.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_NotLastNPeriods__VisitsSummary.get_month.xml
index 9aa711753b..9aa711753b 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_NotLastNPeriods__VisitsSummary.get_month.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_NotLastNPeriods__VisitsSummary.get_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Referrers.getWebsites_firstSite_lastN__API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Referrers.getWebsites_firstSite_lastN__API.getProcessedReport_day.xml
index b44b46c790..b44b46c790 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_Referrers.getWebsites_firstSite_lastN__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_Referrers.getWebsites_firstSite_lastN__API.getProcessedReport_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_VisitFrequency.get_firstSite_lastN__API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_VisitFrequency.get_firstSite_lastN__API.getProcessedReport_day.xml
index fa28a54c25..fa28a54c25 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_VisitFrequency.get_firstSite_lastN__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_VisitFrequency.get_firstSite_lastN__API.getProcessedReport_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_VisitorInterest.getNumberOfVisitsByDaysSinceLast_firstSite_lastN__API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_VisitorInterest.getNumberOfVisitsByDaysSinceLast_firstSite_lastN__API.getProcessedReport_day.xml
index 0cfdf60b49..0cfdf60b49 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_VisitorInterest.getNumberOfVisitsByDaysSinceLast_firstSite_lastN__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_VisitorInterest.getNumberOfVisitsByDaysSinceLast_firstSite_lastN__API.getProcessedReport_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_VisitsSummary.get_firstSite_lastN__API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_VisitsSummary.get_firstSite_lastN__API.getProcessedReport_day.xml
index 0e48ca569f..0e48ca569f 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_VisitsSummary.get_firstSite_lastN__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_VisitsSummary.get_firstSite_lastN__API.getProcessedReport_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getOutlinks_day.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getOutlinks_day.xml
index 232751d99e..232751d99e 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getOutlinks_day.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getOutlinks_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getOutlinks_month.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getOutlinks_month.xml
index c01baa78e0..c01baa78e0 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getOutlinks_month.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getOutlinks_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getOutlinks_week.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getOutlinks_week.xml
index 42386fd091..42386fd091 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getOutlinks_week.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getOutlinks_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getOutlinks_year.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getOutlinks_year.xml
index 1b66731da4..1b66731da4 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getOutlinks_year.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getOutlinks_year.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageTitle_day.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageTitle_day.xml
index 31cace930f..31cace930f 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageTitle_day.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageTitle_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageTitle_month.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageTitle_month.xml
index 8e94360fea..8e94360fea 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageTitle_month.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageTitle_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageTitle_week.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageTitle_week.xml
index 5138d96b47..5138d96b47 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageTitle_week.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageTitle_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageTitle_year.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageTitle_year.xml
index 8e94360fea..8e94360fea 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageTitle_year.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageTitle_year.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageTitles_day.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageTitles_day.xml
index 41b3ee1ab8..41b3ee1ab8 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageTitles_day.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageTitles_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageTitles_month.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageTitles_month.xml
index d803ad11f9..d803ad11f9 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageTitles_month.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageTitles_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageTitles_week.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageTitles_week.xml
index d04244796f..d04244796f 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageTitles_week.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageTitles_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageTitles_year.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageTitles_year.xml
index 8622de5d82..8622de5d82 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageTitles_year.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageTitles_year.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageUrl_day.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageUrl_day.xml
index baf847ce36..baf847ce36 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageUrl_day.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageUrl_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageUrl_month.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageUrl_month.xml
index 00bb5030af..00bb5030af 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageUrl_month.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageUrl_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageUrl_week.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageUrl_week.xml
index a8fdd76865..a8fdd76865 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageUrl_week.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageUrl_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageUrl_year.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageUrl_year.xml
index 00bb5030af..00bb5030af 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageUrl_year.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageUrl_year.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageUrls_day.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageUrls_day.xml
index eda852deae..eda852deae 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageUrls_day.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageUrls_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageUrls_month.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageUrls_month.xml
index faa058da6b..faa058da6b 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageUrls_month.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageUrls_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageUrls_week.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageUrls_week.xml
index 89ffb01c30..89ffb01c30 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageUrls_week.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageUrls_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageUrls_year.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageUrls_year.xml
index 4bccd4e8bc..4bccd4e8bc 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageUrls_year.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__Actions.getPageUrls_year.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__Referrers.getWebsites_day.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__Referrers.getWebsites_day.xml
index 03e010ff91..03e010ff91 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__Referrers.getWebsites_day.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__Referrers.getWebsites_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__Referrers.getWebsites_month.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__Referrers.getWebsites_month.xml
index aae3dbad27..aae3dbad27 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__Referrers.getWebsites_month.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__Referrers.getWebsites_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__Referrers.getWebsites_week.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__Referrers.getWebsites_week.xml
index 1ba3ef39a1..1ba3ef39a1 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__Referrers.getWebsites_week.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__Referrers.getWebsites_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__Referrers.getWebsites_year.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__Referrers.getWebsites_year.xml
index 81caacb06a..81caacb06a 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__Referrers.getWebsites_year.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__Referrers.getWebsites_year.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__VisitFrequency.get_day.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__VisitFrequency.get_day.xml
index 1132f1191d..1132f1191d 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__VisitFrequency.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__VisitFrequency.get_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__VisitFrequency.get_month.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__VisitFrequency.get_month.xml
index f6da2a541d..f6da2a541d 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__VisitFrequency.get_month.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__VisitFrequency.get_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__VisitFrequency.get_week.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__VisitFrequency.get_week.xml
index d64e929e8a..d64e929e8a 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__VisitFrequency.get_week.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__VisitFrequency.get_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__VisitFrequency.get_year.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__VisitFrequency.get_year.xml
index dd6204a199..dd6204a199 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__VisitFrequency.get_year.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__VisitFrequency.get_year.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__VisitorInterest.getNumberOfVisitsByDaysSinceLast_day.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__VisitorInterest.getNumberOfVisitsByDaysSinceLast_day.xml
index 0bc2b88f8f..0bc2b88f8f 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__VisitorInterest.getNumberOfVisitsByDaysSinceLast_day.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__VisitorInterest.getNumberOfVisitsByDaysSinceLast_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__VisitorInterest.getNumberOfVisitsByDaysSinceLast_month.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__VisitorInterest.getNumberOfVisitsByDaysSinceLast_month.xml
index 16113a3774..16113a3774 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__VisitorInterest.getNumberOfVisitsByDaysSinceLast_month.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__VisitorInterest.getNumberOfVisitsByDaysSinceLast_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__VisitorInterest.getNumberOfVisitsByDaysSinceLast_week.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__VisitorInterest.getNumberOfVisitsByDaysSinceLast_week.xml
index 7595c2461e..7595c2461e 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__VisitorInterest.getNumberOfVisitsByDaysSinceLast_week.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__VisitorInterest.getNumberOfVisitsByDaysSinceLast_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__VisitorInterest.getNumberOfVisitsByDaysSinceLast_year.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__VisitorInterest.getNumberOfVisitsByDaysSinceLast_year.xml
index 59903493cd..59903493cd 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__VisitorInterest.getNumberOfVisitsByDaysSinceLast_year.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__VisitorInterest.getNumberOfVisitsByDaysSinceLast_year.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__VisitsSummary.get_day.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__VisitsSummary.get_day.xml
index c0f0001ebf..c0f0001ebf 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__VisitsSummary.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__VisitsSummary.get_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__VisitsSummary.get_month.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__VisitsSummary.get_month.xml
index d60436c3c9..d60436c3c9 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__VisitsSummary.get_month.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__VisitsSummary.get_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__VisitsSummary.get_week.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__VisitsSummary.get_week.xml
index f754acd177..f754acd177 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__VisitsSummary.get_week.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__VisitsSummary.get_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__VisitsSummary.get_year.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__VisitsSummary.get_year.xml
index 301adee7ee..301adee7ee 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays__VisitsSummary.get_year.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays__VisitsSummary.get_year.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getOutlinks_day.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getOutlinks_day.xml
index d1ed3007ac..d1ed3007ac 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getOutlinks_day.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getOutlinks_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getOutlinks_month.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getOutlinks_month.xml
index e1456fb1fb..e1456fb1fb 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getOutlinks_month.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getOutlinks_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getOutlinks_week.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getOutlinks_week.xml
index 09097240f3..09097240f3 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getOutlinks_week.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getOutlinks_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getOutlinks_year.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getOutlinks_year.xml
index 6996352bad..6996352bad 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getOutlinks_year.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getOutlinks_year.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageTitle_day.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageTitle_day.xml
index eaed13c9ae..eaed13c9ae 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageTitle_day.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageTitle_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageTitle_month.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageTitle_month.xml
index 4e3e4c0a67..4e3e4c0a67 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageTitle_month.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageTitle_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageTitle_week.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageTitle_week.xml
index fe4e40c5bc..fe4e40c5bc 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageTitle_week.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageTitle_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageTitle_year.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageTitle_year.xml
index aa7f84dbc7..aa7f84dbc7 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageTitle_year.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageTitle_year.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageTitles_day.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageTitles_day.xml
index 9f120e0ee0..9f120e0ee0 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageTitles_day.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageTitles_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageTitles_month.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageTitles_month.xml
index 7b53ef8a32..7b53ef8a32 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageTitles_month.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageTitles_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageTitles_week.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageTitles_week.xml
index c8f777c165..c8f777c165 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageTitles_week.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageTitles_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageTitles_year.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageTitles_year.xml
index 0d8b62b451..0d8b62b451 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageTitles_year.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageTitles_year.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageUrl_day.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageUrl_day.xml
index b5ee40f53b..b5ee40f53b 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageUrl_day.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageUrl_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageUrl_month.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageUrl_month.xml
index b12b6dbe6a..b12b6dbe6a 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageUrl_month.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageUrl_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageUrl_week.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageUrl_week.xml
index 3227ff9c6a..3227ff9c6a 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageUrl_week.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageUrl_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageUrl_year.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageUrl_year.xml
index 071c0d3fa2..071c0d3fa2 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageUrl_year.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageUrl_year.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageUrls_day.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageUrls_day.xml
index efb03f5be4..efb03f5be4 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageUrls_day.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageUrls_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageUrls_month.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageUrls_month.xml
index 56e3fc8c35..56e3fc8c35 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageUrls_month.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageUrls_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageUrls_week.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageUrls_week.xml
index 7d086860eb..7d086860eb 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageUrls_week.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageUrls_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageUrls_year.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageUrls_year.xml
index 284466a853..284466a853 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageUrls_year.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Actions.getPageUrls_year.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Referrers.getWebsites_day.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Referrers.getWebsites_day.xml
index 1a10c7ba69..1a10c7ba69 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Referrers.getWebsites_day.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Referrers.getWebsites_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Referrers.getWebsites_month.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Referrers.getWebsites_month.xml
index 2be1501d3c..2be1501d3c 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Referrers.getWebsites_month.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Referrers.getWebsites_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Referrers.getWebsites_week.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Referrers.getWebsites_week.xml
index c0579730ef..c0579730ef 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Referrers.getWebsites_week.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Referrers.getWebsites_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Referrers.getWebsites_year.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Referrers.getWebsites_year.xml
index 76f90bbf1d..76f90bbf1d 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Referrers.getWebsites_year.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___Referrers.getWebsites_year.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___VisitFrequency.get_day.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___VisitFrequency.get_day.xml
index f760097ff0..f760097ff0 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___VisitFrequency.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___VisitFrequency.get_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___VisitFrequency.get_month.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___VisitFrequency.get_month.xml
index ddce4b63c9..ddce4b63c9 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___VisitFrequency.get_month.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___VisitFrequency.get_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___VisitFrequency.get_week.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___VisitFrequency.get_week.xml
index d44fe0f184..d44fe0f184 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___VisitFrequency.get_week.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___VisitFrequency.get_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___VisitFrequency.get_year.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___VisitFrequency.get_year.xml
index a7e7659d80..a7e7659d80 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___VisitFrequency.get_year.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___VisitFrequency.get_year.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___VisitorInterest.getNumberOfVisitsByDaysSinceLast_day.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___VisitorInterest.getNumberOfVisitsByDaysSinceLast_day.xml
index c5d48206a0..c5d48206a0 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___VisitorInterest.getNumberOfVisitsByDaysSinceLast_day.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___VisitorInterest.getNumberOfVisitsByDaysSinceLast_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___VisitorInterest.getNumberOfVisitsByDaysSinceLast_month.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___VisitorInterest.getNumberOfVisitsByDaysSinceLast_month.xml
index 617d79b103..617d79b103 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___VisitorInterest.getNumberOfVisitsByDaysSinceLast_month.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___VisitorInterest.getNumberOfVisitsByDaysSinceLast_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___VisitorInterest.getNumberOfVisitsByDaysSinceLast_week.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___VisitorInterest.getNumberOfVisitsByDaysSinceLast_week.xml
index d657c3bad5..d657c3bad5 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___VisitorInterest.getNumberOfVisitsByDaysSinceLast_week.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___VisitorInterest.getNumberOfVisitsByDaysSinceLast_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___VisitorInterest.getNumberOfVisitsByDaysSinceLast_year.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___VisitorInterest.getNumberOfVisitsByDaysSinceLast_year.xml
index 491a6fce6e..491a6fce6e 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___VisitorInterest.getNumberOfVisitsByDaysSinceLast_year.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___VisitorInterest.getNumberOfVisitsByDaysSinceLast_year.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___VisitsSummary.get_day.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___VisitsSummary.get_day.xml
index 057ccb1b63..057ccb1b63 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___VisitsSummary.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___VisitsSummary.get_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___VisitsSummary.get_month.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___VisitsSummary.get_month.xml
index 30c69614b1..30c69614b1 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___VisitsSummary.get_month.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___VisitsSummary.get_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___VisitsSummary.get_week.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___VisitsSummary.get_week.xml
index bb7f2a5509..bb7f2a5509 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___VisitsSummary.get_week.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___VisitsSummary.get_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___VisitsSummary.get_year.xml b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___VisitsSummary.get_year.xml
index 10e5329cb6..10e5329cb6 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___VisitsSummary.get_year.xml
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_idSiteOne___VisitsSummary.get_year.xml
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_csv__ScheduledReports.generateReport_month.original.csv b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_csv__ScheduledReports.generateReport_month.original.csv
index 07c7ec672a..07c7ec672a 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_csv__ScheduledReports.generateReport_month.original.csv
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_csv__ScheduledReports.generateReport_month.original.csv
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_html_row_evolution_graph__ScheduledReports.generateReport_month.original.html b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_html_row_evolution_graph__ScheduledReports.generateReport_month.original.html
index 828f15f4aa..828f15f4aa 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_html_row_evolution_graph__ScheduledReports.generateReport_month.original.html
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_html_row_evolution_graph__ScheduledReports.generateReport_month.original.html
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_html_tables_and_graph__ScheduledReports.generateReport_month.original.html b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_html_tables_and_graph__ScheduledReports.generateReport_month.original.html
index 13e6b06675..13e6b06675 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_html_tables_and_graph__ScheduledReports.generateReport_month.original.html
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_html_tables_and_graph__ScheduledReports.generateReport_month.original.html
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_html_tables_only__ScheduledReports.generateReport_month.original.html b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_html_tables_only__ScheduledReports.generateReport_month.original.html
index 23ee22f516..23ee22f516 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_html_tables_only__ScheduledReports.generateReport_month.original.html
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_html_tables_only__ScheduledReports.generateReport_month.original.html
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_pdf_tables_only__ScheduledReports.generateReport_month.original.pdf b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_pdf_tables_only__ScheduledReports.generateReport_month.original.pdf
index 1fbdd629d8..1fbdd629d8 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_pdf_tables_only__ScheduledReports.generateReport_month.original.pdf
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_pdf_tables_only__ScheduledReports.generateReport_month.original.pdf
Binary files differ
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_via_sms_all_sites__ScheduledReports.generateReport_month.original.sms.txt b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_via_sms_all_sites__ScheduledReports.generateReport_month.original.sms.txt
index dd8d8a31dd..dd8d8a31dd 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_via_sms_all_sites__ScheduledReports.generateReport_month.original.sms.txt
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_via_sms_all_sites__ScheduledReports.generateReport_month.original.sms.txt
diff --git a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_via_sms_one_site__ScheduledReports.generateReport_month.original.sms.txt b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_via_sms_one_site__ScheduledReports.generateReport_month.original.sms.txt
index 176db1187b..176db1187b 100644
--- a/tests/PHPUnit/Integration/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_via_sms_one_site__ScheduledReports.generateReport_month.original.sms.txt
+++ b/tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_via_sms_one_site__ScheduledReports.generateReport_month.original.sms.txt
diff --git a/tests/PHPUnit/Integration/expected/test_UrlNormalization_keywords__Referrers.getKeywordsForPageUrl_day.xml b/tests/PHPUnit/System/expected/test_UrlNormalization_keywords__Referrers.getKeywordsForPageUrl_day.xml
index 2c2c9551a8..2c2c9551a8 100644
--- a/tests/PHPUnit/Integration/expected/test_UrlNormalization_keywords__Referrers.getKeywordsForPageUrl_day.xml
+++ b/tests/PHPUnit/System/expected/test_UrlNormalization_keywords__Referrers.getKeywordsForPageUrl_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_UrlNormalization_pagesSegmentedRef__Actions.getPageUrls_day.xml b/tests/PHPUnit/System/expected/test_UrlNormalization_pagesSegmentedRef__Actions.getPageUrls_day.xml
index bbb576d7a5..bbb576d7a5 100644
--- a/tests/PHPUnit/Integration/expected/test_UrlNormalization_pagesSegmentedRef__Actions.getPageUrls_day.xml
+++ b/tests/PHPUnit/System/expected/test_UrlNormalization_pagesSegmentedRef__Actions.getPageUrls_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_UrlNormalization_pagesSegmented__Actions.getPageUrls_day.xml b/tests/PHPUnit/System/expected/test_UrlNormalization_pagesSegmented__Actions.getPageUrls_day.xml
index 2d5f40e9cb..2d5f40e9cb 100644
--- a/tests/PHPUnit/Integration/expected/test_UrlNormalization_pagesSegmented__Actions.getPageUrls_day.xml
+++ b/tests/PHPUnit/System/expected/test_UrlNormalization_pagesSegmented__Actions.getPageUrls_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_UrlNormalization_titles__Actions.getPageTitles_day.xml b/tests/PHPUnit/System/expected/test_UrlNormalization_titles__Actions.getPageTitles_day.xml
index 564a6ae28f..564a6ae28f 100644
--- a/tests/PHPUnit/Integration/expected/test_UrlNormalization_titles__Actions.getPageTitles_day.xml
+++ b/tests/PHPUnit/System/expected/test_UrlNormalization_titles__Actions.getPageTitles_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_UrlNormalization_urls__Actions.getPageUrls_day.xml b/tests/PHPUnit/System/expected/test_UrlNormalization_urls__Actions.getPageUrls_day.xml
index bbb576d7a5..bbb576d7a5 100644
--- a/tests/PHPUnit/Integration/expected/test_UrlNormalization_urls__Actions.getPageUrls_day.xml
+++ b/tests/PHPUnit/System/expected/test_UrlNormalization_urls__Actions.getPageUrls_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_UserId_VisitorId__Live.getLastVisitsDetails_month.xml b/tests/PHPUnit/System/expected/test_UserId_VisitorId__Live.getLastVisitsDetails_month.xml
index cc28b360a0..cc28b360a0 100644
--- a/tests/PHPUnit/Integration/expected/test_UserId_VisitorId__Live.getLastVisitsDetails_month.xml
+++ b/tests/PHPUnit/System/expected/test_UserId_VisitorId__Live.getLastVisitsDetails_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_UserId_VisitorId__VisitsSummary.getUsers_day.xml b/tests/PHPUnit/System/expected/test_UserId_VisitorId__VisitsSummary.getUsers_day.xml
index 13002b2017..13002b2017 100644
--- a/tests/PHPUnit/Integration/expected/test_UserId_VisitorId__VisitsSummary.getUsers_day.xml
+++ b/tests/PHPUnit/System/expected/test_UserId_VisitorId__VisitsSummary.getUsers_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_UserId_VisitorId__VisitsSummary.getUsers_month.xml b/tests/PHPUnit/System/expected/test_UserId_VisitorId__VisitsSummary.getUsers_month.xml
index 15ef03fb49..15ef03fb49 100644
--- a/tests/PHPUnit/Integration/expected/test_UserId_VisitorId__VisitsSummary.getUsers_month.xml
+++ b/tests/PHPUnit/System/expected/test_UserId_VisitorId__VisitsSummary.getUsers_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_UserId_VisitorId__VisitsSummary.getUsers_week.xml b/tests/PHPUnit/System/expected/test_UserId_VisitorId__VisitsSummary.getUsers_week.xml
index 13002b2017..13002b2017 100644
--- a/tests/PHPUnit/Integration/expected/test_UserId_VisitorId__VisitsSummary.getUsers_week.xml
+++ b/tests/PHPUnit/System/expected/test_UserId_VisitorId__VisitsSummary.getUsers_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_UserId_VisitorId__VisitsSummary.getUsers_year.xml b/tests/PHPUnit/System/expected/test_UserId_VisitorId__VisitsSummary.getUsers_year.xml
index e8e63ff5b6..e8e63ff5b6 100644
--- a/tests/PHPUnit/Integration/expected/test_UserId_VisitorId__VisitsSummary.getUsers_year.xml
+++ b/tests/PHPUnit/System/expected/test_UserId_VisitorId__VisitsSummary.getUsers_year.xml
diff --git a/tests/PHPUnit/Integration/expected/test_UserId_VisitorId__VisitsSummary.get_day.xml b/tests/PHPUnit/System/expected/test_UserId_VisitorId__VisitsSummary.get_day.xml
index ca85e8dede..ca85e8dede 100644
--- a/tests/PHPUnit/Integration/expected/test_UserId_VisitorId__VisitsSummary.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_UserId_VisitorId__VisitsSummary.get_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_UserId_VisitorId__VisitsSummary.get_month.xml b/tests/PHPUnit/System/expected/test_UserId_VisitorId__VisitsSummary.get_month.xml
index 7731535795..7731535795 100644
--- a/tests/PHPUnit/Integration/expected/test_UserId_VisitorId__VisitsSummary.get_month.xml
+++ b/tests/PHPUnit/System/expected/test_UserId_VisitorId__VisitsSummary.get_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_UserId_VisitorId__VisitsSummary.get_week.xml b/tests/PHPUnit/System/expected/test_UserId_VisitorId__VisitsSummary.get_week.xml
index ca85e8dede..ca85e8dede 100644
--- a/tests/PHPUnit/Integration/expected/test_UserId_VisitorId__VisitsSummary.get_week.xml
+++ b/tests/PHPUnit/System/expected/test_UserId_VisitorId__VisitsSummary.get_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_UserId_VisitorId__VisitsSummary.get_year.xml b/tests/PHPUnit/System/expected/test_UserId_VisitorId__VisitsSummary.get_year.xml
index 84850ee827..84850ee827 100644
--- a/tests/PHPUnit/Integration/expected/test_UserId_VisitorId__VisitsSummary.get_year.xml
+++ b/tests/PHPUnit/System/expected/test_UserId_VisitorId__VisitsSummary.get_year.xml
diff --git a/tests/PHPUnit/Integration/expected/test_UserId_VisitorId_invalidSegmentUserId__VisitsSummary.get_day.xml b/tests/PHPUnit/System/expected/test_UserId_VisitorId_invalidSegmentUserId__VisitsSummary.get_day.xml
index 71903c4801..71903c4801 100644
--- a/tests/PHPUnit/Integration/expected/test_UserId_VisitorId_invalidSegmentUserId__VisitsSummary.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_UserId_VisitorId_invalidSegmentUserId__VisitsSummary.get_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_UserId_VisitorId_segmentUserIdAndCartAbandoned_getAbandonedCartItems__Goals.getItemsName_day.xml b/tests/PHPUnit/System/expected/test_UserId_VisitorId_segmentUserIdAndCartAbandoned_getAbandonedCartItems__Goals.getItemsName_day.xml
index 39c7de375f..39c7de375f 100644
--- a/tests/PHPUnit/Integration/expected/test_UserId_VisitorId_segmentUserIdAndCartAbandoned_getAbandonedCartItems__Goals.getItemsName_day.xml
+++ b/tests/PHPUnit/System/expected/test_UserId_VisitorId_segmentUserIdAndCartAbandoned_getAbandonedCartItems__Goals.getItemsName_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_UserId_VisitorId_segmentUserId__Goals.get_day.xml b/tests/PHPUnit/System/expected/test_UserId_VisitorId_segmentUserId__Goals.get_day.xml
index a43cbc433e..a43cbc433e 100644
--- a/tests/PHPUnit/Integration/expected/test_UserId_VisitorId_segmentUserId__Goals.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_UserId_VisitorId_segmentUserId__Goals.get_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_UserId_VisitorId_segmentUserId__VisitsSummary.get_day.xml b/tests/PHPUnit/System/expected/test_UserId_VisitorId_segmentUserId__VisitsSummary.get_day.xml
index 969fd130e8..969fd130e8 100644
--- a/tests/PHPUnit/Integration/expected/test_UserId_VisitorId_segmentUserId__VisitsSummary.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_UserId_VisitorId_segmentUserId__VisitsSummary.get_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_VisitsInPast_InvalidateOldReportsWebsite1_OldReportsShouldAppear__Actions.getPageUrls_month.xml b/tests/PHPUnit/System/expected/test_VisitsInPast_InvalidateOldReportsWebsite1_OldReportsShouldAppear__Actions.getPageUrls_month.xml
index 2f10eb3f97..2f10eb3f97 100644
--- a/tests/PHPUnit/Integration/expected/test_VisitsInPast_InvalidateOldReportsWebsite1_OldReportsShouldAppear__Actions.getPageUrls_month.xml
+++ b/tests/PHPUnit/System/expected/test_VisitsInPast_InvalidateOldReportsWebsite1_OldReportsShouldAppear__Actions.getPageUrls_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_VisitsInPast_InvalidateOldReportsWebsite1_OldReportsShouldAppear__VisitsSummary.get_month.xml b/tests/PHPUnit/System/expected/test_VisitsInPast_InvalidateOldReportsWebsite1_OldReportsShouldAppear__VisitsSummary.get_month.xml
index 2f7ce19aa5..2f7ce19aa5 100644
--- a/tests/PHPUnit/Integration/expected/test_VisitsInPast_InvalidateOldReportsWebsite1_OldReportsShouldAppear__VisitsSummary.get_month.xml
+++ b/tests/PHPUnit/System/expected/test_VisitsInPast_InvalidateOldReportsWebsite1_OldReportsShouldAppear__VisitsSummary.get_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_VisitsInPast_InvalidateOldReportsWebsite1_OldReportsShouldNotAppear__Actions.getPageUrls_month.xml b/tests/PHPUnit/System/expected/test_VisitsInPast_InvalidateOldReportsWebsite1_OldReportsShouldNotAppear__Actions.getPageUrls_month.xml
index 89eec3fbc3..89eec3fbc3 100644
--- a/tests/PHPUnit/Integration/expected/test_VisitsInPast_InvalidateOldReportsWebsite1_OldReportsShouldNotAppear__Actions.getPageUrls_month.xml
+++ b/tests/PHPUnit/System/expected/test_VisitsInPast_InvalidateOldReportsWebsite1_OldReportsShouldNotAppear__Actions.getPageUrls_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_VisitsInPast_InvalidateOldReportsWebsite1_OldReportsShouldNotAppear__VisitsSummary.get_month.xml b/tests/PHPUnit/System/expected/test_VisitsInPast_InvalidateOldReportsWebsite1_OldReportsShouldNotAppear__VisitsSummary.get_month.xml
index d84e6c4f35..d84e6c4f35 100644
--- a/tests/PHPUnit/Integration/expected/test_VisitsInPast_InvalidateOldReportsWebsite1_OldReportsShouldNotAppear__VisitsSummary.get_month.xml
+++ b/tests/PHPUnit/System/expected/test_VisitsInPast_InvalidateOldReportsWebsite1_OldReportsShouldNotAppear__VisitsSummary.get_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_VisitsInPast_InvalidateOldReportsWebsite2_OldReportsShouldAppear__Actions.getPageUrls_month.xml b/tests/PHPUnit/System/expected/test_VisitsInPast_InvalidateOldReportsWebsite2_OldReportsShouldAppear__Actions.getPageUrls_month.xml
index 401e8d2dc7..401e8d2dc7 100644
--- a/tests/PHPUnit/Integration/expected/test_VisitsInPast_InvalidateOldReportsWebsite2_OldReportsShouldAppear__Actions.getPageUrls_month.xml
+++ b/tests/PHPUnit/System/expected/test_VisitsInPast_InvalidateOldReportsWebsite2_OldReportsShouldAppear__Actions.getPageUrls_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_VisitsInPast_InvalidateOldReportsWebsite2_OldReportsShouldAppear__VisitsSummary.get_month.xml b/tests/PHPUnit/System/expected/test_VisitsInPast_InvalidateOldReportsWebsite2_OldReportsShouldAppear__VisitsSummary.get_month.xml
index ed3e2b6ade..ed3e2b6ade 100644
--- a/tests/PHPUnit/Integration/expected/test_VisitsInPast_InvalidateOldReportsWebsite2_OldReportsShouldAppear__VisitsSummary.get_month.xml
+++ b/tests/PHPUnit/System/expected/test_VisitsInPast_InvalidateOldReportsWebsite2_OldReportsShouldAppear__VisitsSummary.get_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_VisitsInPast_InvalidateOldReportsWebsite2_OldReportsShouldNotAppear__Actions.getPageUrls_month.xml b/tests/PHPUnit/System/expected/test_VisitsInPast_InvalidateOldReportsWebsite2_OldReportsShouldNotAppear__Actions.getPageUrls_month.xml
index aaef3a0ec5..aaef3a0ec5 100644
--- a/tests/PHPUnit/Integration/expected/test_VisitsInPast_InvalidateOldReportsWebsite2_OldReportsShouldNotAppear__Actions.getPageUrls_month.xml
+++ b/tests/PHPUnit/System/expected/test_VisitsInPast_InvalidateOldReportsWebsite2_OldReportsShouldNotAppear__Actions.getPageUrls_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_VisitsInPast_InvalidateOldReportsWebsite2_OldReportsShouldNotAppear__VisitsSummary.get_month.xml b/tests/PHPUnit/System/expected/test_VisitsInPast_InvalidateOldReportsWebsite2_OldReportsShouldNotAppear__VisitsSummary.get_month.xml
index d046dca549..d046dca549 100644
--- a/tests/PHPUnit/Integration/expected/test_VisitsInPast_InvalidateOldReportsWebsite2_OldReportsShouldNotAppear__VisitsSummary.get_month.xml
+++ b/tests/PHPUnit/System/expected/test_VisitsInPast_InvalidateOldReportsWebsite2_OldReportsShouldNotAppear__VisitsSummary.get_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_annotations__Annotations.get.xml b/tests/PHPUnit/System/expected/test_annotations__Annotations.get.xml
index 8ac7b4520a..8ac7b4520a 100644
--- a/tests/PHPUnit/Integration/expected/test_annotations__Annotations.get.xml
+++ b/tests/PHPUnit/System/expected/test_annotations__Annotations.get.xml
diff --git a/tests/PHPUnit/Integration/expected/test_annotations__Annotations.getAll_day.xml b/tests/PHPUnit/System/expected/test_annotations__Annotations.getAll_day.xml
index c65b44912c..c65b44912c 100644
--- a/tests/PHPUnit/Integration/expected/test_annotations__Annotations.getAll_day.xml
+++ b/tests/PHPUnit/System/expected/test_annotations__Annotations.getAll_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_annotations__Annotations.getAll_month.xml b/tests/PHPUnit/System/expected/test_annotations__Annotations.getAll_month.xml
index fa326bf6fd..fa326bf6fd 100644
--- a/tests/PHPUnit/Integration/expected/test_annotations__Annotations.getAll_month.xml
+++ b/tests/PHPUnit/System/expected/test_annotations__Annotations.getAll_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_annotations__Annotations.getAll_week.xml b/tests/PHPUnit/System/expected/test_annotations__Annotations.getAll_week.xml
index 3d0078beac..3d0078beac 100644
--- a/tests/PHPUnit/Integration/expected/test_annotations__Annotations.getAll_week.xml
+++ b/tests/PHPUnit/System/expected/test_annotations__Annotations.getAll_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_annotations__Annotations.getAll_year.xml b/tests/PHPUnit/System/expected/test_annotations__Annotations.getAll_year.xml
index f2f2835d16..f2f2835d16 100644
--- a/tests/PHPUnit/Integration/expected/test_annotations__Annotations.getAll_year.xml
+++ b/tests/PHPUnit/System/expected/test_annotations__Annotations.getAll_year.xml
diff --git a/tests/PHPUnit/Integration/expected/test_annotations__Annotations.getAnnotationCountForDates_day.xml b/tests/PHPUnit/System/expected/test_annotations__Annotations.getAnnotationCountForDates_day.xml
index 7409bdf738..7409bdf738 100644
--- a/tests/PHPUnit/Integration/expected/test_annotations__Annotations.getAnnotationCountForDates_day.xml
+++ b/tests/PHPUnit/System/expected/test_annotations__Annotations.getAnnotationCountForDates_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_annotations__Annotations.getAnnotationCountForDates_month.xml b/tests/PHPUnit/System/expected/test_annotations__Annotations.getAnnotationCountForDates_month.xml
index 152be4e272..152be4e272 100644
--- a/tests/PHPUnit/Integration/expected/test_annotations__Annotations.getAnnotationCountForDates_month.xml
+++ b/tests/PHPUnit/System/expected/test_annotations__Annotations.getAnnotationCountForDates_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_annotations__Annotations.getAnnotationCountForDates_week.xml b/tests/PHPUnit/System/expected/test_annotations__Annotations.getAnnotationCountForDates_week.xml
index d428059285..d428059285 100644
--- a/tests/PHPUnit/Integration/expected/test_annotations__Annotations.getAnnotationCountForDates_week.xml
+++ b/tests/PHPUnit/System/expected/test_annotations__Annotations.getAnnotationCountForDates_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_annotations__Annotations.getAnnotationCountForDates_year.xml b/tests/PHPUnit/System/expected/test_annotations__Annotations.getAnnotationCountForDates_year.xml
index 3d501c35f1..3d501c35f1 100644
--- a/tests/PHPUnit/Integration/expected/test_annotations__Annotations.getAnnotationCountForDates_year.xml
+++ b/tests/PHPUnit/System/expected/test_annotations__Annotations.getAnnotationCountForDates_year.xml
diff --git a/tests/PHPUnit/Integration/expected/test_annotations_lastN__Annotations.getAll_week.xml b/tests/PHPUnit/System/expected/test_annotations_lastN__Annotations.getAll_week.xml
index d3aecc147b..d3aecc147b 100644
--- a/tests/PHPUnit/Integration/expected/test_annotations_lastN__Annotations.getAll_week.xml
+++ b/tests/PHPUnit/System/expected/test_annotations_lastN__Annotations.getAll_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_annotations_lastN__Annotations.getAnnotationCountForDates_week.xml b/tests/PHPUnit/System/expected/test_annotations_lastN__Annotations.getAnnotationCountForDates_week.xml
index 2abbab5b3f..2abbab5b3f 100644
--- a/tests/PHPUnit/Integration/expected/test_annotations_lastN__Annotations.getAnnotationCountForDates_week.xml
+++ b/tests/PHPUnit/System/expected/test_annotations_lastN__Annotations.getAnnotationCountForDates_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_annotations_multipleSites__Annotations.getAll_month.xml b/tests/PHPUnit/System/expected/test_annotations_multipleSites__Annotations.getAll_month.xml
index 0d3c8ae176..0d3c8ae176 100644
--- a/tests/PHPUnit/Integration/expected/test_annotations_multipleSites__Annotations.getAll_month.xml
+++ b/tests/PHPUnit/System/expected/test_annotations_multipleSites__Annotations.getAll_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_annotations_multipleSites__Annotations.getAnnotationCountForDates_month.xml b/tests/PHPUnit/System/expected/test_annotations_multipleSites__Annotations.getAnnotationCountForDates_month.xml
index 8549b62364..8549b62364 100644
--- a/tests/PHPUnit/Integration/expected/test_annotations_multipleSites__Annotations.getAnnotationCountForDates_month.xml
+++ b/tests/PHPUnit/System/expected/test_annotations_multipleSites__Annotations.getAnnotationCountForDates_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_annotations_range__Annotations.getAll_range.xml b/tests/PHPUnit/System/expected/test_annotations_range__Annotations.getAll_range.xml
index 2e351524dc..2e351524dc 100644
--- a/tests/PHPUnit/Integration/expected/test_annotations_range__Annotations.getAll_range.xml
+++ b/tests/PHPUnit/System/expected/test_annotations_range__Annotations.getAll_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_annotations_range__Annotations.getAnnotationCountForDates_range.xml b/tests/PHPUnit/System/expected/test_annotations_range__Annotations.getAnnotationCountForDates_range.xml
index 77c83c9c84..77c83c9c84 100644
--- a/tests/PHPUnit/Integration/expected/test_annotations_range__Annotations.getAnnotationCountForDates_range.xml
+++ b/tests/PHPUnit/System/expected/test_annotations_range__Annotations.getAnnotationCountForDates_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_apiGetReportMetadata__API.getDefaultMetricTranslations.xml b/tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getDefaultMetricTranslations.xml
index 82c64dfc5c..82c64dfc5c 100644
--- a/tests/PHPUnit/Integration/expected/test_apiGetReportMetadata__API.getDefaultMetricTranslations.xml
+++ b/tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getDefaultMetricTranslations.xml
diff --git a/tests/PHPUnit/Integration/expected/test_apiGetReportMetadata__API.getIpFromHeader.xml b/tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getIpFromHeader.xml
index 7c42ec92e0..7c42ec92e0 100644
--- a/tests/PHPUnit/Integration/expected/test_apiGetReportMetadata__API.getIpFromHeader.xml
+++ b/tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getIpFromHeader.xml
diff --git a/tests/PHPUnit/Integration/expected/test_apiGetReportMetadata__API.getLastDate_day.xml b/tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getLastDate_day.xml
index 612d6fbf5c..612d6fbf5c 100644
--- a/tests/PHPUnit/Integration/expected/test_apiGetReportMetadata__API.getLastDate_day.xml
+++ b/tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getLastDate_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_apiGetReportMetadata__API.getMetadata_day.xml b/tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getMetadata_day.xml
index c495e00070..c495e00070 100644
--- a/tests/PHPUnit/Integration/expected/test_apiGetReportMetadata__API.getMetadata_day.xml
+++ b/tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getMetadata_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_apiGetReportMetadata__API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getProcessedReport_day.xml
index f08e134ae6..f08e134ae6 100644
--- a/tests/PHPUnit/Integration/expected/test_apiGetReportMetadata__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getProcessedReport_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_apiGetReportMetadata__API.getReportMetadata_day.xml b/tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getReportMetadata_day.xml
index 52257420bd..52257420bd 100644
--- a/tests/PHPUnit/Integration/expected/test_apiGetReportMetadata__API.getReportMetadata_day.xml
+++ b/tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getReportMetadata_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_apiGetReportMetadata__API.getRowEvolution_day.xml b/tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getRowEvolution_day.xml
index 29bf42cae8..29bf42cae8 100644
--- a/tests/PHPUnit/Integration/expected/test_apiGetReportMetadata__API.getRowEvolution_day.xml
+++ b/tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getRowEvolution_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_apiGetReportMetadata__API.getSegmentsMetadata.xml b/tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getSegmentsMetadata.xml
index 10e7fd78e3..10e7fd78e3 100644
--- a/tests/PHPUnit/Integration/expected/test_apiGetReportMetadata__API.getSegmentsMetadata.xml
+++ b/tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getSegmentsMetadata.xml
diff --git a/tests/PHPUnit/Integration/expected/test_apiGetReportMetadata__API.getSettings.xml b/tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getSettings.xml
index a43ea923e8..a43ea923e8 100644
--- a/tests/PHPUnit/Integration/expected/test_apiGetReportMetadata__API.getSettings.xml
+++ b/tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getSettings.xml
diff --git a/tests/PHPUnit/Integration/expected/test_apiGetReportMetadata__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getSuggestedValuesForSegment.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_apiGetReportMetadata__API.getSuggestedValuesForSegment.xml
+++ b/tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getSuggestedValuesForSegment.xml
diff --git a/tests/PHPUnit/Integration/expected/test_apiGetReportMetadata__API.get_day.xml b/tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.get_day.xml
index 8615d546da..8615d546da 100644
--- a/tests/PHPUnit/Integration/expected/test_apiGetReportMetadata__API.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.get_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_apiGetReportMetadata_hideMetricsDoc__API.getMetadata_day.xml b/tests/PHPUnit/System/expected/test_apiGetReportMetadata_hideMetricsDoc__API.getMetadata_day.xml
index 590b2acbe5..590b2acbe5 100644
--- a/tests/PHPUnit/Integration/expected/test_apiGetReportMetadata_hideMetricsDoc__API.getMetadata_day.xml
+++ b/tests/PHPUnit/System/expected/test_apiGetReportMetadata_hideMetricsDoc__API.getMetadata_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_apiGetReportMetadata_hideMetricsDoc__API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_apiGetReportMetadata_hideMetricsDoc__API.getProcessedReport_day.xml
index 6eb752956e..6eb752956e 100644
--- a/tests/PHPUnit/Integration/expected/test_apiGetReportMetadata_hideMetricsDoc__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_apiGetReportMetadata_hideMetricsDoc__API.getProcessedReport_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_apiGetReportMetadata_pageTitleZeroString__Actions.getPageTitles_day.xml b/tests/PHPUnit/System/expected/test_apiGetReportMetadata_pageTitleZeroString__Actions.getPageTitles_day.xml
index 63017ad657..63017ad657 100644
--- a/tests/PHPUnit/Integration/expected/test_apiGetReportMetadata_pageTitleZeroString__Actions.getPageTitles_day.xml
+++ b/tests/PHPUnit/System/expected/test_apiGetReportMetadata_pageTitleZeroString__Actions.getPageTitles_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_apiGetReportMetadata_phpRenderer__API.getDefaultMetricTranslations.php b/tests/PHPUnit/System/expected/test_apiGetReportMetadata_phpRenderer__API.getDefaultMetricTranslations.php
index d9144d3e39..d9144d3e39 100644
--- a/tests/PHPUnit/Integration/expected/test_apiGetReportMetadata_phpRenderer__API.getDefaultMetricTranslations.php
+++ b/tests/PHPUnit/System/expected/test_apiGetReportMetadata_phpRenderer__API.getDefaultMetricTranslations.php
diff --git a/tests/PHPUnit/Integration/expected/test_apiGetReportMetadata_showRawMetrics__API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_apiGetReportMetadata_showRawMetrics__API.getProcessedReport_day.xml
index 4b38b3da7f..4b38b3da7f 100644
--- a/tests/PHPUnit/Integration/expected/test_apiGetReportMetadata_showRawMetrics__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_apiGetReportMetadata_showRawMetrics__API.getProcessedReport_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_apiGetReportMetadata_year__API.getProcessedReport_year.xml b/tests/PHPUnit/System/expected/test_apiGetReportMetadata_year__API.getProcessedReport_year.xml
index f371029f1b..f371029f1b 100644
--- a/tests/PHPUnit/Integration/expected/test_apiGetReportMetadata_year__API.getProcessedReport_year.xml
+++ b/tests/PHPUnit/System/expected/test_apiGetReportMetadata_year__API.getProcessedReport_year.xml
diff --git a/tests/PHPUnit/Integration/expected/test_apiGetReportMetadata_year__LanguagesManager.getAvailableLanguageNames.xml b/tests/PHPUnit/System/expected/test_apiGetReportMetadata_year__LanguagesManager.getAvailableLanguageNames.xml
index d7738f1123..d7738f1123 100644
--- a/tests/PHPUnit/Integration/expected/test_apiGetReportMetadata_year__LanguagesManager.getAvailableLanguageNames.xml
+++ b/tests/PHPUnit/System/expected/test_apiGetReportMetadata_year__LanguagesManager.getAvailableLanguageNames.xml
diff --git a/tests/PHPUnit/Integration/expected/test_apiGetReportMetadata_year__SitesManager.getJavascriptTag.xml b/tests/PHPUnit/System/expected/test_apiGetReportMetadata_year__SitesManager.getJavascriptTag.xml
index d4c25ca522..d4c25ca522 100644
--- a/tests/PHPUnit/Integration/expected/test_apiGetReportMetadata_year__SitesManager.getJavascriptTag.xml
+++ b/tests/PHPUnit/System/expected/test_apiGetReportMetadata_year__SitesManager.getJavascriptTag.xml
diff --git a/tests/PHPUnit/Integration/expected/test_csvExport__Live.getLastVisitsDetails_day.csv b/tests/PHPUnit/System/expected/test_csvExport__Live.getLastVisitsDetails_day.csv
index 92630d07b3..92630d07b3 100644
--- a/tests/PHPUnit/Integration/expected/test_csvExport__Live.getLastVisitsDetails_day.csv
+++ b/tests/PHPUnit/System/expected/test_csvExport__Live.getLastVisitsDetails_day.csv
Binary files differ
diff --git a/tests/PHPUnit/Integration/expected/test_csvExport_xp0__CustomVariables.getCustomVariables_day.csv b/tests/PHPUnit/System/expected/test_csvExport_xp0__CustomVariables.getCustomVariables_day.csv
index 89e329416e..89e329416e 100644
--- a/tests/PHPUnit/Integration/expected/test_csvExport_xp0__CustomVariables.getCustomVariables_day.csv
+++ b/tests/PHPUnit/System/expected/test_csvExport_xp0__CustomVariables.getCustomVariables_day.csv
Binary files differ
diff --git a/tests/PHPUnit/Integration/expected/test_csvExport_xp0__VisitsSummary.get_day.csv b/tests/PHPUnit/System/expected/test_csvExport_xp0__VisitsSummary.get_day.csv
index 26adb45055..26adb45055 100644
--- a/tests/PHPUnit/Integration/expected/test_csvExport_xp0__VisitsSummary.get_day.csv
+++ b/tests/PHPUnit/System/expected/test_csvExport_xp0__VisitsSummary.get_day.csv
Binary files differ
diff --git a/tests/PHPUnit/Integration/expected/test_csvExport_xp1_inner0_trans-en__CustomVariables.getCustomVariables_day.csv b/tests/PHPUnit/System/expected/test_csvExport_xp1_inner0_trans-en__CustomVariables.getCustomVariables_day.csv
index 1dde5308a4..1dde5308a4 100644
--- a/tests/PHPUnit/Integration/expected/test_csvExport_xp1_inner0_trans-en__CustomVariables.getCustomVariables_day.csv
+++ b/tests/PHPUnit/System/expected/test_csvExport_xp1_inner0_trans-en__CustomVariables.getCustomVariables_day.csv
Binary files differ
diff --git a/tests/PHPUnit/Integration/expected/test_csvExport_xp1_inner0_trans-en__VisitsSummary.get_day.csv b/tests/PHPUnit/System/expected/test_csvExport_xp1_inner0_trans-en__VisitsSummary.get_day.csv
index 58e88ae47a..58e88ae47a 100644
--- a/tests/PHPUnit/Integration/expected/test_csvExport_xp1_inner0_trans-en__VisitsSummary.get_day.csv
+++ b/tests/PHPUnit/System/expected/test_csvExport_xp1_inner0_trans-en__VisitsSummary.get_day.csv
Binary files differ
diff --git a/tests/PHPUnit/Integration/expected/test_csvExport_xp1_inner1_trans-de__CustomVariables.getCustomVariables_day.csv b/tests/PHPUnit/System/expected/test_csvExport_xp1_inner1_trans-de__CustomVariables.getCustomVariables_day.csv
index 24c786dd47..24c786dd47 100644
--- a/tests/PHPUnit/Integration/expected/test_csvExport_xp1_inner1_trans-de__CustomVariables.getCustomVariables_day.csv
+++ b/tests/PHPUnit/System/expected/test_csvExport_xp1_inner1_trans-de__CustomVariables.getCustomVariables_day.csv
Binary files differ
diff --git a/tests/PHPUnit/Integration/expected/test_csvExport_xp1_inner1_trans-de__VisitsSummary.get_day.csv b/tests/PHPUnit/System/expected/test_csvExport_xp1_inner1_trans-de__VisitsSummary.get_day.csv
index 7315bde871..7315bde871 100644
--- a/tests/PHPUnit/Integration/expected/test_csvExport_xp1_inner1_trans-de__VisitsSummary.get_day.csv
+++ b/tests/PHPUnit/System/expected/test_csvExport_xp1_inner1_trans-de__VisitsSummary.get_day.csv
Binary files differ
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_API_get__API.get_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_API_get__API.get_day.xml
index f321ae62e1..f321ae62e1 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_API_get__API.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_API_get__API.get_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_API_get__API.get_week.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_API_get__API.get_week.xml
index 330e0110bf..330e0110bf 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_API_get__API.get_week.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_API_get__API.get_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_AbandonedCarts__Goals.getItemsCategory_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_AbandonedCarts__Goals.getItemsCategory_day.xml
index b27ccd173e..b27ccd173e 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_AbandonedCarts__Goals.getItemsCategory_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_AbandonedCarts__Goals.getItemsCategory_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_AbandonedCarts__Goals.getItemsCategory_week.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_AbandonedCarts__Goals.getItemsCategory_week.xml
index b29f7fd16b..b29f7fd16b 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_AbandonedCarts__Goals.getItemsCategory_week.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_AbandonedCarts__Goals.getItemsCategory_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_AbandonedCarts__Goals.getItemsName_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_AbandonedCarts__Goals.getItemsName_day.xml
index 76195df336..76195df336 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_AbandonedCarts__Goals.getItemsName_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_AbandonedCarts__Goals.getItemsName_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_AbandonedCarts__Goals.getItemsName_week.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_AbandonedCarts__Goals.getItemsName_week.xml
index 5a0ddd4302..5a0ddd4302 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_AbandonedCarts__Goals.getItemsName_week.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_AbandonedCarts__Goals.getItemsName_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_AbandonedCarts__Goals.getItemsSku_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_AbandonedCarts__Goals.getItemsSku_day.xml
index ca2b2296ed..ca2b2296ed 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_AbandonedCarts__Goals.getItemsSku_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_AbandonedCarts__Goals.getItemsSku_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_AbandonedCarts__Goals.getItemsSku_week.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_AbandonedCarts__Goals.getItemsSku_week.xml
index 5c1999197a..5c1999197a 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_AbandonedCarts__Goals.getItemsSku_week.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_AbandonedCarts__Goals.getItemsSku_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_GoalAbandonedCart__Goals.get_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalAbandonedCart__Goals.get_day.xml
index 343be649b7..343be649b7 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_GoalAbandonedCart__Goals.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalAbandonedCart__Goals.get_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_GoalAbandonedCart__Goals.get_week.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalAbandonedCart__Goals.get_week.xml
index a2d20e0f55..a2d20e0f55 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_GoalAbandonedCart__Goals.get_week.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalAbandonedCart__Goals.get_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_GoalMatchTitle__Goals.get_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalMatchTitle__Goals.get_day.xml
index 28ecffa619..28ecffa619 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_GoalMatchTitle__Goals.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalMatchTitle__Goals.get_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_GoalMatchTitle__Goals.get_week.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalMatchTitle__Goals.get_week.xml
index 46934b1c19..46934b1c19 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_GoalMatchTitle__Goals.get_week.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalMatchTitle__Goals.get_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_GoalOrder__Goals.get_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalOrder__Goals.get_day.xml
index 698b353eab..698b353eab 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_GoalOrder__Goals.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalOrder__Goals.get_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_GoalOrder__Goals.get_week.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalOrder__Goals.get_week.xml
index 1daeb97961..1daeb97961 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_GoalOrder__Goals.get_week.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalOrder__Goals.get_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_GoalOverall__Goals.get_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalOverall__Goals.get_day.xml
index c2cd462325..c2cd462325 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_GoalOverall__Goals.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalOverall__Goals.get_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_GoalOverall__Goals.get_week.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalOverall__Goals.get_week.xml
index 8190aee36f..8190aee36f 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_GoalOverall__Goals.get_week.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_GoalOverall__Goals.get_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_LiveEcommerceStatusOrdered__Live.getLastVisitsDetails_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_LiveEcommerceStatusOrdered__Live.getLastVisitsDetails_day.xml
index 42b55ed358..42b55ed358 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_LiveEcommerceStatusOrdered__Live.getLastVisitsDetails_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_LiveEcommerceStatusOrdered__Live.getLastVisitsDetails_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_Metadata_Goals.Get_AbandonedCart__API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_Metadata_Goals.Get_AbandonedCart__API.getProcessedReport_day.xml
index 65e862ccc6..65e862ccc6 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_Metadata_Goals.Get_AbandonedCart__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_Metadata_Goals.Get_AbandonedCart__API.getProcessedReport_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_Metadata_Goals.Get_NormalGoal__API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_Metadata_Goals.Get_NormalGoal__API.getProcessedReport_day.xml
index 358467f45e..358467f45e 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_Metadata_Goals.Get_NormalGoal__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_Metadata_Goals.Get_NormalGoal__API.getProcessedReport_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_Metadata_Goals.Get_NotExistingGoal__API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_Metadata_Goals.Get_NotExistingGoal__API.getProcessedReport_day.xml
index 1625ba026c..1625ba026c 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_Metadata_Goals.Get_NotExistingGoal__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_Metadata_Goals.Get_NotExistingGoal__API.getProcessedReport_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_Metadata_Goals.Get_Order__API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_Metadata_Goals.Get_Order__API.getProcessedReport_day.xml
index 795e631e81..795e631e81 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_Metadata_Goals.Get_Order__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_Metadata_Goals.Get_Order__API.getProcessedReport_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_Metadata_ItemsCategory__API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_Metadata_ItemsCategory__API.getProcessedReport_day.xml
index 002d38705c..002d38705c 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_Metadata_ItemsCategory__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_Metadata_ItemsCategory__API.getProcessedReport_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_Metadata_ItemsSku__API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_Metadata_ItemsSku__API.getProcessedReport_day.xml
index cb341801b4..cb341801b4 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_Metadata_ItemsSku__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_Metadata_ItemsSku__API.getProcessedReport_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_Metadata_VisitTime.getVisitInformationPerServerTime__API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_Metadata_VisitTime.getVisitInformationPerServerTime__API.getProcessedReport_day.xml
index 71282d9145..71282d9145 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_Metadata_VisitTime.getVisitInformationPerServerTime__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_Metadata_VisitTime.getVisitInformationPerServerTime__API.getProcessedReport_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentAbandonedCart__VisitsSummary.get_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentAbandonedCart__VisitsSummary.get_day.xml
index 2ecf693474..2ecf693474 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentAbandonedCart__VisitsSummary.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentAbandonedCart__VisitsSummary.get_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentConvertedGoalId1__VisitsSummary.get_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentConvertedGoalId1__VisitsSummary.get_day.xml
index a9d2095dfb..a9d2095dfb 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentConvertedGoalId1__VisitsSummary.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentConvertedGoalId1__VisitsSummary.get_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentConvertedGoalId1__VisitsSummary.get_week.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentConvertedGoalId1__VisitsSummary.get_week.xml
index a9d2095dfb..a9d2095dfb 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentConvertedGoalId1__VisitsSummary.get_week.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentConvertedGoalId1__VisitsSummary.get_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentCountryIsFr__Goals.getItemsCategory_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentCountryIsFr__Goals.getItemsCategory_day.xml
index 02187588c4..02187588c4 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentCountryIsFr__Goals.getItemsCategory_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentCountryIsFr__Goals.getItemsCategory_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentCountryIsFr__Goals.getItemsCategory_week.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentCountryIsFr__Goals.getItemsCategory_week.xml
index 19944203ad..19944203ad 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentCountryIsFr__Goals.getItemsCategory_week.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentCountryIsFr__Goals.getItemsCategory_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentCountryIsFr__Goals.getItemsName_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentCountryIsFr__Goals.getItemsName_day.xml
index bf093d7b73..bf093d7b73 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentCountryIsFr__Goals.getItemsName_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentCountryIsFr__Goals.getItemsName_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentCountryIsFr__Goals.getItemsName_week.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentCountryIsFr__Goals.getItemsName_week.xml
index 1adac8c4ec..1adac8c4ec 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentCountryIsFr__Goals.getItemsName_week.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentCountryIsFr__Goals.getItemsName_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentCountryIsFr__Goals.getItemsSku_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentCountryIsFr__Goals.getItemsSku_day.xml
index db5fcd88f4..db5fcd88f4 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentCountryIsFr__Goals.getItemsSku_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentCountryIsFr__Goals.getItemsSku_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentCountryIsFr__Goals.getItemsSku_week.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentCountryIsFr__Goals.getItemsSku_week.xml
index 6a14444a59..6a14444a59 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentCountryIsFr__Goals.getItemsSku_week.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentCountryIsFr__Goals.getItemsSku_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentDidNotConvertGoalId1__VisitsSummary.get_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentDidNotConvertGoalId1__VisitsSummary.get_day.xml
index 2ecf693474..2ecf693474 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentDidNotConvertGoalId1__VisitsSummary.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentDidNotConvertGoalId1__VisitsSummary.get_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentNewVisitors__VisitsSummary.get_week.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentNewVisitors__VisitsSummary.get_week.xml
index a9d2095dfb..a9d2095dfb 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentNewVisitors__VisitsSummary.get_week.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentNewVisitors__VisitsSummary.get_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentNoEcommerce__VisitsSummary.get_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentNoEcommerce__VisitsSummary.get_day.xml
index a9d2095dfb..a9d2095dfb 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentNoEcommerce__VisitsSummary.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentNoEcommerce__VisitsSummary.get_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentNoVisit_HaveConvertedNonExistingGoal__Goals.getItemsCategory_week.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentNoVisit_HaveConvertedNonExistingGoal__Goals.getItemsCategory_week.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentNoVisit_HaveConvertedNonExistingGoal__Goals.getItemsCategory_week.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentNoVisit_HaveConvertedNonExistingGoal__Goals.getItemsCategory_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentNoVisit_HaveConvertedNonExistingGoal__Goals.getItemsName_week.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentNoVisit_HaveConvertedNonExistingGoal__Goals.getItemsName_week.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentNoVisit_HaveConvertedNonExistingGoal__Goals.getItemsName_week.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentNoVisit_HaveConvertedNonExistingGoal__Goals.getItemsName_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentNoVisit_HaveConvertedNonExistingGoal__Goals.getItemsSku_week.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentNoVisit_HaveConvertedNonExistingGoal__Goals.getItemsSku_week.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentNoVisit_HaveConvertedNonExistingGoal__Goals.getItemsSku_week.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentNoVisit_HaveConvertedNonExistingGoal__Goals.getItemsSku_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentNoVisit_HaveConvertedNonExistingGoal__Goals.get_week.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentNoVisit_HaveConvertedNonExistingGoal__Goals.get_week.xml
index 257dd359a5..257dd359a5 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentNoVisit_HaveConvertedNonExistingGoal__Goals.get_week.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentNoVisit_HaveConvertedNonExistingGoal__Goals.get_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentNoVisit_HaveConvertedNonExistingGoal__VisitsSummary.get_week.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentNoVisit_HaveConvertedNonExistingGoal__VisitsSummary.get_week.xml
index 32b66284be..32b66284be 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentNoVisit_HaveConvertedNonExistingGoal__VisitsSummary.get_week.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentNoVisit_HaveConvertedNonExistingGoal__VisitsSummary.get_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentOrderedSomething__VisitsSummary.get_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentOrderedSomething__VisitsSummary.get_day.xml
index 44b18e613c..44b18e613c 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentOrderedSomething__VisitsSummary.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentOrderedSomething__VisitsSummary.get_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentPageTitleMatch__VisitsSummary.get_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentPageTitleMatch__VisitsSummary.get_day.xml
index a9d2095dfb..a9d2095dfb 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentPageTitleMatch__VisitsSummary.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentPageTitleMatch__VisitsSummary.get_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentPageUrlContains__Goals.getItemsCategory_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentPageUrlContains__Goals.getItemsCategory_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentPageUrlContains__Goals.getItemsCategory_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentPageUrlContains__Goals.getItemsCategory_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentPageUrlContains__Goals.getItemsCategory_week.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentPageUrlContains__Goals.getItemsCategory_week.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentPageUrlContains__Goals.getItemsCategory_week.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentPageUrlContains__Goals.getItemsCategory_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentPageUrlContains__Goals.getItemsName_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentPageUrlContains__Goals.getItemsName_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentPageUrlContains__Goals.getItemsName_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentPageUrlContains__Goals.getItemsName_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentPageUrlContains__Goals.getItemsName_week.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentPageUrlContains__Goals.getItemsName_week.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentPageUrlContains__Goals.getItemsName_week.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentPageUrlContains__Goals.getItemsName_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentPageUrlContains__Goals.getItemsSku_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentPageUrlContains__Goals.getItemsSku_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentPageUrlContains__Goals.getItemsSku_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentPageUrlContains__Goals.getItemsSku_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentPageUrlContains__Goals.getItemsSku_week.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentPageUrlContains__Goals.getItemsSku_week.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentPageUrlContains__Goals.getItemsSku_week.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentPageUrlContains__Goals.getItemsSku_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentReturningCustomers__VisitsSummary.get_week.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentReturningCustomers__VisitsSummary.get_week.xml
index 02458f0645..02458f0645 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentReturningCustomers__VisitsSummary.get_week.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentReturningCustomers__VisitsSummary.get_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentReturningVisitors__VisitsSummary.get_week.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentReturningVisitors__VisitsSummary.get_week.xml
index 44b18e613c..44b18e613c 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentReturningVisitors__VisitsSummary.get_week.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentReturningVisitors__VisitsSummary.get_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentVisitHasConvertedGoal__Goals.getItemsCategory_week.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentVisitHasConvertedGoal__Goals.getItemsCategory_week.xml
index c0730f15dd..c0730f15dd 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentVisitHasConvertedGoal__Goals.getItemsCategory_week.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentVisitHasConvertedGoal__Goals.getItemsCategory_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentVisitHasConvertedGoal__Goals.getItemsName_week.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentVisitHasConvertedGoal__Goals.getItemsName_week.xml
index cea3474969..cea3474969 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentVisitHasConvertedGoal__Goals.getItemsName_week.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentVisitHasConvertedGoal__Goals.getItemsName_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentVisitHasConvertedGoal__Goals.getItemsSku_week.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentVisitHasConvertedGoal__Goals.getItemsSku_week.xml
index 79f78fc9d3..79f78fc9d3 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentVisitHasConvertedGoal__Goals.getItemsSku_week.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentVisitHasConvertedGoal__Goals.getItemsSku_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentVisitHasConvertedGoal__Goals.get_week.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentVisitHasConvertedGoal__Goals.get_week.xml
index 78dc5020d7..78dc5020d7 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentVisitHasConvertedGoal__Goals.get_week.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentVisitHasConvertedGoal__Goals.get_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentVisitHasConvertedGoal__VisitsSummary.get_week.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentVisitHasConvertedGoal__VisitsSummary.get_week.xml
index a9d2095dfb..a9d2095dfb 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentVisitHasConvertedGoal__VisitsSummary.get_week.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentVisitHasConvertedGoal__VisitsSummary.get_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentVisitHasNotOrderedAndConvertedGoal__Goals.getItemsCategory_week.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentVisitHasNotOrderedAndConvertedGoal__Goals.getItemsCategory_week.xml
index c0730f15dd..c0730f15dd 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentVisitHasNotOrderedAndConvertedGoal__Goals.getItemsCategory_week.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentVisitHasNotOrderedAndConvertedGoal__Goals.getItemsCategory_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentVisitHasNotOrderedAndConvertedGoal__Goals.getItemsName_week.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentVisitHasNotOrderedAndConvertedGoal__Goals.getItemsName_week.xml
index cea3474969..cea3474969 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentVisitHasNotOrderedAndConvertedGoal__Goals.getItemsName_week.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentVisitHasNotOrderedAndConvertedGoal__Goals.getItemsName_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentVisitHasNotOrderedAndConvertedGoal__Goals.getItemsSku_week.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentVisitHasNotOrderedAndConvertedGoal__Goals.getItemsSku_week.xml
index 79f78fc9d3..79f78fc9d3 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentVisitHasNotOrderedAndConvertedGoal__Goals.getItemsSku_week.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentVisitHasNotOrderedAndConvertedGoal__Goals.getItemsSku_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentVisitHasNotOrderedAndConvertedGoal__Goals.get_week.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentVisitHasNotOrderedAndConvertedGoal__Goals.get_week.xml
index 78dc5020d7..78dc5020d7 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentVisitHasNotOrderedAndConvertedGoal__Goals.get_week.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentVisitHasNotOrderedAndConvertedGoal__Goals.get_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentVisitHasNotOrderedAndConvertedGoal__VisitsSummary.get_week.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentVisitHasNotOrderedAndConvertedGoal__VisitsSummary.get_week.xml
index a9d2095dfb..a9d2095dfb 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentVisitHasNotOrderedAndConvertedGoal__VisitsSummary.get_week.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_SegmentVisitHasNotOrderedAndConvertedGoal__VisitsSummary.get_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_Website2__Goals.getItemsCategory_week.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_Website2__Goals.getItemsCategory_week.xml
index df23a6ffa1..df23a6ffa1 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_Website2__Goals.getItemsCategory_week.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_Website2__Goals.getItemsCategory_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_Website2__Goals.getItemsName_week.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_Website2__Goals.getItemsName_week.xml
index b271d3219f..b271d3219f 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_Website2__Goals.getItemsName_week.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_Website2__Goals.getItemsName_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_Website2__Goals.getItemsSku_week.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_Website2__Goals.getItemsSku_week.xml
index 83e2cd8798..83e2cd8798 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_Website2__Goals.getItemsSku_week.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_Website2__Goals.getItemsSku_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_Website2__Goals.get_week.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_Website2__Goals.get_week.xml
index d896b423d7..d896b423d7 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_Website2__Goals.get_week.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_Website2__Goals.get_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems__API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__API.getProcessedReport_day.xml
index 79289ce2d7..79289ce2d7 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__API.getProcessedReport_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems__CustomVariables.getCustomVariables_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__CustomVariables.getCustomVariables_day.xml
index 8056021220..8056021220 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems__CustomVariables.getCustomVariables_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__CustomVariables.getCustomVariables_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems__Goals.getItemsCategory_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__Goals.getItemsCategory_day.xml
index 4b0694c88f..4b0694c88f 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems__Goals.getItemsCategory_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__Goals.getItemsCategory_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems__Goals.getItemsCategory_week.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__Goals.getItemsCategory_week.xml
index 96af10c76f..96af10c76f 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems__Goals.getItemsCategory_week.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__Goals.getItemsCategory_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems__Goals.getItemsName_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__Goals.getItemsName_day.xml
index 80da495736..80da495736 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems__Goals.getItemsName_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__Goals.getItemsName_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems__Goals.getItemsName_week.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__Goals.getItemsName_week.xml
index 854349a01e..854349a01e 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems__Goals.getItemsName_week.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__Goals.getItemsName_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems__Goals.getItemsSku_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__Goals.getItemsSku_day.xml
index 83b6b8ab73..83b6b8ab73 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems__Goals.getItemsSku_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__Goals.getItemsSku_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems__Goals.getItemsSku_week.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__Goals.getItemsSku_week.xml
index 3781b91168..3781b91168 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems__Goals.getItemsSku_week.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__Goals.getItemsSku_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems__Goals.get_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__Goals.get_day.xml
index c2cd462325..c2cd462325 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems__Goals.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__Goals.get_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems__Goals.get_week.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__Goals.get_week.xml
index 8190aee36f..8190aee36f 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems__Goals.get_week.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__Goals.get_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems__Live.getLastVisitsDetails_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__Live.getLastVisitsDetails_day.xml
index 2d178e632d..2d178e632d 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems__Live.getLastVisitsDetails_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__Live.getLastVisitsDetails_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems__UserCountry.getCity_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__UserCountry.getCity_day.xml
index 99fad8ffbf..99fad8ffbf 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems__UserCountry.getCity_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__UserCountry.getCity_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems__UserCountry.getContinent_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__UserCountry.getContinent_day.xml
index 152f156767..152f156767 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems__UserCountry.getContinent_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__UserCountry.getContinent_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems__UserCountry.getCountry_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__UserCountry.getCountry_day.xml
index a61fe0658f..a61fe0658f 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems__UserCountry.getCountry_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__UserCountry.getCountry_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems__UserCountry.getNumberOfDistinctCountries_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__UserCountry.getNumberOfDistinctCountries_day.xml
index 13002b2017..13002b2017 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems__UserCountry.getNumberOfDistinctCountries_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__UserCountry.getNumberOfDistinctCountries_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems__UserCountry.getRegion_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__UserCountry.getRegion_day.xml
index 7a0583f3a4..7a0583f3a4 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems__UserCountry.getRegion_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__UserCountry.getRegion_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems__VisitTime.getByDayOfWeek_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__VisitTime.getByDayOfWeek_day.xml
index a982f9b2c6..a982f9b2c6 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems__VisitTime.getByDayOfWeek_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__VisitTime.getByDayOfWeek_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems__VisitTime.getVisitInformationPerLocalTime_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__VisitTime.getVisitInformationPerLocalTime_day.xml
index 18762c91ed..18762c91ed 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems__VisitTime.getVisitInformationPerLocalTime_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__VisitTime.getVisitInformationPerLocalTime_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems__VisitTime.getVisitInformationPerServerTime_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__VisitTime.getVisitInformationPerServerTime_day.xml
index ac8065dbb1..ac8065dbb1 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems__VisitTime.getVisitInformationPerServerTime_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__VisitTime.getVisitInformationPerServerTime_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems__VisitsSummary.get_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__VisitsSummary.get_day.xml
index 115904be39..115904be39 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems__VisitsSummary.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems__VisitsSummary.get_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_scheduled_report_in_csv__ScheduledReports.generateReport_week.original.csv b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_scheduled_report_in_csv__ScheduledReports.generateReport_week.original.csv
index 69bb6fd4f6..69bb6fd4f6 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_scheduled_report_in_csv__ScheduledReports.generateReport_week.original.csv
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_scheduled_report_in_csv__ScheduledReports.generateReport_week.original.csv
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_scheduled_report_in_html_row_evolution_graph__ScheduledReports.generateReport_week.original.html b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_scheduled_report_in_html_row_evolution_graph__ScheduledReports.generateReport_week.original.html
index 03178c7d32..03178c7d32 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_scheduled_report_in_html_row_evolution_graph__ScheduledReports.generateReport_week.original.html
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_scheduled_report_in_html_row_evolution_graph__ScheduledReports.generateReport_week.original.html
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_scheduled_report_in_html_tables_and_graph__ScheduledReports.generateReport_week.original.html b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_scheduled_report_in_html_tables_and_graph__ScheduledReports.generateReport_week.original.html
index f91034a651..f91034a651 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_scheduled_report_in_html_tables_and_graph__ScheduledReports.generateReport_week.original.html
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_scheduled_report_in_html_tables_and_graph__ScheduledReports.generateReport_week.original.html
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_scheduled_report_in_html_tables_only__ScheduledReports.generateReport_week.original.html b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_scheduled_report_in_html_tables_only__ScheduledReports.generateReport_week.original.html
index 3b420d327e..3b420d327e 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_scheduled_report_in_html_tables_only__ScheduledReports.generateReport_week.original.html
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_scheduled_report_in_html_tables_only__ScheduledReports.generateReport_week.original.html
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_scheduled_report_in_pdf_tables_only__ScheduledReports.generateReport_week.original.pdf b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_scheduled_report_in_pdf_tables_only__ScheduledReports.generateReport_week.original.pdf
index 3db8e7ed77..3db8e7ed77 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_scheduled_report_in_pdf_tables_only__ScheduledReports.generateReport_week.original.pdf
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_scheduled_report_in_pdf_tables_only__ScheduledReports.generateReport_week.original.pdf
Binary files differ
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_scheduled_report_via_sms_all_sites__ScheduledReports.generateReport_week.original.sms.txt b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_scheduled_report_via_sms_all_sites__ScheduledReports.generateReport_week.original.sms.txt
index e0d2df5b77..e0d2df5b77 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_scheduled_report_via_sms_all_sites__ScheduledReports.generateReport_week.original.sms.txt
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_scheduled_report_via_sms_all_sites__ScheduledReports.generateReport_week.original.sms.txt
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_scheduled_report_via_sms_one_site__ScheduledReports.generateReport_week.original.sms.txt b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_scheduled_report_via_sms_one_site__ScheduledReports.generateReport_week.original.sms.txt
index fa6a9d691e..fa6a9d691e 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_scheduled_report_via_sms_one_site__ScheduledReports.generateReport_week.original.sms.txt
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_scheduled_report_via_sms_one_site__ScheduledReports.generateReport_week.original.sms.txt
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItemsmultipleDates__Goals.getItemsCategory_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItemsmultipleDates__Goals.getItemsCategory_day.xml
index f5f998c048..f5f998c048 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItemsmultipleDates__Goals.getItemsCategory_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItemsmultipleDates__Goals.getItemsCategory_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItemsmultipleDates__Goals.getItemsName_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItemsmultipleDates__Goals.getItemsName_day.xml
index bdc280c4c9..bdc280c4c9 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItemsmultipleDates__Goals.getItemsName_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItemsmultipleDates__Goals.getItemsName_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItemsmultipleDates__Goals.getItemsSku_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItemsmultipleDates__Goals.getItemsSku_day.xml
index 4854d5e83c..4854d5e83c 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItemsmultipleDates__Goals.getItemsSku_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItemsmultipleDates__Goals.getItemsSku_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItemsmultipleDates_andMultipleWebsites__Goals.getItemsCategory_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItemsmultipleDates_andMultipleWebsites__Goals.getItemsCategory_day.xml
index 477b37f3d5..477b37f3d5 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItemsmultipleDates_andMultipleWebsites__Goals.getItemsCategory_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItemsmultipleDates_andMultipleWebsites__Goals.getItemsCategory_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItemsmultipleDates_andMultipleWebsites__Goals.getItemsName_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItemsmultipleDates_andMultipleWebsites__Goals.getItemsName_day.xml
index 01995b63ea..01995b63ea 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItemsmultipleDates_andMultipleWebsites__Goals.getItemsName_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItemsmultipleDates_andMultipleWebsites__Goals.getItemsName_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItemsmultipleDates_andMultipleWebsites__Goals.getItemsSku_day.xml b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItemsmultipleDates_andMultipleWebsites__Goals.getItemsSku_day.xml
index 2c696320d5..2c696320d5 100644
--- a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItemsmultipleDates_andMultipleWebsites__Goals.getItemsSku_day.xml
+++ b/tests/PHPUnit/System/expected/test_ecommerceOrderWithItemsmultipleDates_andMultipleWebsites__Goals.getItemsSku_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getDownload_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getDownload_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getDownload_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getDownload_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getDownload_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getDownload_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getDownload_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getDownload_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getDownloads_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getDownloads_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getDownloads_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getDownloads_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getDownloads_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getDownloads_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getDownloads_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getDownloads_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getEntryPageTitles_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getEntryPageTitles_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getEntryPageTitles_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getEntryPageTitles_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getEntryPageTitles_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getEntryPageTitles_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getEntryPageTitles_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getEntryPageTitles_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getEntryPageUrls_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getEntryPageUrls_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getEntryPageUrls_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getEntryPageUrls_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getEntryPageUrls_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getEntryPageUrls_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getEntryPageUrls_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getEntryPageUrls_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getExitPageTitles_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getExitPageTitles_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getExitPageTitles_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getExitPageTitles_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getExitPageTitles_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getExitPageTitles_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getExitPageTitles_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getExitPageTitles_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getExitPageUrls_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getExitPageUrls_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getExitPageUrls_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getExitPageUrls_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getExitPageUrls_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getExitPageUrls_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getExitPageUrls_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getExitPageUrls_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getOutlink_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getOutlink_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getOutlink_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getOutlink_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getOutlink_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getOutlink_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getOutlink_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getOutlink_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getOutlinks_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getOutlinks_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getOutlinks_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getOutlinks_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getOutlinks_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getOutlinks_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getOutlinks_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getOutlinks_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getPageTitle_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getPageTitle_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getPageTitle_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getPageTitle_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getPageTitle_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getPageTitle_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getPageTitle_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getPageTitle_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getPageTitlesFollowingSiteSearch_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getPageTitlesFollowingSiteSearch_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getPageTitlesFollowingSiteSearch_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getPageTitlesFollowingSiteSearch_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getPageTitlesFollowingSiteSearch_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getPageTitlesFollowingSiteSearch_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getPageTitlesFollowingSiteSearch_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getPageTitlesFollowingSiteSearch_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getPageTitles_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getPageTitles_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getPageTitles_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getPageTitles_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getPageTitles_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getPageTitles_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getPageTitles_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getPageTitles_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getPageUrl_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getPageUrl_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getPageUrl_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getPageUrl_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getPageUrl_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getPageUrl_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getPageUrl_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getPageUrl_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getPageUrlsFollowingSiteSearch_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getPageUrlsFollowingSiteSearch_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getPageUrlsFollowingSiteSearch_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getPageUrlsFollowingSiteSearch_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getPageUrlsFollowingSiteSearch_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getPageUrlsFollowingSiteSearch_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getPageUrlsFollowingSiteSearch_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getPageUrlsFollowingSiteSearch_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getPageUrls_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getPageUrls_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getPageUrls_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getPageUrls_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getPageUrls_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getPageUrls_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getPageUrls_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getPageUrls_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getSiteSearchCategories_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getSiteSearchCategories_day.xml
index a91076f826..a91076f826 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getSiteSearchCategories_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getSiteSearchCategories_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getSiteSearchCategories_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getSiteSearchCategories_week.xml
index a91076f826..a91076f826 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getSiteSearchCategories_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getSiteSearchCategories_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getSiteSearchKeywords_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getSiteSearchKeywords_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getSiteSearchKeywords_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getSiteSearchKeywords_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getSiteSearchKeywords_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getSiteSearchKeywords_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getSiteSearchKeywords_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getSiteSearchKeywords_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getSiteSearchNoResultKeywords_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getSiteSearchNoResultKeywords_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getSiteSearchNoResultKeywords_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getSiteSearchNoResultKeywords_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getSiteSearchNoResultKeywords_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getSiteSearchNoResultKeywords_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.getSiteSearchNoResultKeywords_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.getSiteSearchNoResultKeywords_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.get_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.get_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.get_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.get_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.get_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Actions.get_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Actions.get_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Contents.getContentNames_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Contents.getContentNames_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Contents.getContentNames_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Contents.getContentNames_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Contents.getContentNames_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Contents.getContentNames_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Contents.getContentNames_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Contents.getContentNames_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Contents.getContentPieces_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Contents.getContentPieces_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Contents.getContentPieces_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Contents.getContentPieces_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Contents.getContentPieces_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Contents.getContentPieces_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Contents.getContentPieces_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Contents.getContentPieces_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__CustomVariables.getCustomVariables_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__CustomVariables.getCustomVariables_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__CustomVariables.getCustomVariables_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__CustomVariables.getCustomVariables_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__CustomVariables.getCustomVariables_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__CustomVariables.getCustomVariables_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__CustomVariables.getCustomVariables_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__CustomVariables.getCustomVariables_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__DevicesDetection.getBrand_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__DevicesDetection.getBrand_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__DevicesDetection.getBrand_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__DevicesDetection.getBrand_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__DevicesDetection.getBrand_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__DevicesDetection.getBrand_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__DevicesDetection.getBrand_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__DevicesDetection.getBrand_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__DevicesDetection.getBrowserEngines_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__DevicesDetection.getBrowserEngines_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__DevicesDetection.getBrowserEngines_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__DevicesDetection.getBrowserEngines_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__DevicesDetection.getBrowserEngines_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__DevicesDetection.getBrowserEngines_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__DevicesDetection.getBrowserEngines_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__DevicesDetection.getBrowserEngines_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__DevicesDetection.getBrowserFamilies_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__DevicesDetection.getBrowserFamilies_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__DevicesDetection.getBrowserFamilies_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__DevicesDetection.getBrowserFamilies_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__DevicesDetection.getBrowserFamilies_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__DevicesDetection.getBrowserFamilies_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__DevicesDetection.getBrowserFamilies_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__DevicesDetection.getBrowserFamilies_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__DevicesDetection.getBrowserVersions_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__DevicesDetection.getBrowserVersions_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__DevicesDetection.getBrowserVersions_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__DevicesDetection.getBrowserVersions_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__DevicesDetection.getBrowserVersions_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__DevicesDetection.getBrowserVersions_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__DevicesDetection.getBrowserVersions_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__DevicesDetection.getBrowserVersions_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__DevicesDetection.getModel_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__DevicesDetection.getModel_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__DevicesDetection.getModel_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__DevicesDetection.getModel_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__DevicesDetection.getModel_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__DevicesDetection.getModel_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__DevicesDetection.getModel_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__DevicesDetection.getModel_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__DevicesDetection.getOsFamilies_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__DevicesDetection.getOsFamilies_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__DevicesDetection.getOsFamilies_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__DevicesDetection.getOsFamilies_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__DevicesDetection.getOsFamilies_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__DevicesDetection.getOsFamilies_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__DevicesDetection.getOsFamilies_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__DevicesDetection.getOsFamilies_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__DevicesDetection.getOsVersions_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__DevicesDetection.getOsVersions_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__DevicesDetection.getOsVersions_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__DevicesDetection.getOsVersions_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__DevicesDetection.getOsVersions_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__DevicesDetection.getOsVersions_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__DevicesDetection.getOsVersions_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__DevicesDetection.getOsVersions_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__DevicesDetection.getType_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__DevicesDetection.getType_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__DevicesDetection.getType_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__DevicesDetection.getType_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__DevicesDetection.getType_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__DevicesDetection.getType_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__DevicesDetection.getType_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__DevicesDetection.getType_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Events.getAction_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Events.getAction_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Events.getAction_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Events.getAction_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Events.getAction_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Events.getAction_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Events.getAction_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Events.getAction_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Events.getCategory_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Events.getCategory_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Events.getCategory_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Events.getCategory_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Events.getCategory_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Events.getCategory_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Events.getCategory_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Events.getCategory_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Events.getName_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Events.getName_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Events.getName_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Events.getName_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Events.getName_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Events.getName_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Events.getName_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Events.getName_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__ExamplePlugin.getAnswerToLife.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__ExamplePlugin.getAnswerToLife.xml
index 36a787c47a..36a787c47a 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__ExamplePlugin.getAnswerToLife.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__ExamplePlugin.getAnswerToLife.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__ExamplePlugin.getExampleReport_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__ExamplePlugin.getExampleReport_day.xml
index 1b2fed39f9..1b2fed39f9 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__ExamplePlugin.getExampleReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__ExamplePlugin.getExampleReport_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__ExamplePlugin.getExampleReport_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__ExamplePlugin.getExampleReport_week.xml
index 1b2fed39f9..1b2fed39f9 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__ExamplePlugin.getExampleReport_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__ExamplePlugin.getExampleReport_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Goals.getDaysToConversion_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Goals.getDaysToConversion_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Goals.getDaysToConversion_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Goals.getDaysToConversion_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Goals.getDaysToConversion_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Goals.getDaysToConversion_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Goals.getDaysToConversion_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Goals.getDaysToConversion_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Goals.getGoals.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Goals.getGoals.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Goals.getGoals.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Goals.getGoals.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Goals.getItemsCategory_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Goals.getItemsCategory_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Goals.getItemsCategory_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Goals.getItemsCategory_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Goals.getItemsCategory_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Goals.getItemsCategory_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Goals.getItemsCategory_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Goals.getItemsCategory_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Goals.getItemsName_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Goals.getItemsName_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Goals.getItemsName_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Goals.getItemsName_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Goals.getItemsName_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Goals.getItemsName_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Goals.getItemsName_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Goals.getItemsName_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Goals.getItemsSku_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Goals.getItemsSku_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Goals.getItemsSku_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Goals.getItemsSku_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Goals.getItemsSku_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Goals.getItemsSku_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Goals.getItemsSku_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Goals.getItemsSku_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Goals.getVisitsUntilConversion_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Goals.getVisitsUntilConversion_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Goals.getVisitsUntilConversion_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Goals.getVisitsUntilConversion_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Goals.getVisitsUntilConversion_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Goals.getVisitsUntilConversion_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Goals.getVisitsUntilConversion_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Goals.getVisitsUntilConversion_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Goals.get_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Goals.get_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Goals.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Goals.get_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Goals.get_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Goals.get_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Goals.get_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Goals.get_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__MultiSites.getAll_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__MultiSites.getAll_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__MultiSites.getAll_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__MultiSites.getAll_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__MultiSites.getAll_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__MultiSites.getAll_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__MultiSites.getAll_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__MultiSites.getAll_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__MultiSites.getOne_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__MultiSites.getOne_day.xml
index b34eb3e56b..b34eb3e56b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__MultiSites.getOne_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__MultiSites.getOne_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__MultiSites.getOne_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__MultiSites.getOne_week.xml
index 61e2dd5a02..61e2dd5a02 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__MultiSites.getOne_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__MultiSites.getOne_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Provider.getProvider_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Provider.getProvider_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Provider.getProvider_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Provider.getProvider_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Provider.getProvider_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Provider.getProvider_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Provider.getProvider_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Provider.getProvider_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getAll_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getAll_day.xml
index 64d7aebcb2..64d7aebcb2 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getAll_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getAll_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getAll_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getAll_week.xml
index 64d7aebcb2..64d7aebcb2 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getAll_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getAll_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getCampaigns_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getCampaigns_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getCampaigns_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getCampaigns_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getCampaigns_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getCampaigns_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getCampaigns_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getCampaigns_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getKeywordsForPageUrl_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getKeywordsForPageUrl_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getKeywordsForPageUrl_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getKeywordsForPageUrl_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getKeywordsForPageUrl_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getKeywordsForPageUrl_week.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getKeywordsForPageUrl_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getKeywordsForPageUrl_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getKeywords_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getKeywords_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getKeywords_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getKeywords_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getKeywords_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getKeywords_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getKeywords_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getKeywords_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getNumberOfDistinctCampaigns_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getNumberOfDistinctCampaigns_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getNumberOfDistinctCampaigns_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getNumberOfDistinctCampaigns_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getNumberOfDistinctCampaigns_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getNumberOfDistinctCampaigns_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getNumberOfDistinctCampaigns_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getNumberOfDistinctCampaigns_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getNumberOfDistinctKeywords_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getNumberOfDistinctKeywords_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getNumberOfDistinctKeywords_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getNumberOfDistinctKeywords_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getNumberOfDistinctKeywords_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getNumberOfDistinctKeywords_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getNumberOfDistinctKeywords_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getNumberOfDistinctKeywords_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getNumberOfDistinctSearchEngines_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getNumberOfDistinctSearchEngines_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getNumberOfDistinctSearchEngines_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getNumberOfDistinctSearchEngines_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getNumberOfDistinctSearchEngines_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getNumberOfDistinctSearchEngines_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getNumberOfDistinctSearchEngines_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getNumberOfDistinctSearchEngines_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getNumberOfDistinctWebsitesUrls_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getNumberOfDistinctWebsitesUrls_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getNumberOfDistinctWebsitesUrls_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getNumberOfDistinctWebsitesUrls_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getNumberOfDistinctWebsitesUrls_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getNumberOfDistinctWebsitesUrls_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getNumberOfDistinctWebsitesUrls_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getNumberOfDistinctWebsitesUrls_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getNumberOfDistinctWebsites_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getNumberOfDistinctWebsites_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getNumberOfDistinctWebsites_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getNumberOfDistinctWebsites_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getNumberOfDistinctWebsites_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getNumberOfDistinctWebsites_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getNumberOfDistinctWebsites_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getNumberOfDistinctWebsites_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getReferrerType_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getReferrerType_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getReferrerType_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getReferrerType_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getReferrerType_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getReferrerType_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getReferrerType_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getReferrerType_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getSearchEngines_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getSearchEngines_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getSearchEngines_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getSearchEngines_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getSearchEngines_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getSearchEngines_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getSearchEngines_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getSearchEngines_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getSocials_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getSocials_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getSocials_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getSocials_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getSocials_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getSocials_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getSocials_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getSocials_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getUrlsForSocial_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getUrlsForSocial_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getUrlsForSocial_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getUrlsForSocial_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getUrlsForSocial_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getUrlsForSocial_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getUrlsForSocial_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getUrlsForSocial_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getWebsites_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getWebsites_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getWebsites_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getWebsites_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getWebsites_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getWebsites_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__Referrers.getWebsites_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__Referrers.getWebsites_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserCountry.getCity_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserCountry.getCity_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserCountry.getCity_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserCountry.getCity_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserCountry.getCity_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserCountry.getCity_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserCountry.getCity_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserCountry.getCity_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserCountry.getContinent_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserCountry.getContinent_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserCountry.getContinent_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserCountry.getContinent_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserCountry.getContinent_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserCountry.getContinent_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserCountry.getContinent_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserCountry.getContinent_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserCountry.getCountry_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserCountry.getCountry_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserCountry.getCountry_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserCountry.getCountry_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserCountry.getCountry_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserCountry.getCountry_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserCountry.getCountry_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserCountry.getCountry_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserCountry.getNumberOfDistinctCountries_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserCountry.getNumberOfDistinctCountries_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserCountry.getNumberOfDistinctCountries_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserCountry.getNumberOfDistinctCountries_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserCountry.getNumberOfDistinctCountries_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserCountry.getNumberOfDistinctCountries_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserCountry.getNumberOfDistinctCountries_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserCountry.getNumberOfDistinctCountries_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserCountry.getRegion_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserCountry.getRegion_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserCountry.getRegion_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserCountry.getRegion_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserCountry.getRegion_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserCountry.getRegion_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserCountry.getRegion_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserCountry.getRegion_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserSettings.getBrowserVersion_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserSettings.getBrowserVersion_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserSettings.getBrowserVersion_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserSettings.getBrowserVersion_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserSettings.getBrowserVersion_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserSettings.getBrowserVersion_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserSettings.getBrowserVersion_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserSettings.getBrowserVersion_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserSettings.getBrowser_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserSettings.getBrowser_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserSettings.getBrowser_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserSettings.getBrowser_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserSettings.getBrowser_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserSettings.getBrowser_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserSettings.getBrowser_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserSettings.getBrowser_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserSettings.getConfiguration_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserSettings.getConfiguration_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserSettings.getConfiguration_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserSettings.getConfiguration_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserSettings.getConfiguration_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserSettings.getConfiguration_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserSettings.getConfiguration_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserSettings.getConfiguration_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserSettings.getLanguageCode_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserSettings.getLanguageCode_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserSettings.getLanguageCode_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserSettings.getLanguageCode_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserSettings.getLanguageCode_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserSettings.getLanguageCode_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserSettings.getLanguageCode_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserSettings.getLanguageCode_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserSettings.getLanguage_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserSettings.getLanguage_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserSettings.getLanguage_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserSettings.getLanguage_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserSettings.getLanguage_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserSettings.getLanguage_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserSettings.getLanguage_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserSettings.getLanguage_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserSettings.getMobileVsDesktop_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserSettings.getMobileVsDesktop_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserSettings.getMobileVsDesktop_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserSettings.getMobileVsDesktop_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserSettings.getMobileVsDesktop_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserSettings.getMobileVsDesktop_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserSettings.getMobileVsDesktop_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserSettings.getMobileVsDesktop_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserSettings.getOSFamily_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserSettings.getOSFamily_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserSettings.getOSFamily_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserSettings.getOSFamily_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserSettings.getOSFamily_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserSettings.getOSFamily_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserSettings.getOSFamily_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserSettings.getOSFamily_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserSettings.getOS_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserSettings.getOS_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserSettings.getOS_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserSettings.getOS_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserSettings.getOS_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserSettings.getOS_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserSettings.getOS_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserSettings.getOS_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserSettings.getPlugin_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserSettings.getPlugin_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserSettings.getPlugin_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserSettings.getPlugin_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserSettings.getPlugin_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserSettings.getPlugin_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserSettings.getPlugin_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserSettings.getPlugin_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserSettings.getResolution_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserSettings.getResolution_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserSettings.getResolution_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserSettings.getResolution_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserSettings.getResolution_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserSettings.getResolution_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserSettings.getResolution_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserSettings.getResolution_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserSettings.getWideScreen_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserSettings.getWideScreen_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserSettings.getWideScreen_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserSettings.getWideScreen_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserSettings.getWideScreen_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserSettings.getWideScreen_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__UserSettings.getWideScreen_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__UserSettings.getWideScreen_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitFrequency.get_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitFrequency.get_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitFrequency.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitFrequency.get_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitFrequency.get_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitFrequency.get_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitFrequency.get_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitFrequency.get_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitTime.getByDayOfWeek_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitTime.getByDayOfWeek_day.xml
index 547baf7416..547baf7416 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitTime.getByDayOfWeek_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitTime.getByDayOfWeek_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitTime.getByDayOfWeek_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitTime.getByDayOfWeek_week.xml
index 547baf7416..547baf7416 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitTime.getByDayOfWeek_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitTime.getByDayOfWeek_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitTime.getVisitInformationPerLocalTime_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitTime.getVisitInformationPerLocalTime_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitTime.getVisitInformationPerLocalTime_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitTime.getVisitInformationPerLocalTime_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitTime.getVisitInformationPerLocalTime_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitTime.getVisitInformationPerLocalTime_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitTime.getVisitInformationPerLocalTime_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitTime.getVisitInformationPerLocalTime_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitTime.getVisitInformationPerServerTime_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitTime.getVisitInformationPerServerTime_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitTime.getVisitInformationPerServerTime_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitTime.getVisitInformationPerServerTime_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitTime.getVisitInformationPerServerTime_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitTime.getVisitInformationPerServerTime_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitTime.getVisitInformationPerServerTime_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitTime.getVisitInformationPerServerTime_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitorInterest.getNumberOfVisitsByDaysSinceLast_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitorInterest.getNumberOfVisitsByDaysSinceLast_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitorInterest.getNumberOfVisitsByDaysSinceLast_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitorInterest.getNumberOfVisitsByDaysSinceLast_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitorInterest.getNumberOfVisitsByDaysSinceLast_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitorInterest.getNumberOfVisitsByDaysSinceLast_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitorInterest.getNumberOfVisitsByDaysSinceLast_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitorInterest.getNumberOfVisitsByDaysSinceLast_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitorInterest.getNumberOfVisitsByVisitCount_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitorInterest.getNumberOfVisitsByVisitCount_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitorInterest.getNumberOfVisitsByVisitCount_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitorInterest.getNumberOfVisitsByVisitCount_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitorInterest.getNumberOfVisitsByVisitCount_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitorInterest.getNumberOfVisitsByVisitCount_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitorInterest.getNumberOfVisitsByVisitCount_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitorInterest.getNumberOfVisitsByVisitCount_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitorInterest.getNumberOfVisitsPerPage_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitorInterest.getNumberOfVisitsPerPage_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitorInterest.getNumberOfVisitsPerPage_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitorInterest.getNumberOfVisitsPerPage_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitorInterest.getNumberOfVisitsPerPage_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitorInterest.getNumberOfVisitsPerPage_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitorInterest.getNumberOfVisitsPerPage_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitorInterest.getNumberOfVisitsPerPage_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitorInterest.getNumberOfVisitsPerVisitDuration_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitorInterest.getNumberOfVisitsPerVisitDuration_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitorInterest.getNumberOfVisitsPerVisitDuration_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitorInterest.getNumberOfVisitsPerVisitDuration_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitorInterest.getNumberOfVisitsPerVisitDuration_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitorInterest.getNumberOfVisitsPerVisitDuration_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitorInterest.getNumberOfVisitsPerVisitDuration_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitorInterest.getNumberOfVisitsPerVisitDuration_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitsSummary.getActions_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitsSummary.getActions_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitsSummary.getActions_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitsSummary.getActions_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitsSummary.getActions_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitsSummary.getActions_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitsSummary.getActions_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitsSummary.getActions_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitsSummary.getBounceCount_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitsSummary.getBounceCount_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitsSummary.getBounceCount_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitsSummary.getBounceCount_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitsSummary.getBounceCount_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitsSummary.getBounceCount_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitsSummary.getBounceCount_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitsSummary.getBounceCount_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitsSummary.getMaxActions_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitsSummary.getMaxActions_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitsSummary.getMaxActions_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitsSummary.getMaxActions_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitsSummary.getMaxActions_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitsSummary.getMaxActions_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitsSummary.getMaxActions_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitsSummary.getMaxActions_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitsSummary.getSumVisitsLengthPretty_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitsSummary.getSumVisitsLengthPretty_day.xml
index c908c9a75d..c908c9a75d 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitsSummary.getSumVisitsLengthPretty_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitsSummary.getSumVisitsLengthPretty_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitsSummary.getSumVisitsLengthPretty_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitsSummary.getSumVisitsLengthPretty_week.xml
index 1f731a8248..1f731a8248 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitsSummary.getSumVisitsLengthPretty_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitsSummary.getSumVisitsLengthPretty_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitsSummary.getSumVisitsLength_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitsSummary.getSumVisitsLength_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitsSummary.getSumVisitsLength_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitsSummary.getSumVisitsLength_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitsSummary.getSumVisitsLength_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitsSummary.getSumVisitsLength_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitsSummary.getSumVisitsLength_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitsSummary.getSumVisitsLength_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitsSummary.getUniqueVisitors_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitsSummary.getUniqueVisitors_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitsSummary.getUniqueVisitors_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitsSummary.getUniqueVisitors_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitsSummary.getUniqueVisitors_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitsSummary.getUniqueVisitors_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitsSummary.getUniqueVisitors_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitsSummary.getUniqueVisitors_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitsSummary.getUsers_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitsSummary.getUsers_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitsSummary.getUsers_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitsSummary.getUsers_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitsSummary.getUsers_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitsSummary.getUsers_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitsSummary.getUsers_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitsSummary.getUsers_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitsSummary.getVisitsConverted_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitsSummary.getVisitsConverted_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitsSummary.getVisitsConverted_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitsSummary.getVisitsConverted_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitsSummary.getVisitsConverted_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitsSummary.getVisitsConverted_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitsSummary.getVisitsConverted_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitsSummary.getVisitsConverted_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitsSummary.getVisits_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitsSummary.getVisits_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitsSummary.getVisits_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitsSummary.getVisits_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitsSummary.getVisits_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitsSummary.getVisits_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitsSummary.getVisits_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitsSummary.getVisits_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitsSummary.get_day.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitsSummary.get_day.xml
index 106f23f16b..106f23f16b 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitsSummary.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitsSummary.get_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitsSummary.get_week.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitsSummary.get_week.xml
index 5cfb246edc..5cfb246edc 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit_PeriodIsLast__VisitsSummary.get_week.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__VisitsSummary.get_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__Actions.getDownload_day.xml b/tests/PHPUnit/System/expected/test_noVisit__Actions.getDownload_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__Actions.getDownload_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__Actions.getDownload_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__Actions.getDownloads_day.xml b/tests/PHPUnit/System/expected/test_noVisit__Actions.getDownloads_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__Actions.getDownloads_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__Actions.getDownloads_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__Actions.getEntryPageTitles_day.xml b/tests/PHPUnit/System/expected/test_noVisit__Actions.getEntryPageTitles_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__Actions.getEntryPageTitles_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__Actions.getEntryPageTitles_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__Actions.getEntryPageUrls_day.xml b/tests/PHPUnit/System/expected/test_noVisit__Actions.getEntryPageUrls_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__Actions.getEntryPageUrls_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__Actions.getEntryPageUrls_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__Actions.getExitPageTitles_day.xml b/tests/PHPUnit/System/expected/test_noVisit__Actions.getExitPageTitles_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__Actions.getExitPageTitles_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__Actions.getExitPageTitles_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__Actions.getExitPageUrls_day.xml b/tests/PHPUnit/System/expected/test_noVisit__Actions.getExitPageUrls_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__Actions.getExitPageUrls_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__Actions.getExitPageUrls_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__Actions.getOutlink_day.xml b/tests/PHPUnit/System/expected/test_noVisit__Actions.getOutlink_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__Actions.getOutlink_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__Actions.getOutlink_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__Actions.getOutlinks_day.xml b/tests/PHPUnit/System/expected/test_noVisit__Actions.getOutlinks_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__Actions.getOutlinks_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__Actions.getOutlinks_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__Actions.getPageTitle_day.xml b/tests/PHPUnit/System/expected/test_noVisit__Actions.getPageTitle_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__Actions.getPageTitle_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__Actions.getPageTitle_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__Actions.getPageTitlesFollowingSiteSearch_day.xml b/tests/PHPUnit/System/expected/test_noVisit__Actions.getPageTitlesFollowingSiteSearch_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__Actions.getPageTitlesFollowingSiteSearch_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__Actions.getPageTitlesFollowingSiteSearch_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__Actions.getPageTitles_day.xml b/tests/PHPUnit/System/expected/test_noVisit__Actions.getPageTitles_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__Actions.getPageTitles_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__Actions.getPageTitles_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__Actions.getPageUrl_day.xml b/tests/PHPUnit/System/expected/test_noVisit__Actions.getPageUrl_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__Actions.getPageUrl_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__Actions.getPageUrl_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__Actions.getPageUrlsFollowingSiteSearch_day.xml b/tests/PHPUnit/System/expected/test_noVisit__Actions.getPageUrlsFollowingSiteSearch_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__Actions.getPageUrlsFollowingSiteSearch_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__Actions.getPageUrlsFollowingSiteSearch_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__Actions.getPageUrls_day.xml b/tests/PHPUnit/System/expected/test_noVisit__Actions.getPageUrls_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__Actions.getPageUrls_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__Actions.getPageUrls_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__Actions.getSiteSearchCategories_day.xml b/tests/PHPUnit/System/expected/test_noVisit__Actions.getSiteSearchCategories_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__Actions.getSiteSearchCategories_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__Actions.getSiteSearchCategories_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__Actions.getSiteSearchKeywords_day.xml b/tests/PHPUnit/System/expected/test_noVisit__Actions.getSiteSearchKeywords_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__Actions.getSiteSearchKeywords_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__Actions.getSiteSearchKeywords_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__Actions.getSiteSearchNoResultKeywords_day.xml b/tests/PHPUnit/System/expected/test_noVisit__Actions.getSiteSearchNoResultKeywords_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__Actions.getSiteSearchNoResultKeywords_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__Actions.getSiteSearchNoResultKeywords_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__Actions.get_day.xml b/tests/PHPUnit/System/expected/test_noVisit__Actions.get_day.xml
index 6eb4818cba..6eb4818cba 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__Actions.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__Actions.get_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__Contents.getContentNames_day.xml b/tests/PHPUnit/System/expected/test_noVisit__Contents.getContentNames_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__Contents.getContentNames_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__Contents.getContentNames_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__Contents.getContentPieces_day.xml b/tests/PHPUnit/System/expected/test_noVisit__Contents.getContentPieces_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__Contents.getContentPieces_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__Contents.getContentPieces_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__CustomVariables.getCustomVariables_day.xml b/tests/PHPUnit/System/expected/test_noVisit__CustomVariables.getCustomVariables_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__CustomVariables.getCustomVariables_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__CustomVariables.getCustomVariables_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__DevicesDetection.getBrand_day.xml b/tests/PHPUnit/System/expected/test_noVisit__DevicesDetection.getBrand_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__DevicesDetection.getBrand_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__DevicesDetection.getBrand_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__DevicesDetection.getBrowserEngines_day.xml b/tests/PHPUnit/System/expected/test_noVisit__DevicesDetection.getBrowserEngines_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__DevicesDetection.getBrowserEngines_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__DevicesDetection.getBrowserEngines_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__DevicesDetection.getBrowserFamilies_day.xml b/tests/PHPUnit/System/expected/test_noVisit__DevicesDetection.getBrowserFamilies_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__DevicesDetection.getBrowserFamilies_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__DevicesDetection.getBrowserFamilies_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__DevicesDetection.getBrowserVersions_day.xml b/tests/PHPUnit/System/expected/test_noVisit__DevicesDetection.getBrowserVersions_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__DevicesDetection.getBrowserVersions_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__DevicesDetection.getBrowserVersions_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__DevicesDetection.getModel_day.xml b/tests/PHPUnit/System/expected/test_noVisit__DevicesDetection.getModel_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__DevicesDetection.getModel_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__DevicesDetection.getModel_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__DevicesDetection.getOsFamilies_day.xml b/tests/PHPUnit/System/expected/test_noVisit__DevicesDetection.getOsFamilies_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__DevicesDetection.getOsFamilies_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__DevicesDetection.getOsFamilies_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__DevicesDetection.getOsVersions_day.xml b/tests/PHPUnit/System/expected/test_noVisit__DevicesDetection.getOsVersions_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__DevicesDetection.getOsVersions_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__DevicesDetection.getOsVersions_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__DevicesDetection.getType_day.xml b/tests/PHPUnit/System/expected/test_noVisit__DevicesDetection.getType_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__DevicesDetection.getType_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__DevicesDetection.getType_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__Events.getAction_day.xml b/tests/PHPUnit/System/expected/test_noVisit__Events.getAction_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__Events.getAction_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__Events.getAction_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__Events.getCategory_day.xml b/tests/PHPUnit/System/expected/test_noVisit__Events.getCategory_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__Events.getCategory_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__Events.getCategory_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__Events.getName_day.xml b/tests/PHPUnit/System/expected/test_noVisit__Events.getName_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__Events.getName_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__Events.getName_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__ExamplePlugin.getAnswerToLife.xml b/tests/PHPUnit/System/expected/test_noVisit__ExamplePlugin.getAnswerToLife.xml
index 36a787c47a..36a787c47a 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__ExamplePlugin.getAnswerToLife.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__ExamplePlugin.getAnswerToLife.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__ExamplePlugin.getExampleReport_day.xml b/tests/PHPUnit/System/expected/test_noVisit__ExamplePlugin.getExampleReport_day.xml
index 1b2fed39f9..1b2fed39f9 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__ExamplePlugin.getExampleReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__ExamplePlugin.getExampleReport_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__Goals.getDaysToConversion_day.xml b/tests/PHPUnit/System/expected/test_noVisit__Goals.getDaysToConversion_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__Goals.getDaysToConversion_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__Goals.getDaysToConversion_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__Goals.getGoals.xml b/tests/PHPUnit/System/expected/test_noVisit__Goals.getGoals.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__Goals.getGoals.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__Goals.getGoals.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__Goals.getItemsCategory_day.xml b/tests/PHPUnit/System/expected/test_noVisit__Goals.getItemsCategory_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__Goals.getItemsCategory_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__Goals.getItemsCategory_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__Goals.getItemsName_day.xml b/tests/PHPUnit/System/expected/test_noVisit__Goals.getItemsName_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__Goals.getItemsName_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__Goals.getItemsName_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__Goals.getItemsSku_day.xml b/tests/PHPUnit/System/expected/test_noVisit__Goals.getItemsSku_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__Goals.getItemsSku_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__Goals.getItemsSku_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__Goals.getVisitsUntilConversion_day.xml b/tests/PHPUnit/System/expected/test_noVisit__Goals.getVisitsUntilConversion_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__Goals.getVisitsUntilConversion_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__Goals.getVisitsUntilConversion_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__Goals.get_day.xml b/tests/PHPUnit/System/expected/test_noVisit__Goals.get_day.xml
index 257dd359a5..257dd359a5 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__Goals.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__Goals.get_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__MultiSites.getAll_day.xml b/tests/PHPUnit/System/expected/test_noVisit__MultiSites.getAll_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__MultiSites.getAll_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__MultiSites.getAll_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__MultiSites.getOne_day.xml b/tests/PHPUnit/System/expected/test_noVisit__MultiSites.getOne_day.xml
index 2c523aeb3e..2c523aeb3e 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__MultiSites.getOne_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__MultiSites.getOne_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__Provider.getProvider_day.xml b/tests/PHPUnit/System/expected/test_noVisit__Provider.getProvider_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__Provider.getProvider_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__Provider.getProvider_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__Referrers.getAll_day.xml b/tests/PHPUnit/System/expected/test_noVisit__Referrers.getAll_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__Referrers.getAll_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__Referrers.getAll_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__Referrers.getCampaigns_day.xml b/tests/PHPUnit/System/expected/test_noVisit__Referrers.getCampaigns_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__Referrers.getCampaigns_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__Referrers.getCampaigns_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__Referrers.getKeywordsForPageUrl_day.xml b/tests/PHPUnit/System/expected/test_noVisit__Referrers.getKeywordsForPageUrl_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__Referrers.getKeywordsForPageUrl_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__Referrers.getKeywordsForPageUrl_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__Referrers.getKeywords_day.xml b/tests/PHPUnit/System/expected/test_noVisit__Referrers.getKeywords_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__Referrers.getKeywords_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__Referrers.getKeywords_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__Referrers.getNumberOfDistinctCampaigns_day.xml b/tests/PHPUnit/System/expected/test_noVisit__Referrers.getNumberOfDistinctCampaigns_day.xml
index f5722c2b94..f5722c2b94 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__Referrers.getNumberOfDistinctCampaigns_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__Referrers.getNumberOfDistinctCampaigns_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__Referrers.getNumberOfDistinctKeywords_day.xml b/tests/PHPUnit/System/expected/test_noVisit__Referrers.getNumberOfDistinctKeywords_day.xml
index f5722c2b94..f5722c2b94 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__Referrers.getNumberOfDistinctKeywords_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__Referrers.getNumberOfDistinctKeywords_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__Referrers.getNumberOfDistinctSearchEngines_day.xml b/tests/PHPUnit/System/expected/test_noVisit__Referrers.getNumberOfDistinctSearchEngines_day.xml
index f5722c2b94..f5722c2b94 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__Referrers.getNumberOfDistinctSearchEngines_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__Referrers.getNumberOfDistinctSearchEngines_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__Referrers.getNumberOfDistinctWebsitesUrls_day.xml b/tests/PHPUnit/System/expected/test_noVisit__Referrers.getNumberOfDistinctWebsitesUrls_day.xml
index f5722c2b94..f5722c2b94 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__Referrers.getNumberOfDistinctWebsitesUrls_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__Referrers.getNumberOfDistinctWebsitesUrls_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__Referrers.getNumberOfDistinctWebsites_day.xml b/tests/PHPUnit/System/expected/test_noVisit__Referrers.getNumberOfDistinctWebsites_day.xml
index f5722c2b94..f5722c2b94 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__Referrers.getNumberOfDistinctWebsites_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__Referrers.getNumberOfDistinctWebsites_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__Referrers.getReferrerType_day.xml b/tests/PHPUnit/System/expected/test_noVisit__Referrers.getReferrerType_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__Referrers.getReferrerType_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__Referrers.getReferrerType_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__Referrers.getSearchEngines_day.xml b/tests/PHPUnit/System/expected/test_noVisit__Referrers.getSearchEngines_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__Referrers.getSearchEngines_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__Referrers.getSearchEngines_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__Referrers.getSocials_day.xml b/tests/PHPUnit/System/expected/test_noVisit__Referrers.getSocials_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__Referrers.getSocials_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__Referrers.getSocials_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__Referrers.getUrlsForSocial_day.xml b/tests/PHPUnit/System/expected/test_noVisit__Referrers.getUrlsForSocial_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__Referrers.getUrlsForSocial_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__Referrers.getUrlsForSocial_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__Referrers.getWebsites_day.xml b/tests/PHPUnit/System/expected/test_noVisit__Referrers.getWebsites_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__Referrers.getWebsites_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__Referrers.getWebsites_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__UserCountry.getCity_day.xml b/tests/PHPUnit/System/expected/test_noVisit__UserCountry.getCity_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__UserCountry.getCity_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__UserCountry.getCity_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__UserCountry.getContinent_day.xml b/tests/PHPUnit/System/expected/test_noVisit__UserCountry.getContinent_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__UserCountry.getContinent_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__UserCountry.getContinent_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__UserCountry.getCountry_day.xml b/tests/PHPUnit/System/expected/test_noVisit__UserCountry.getCountry_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__UserCountry.getCountry_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__UserCountry.getCountry_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__UserCountry.getNumberOfDistinctCountries_day.xml b/tests/PHPUnit/System/expected/test_noVisit__UserCountry.getNumberOfDistinctCountries_day.xml
index f5722c2b94..f5722c2b94 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__UserCountry.getNumberOfDistinctCountries_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__UserCountry.getNumberOfDistinctCountries_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__UserCountry.getRegion_day.xml b/tests/PHPUnit/System/expected/test_noVisit__UserCountry.getRegion_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__UserCountry.getRegion_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__UserCountry.getRegion_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__UserSettings.getBrowserVersion_day.xml b/tests/PHPUnit/System/expected/test_noVisit__UserSettings.getBrowserVersion_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__UserSettings.getBrowserVersion_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__UserSettings.getBrowserVersion_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__UserSettings.getBrowser_day.xml b/tests/PHPUnit/System/expected/test_noVisit__UserSettings.getBrowser_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__UserSettings.getBrowser_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__UserSettings.getBrowser_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__UserSettings.getConfiguration_day.xml b/tests/PHPUnit/System/expected/test_noVisit__UserSettings.getConfiguration_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__UserSettings.getConfiguration_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__UserSettings.getConfiguration_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__UserSettings.getLanguageCode_day.xml b/tests/PHPUnit/System/expected/test_noVisit__UserSettings.getLanguageCode_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__UserSettings.getLanguageCode_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__UserSettings.getLanguageCode_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__UserSettings.getLanguage_day.xml b/tests/PHPUnit/System/expected/test_noVisit__UserSettings.getLanguage_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__UserSettings.getLanguage_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__UserSettings.getLanguage_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__UserSettings.getMobileVsDesktop_day.xml b/tests/PHPUnit/System/expected/test_noVisit__UserSettings.getMobileVsDesktop_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__UserSettings.getMobileVsDesktop_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__UserSettings.getMobileVsDesktop_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__UserSettings.getOSFamily_day.xml b/tests/PHPUnit/System/expected/test_noVisit__UserSettings.getOSFamily_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__UserSettings.getOSFamily_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__UserSettings.getOSFamily_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__UserSettings.getOS_day.xml b/tests/PHPUnit/System/expected/test_noVisit__UserSettings.getOS_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__UserSettings.getOS_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__UserSettings.getOS_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__UserSettings.getPlugin_day.xml b/tests/PHPUnit/System/expected/test_noVisit__UserSettings.getPlugin_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__UserSettings.getPlugin_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__UserSettings.getPlugin_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__UserSettings.getResolution_day.xml b/tests/PHPUnit/System/expected/test_noVisit__UserSettings.getResolution_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__UserSettings.getResolution_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__UserSettings.getResolution_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__UserSettings.getWideScreen_day.xml b/tests/PHPUnit/System/expected/test_noVisit__UserSettings.getWideScreen_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__UserSettings.getWideScreen_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__UserSettings.getWideScreen_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__VisitFrequency.get_day.xml b/tests/PHPUnit/System/expected/test_noVisit__VisitFrequency.get_day.xml
index c415099916..c415099916 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__VisitFrequency.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__VisitFrequency.get_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__VisitTime.getByDayOfWeek_day.xml b/tests/PHPUnit/System/expected/test_noVisit__VisitTime.getByDayOfWeek_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__VisitTime.getByDayOfWeek_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__VisitTime.getByDayOfWeek_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__VisitTime.getVisitInformationPerLocalTime_day.xml b/tests/PHPUnit/System/expected/test_noVisit__VisitTime.getVisitInformationPerLocalTime_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__VisitTime.getVisitInformationPerLocalTime_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__VisitTime.getVisitInformationPerLocalTime_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__VisitTime.getVisitInformationPerServerTime_day.xml b/tests/PHPUnit/System/expected/test_noVisit__VisitTime.getVisitInformationPerServerTime_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__VisitTime.getVisitInformationPerServerTime_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__VisitTime.getVisitInformationPerServerTime_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__VisitorInterest.getNumberOfVisitsByDaysSinceLast_day.xml b/tests/PHPUnit/System/expected/test_noVisit__VisitorInterest.getNumberOfVisitsByDaysSinceLast_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__VisitorInterest.getNumberOfVisitsByDaysSinceLast_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__VisitorInterest.getNumberOfVisitsByDaysSinceLast_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__VisitorInterest.getNumberOfVisitsByVisitCount_day.xml b/tests/PHPUnit/System/expected/test_noVisit__VisitorInterest.getNumberOfVisitsByVisitCount_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__VisitorInterest.getNumberOfVisitsByVisitCount_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__VisitorInterest.getNumberOfVisitsByVisitCount_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__VisitorInterest.getNumberOfVisitsPerPage_day.xml b/tests/PHPUnit/System/expected/test_noVisit__VisitorInterest.getNumberOfVisitsPerPage_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__VisitorInterest.getNumberOfVisitsPerPage_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__VisitorInterest.getNumberOfVisitsPerPage_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__VisitorInterest.getNumberOfVisitsPerVisitDuration_day.xml b/tests/PHPUnit/System/expected/test_noVisit__VisitorInterest.getNumberOfVisitsPerVisitDuration_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__VisitorInterest.getNumberOfVisitsPerVisitDuration_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__VisitorInterest.getNumberOfVisitsPerVisitDuration_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__VisitsSummary.getActions_day.xml b/tests/PHPUnit/System/expected/test_noVisit__VisitsSummary.getActions_day.xml
index f5722c2b94..f5722c2b94 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__VisitsSummary.getActions_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__VisitsSummary.getActions_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__VisitsSummary.getBounceCount_day.xml b/tests/PHPUnit/System/expected/test_noVisit__VisitsSummary.getBounceCount_day.xml
index f5722c2b94..f5722c2b94 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__VisitsSummary.getBounceCount_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__VisitsSummary.getBounceCount_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__VisitsSummary.getMaxActions_day.xml b/tests/PHPUnit/System/expected/test_noVisit__VisitsSummary.getMaxActions_day.xml
index f5722c2b94..f5722c2b94 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__VisitsSummary.getMaxActions_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__VisitsSummary.getMaxActions_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__VisitsSummary.getSumVisitsLengthPretty_day.xml b/tests/PHPUnit/System/expected/test_noVisit__VisitsSummary.getSumVisitsLengthPretty_day.xml
index 6b13a17caa..6b13a17caa 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__VisitsSummary.getSumVisitsLengthPretty_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__VisitsSummary.getSumVisitsLengthPretty_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__VisitsSummary.getSumVisitsLength_day.xml b/tests/PHPUnit/System/expected/test_noVisit__VisitsSummary.getSumVisitsLength_day.xml
index f5722c2b94..f5722c2b94 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__VisitsSummary.getSumVisitsLength_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__VisitsSummary.getSumVisitsLength_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__VisitsSummary.getUniqueVisitors_day.xml b/tests/PHPUnit/System/expected/test_noVisit__VisitsSummary.getUniqueVisitors_day.xml
index f5722c2b94..f5722c2b94 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__VisitsSummary.getUniqueVisitors_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__VisitsSummary.getUniqueVisitors_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__VisitsSummary.getUsers_day.xml b/tests/PHPUnit/System/expected/test_noVisit__VisitsSummary.getUsers_day.xml
index f5722c2b94..f5722c2b94 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__VisitsSummary.getUsers_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__VisitsSummary.getUsers_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__VisitsSummary.getVisitsConverted_day.xml b/tests/PHPUnit/System/expected/test_noVisit__VisitsSummary.getVisitsConverted_day.xml
index f5722c2b94..f5722c2b94 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__VisitsSummary.getVisitsConverted_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__VisitsSummary.getVisitsConverted_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__VisitsSummary.getVisits_day.xml b/tests/PHPUnit/System/expected/test_noVisit__VisitsSummary.getVisits_day.xml
index f5722c2b94..f5722c2b94 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__VisitsSummary.getVisits_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__VisitsSummary.getVisits_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_noVisit__VisitsSummary.get_day.xml b/tests/PHPUnit/System/expected/test_noVisit__VisitsSummary.get_day.xml
index 32b66284be..32b66284be 100644
--- a/tests/PHPUnit/Integration/expected/test_noVisit__VisitsSummary.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__VisitsSummary.get_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_oneVisitor_oneWebsite_severalDays_DateRange_IndexedByDate__MultiSites.getAll_day.xml b/tests/PHPUnit/System/expected/test_oneVisitor_oneWebsite_severalDays_DateRange_IndexedByDate__MultiSites.getAll_day.xml
index 75e0ce7728..75e0ce7728 100644
--- a/tests/PHPUnit/Integration/expected/test_oneVisitor_oneWebsite_severalDays_DateRange_IndexedByDate__MultiSites.getAll_day.xml
+++ b/tests/PHPUnit/System/expected/test_oneVisitor_oneWebsite_severalDays_DateRange_IndexedByDate__MultiSites.getAll_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_oneVisitor_oneWebsite_severalDays_DateRange_IndexedByDate__Referrers.getSocials_day.xml b/tests/PHPUnit/System/expected/test_oneVisitor_oneWebsite_severalDays_DateRange_IndexedByDate__Referrers.getSocials_day.xml
index 1ffd258f3c..1ffd258f3c 100644
--- a/tests/PHPUnit/Integration/expected/test_oneVisitor_oneWebsite_severalDays_DateRange_IndexedByDate__Referrers.getSocials_day.xml
+++ b/tests/PHPUnit/System/expected/test_oneVisitor_oneWebsite_severalDays_DateRange_IndexedByDate__Referrers.getSocials_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_oneVisitor_oneWebsite_severalDays_DateRange_MultipleDatesNotSupported__MultiSites.getAll_day.xml b/tests/PHPUnit/System/expected/test_oneVisitor_oneWebsite_severalDays_DateRange_MultipleDatesNotSupported__MultiSites.getAll_day.xml
index 2fb69ad710..2fb69ad710 100644
--- a/tests/PHPUnit/Integration/expected/test_oneVisitor_oneWebsite_severalDays_DateRange_MultipleDatesNotSupported__MultiSites.getAll_day.xml
+++ b/tests/PHPUnit/System/expected/test_oneVisitor_oneWebsite_severalDays_DateRange_MultipleDatesNotSupported__MultiSites.getAll_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_oneVisitor_oneWebsite_severalDays_DateRange__Actions.getPageUrls_range.xml b/tests/PHPUnit/System/expected/test_oneVisitor_oneWebsite_severalDays_DateRange__Actions.getPageUrls_range.xml
index fdcb7efcf3..fdcb7efcf3 100644
--- a/tests/PHPUnit/Integration/expected/test_oneVisitor_oneWebsite_severalDays_DateRange__Actions.getPageUrls_range.xml
+++ b/tests/PHPUnit/System/expected/test_oneVisitor_oneWebsite_severalDays_DateRange__Actions.getPageUrls_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_oneVisitor_oneWebsite_severalDays_DateRange__MultiSites.getAll_range.xml b/tests/PHPUnit/System/expected/test_oneVisitor_oneWebsite_severalDays_DateRange__MultiSites.getAll_range.xml
index 5e03453232..5e03453232 100644
--- a/tests/PHPUnit/Integration/expected/test_oneVisitor_oneWebsite_severalDays_DateRange__MultiSites.getAll_range.xml
+++ b/tests/PHPUnit/System/expected/test_oneVisitor_oneWebsite_severalDays_DateRange__MultiSites.getAll_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_oneVisitor_oneWebsite_severalDays_DateRange__MultiSites.getOne_range.xml b/tests/PHPUnit/System/expected/test_oneVisitor_oneWebsite_severalDays_DateRange__MultiSites.getOne_range.xml
index 148c3cd10d..148c3cd10d 100644
--- a/tests/PHPUnit/Integration/expected/test_oneVisitor_oneWebsite_severalDays_DateRange__MultiSites.getOne_range.xml
+++ b/tests/PHPUnit/System/expected/test_oneVisitor_oneWebsite_severalDays_DateRange__MultiSites.getOne_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_oneVisitor_oneWebsite_severalDays_DateRange__Referrers.getSocials_range.xml b/tests/PHPUnit/System/expected/test_oneVisitor_oneWebsite_severalDays_DateRange__Referrers.getSocials_range.xml
index ec49edb3fd..ec49edb3fd 100644
--- a/tests/PHPUnit/Integration/expected/test_oneVisitor_oneWebsite_severalDays_DateRange__Referrers.getSocials_range.xml
+++ b/tests/PHPUnit/System/expected/test_oneVisitor_oneWebsite_severalDays_DateRange__Referrers.getSocials_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_oneVisitor_oneWebsite_severalDays_DateRange__Referrers.getUrlsForSocial_range.xml b/tests/PHPUnit/System/expected/test_oneVisitor_oneWebsite_severalDays_DateRange__Referrers.getUrlsForSocial_range.xml
index 2b521b00a4..2b521b00a4 100644
--- a/tests/PHPUnit/Integration/expected/test_oneVisitor_oneWebsite_severalDays_DateRange__Referrers.getUrlsForSocial_range.xml
+++ b/tests/PHPUnit/System/expected/test_oneVisitor_oneWebsite_severalDays_DateRange__Referrers.getUrlsForSocial_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_oneVisitor_oneWebsite_severalDays_DateRange__UserCountry.getCountry_range.xml b/tests/PHPUnit/System/expected/test_oneVisitor_oneWebsite_severalDays_DateRange__UserCountry.getCountry_range.xml
index 7cbd671101..7cbd671101 100644
--- a/tests/PHPUnit/Integration/expected/test_oneVisitor_oneWebsite_severalDays_DateRange__UserCountry.getCountry_range.xml
+++ b/tests/PHPUnit/System/expected/test_oneVisitor_oneWebsite_severalDays_DateRange__UserCountry.getCountry_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_oneVisitor_oneWebsite_severalDays_DateRange__UserSettings.getResolution_range.xml b/tests/PHPUnit/System/expected/test_oneVisitor_oneWebsite_severalDays_DateRange__UserSettings.getResolution_range.xml
index bef1e186ef..bef1e186ef 100644
--- a/tests/PHPUnit/Integration/expected/test_oneVisitor_oneWebsite_severalDays_DateRange__UserSettings.getResolution_range.xml
+++ b/tests/PHPUnit/System/expected/test_oneVisitor_oneWebsite_severalDays_DateRange__UserSettings.getResolution_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_oneVisitor_oneWebsite_severalDays_DateRange__VisitFrequency.get_range.xml b/tests/PHPUnit/System/expected/test_oneVisitor_oneWebsite_severalDays_DateRange__VisitFrequency.get_range.xml
index d7c74b8645..d7c74b8645 100644
--- a/tests/PHPUnit/Integration/expected/test_oneVisitor_oneWebsite_severalDays_DateRange__VisitFrequency.get_range.xml
+++ b/tests/PHPUnit/System/expected/test_oneVisitor_oneWebsite_severalDays_DateRange__VisitFrequency.get_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_oneVisitor_oneWebsite_severalDays_DateRange__VisitTime.getVisitInformationPerServerTime_range.xml b/tests/PHPUnit/System/expected/test_oneVisitor_oneWebsite_severalDays_DateRange__VisitTime.getVisitInformationPerServerTime_range.xml
index b054303185..b054303185 100644
--- a/tests/PHPUnit/Integration/expected/test_oneVisitor_oneWebsite_severalDays_DateRange__VisitTime.getVisitInformationPerServerTime_range.xml
+++ b/tests/PHPUnit/System/expected/test_oneVisitor_oneWebsite_severalDays_DateRange__VisitTime.getVisitInformationPerServerTime_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_oneVisitor_oneWebsite_severalDays_DateRange__VisitsSummary.get_range.xml b/tests/PHPUnit/System/expected/test_oneVisitor_oneWebsite_severalDays_DateRange__VisitsSummary.get_range.xml
index 29d972ff8a..29d972ff8a 100644
--- a/tests/PHPUnit/Integration/expected/test_oneVisitor_oneWebsite_severalDays_DateRange__VisitsSummary.get_range.xml
+++ b/tests/PHPUnit/System/expected/test_oneVisitor_oneWebsite_severalDays_DateRange__VisitsSummary.get_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_oneVisitor_oneWebsite_severalDays_DateRange_noIdSubtable__Referrers.getUrlsForSocial_range.xml b/tests/PHPUnit/System/expected/test_oneVisitor_oneWebsite_severalDays_DateRange_noIdSubtable__Referrers.getUrlsForSocial_range.xml
index 4649b78a18..4649b78a18 100644
--- a/tests/PHPUnit/Integration/expected/test_oneVisitor_oneWebsite_severalDays_DateRange_noIdSubtable__Referrers.getUrlsForSocial_range.xml
+++ b/tests/PHPUnit/System/expected/test_oneVisitor_oneWebsite_severalDays_DateRange_noIdSubtable__Referrers.getUrlsForSocial_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_oneVisitor_oneWebsite_severalDays_DateRange_periodIsRange_expanded___Actions.getPageUrls_range.xml b/tests/PHPUnit/System/expected/test_oneVisitor_oneWebsite_severalDays_DateRange_periodIsRange_expanded___Actions.getPageUrls_range.xml
index f5ed922233..f5ed922233 100644
--- a/tests/PHPUnit/Integration/expected/test_oneVisitor_oneWebsite_severalDays_DateRange_periodIsRange_expanded___Actions.getPageUrls_range.xml
+++ b/tests/PHPUnit/System/expected/test_oneVisitor_oneWebsite_severalDays_DateRange_periodIsRange_expanded___Actions.getPageUrls_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_oneVisitor_oneWebsite_severalDays_DateRange_periodIsRange_flattened___Actions.getPageUrls_range.xml b/tests/PHPUnit/System/expected/test_oneVisitor_oneWebsite_severalDays_DateRange_periodIsRange_flattened___Actions.getPageUrls_range.xml
index 1f11de6d95..1f11de6d95 100644
--- a/tests/PHPUnit/Integration/expected/test_oneVisitor_oneWebsite_severalDays_DateRange_periodIsRange_flattened___Actions.getPageUrls_range.xml
+++ b/tests/PHPUnit/System/expected/test_oneVisitor_oneWebsite_severalDays_DateRange_periodIsRange_flattened___Actions.getPageUrls_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__API.getProcessedReport_range.xml b/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__API.getProcessedReport_range.xml
index 9efeb67c66..9efeb67c66 100644
--- a/tests/PHPUnit/Integration/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__API.getProcessedReport_range.xml
+++ b/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__API.getProcessedReport_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Actions.getPageUrls_range.xml b/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Actions.getPageUrls_range.xml
index 7bc6d955d2..7bc6d955d2 100644
--- a/tests/PHPUnit/Integration/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Actions.getPageUrls_range.xml
+++ b/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Actions.getPageUrls_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__CustomVariables.getCustomVariables_range.xml b/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__CustomVariables.getCustomVariables_range.xml
index 1639c238a3..1639c238a3 100644
--- a/tests/PHPUnit/Integration/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__CustomVariables.getCustomVariables_range.xml
+++ b/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__CustomVariables.getCustomVariables_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Goals.get_range.xml b/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Goals.get_range.xml
index cf9900ec47..cf9900ec47 100644
--- a/tests/PHPUnit/Integration/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Goals.get_range.xml
+++ b/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Goals.get_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Live.getCounters.xml b/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Live.getCounters.xml
index ba6489a54c..ba6489a54c 100644
--- a/tests/PHPUnit/Integration/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Live.getCounters.xml
+++ b/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Live.getCounters.xml
diff --git a/tests/PHPUnit/Integration/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Live.getLastVisitsDetails_range.xml b/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Live.getLastVisitsDetails_range.xml
index e030350ae3..e030350ae3 100644
--- a/tests/PHPUnit/Integration/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Live.getLastVisitsDetails_range.xml
+++ b/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Live.getLastVisitsDetails_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Live.getMostRecentVisitorId.xml b/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Live.getMostRecentVisitorId.xml
index 943e78b64e..943e78b64e 100644
--- a/tests/PHPUnit/Integration/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Live.getMostRecentVisitorId.xml
+++ b/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Live.getMostRecentVisitorId.xml
diff --git a/tests/PHPUnit/Integration/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Live.getVisitorProfile.xml b/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Live.getVisitorProfile.xml
index 3001bf7177..3001bf7177 100644
--- a/tests/PHPUnit/Integration/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Live.getVisitorProfile.xml
+++ b/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Live.getVisitorProfile.xml
diff --git a/tests/PHPUnit/Integration/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Referrers.getCampaigns_range.xml b/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Referrers.getCampaigns_range.xml
index 4faa5d55df..4faa5d55df 100644
--- a/tests/PHPUnit/Integration/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Referrers.getCampaigns_range.xml
+++ b/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Referrers.getCampaigns_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Referrers.getKeywords_range.xml b/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Referrers.getKeywords_range.xml
index bd1f763bd0..bd1f763bd0 100644
--- a/tests/PHPUnit/Integration/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Referrers.getKeywords_range.xml
+++ b/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__Referrers.getKeywords_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__VisitsSummary.get_range.xml b/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__VisitsSummary.get_range.xml
index 4a5151e912..4a5151e912 100644
--- a/tests/PHPUnit/Integration/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__VisitsSummary.get_range.xml
+++ b/tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__VisitsSummary.get_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_reportLimiting__Actions.getDownloads_day.xml b/tests/PHPUnit/System/expected/test_reportLimiting__Actions.getDownloads_day.xml
index ee5d1985fc..ee5d1985fc 100644
--- a/tests/PHPUnit/Integration/expected/test_reportLimiting__Actions.getDownloads_day.xml
+++ b/tests/PHPUnit/System/expected/test_reportLimiting__Actions.getDownloads_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_reportLimiting__Actions.getOutlinks_day.xml b/tests/PHPUnit/System/expected/test_reportLimiting__Actions.getOutlinks_day.xml
index 1181f0a0c3..1181f0a0c3 100644
--- a/tests/PHPUnit/Integration/expected/test_reportLimiting__Actions.getOutlinks_day.xml
+++ b/tests/PHPUnit/System/expected/test_reportLimiting__Actions.getOutlinks_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_reportLimiting__Actions.getPageTitles_day.xml b/tests/PHPUnit/System/expected/test_reportLimiting__Actions.getPageTitles_day.xml
index 75278b578c..75278b578c 100644
--- a/tests/PHPUnit/Integration/expected/test_reportLimiting__Actions.getPageTitles_day.xml
+++ b/tests/PHPUnit/System/expected/test_reportLimiting__Actions.getPageTitles_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_reportLimiting__Actions.getPageUrls_day.xml b/tests/PHPUnit/System/expected/test_reportLimiting__Actions.getPageUrls_day.xml
index db723f1f22..db723f1f22 100644
--- a/tests/PHPUnit/Integration/expected/test_reportLimiting__Actions.getPageUrls_day.xml
+++ b/tests/PHPUnit/System/expected/test_reportLimiting__Actions.getPageUrls_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_reportLimiting__CustomVariables.getCustomVariables_day.xml b/tests/PHPUnit/System/expected/test_reportLimiting__CustomVariables.getCustomVariables_day.xml
index 994f62a320..994f62a320 100644
--- a/tests/PHPUnit/Integration/expected/test_reportLimiting__CustomVariables.getCustomVariables_day.xml
+++ b/tests/PHPUnit/System/expected/test_reportLimiting__CustomVariables.getCustomVariables_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_reportLimiting__Goals.getItemsCategory_day.xml b/tests/PHPUnit/System/expected/test_reportLimiting__Goals.getItemsCategory_day.xml
index a8d3e17e53..a8d3e17e53 100644
--- a/tests/PHPUnit/Integration/expected/test_reportLimiting__Goals.getItemsCategory_day.xml
+++ b/tests/PHPUnit/System/expected/test_reportLimiting__Goals.getItemsCategory_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_reportLimiting__Goals.getItemsName_day.xml b/tests/PHPUnit/System/expected/test_reportLimiting__Goals.getItemsName_day.xml
index 95cb364b56..95cb364b56 100644
--- a/tests/PHPUnit/Integration/expected/test_reportLimiting__Goals.getItemsName_day.xml
+++ b/tests/PHPUnit/System/expected/test_reportLimiting__Goals.getItemsName_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_reportLimiting__Goals.getItemsSku_day.xml b/tests/PHPUnit/System/expected/test_reportLimiting__Goals.getItemsSku_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_reportLimiting__Goals.getItemsSku_day.xml
+++ b/tests/PHPUnit/System/expected/test_reportLimiting__Goals.getItemsSku_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_reportLimiting__Referrers.getAll_day.xml b/tests/PHPUnit/System/expected/test_reportLimiting__Referrers.getAll_day.xml
index 8202c35460..8202c35460 100644
--- a/tests/PHPUnit/Integration/expected/test_reportLimiting__Referrers.getAll_day.xml
+++ b/tests/PHPUnit/System/expected/test_reportLimiting__Referrers.getAll_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_reportLimiting__Referrers.getKeywords_day.xml b/tests/PHPUnit/System/expected/test_reportLimiting__Referrers.getKeywords_day.xml
index dd1f7037e6..dd1f7037e6 100644
--- a/tests/PHPUnit/Integration/expected/test_reportLimiting__Referrers.getKeywords_day.xml
+++ b/tests/PHPUnit/System/expected/test_reportLimiting__Referrers.getKeywords_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_reportLimiting__Referrers.getReferrerType_day.xml b/tests/PHPUnit/System/expected/test_reportLimiting__Referrers.getReferrerType_day.xml
index 6b8c754c71..6b8c754c71 100644
--- a/tests/PHPUnit/Integration/expected/test_reportLimiting__Referrers.getReferrerType_day.xml
+++ b/tests/PHPUnit/System/expected/test_reportLimiting__Referrers.getReferrerType_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_reportLimiting__Referrers.getSearchEngines_day.xml b/tests/PHPUnit/System/expected/test_reportLimiting__Referrers.getSearchEngines_day.xml
index cfcc0601a9..cfcc0601a9 100644
--- a/tests/PHPUnit/Integration/expected/test_reportLimiting__Referrers.getSearchEngines_day.xml
+++ b/tests/PHPUnit/System/expected/test_reportLimiting__Referrers.getSearchEngines_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_reportLimiting__Referrers.getWebsites_day.xml b/tests/PHPUnit/System/expected/test_reportLimiting__Referrers.getWebsites_day.xml
index 6b473345a8..6b473345a8 100644
--- a/tests/PHPUnit/Integration/expected/test_reportLimiting__Referrers.getWebsites_day.xml
+++ b/tests/PHPUnit/System/expected/test_reportLimiting__Referrers.getWebsites_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_reportLimiting__UserCountry.getCity_day.xml b/tests/PHPUnit/System/expected/test_reportLimiting__UserCountry.getCity_day.xml
index c9eb98ffda..c9eb98ffda 100644
--- a/tests/PHPUnit/Integration/expected/test_reportLimiting__UserCountry.getCity_day.xml
+++ b/tests/PHPUnit/System/expected/test_reportLimiting__UserCountry.getCity_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_reportLimiting__UserCountry.getRegion_day.xml b/tests/PHPUnit/System/expected/test_reportLimiting__UserCountry.getRegion_day.xml
index 50888ce069..50888ce069 100644
--- a/tests/PHPUnit/Integration/expected/test_reportLimiting__UserCountry.getRegion_day.xml
+++ b/tests/PHPUnit/System/expected/test_reportLimiting__UserCountry.getRegion_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_reportLimiting__UserSettings.getBrowserVersion_day.xml b/tests/PHPUnit/System/expected/test_reportLimiting__UserSettings.getBrowserVersion_day.xml
index 72dab998db..72dab998db 100644
--- a/tests/PHPUnit/Integration/expected/test_reportLimiting__UserSettings.getBrowserVersion_day.xml
+++ b/tests/PHPUnit/System/expected/test_reportLimiting__UserSettings.getBrowserVersion_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_reportLimiting__UserSettings.getConfiguration_day.xml b/tests/PHPUnit/System/expected/test_reportLimiting__UserSettings.getConfiguration_day.xml
index 9f4d67971d..9f4d67971d 100644
--- a/tests/PHPUnit/Integration/expected/test_reportLimiting__UserSettings.getConfiguration_day.xml
+++ b/tests/PHPUnit/System/expected/test_reportLimiting__UserSettings.getConfiguration_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_reportLimiting__UserSettings.getOS_day.xml b/tests/PHPUnit/System/expected/test_reportLimiting__UserSettings.getOS_day.xml
index 803dcc4819..803dcc4819 100644
--- a/tests/PHPUnit/Integration/expected/test_reportLimiting__UserSettings.getOS_day.xml
+++ b/tests/PHPUnit/System/expected/test_reportLimiting__UserSettings.getOS_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_reportLimiting__UserSettings.getResolution_day.xml b/tests/PHPUnit/System/expected/test_reportLimiting__UserSettings.getResolution_day.xml
index 7b29bb6e65..7b29bb6e65 100644
--- a/tests/PHPUnit/Integration/expected/test_reportLimiting__UserSettings.getResolution_day.xml
+++ b/tests/PHPUnit/System/expected/test_reportLimiting__UserSettings.getResolution_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_reportLimiting_rangeFlat_rankingQueryDisabled__Actions.getDownloads_range.xml b/tests/PHPUnit/System/expected/test_reportLimiting_rangeFlat_rankingQueryDisabled__Actions.getDownloads_range.xml
index d91a3e6444..d91a3e6444 100644
--- a/tests/PHPUnit/Integration/expected/test_reportLimiting_rangeFlat_rankingQueryDisabled__Actions.getDownloads_range.xml
+++ b/tests/PHPUnit/System/expected/test_reportLimiting_rangeFlat_rankingQueryDisabled__Actions.getDownloads_range.xml
diff --git a/tests/PHPUnit/Integration/expected/test_reportLimiting_rankingQueryDisabled__Actions.getPageUrls_day.xml b/tests/PHPUnit/System/expected/test_reportLimiting_rankingQueryDisabled__Actions.getPageUrls_day.xml
index b895fdd1a4..b895fdd1a4 100644
--- a/tests/PHPUnit/Integration/expected/test_reportLimiting_rankingQueryDisabled__Actions.getPageUrls_day.xml
+++ b/tests/PHPUnit/System/expected/test_reportLimiting_rankingQueryDisabled__Actions.getPageUrls_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_reportLimiting_rankingQueryDisabled__Provider.getProvider_month.xml b/tests/PHPUnit/System/expected/test_reportLimiting_rankingQueryDisabled__Provider.getProvider_month.xml
index 95d4b86627..95d4b86627 100644
--- a/tests/PHPUnit/Integration/expected/test_reportLimiting_rankingQueryDisabled__Provider.getProvider_month.xml
+++ b/tests/PHPUnit/System/expected/test_reportLimiting_rankingQueryDisabled__Provider.getProvider_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_reportLimiting_rankingQuery__Actions.getDownloads_day.xml b/tests/PHPUnit/System/expected/test_reportLimiting_rankingQuery__Actions.getDownloads_day.xml
index 486f5a4a80..486f5a4a80 100644
--- a/tests/PHPUnit/Integration/expected/test_reportLimiting_rankingQuery__Actions.getDownloads_day.xml
+++ b/tests/PHPUnit/System/expected/test_reportLimiting_rankingQuery__Actions.getDownloads_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_reportLimiting_rankingQuery__Actions.getOutlinks_day.xml b/tests/PHPUnit/System/expected/test_reportLimiting_rankingQuery__Actions.getOutlinks_day.xml
index d7f085aa42..d7f085aa42 100644
--- a/tests/PHPUnit/Integration/expected/test_reportLimiting_rankingQuery__Actions.getOutlinks_day.xml
+++ b/tests/PHPUnit/System/expected/test_reportLimiting_rankingQuery__Actions.getOutlinks_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_reportLimiting_rankingQuery__Actions.getPageTitles_day.xml b/tests/PHPUnit/System/expected/test_reportLimiting_rankingQuery__Actions.getPageTitles_day.xml
index a6451384fc..a6451384fc 100644
--- a/tests/PHPUnit/Integration/expected/test_reportLimiting_rankingQuery__Actions.getPageTitles_day.xml
+++ b/tests/PHPUnit/System/expected/test_reportLimiting_rankingQuery__Actions.getPageTitles_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_reportLimiting_rankingQuery__Actions.getPageUrls_day.xml b/tests/PHPUnit/System/expected/test_reportLimiting_rankingQuery__Actions.getPageUrls_day.xml
index d50996584c..d50996584c 100644
--- a/tests/PHPUnit/Integration/expected/test_reportLimiting_rankingQuery__Actions.getPageUrls_day.xml
+++ b/tests/PHPUnit/System/expected/test_reportLimiting_rankingQuery__Actions.getPageUrls_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_reportLimiting_rankingQuery__CustomVariables.getCustomVariables_day.xml b/tests/PHPUnit/System/expected/test_reportLimiting_rankingQuery__CustomVariables.getCustomVariables_day.xml
index 994f62a320..994f62a320 100644
--- a/tests/PHPUnit/Integration/expected/test_reportLimiting_rankingQuery__CustomVariables.getCustomVariables_day.xml
+++ b/tests/PHPUnit/System/expected/test_reportLimiting_rankingQuery__CustomVariables.getCustomVariables_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_reportLimiting_rankingQuery__Goals.getItemsCategory_day.xml b/tests/PHPUnit/System/expected/test_reportLimiting_rankingQuery__Goals.getItemsCategory_day.xml
index a8d3e17e53..a8d3e17e53 100644
--- a/tests/PHPUnit/Integration/expected/test_reportLimiting_rankingQuery__Goals.getItemsCategory_day.xml
+++ b/tests/PHPUnit/System/expected/test_reportLimiting_rankingQuery__Goals.getItemsCategory_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_reportLimiting_rankingQuery__Goals.getItemsName_day.xml b/tests/PHPUnit/System/expected/test_reportLimiting_rankingQuery__Goals.getItemsName_day.xml
index 95cb364b56..95cb364b56 100644
--- a/tests/PHPUnit/Integration/expected/test_reportLimiting_rankingQuery__Goals.getItemsName_day.xml
+++ b/tests/PHPUnit/System/expected/test_reportLimiting_rankingQuery__Goals.getItemsName_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_reportLimiting_rankingQuery__Goals.getItemsSku_day.xml b/tests/PHPUnit/System/expected/test_reportLimiting_rankingQuery__Goals.getItemsSku_day.xml
index c234bed59e..c234bed59e 100644
--- a/tests/PHPUnit/Integration/expected/test_reportLimiting_rankingQuery__Goals.getItemsSku_day.xml
+++ b/tests/PHPUnit/System/expected/test_reportLimiting_rankingQuery__Goals.getItemsSku_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_reportLimiting_rankingQuery__Referrers.getAll_day.xml b/tests/PHPUnit/System/expected/test_reportLimiting_rankingQuery__Referrers.getAll_day.xml
index 8202c35460..8202c35460 100644
--- a/tests/PHPUnit/Integration/expected/test_reportLimiting_rankingQuery__Referrers.getAll_day.xml
+++ b/tests/PHPUnit/System/expected/test_reportLimiting_rankingQuery__Referrers.getAll_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_reportLimiting_rankingQuery__Referrers.getKeywords_day.xml b/tests/PHPUnit/System/expected/test_reportLimiting_rankingQuery__Referrers.getKeywords_day.xml
index dd1f7037e6..dd1f7037e6 100644
--- a/tests/PHPUnit/Integration/expected/test_reportLimiting_rankingQuery__Referrers.getKeywords_day.xml
+++ b/tests/PHPUnit/System/expected/test_reportLimiting_rankingQuery__Referrers.getKeywords_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_reportLimiting_rankingQuery__Referrers.getReferrerType_day.xml b/tests/PHPUnit/System/expected/test_reportLimiting_rankingQuery__Referrers.getReferrerType_day.xml
index 6b8c754c71..6b8c754c71 100644
--- a/tests/PHPUnit/Integration/expected/test_reportLimiting_rankingQuery__Referrers.getReferrerType_day.xml
+++ b/tests/PHPUnit/System/expected/test_reportLimiting_rankingQuery__Referrers.getReferrerType_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_reportLimiting_rankingQuery__Referrers.getSearchEngines_day.xml b/tests/PHPUnit/System/expected/test_reportLimiting_rankingQuery__Referrers.getSearchEngines_day.xml
index cfcc0601a9..cfcc0601a9 100644
--- a/tests/PHPUnit/Integration/expected/test_reportLimiting_rankingQuery__Referrers.getSearchEngines_day.xml
+++ b/tests/PHPUnit/System/expected/test_reportLimiting_rankingQuery__Referrers.getSearchEngines_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_reportLimiting_rankingQuery__Referrers.getWebsites_day.xml b/tests/PHPUnit/System/expected/test_reportLimiting_rankingQuery__Referrers.getWebsites_day.xml
index 6b473345a8..6b473345a8 100644
--- a/tests/PHPUnit/Integration/expected/test_reportLimiting_rankingQuery__Referrers.getWebsites_day.xml
+++ b/tests/PHPUnit/System/expected/test_reportLimiting_rankingQuery__Referrers.getWebsites_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_reportLimiting_rankingQuery__UserCountry.getCity_day.xml b/tests/PHPUnit/System/expected/test_reportLimiting_rankingQuery__UserCountry.getCity_day.xml
index c9eb98ffda..c9eb98ffda 100644
--- a/tests/PHPUnit/Integration/expected/test_reportLimiting_rankingQuery__UserCountry.getCity_day.xml
+++ b/tests/PHPUnit/System/expected/test_reportLimiting_rankingQuery__UserCountry.getCity_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_reportLimiting_rankingQuery__UserCountry.getRegion_day.xml b/tests/PHPUnit/System/expected/test_reportLimiting_rankingQuery__UserCountry.getRegion_day.xml
index 50888ce069..50888ce069 100644
--- a/tests/PHPUnit/Integration/expected/test_reportLimiting_rankingQuery__UserCountry.getRegion_day.xml
+++ b/tests/PHPUnit/System/expected/test_reportLimiting_rankingQuery__UserCountry.getRegion_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_reportLimiting_rankingQuery__UserSettings.getBrowserVersion_day.xml b/tests/PHPUnit/System/expected/test_reportLimiting_rankingQuery__UserSettings.getBrowserVersion_day.xml
index 72dab998db..72dab998db 100644
--- a/tests/PHPUnit/Integration/expected/test_reportLimiting_rankingQuery__UserSettings.getBrowserVersion_day.xml
+++ b/tests/PHPUnit/System/expected/test_reportLimiting_rankingQuery__UserSettings.getBrowserVersion_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_reportLimiting_rankingQuery__UserSettings.getConfiguration_day.xml b/tests/PHPUnit/System/expected/test_reportLimiting_rankingQuery__UserSettings.getConfiguration_day.xml
index 9f4d67971d..9f4d67971d 100644
--- a/tests/PHPUnit/Integration/expected/test_reportLimiting_rankingQuery__UserSettings.getConfiguration_day.xml
+++ b/tests/PHPUnit/System/expected/test_reportLimiting_rankingQuery__UserSettings.getConfiguration_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_reportLimiting_rankingQuery__UserSettings.getOS_day.xml b/tests/PHPUnit/System/expected/test_reportLimiting_rankingQuery__UserSettings.getOS_day.xml
index 803dcc4819..803dcc4819 100644
--- a/tests/PHPUnit/Integration/expected/test_reportLimiting_rankingQuery__UserSettings.getOS_day.xml
+++ b/tests/PHPUnit/System/expected/test_reportLimiting_rankingQuery__UserSettings.getOS_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_reportLimiting_rankingQuery__UserSettings.getResolution_day.xml b/tests/PHPUnit/System/expected/test_reportLimiting_rankingQuery__UserSettings.getResolution_day.xml
index 7b29bb6e65..7b29bb6e65 100644
--- a/tests/PHPUnit/Integration/expected/test_reportLimiting_rankingQuery__UserSettings.getResolution_day.xml
+++ b/tests/PHPUnit/System/expected/test_reportLimiting_rankingQuery__UserSettings.getResolution_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_reportLimiting_segment_provider_rankingQueryDisabled__Provider.getProvider_month.xml b/tests/PHPUnit/System/expected/test_reportLimiting_segment_provider_rankingQueryDisabled__Provider.getProvider_month.xml
index 7993897a0a..7993897a0a 100644
--- a/tests/PHPUnit/Integration/expected/test_reportLimiting_segment_provider_rankingQueryDisabled__Provider.getProvider_month.xml
+++ b/tests/PHPUnit/System/expected/test_reportLimiting_segment_provider_rankingQueryDisabled__Provider.getProvider_month.xml
diff --git a/tests/PHPUnit/Integration/expected/test_trackGoals_allowMultipleConversionsPerVisit__VisitTime.getVisitInformationPerServerTime_day.xml b/tests/PHPUnit/System/expected/test_trackGoals_allowMultipleConversionsPerVisit__VisitTime.getVisitInformationPerServerTime_day.xml
index 55a4fa3bd0..55a4fa3bd0 100644
--- a/tests/PHPUnit/Integration/expected/test_trackGoals_allowMultipleConversionsPerVisit__VisitTime.getVisitInformationPerServerTime_day.xml
+++ b/tests/PHPUnit/System/expected/test_trackGoals_allowMultipleConversionsPerVisit__VisitTime.getVisitInformationPerServerTime_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_trackGoals_allowMultipleConversionsPerVisit__VisitsSummary.get_day.xml b/tests/PHPUnit/System/expected/test_trackGoals_allowMultipleConversionsPerVisit__VisitsSummary.get_day.xml
index 7168091d51..7168091d51 100644
--- a/tests/PHPUnit/Integration/expected/test_trackGoals_allowMultipleConversionsPerVisit__VisitsSummary.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_trackGoals_allowMultipleConversionsPerVisit__VisitsSummary.get_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_SegmentPageTitleContainsStrangeCharacters__Actions.getPageTitles_day.xml b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_SegmentPageTitleContainsStrangeCharacters__Actions.getPageTitles_day.xml
index 14874d56d6..14874d56d6 100644
--- a/tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_SegmentPageTitleContainsStrangeCharacters__Actions.getPageTitles_day.xml
+++ b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_SegmentPageTitleContainsStrangeCharacters__Actions.getPageTitles_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_SegmentPageTitleContainsStrangeCharacters__VisitsSummary.get_day.xml b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_SegmentPageTitleContainsStrangeCharacters__VisitsSummary.get_day.xml
index 9cdfb2d5b7..9cdfb2d5b7 100644
--- a/tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_SegmentPageTitleContainsStrangeCharacters__VisitsSummary.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_SegmentPageTitleContainsStrangeCharacters__VisitsSummary.get_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_SegmentPageTitleContains__Actions.getPageTitles_day.xml b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_SegmentPageTitleContains__Actions.getPageTitles_day.xml
index 7cfe228274..7cfe228274 100644
--- a/tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_SegmentPageTitleContains__Actions.getPageTitles_day.xml
+++ b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_SegmentPageTitleContains__Actions.getPageTitles_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_SegmentPageTitleContains__Actions.getPageUrls_day.xml b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_SegmentPageTitleContains__Actions.getPageUrls_day.xml
index c64e18155a..c64e18155a 100644
--- a/tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_SegmentPageTitleContains__Actions.getPageUrls_day.xml
+++ b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_SegmentPageTitleContains__Actions.getPageUrls_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_SegmentPageTitleContains__VisitsSummary.get_day.xml b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_SegmentPageTitleContains__VisitsSummary.get_day.xml
index 9cdfb2d5b7..9cdfb2d5b7 100644
--- a/tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_SegmentPageTitleContains__VisitsSummary.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_SegmentPageTitleContains__VisitsSummary.get_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_SegmentPageTitleExcludes__Actions.getPageTitles_day.xml b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_SegmentPageTitleExcludes__Actions.getPageTitles_day.xml
index f4d18a6307..f4d18a6307 100644
--- a/tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_SegmentPageTitleExcludes__Actions.getPageTitles_day.xml
+++ b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_SegmentPageTitleExcludes__Actions.getPageTitles_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_SegmentPageTitleExcludes__Actions.getPageUrls_day.xml b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_SegmentPageTitleExcludes__Actions.getPageUrls_day.xml
index 2c178c678b..2c178c678b 100644
--- a/tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_SegmentPageTitleExcludes__Actions.getPageUrls_day.xml
+++ b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_SegmentPageTitleExcludes__Actions.getPageUrls_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_SegmentPageTitleExcludes__VisitsSummary.get_day.xml b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_SegmentPageTitleExcludes__VisitsSummary.get_day.xml
index 06b9efca77..06b9efca77 100644
--- a/tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_SegmentPageTitleExcludes__VisitsSummary.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_SegmentPageTitleExcludes__VisitsSummary.get_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_SegmentPageUrlContains__Actions.getPageTitles_day.xml b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_SegmentPageUrlContains__Actions.getPageTitles_day.xml
index 7cfe228274..7cfe228274 100644
--- a/tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_SegmentPageUrlContains__Actions.getPageTitles_day.xml
+++ b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_SegmentPageUrlContains__Actions.getPageTitles_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_SegmentPageUrlContains__Actions.getPageUrls_day.xml b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_SegmentPageUrlContains__Actions.getPageUrls_day.xml
index c64e18155a..c64e18155a 100644
--- a/tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_SegmentPageUrlContains__Actions.getPageUrls_day.xml
+++ b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_SegmentPageUrlContains__Actions.getPageUrls_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_SegmentPageUrlContains__VisitsSummary.get_day.xml b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_SegmentPageUrlContains__VisitsSummary.get_day.xml
index 9cdfb2d5b7..9cdfb2d5b7 100644
--- a/tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_SegmentPageUrlContains__VisitsSummary.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_SegmentPageUrlContains__VisitsSummary.get_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_SegmentPageUrlExcludes__Actions.getPageTitles_day.xml b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_SegmentPageUrlExcludes__Actions.getPageTitles_day.xml
index f4d18a6307..f4d18a6307 100644
--- a/tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_SegmentPageUrlExcludes__Actions.getPageTitles_day.xml
+++ b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_SegmentPageUrlExcludes__Actions.getPageTitles_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_SegmentPageUrlExcludes__Actions.getPageUrls_day.xml b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_SegmentPageUrlExcludes__Actions.getPageUrls_day.xml
index 2c178c678b..2c178c678b 100644
--- a/tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_SegmentPageUrlExcludes__Actions.getPageUrls_day.xml
+++ b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_SegmentPageUrlExcludes__Actions.getPageUrls_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_SegmentPageUrlExcludes__VisitsSummary.get_day.xml b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_SegmentPageUrlExcludes__VisitsSummary.get_day.xml
index 06b9efca77..06b9efca77 100644
--- a/tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_SegmentPageUrlExcludes__VisitsSummary.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_SegmentPageUrlExcludes__VisitsSummary.get_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables__CustomVariables.getCustomVariables_day.xml b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables__CustomVariables.getCustomVariables_day.xml
index c92fc50036..c92fc50036 100644
--- a/tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables__CustomVariables.getCustomVariables_day.xml
+++ b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables__CustomVariables.getCustomVariables_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables__CustomVariables.getCustomVariables_week.xml b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables__CustomVariables.getCustomVariables_week.xml
index 60639711b9..60639711b9 100644
--- a/tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables__CustomVariables.getCustomVariables_week.xml
+++ b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables__CustomVariables.getCustomVariables_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables__VisitsSummary.get_day.xml b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables__VisitsSummary.get_day.xml
index ab7f9f9a18..ab7f9f9a18 100644
--- a/tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables__VisitsSummary.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables__VisitsSummary.get_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables__VisitsSummary.get_week.xml b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables__VisitsSummary.get_week.xml
index b5e37b20aa..b5e37b20aa 100644
--- a/tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables__VisitsSummary.get_week.xml
+++ b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables__VisitsSummary.get_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables__subtable__API.getProcessedReport_day.xml b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables__subtable__API.getProcessedReport_day.xml
index 104b5cfd27..104b5cfd27 100644
--- a/tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables__subtable__API.getProcessedReport_day.xml
+++ b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables__subtable__API.getProcessedReport_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_segmentMatchALL_noGoalData__CustomVariables.getCustomVariables_day.xml b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_segmentMatchALL_noGoalData__CustomVariables.getCustomVariables_day.xml
index 5b779b60c6..5b779b60c6 100644
--- a/tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_segmentMatchALL_noGoalData__CustomVariables.getCustomVariables_day.xml
+++ b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_segmentMatchALL_noGoalData__CustomVariables.getCustomVariables_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_segmentMatchALL_noGoalData__CustomVariables.getCustomVariables_week.xml b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_segmentMatchALL_noGoalData__CustomVariables.getCustomVariables_week.xml
index 6b156a1379..6b156a1379 100644
--- a/tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_segmentMatchALL_noGoalData__CustomVariables.getCustomVariables_week.xml
+++ b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_segmentMatchALL_noGoalData__CustomVariables.getCustomVariables_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_segmentMatchALL_noGoalData__VisitsSummary.get_day.xml b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_segmentMatchALL_noGoalData__VisitsSummary.get_day.xml
index 283758c4ec..283758c4ec 100644
--- a/tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_segmentMatchALL_noGoalData__VisitsSummary.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_segmentMatchALL_noGoalData__VisitsSummary.get_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_segmentMatchALL_noGoalData__VisitsSummary.get_week.xml b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_segmentMatchALL_noGoalData__VisitsSummary.get_week.xml
index 4dab22a018..4dab22a018 100644
--- a/tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_segmentMatchALL_noGoalData__VisitsSummary.get_week.xml
+++ b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_segmentMatchALL_noGoalData__VisitsSummary.get_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_segmentMatchNONE__CustomVariables.getCustomVariables_day.xml b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_segmentMatchNONE__CustomVariables.getCustomVariables_day.xml
index b9dfec843f..b9dfec843f 100644
--- a/tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_segmentMatchNONE__CustomVariables.getCustomVariables_day.xml
+++ b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_segmentMatchNONE__CustomVariables.getCustomVariables_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_segmentMatchNONE__CustomVariables.getCustomVariables_week.xml b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_segmentMatchNONE__CustomVariables.getCustomVariables_week.xml
index 0023e2ea8f..0023e2ea8f 100644
--- a/tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_segmentMatchNONE__CustomVariables.getCustomVariables_week.xml
+++ b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_segmentMatchNONE__CustomVariables.getCustomVariables_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_segmentMatchNONE__VisitsSummary.get_day.xml b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_segmentMatchNONE__VisitsSummary.get_day.xml
index b9dfec843f..b9dfec843f 100644
--- a/tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_segmentMatchNONE__VisitsSummary.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_segmentMatchNONE__VisitsSummary.get_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_segmentMatchNONE__VisitsSummary.get_week.xml b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_segmentMatchNONE__VisitsSummary.get_week.xml
index 0023e2ea8f..0023e2ea8f 100644
--- a/tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_segmentMatchNONE__VisitsSummary.get_week.xml
+++ b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_segmentMatchNONE__VisitsSummary.get_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_segmentMatchVisitorType__CustomVariables.getCustomVariables_day.xml b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_segmentMatchVisitorType__CustomVariables.getCustomVariables_day.xml
index 4a549e2004..4a549e2004 100644
--- a/tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_segmentMatchVisitorType__CustomVariables.getCustomVariables_day.xml
+++ b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_segmentMatchVisitorType__CustomVariables.getCustomVariables_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_segmentMatchVisitorType__CustomVariables.getCustomVariables_week.xml b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_segmentMatchVisitorType__CustomVariables.getCustomVariables_week.xml
index 28956c8523..28956c8523 100644
--- a/tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_segmentMatchVisitorType__CustomVariables.getCustomVariables_week.xml
+++ b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_segmentMatchVisitorType__CustomVariables.getCustomVariables_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_segmentMatchVisitorType__Referrers.getKeywords_day.xml b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_segmentMatchVisitorType__Referrers.getKeywords_day.xml
index 5f34b6f1bb..5f34b6f1bb 100644
--- a/tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_segmentMatchVisitorType__Referrers.getKeywords_day.xml
+++ b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_segmentMatchVisitorType__Referrers.getKeywords_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_segmentMatchVisitorType__Referrers.getKeywords_week.xml b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_segmentMatchVisitorType__Referrers.getKeywords_week.xml
index 94f2fa7c83..94f2fa7c83 100644
--- a/tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_segmentMatchVisitorType__Referrers.getKeywords_week.xml
+++ b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_segmentMatchVisitorType__Referrers.getKeywords_week.xml
diff --git a/tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_segmentMatchVisitorType__VisitsSummary.get_day.xml b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_segmentMatchVisitorType__VisitsSummary.get_day.xml
index de4eac0560..de4eac0560 100644
--- a/tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_segmentMatchVisitorType__VisitsSummary.get_day.xml
+++ b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_segmentMatchVisitorType__VisitsSummary.get_day.xml
diff --git a/tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_segmentMatchVisitorType__VisitsSummary.get_week.xml b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_segmentMatchVisitorType__VisitsSummary.get_week.xml
index b23508240f..b23508240f 100644
--- a/tests/PHPUnit/Integration/expected/test_twoVisitsWithCustomVariables_segmentMatchVisitorType__VisitsSummary.get_week.xml
+++ b/tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_segmentMatchVisitorType__VisitsSummary.get_week.xml
diff --git a/tests/PHPUnit/TestingEnvironment.php b/tests/PHPUnit/TestingEnvironment.php
index 0c5ddbc69e..b2b875d7fc 100644
--- a/tests/PHPUnit/TestingEnvironment.php
+++ b/tests/PHPUnit/TestingEnvironment.php
@@ -232,9 +232,9 @@ class Piwik_TestingEnvironment
$outputContent = str_replace("=3D", "=", $outputContent);
$outputContents = array(
- 'from' => $mail->getFrom(),
- 'to' => $mail->getRecipients(),
- 'subject' => $mail->getSubject(),
+ 'from' => $mail->getFrom(),
+ 'to' => $mail->getRecipients(),
+ 'subject' => $mail->getSubject(),
'contents' => $outputContent
);
diff --git a/tests/PHPUnit/UI b/tests/PHPUnit/UI
-Subproject 6100f9642a51ee82b613d4f25595e4ee914878a
+Subproject 2e810ad80b3fd240c3231334efb62cd0468d125
diff --git a/tests/PHPUnit/Core/API/ApiRendererTest.php b/tests/PHPUnit/Unit/API/ApiRendererTest.php
index ebe1952a90..ebe1952a90 100644
--- a/tests/PHPUnit/Core/API/ApiRendererTest.php
+++ b/tests/PHPUnit/Unit/API/ApiRendererTest.php
diff --git a/tests/PHPUnit/Core/API/ResponseBuilderTest.php b/tests/PHPUnit/Unit/API/ResponseBuilderTest.php
index 9d6d0bc779..9d6d0bc779 100644
--- a/tests/PHPUnit/Core/API/ResponseBuilderTest.php
+++ b/tests/PHPUnit/Unit/API/ResponseBuilderTest.php
diff --git a/tests/PHPUnit/Core/AssetManager/PluginManagerMock.php b/tests/PHPUnit/Unit/AssetManager/PluginManagerMock.php
index 2dd91867f2..2dd91867f2 100644
--- a/tests/PHPUnit/Core/AssetManager/PluginManagerMock.php
+++ b/tests/PHPUnit/Unit/AssetManager/PluginManagerMock.php
diff --git a/tests/PHPUnit/Core/AssetManager/PluginMock.php b/tests/PHPUnit/Unit/AssetManager/PluginMock.php
index 6b6e8919ab..6b6e8919ab 100644
--- a/tests/PHPUnit/Core/AssetManager/PluginMock.php
+++ b/tests/PHPUnit/Unit/AssetManager/PluginMock.php
diff --git a/tests/PHPUnit/Core/AssetManager/ThemeMock.php b/tests/PHPUnit/Unit/AssetManager/ThemeMock.php
index 213a14d737..213a14d737 100644
--- a/tests/PHPUnit/Core/AssetManager/ThemeMock.php
+++ b/tests/PHPUnit/Unit/AssetManager/ThemeMock.php
diff --git a/tests/PHPUnit/Core/AssetManager/UIAssetCacheBusterMock.php b/tests/PHPUnit/Unit/AssetManager/UIAssetCacheBusterMock.php
index c6d2205aae..c6d2205aae 100644
--- a/tests/PHPUnit/Core/AssetManager/UIAssetCacheBusterMock.php
+++ b/tests/PHPUnit/Unit/AssetManager/UIAssetCacheBusterMock.php
diff --git a/tests/PHPUnit/Core/AssetManager/UIAssetCacheBusterTest.php b/tests/PHPUnit/Unit/AssetManager/UIAssetCacheBusterTest.php
index 85c4b613b3..85c4b613b3 100644
--- a/tests/PHPUnit/Core/AssetManager/UIAssetCacheBusterTest.php
+++ b/tests/PHPUnit/Unit/AssetManager/UIAssetCacheBusterTest.php
diff --git a/tests/PHPUnit/Core/AssetManager/UIAssetCatalogSorterTest.php b/tests/PHPUnit/Unit/AssetManager/UIAssetCatalogSorterTest.php
index 820d8161bf..820d8161bf 100644
--- a/tests/PHPUnit/Core/AssetManager/UIAssetCatalogSorterTest.php
+++ b/tests/PHPUnit/Unit/AssetManager/UIAssetCatalogSorterTest.php
diff --git a/tests/PHPUnit/Core/AssetManager/configs/merged-assets-disabled.ini.php b/tests/PHPUnit/Unit/AssetManager/configs/merged-assets-disabled.ini.php
index 610d020da1..610d020da1 100644
--- a/tests/PHPUnit/Core/AssetManager/configs/merged-assets-disabled.ini.php
+++ b/tests/PHPUnit/Unit/AssetManager/configs/merged-assets-disabled.ini.php
diff --git a/tests/PHPUnit/Core/AssetManager/configs/merged-assets-enabled.ini.php b/tests/PHPUnit/Unit/AssetManager/configs/merged-assets-enabled.ini.php
index 69a1facd8a..69a1facd8a 100644
--- a/tests/PHPUnit/Core/AssetManager/configs/merged-assets-enabled.ini.php
+++ b/tests/PHPUnit/Unit/AssetManager/configs/merged-assets-enabled.ini.php
diff --git a/tests/PHPUnit/Core/AssetManager/configs/plugins.ini.php b/tests/PHPUnit/Unit/AssetManager/configs/plugins.ini.php
index 72834098e0..72834098e0 100644
--- a/tests/PHPUnit/Core/AssetManager/configs/plugins.ini.php
+++ b/tests/PHPUnit/Unit/AssetManager/configs/plugins.ini.php
diff --git a/tests/PHPUnit/Core/AssetManager/scripts/ExpectedMergeResultCore.js b/tests/PHPUnit/Unit/AssetManager/scripts/ExpectedMergeResultCore.js
index 823fc76cdb..823fc76cdb 100644
--- a/tests/PHPUnit/Core/AssetManager/scripts/ExpectedMergeResultCore.js
+++ b/tests/PHPUnit/Unit/AssetManager/scripts/ExpectedMergeResultCore.js
diff --git a/tests/PHPUnit/Core/AssetManager/scripts/ExpectedMergeResultNonCore.js b/tests/PHPUnit/Unit/AssetManager/scripts/ExpectedMergeResultNonCore.js
index f004dcc501..f004dcc501 100644
--- a/tests/PHPUnit/Core/AssetManager/scripts/ExpectedMergeResultNonCore.js
+++ b/tests/PHPUnit/Unit/AssetManager/scripts/ExpectedMergeResultNonCore.js
diff --git a/tests/PHPUnit/Core/AssetManager/scripts/SimpleAlert.js b/tests/PHPUnit/Unit/AssetManager/scripts/SimpleAlert.js
index 003d113a36..003d113a36 100644
--- a/tests/PHPUnit/Core/AssetManager/scripts/SimpleAlert.js
+++ b/tests/PHPUnit/Unit/AssetManager/scripts/SimpleAlert.js
diff --git a/tests/PHPUnit/Core/AssetManager/scripts/SimpleArray.js b/tests/PHPUnit/Unit/AssetManager/scripts/SimpleArray.js
index 3176f85cff..3176f85cff 100644
--- a/tests/PHPUnit/Core/AssetManager/scripts/SimpleArray.js
+++ b/tests/PHPUnit/Unit/AssetManager/scripts/SimpleArray.js
diff --git a/tests/PHPUnit/Core/AssetManager/scripts/SimpleComments.js b/tests/PHPUnit/Unit/AssetManager/scripts/SimpleComments.js
index 5a7103256a..5a7103256a 100644
--- a/tests/PHPUnit/Core/AssetManager/scripts/SimpleComments.js
+++ b/tests/PHPUnit/Unit/AssetManager/scripts/SimpleComments.js
diff --git a/tests/PHPUnit/Core/AssetManager/scripts/SimpleObject.js b/tests/PHPUnit/Unit/AssetManager/scripts/SimpleObject.js
index aacdf5069c..aacdf5069c 100644
--- a/tests/PHPUnit/Core/AssetManager/scripts/SimpleObject.js
+++ b/tests/PHPUnit/Unit/AssetManager/scripts/SimpleObject.js
diff --git a/tests/PHPUnit/Unit/AssetManager/stylesheets/CssWithURLs.css b/tests/PHPUnit/Unit/AssetManager/stylesheets/CssWithURLs.css
new file mode 100644
index 0000000000..f53dbe37b5
--- /dev/null
+++ b/tests/PHPUnit/Unit/AssetManager/stylesheets/CssWithURLs.css
@@ -0,0 +1,12 @@
+h1 {
+ color: orange;
+ text-align: center;
+ /* url relative to root: must not be rewritten*/
+ background: url(tests/PHPUnit/Unit/AssetManager/stylesheets/images/test-image.png);
+}
+
+p {
+ font-size: 20px;
+ /* url relative to file: must be rewritten*/
+ background: url(images/test-image.png);
+} \ No newline at end of file
diff --git a/tests/PHPUnit/Unit/AssetManager/stylesheets/ExpectedMergeResult.css b/tests/PHPUnit/Unit/AssetManager/stylesheets/ExpectedMergeResult.css
new file mode 100644
index 0000000000..12acb9937c
--- /dev/null
+++ b/tests/PHPUnit/Unit/AssetManager/stylesheets/ExpectedMergeResult.css
@@ -0,0 +1,30 @@
+/* compile_me_once={{{CACHE-BUSTER-JS}}} */
+/* Piwik CSS file is compiled with Less. You may be interested in writing a custom Theme for Piwik! */
+#page #header {
+ color: white;
+}
+#footer {
+ color: red;
+}
+.box {
+ color: #fe33ac;
+ border-color: #fdcdea;
+}
+.box div {
+ -webkit-box-shadow: 0 0 5px rgba(0,0,0,0.3);
+ -moz-box-shadow: 0 0 5px rgba(0,0,0,0.3);
+ box-shadow: 0 0 5px rgba(0,0,0,0.3);
+}
+h1 {
+ color: orange;
+ text-align: center;
+ background: url(tests/PHPUnit/Unit/AssetManager/stylesheets/images/test-image.png);
+}
+p {
+ font-size: 20px;
+ background: url(tests/PHPUnit/Unit/AssetManager/stylesheets/images/test-image.png);
+}
+body {
+ background-color: #b0c4de;
+}
+/* customization via event */ \ No newline at end of file
diff --git a/tests/PHPUnit/Core/AssetManager/stylesheets/ImportedLess.less b/tests/PHPUnit/Unit/AssetManager/stylesheets/ImportedLess.less
index db566317b6..db566317b6 100644
--- a/tests/PHPUnit/Core/AssetManager/stylesheets/ImportedLess.less
+++ b/tests/PHPUnit/Unit/AssetManager/stylesheets/ImportedLess.less
diff --git a/tests/PHPUnit/Core/AssetManager/stylesheets/SimpleBody.css b/tests/PHPUnit/Unit/AssetManager/stylesheets/SimpleBody.css
index 6e0e55777a..6e0e55777a 100644
--- a/tests/PHPUnit/Core/AssetManager/stylesheets/SimpleBody.css
+++ b/tests/PHPUnit/Unit/AssetManager/stylesheets/SimpleBody.css
diff --git a/tests/PHPUnit/Core/AssetManager/stylesheets/SimpleLess.less b/tests/PHPUnit/Unit/AssetManager/stylesheets/SimpleLess.less
index fd7b33af31..fd7b33af31 100644
--- a/tests/PHPUnit/Core/AssetManager/stylesheets/SimpleLess.less
+++ b/tests/PHPUnit/Unit/AssetManager/stylesheets/SimpleLess.less
diff --git a/tests/PHPUnit/Core/AssetManager/stylesheets/images/test-image.png b/tests/PHPUnit/Unit/AssetManager/stylesheets/images/test-image.png
index da6e1bbe89..da6e1bbe89 100644
--- a/tests/PHPUnit/Core/AssetManager/stylesheets/images/test-image.png
+++ b/tests/PHPUnit/Unit/AssetManager/stylesheets/images/test-image.png
Binary files differ
diff --git a/tests/PHPUnit/Unit/AssetManagerTest.php b/tests/PHPUnit/Unit/AssetManagerTest.php
new file mode 100644
index 0000000000..5d3e709004
--- /dev/null
+++ b/tests/PHPUnit/Unit/AssetManagerTest.php
@@ -0,0 +1,721 @@
+<?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\AssetManager\UIAsset\OnDiskUIAsset;
+use Piwik\AssetManager\UIAsset;
+use Piwik\AssetManager;
+use Piwik\AssetManager\UIAssetFetcher\StaticUIAssetFetcher;
+use Piwik\Config;
+use Piwik\Plugin;
+use Piwik\Plugin\Manager;
+use Piwik\EventDispatcher;
+
+require_once PIWIK_INCLUDE_PATH . "/tests/PHPUnit/Unit/AssetManager/UIAssetCacheBusterMock.php";
+require_once PIWIK_INCLUDE_PATH . "/tests/PHPUnit/Unit/AssetManager/PluginManagerMock.php";
+require_once PIWIK_INCLUDE_PATH . "/tests/PHPUnit/Unit/AssetManager/PluginMock.php";
+require_once PIWIK_INCLUDE_PATH . "/tests/PHPUnit/Unit/AssetManager/ThemeMock.php";
+
+/**
+ * @group AssetManagerTest
+ */
+class AssetManagerTest extends PHPUnit_Framework_TestCase
+{
+ // todo Theme->rewriteAssetPathIfOverridesFound is not tested
+
+ const ASSET_MANAGER_TEST_DIR = 'tests/PHPUnit/Unit/AssetManager/';
+
+ const FIRST_CACHE_BUSTER_JS = 'first-cache-buster-js';
+ const SECOND_CACHE_BUSTER_JS = 'second-cache-buster-js';
+ const FIRST_CACHE_BUSTER_SS = 'first-cache-buster-stylesheet';
+ const SECOND_CACHE_BUSTER_SS = 'second-cache-buster-stylesheet';
+
+ const CORE_PLUGIN_NAME = 'MockCorePlugin';
+ const CORE_PLUGIN_WITHOUT_ASSETS_NAME = 'MockCoreWithoutAssetPlugin';
+ const NON_CORE_PLUGIN_NAME = 'MockNonCorePlugin';
+ const CORE_THEME_PLUGIN_NAME = 'CoreThemePlugin';
+ const NON_CORE_THEME_PLUGIN_NAME = 'NonCoreThemePlugin';
+
+ /**
+ * @var AssetManager
+ */
+ private $assetManager;
+
+ /**
+ * @var UIAsset
+ */
+ private $mergedAsset;
+
+ /**
+ * @var UIAssetCacheBusterMock
+ */
+ private $cacheBuster;
+
+ /**
+ * @var PluginManagerMock
+ */
+ private $pluginManager;
+
+ public function setUp()
+ {
+ $this->activateMergedAssets();
+
+ $this->setUpCacheBuster();
+
+ $this->setUpAssetManager();
+
+ $this->setUpPluginManager();
+
+ $this->setUpTheme();
+
+ $this->setUpPlugins();
+ }
+
+ public function tearDown()
+ {
+ $this->assetManager->removeMergedAssets();
+ Manager::unsetInstance();
+ }
+
+ private function activateMergedAssets()
+ {
+ $this->setUpConfig('merged-assets-enabled.ini.php');
+ }
+
+ private function disableMergedAssets()
+ {
+ $this->setUpConfig('merged-assets-disabled.ini.php');
+ }
+
+ /**
+ * @param string $filename
+ */
+ private function setUpConfig($filename)
+ {
+ $userFile = PIWIK_INCLUDE_PATH . '/' . self::ASSET_MANAGER_TEST_DIR . 'configs/' . $filename;
+ $globalFile = PIWIK_INCLUDE_PATH . '/' . self::ASSET_MANAGER_TEST_DIR . 'configs/plugins.ini.php';
+
+ $config = Config::getInstance();
+ $config->setTestEnvironment($userFile, $globalFile);
+ $config->init();
+ }
+
+ private function setUpCacheBuster()
+ {
+ $this->cacheBuster = UIAssetCacheBusterMock::getInstance();
+ }
+
+ private function setUpAssetManager()
+ {
+ $this->assetManager = AssetManager::getInstance();
+
+ $this->assetManager->removeMergedAssets();
+
+ $this->assetManager->setCacheBuster($this->cacheBuster);
+ }
+
+ private function setUpPluginManager()
+ {
+ $this->pluginManager = PluginManagerMock::getInstance();
+ Manager::setSingletonInstance($this->pluginManager);
+
+ EventDispatcher::unsetInstance(); // EventDispatcher stores a reference to Plugin Manager
+ }
+
+ private function setUpPlugins()
+ {
+ $this->pluginManager->setPlugins(
+ array(
+ $this->getCoreTheme()->getPlugin(),
+ $this->getNonCoreTheme()->getPlugin(),
+ $this->getCorePlugin(),
+ $this->getCorePluginWithoutUIAssets(),
+ $this->getNonCorePlugin()
+ )
+ );
+
+ $this->pluginManager->setLoadedTheme($this->getNonCoreTheme());
+ }
+
+ private function setUpCorePluginOnly()
+ {
+ $this->pluginManager->setPlugins(
+ array(
+ $this->getCorePlugin(),
+ )
+ );
+ }
+
+ /**
+ * @return Plugin
+ */
+ private function getCorePlugin()
+ {
+ $corePlugin = new PluginMock(self::CORE_PLUGIN_NAME);
+
+ $corePlugin->setJsFiles(
+ array(
+ self::ASSET_MANAGER_TEST_DIR . 'scripts/SimpleObject.js',
+ self::ASSET_MANAGER_TEST_DIR . 'scripts/SimpleArray.js',
+ )
+ );
+
+ $corePlugin->setStylesheetFiles($this->getCorePluginStylesheetFiles());
+ $corePlugin->setJsCustomization('// customization via event');
+ $corePlugin->setCssCustomization('/* customization via event */');
+
+ return $corePlugin;
+ }
+
+ /**
+ * @return Plugin
+ */
+ private function getCorePluginWithoutUIAssets()
+ {
+ return new PluginMock(self::CORE_PLUGIN_WITHOUT_ASSETS_NAME);
+ }
+
+ /**
+ * @return Plugin
+ */
+ private function getNonCorePlugin()
+ {
+ $nonCorePlugin = new PluginMock(self::NON_CORE_PLUGIN_NAME);
+ $nonCorePlugin->setJsFiles(array(self::ASSET_MANAGER_TEST_DIR . 'scripts/SimpleAlert.js'));
+
+ return $nonCorePlugin;
+ }
+
+ private function setUpTheme()
+ {
+ $this->assetManager->setTheme($this->getCoreTheme());
+ }
+
+ /**
+ * @return ThemeMock
+ */
+ private function getCoreTheme()
+ {
+ return $this->createTheme(self::CORE_THEME_PLUGIN_NAME);
+ }
+
+ /**
+ * @return ThemeMock
+ */
+ private function getNonCoreTheme()
+ {
+ return $this->createTheme(self::NON_CORE_THEME_PLUGIN_NAME);
+ }
+
+ /**
+ * @param string $themeName
+ * @return ThemeMock
+ */
+ private function createTheme($themeName)
+ {
+ $coreThemePlugin = new PluginMock($themeName);
+
+ $coreThemePlugin->setIsTheme(true);
+
+ $coreTheme = new ThemeMock($coreThemePlugin);
+
+ $coreTheme->setStylesheet($this->getCoreThemeStylesheet());
+ $coreTheme->setJsFiles(array(self::ASSET_MANAGER_TEST_DIR . 'scripts/SimpleComments.js'));
+
+ return $coreTheme;
+ }
+
+ /**
+ * @return string[]
+ */
+ public function getCorePluginStylesheetFiles()
+ {
+ return array(
+ self::ASSET_MANAGER_TEST_DIR . 'stylesheets/SimpleLess.less',
+ self::ASSET_MANAGER_TEST_DIR . 'stylesheets/CssWithURLs.css',
+ );
+ }
+
+ private function clearDateCache()
+ {
+ clearstatcache();
+ }
+
+ /**
+ * @return int
+ */
+ private function waitAndGetModificationDate()
+ {
+ $this->clearDateCache();
+
+ sleep(1.5);
+
+ $modificationDate = $this->mergedAsset->getModificationDate();
+
+ return $modificationDate;
+ }
+
+ /**
+ * @param string $cacheBuster
+ */
+ private function setJSCacheBuster($cacheBuster)
+ {
+ $this->cacheBuster->setPiwikVersionBasedCacheBuster($cacheBuster);
+ }
+
+ /**
+ * @param string $cacheBuster
+ */
+ private function setStylesheetCacheBuster($cacheBuster)
+ {
+ $this->cacheBuster->setMd5BasedCacheBuster($cacheBuster);
+ }
+
+ private function triggerGetMergedCoreJavaScript()
+ {
+ $this->mergedAsset = $this->assetManager->getMergedCoreJavaScript();
+ }
+
+ private function triggerGetMergedNonCoreJavaScript()
+ {
+ $this->mergedAsset = $this->assetManager->getMergedNonCoreJavaScript();
+ }
+
+ private function triggerGetMergedStylesheet()
+ {
+ $this->mergedAsset = $this->assetManager->getMergedStylesheet();
+ }
+
+ private function validateMergedCoreJs()
+ {
+ $expectedContent = $this->getExpectedMergedCoreJs();
+
+ $this->validateExpectedContent($expectedContent);
+ }
+
+ private function validateMergedNonCoreJs()
+ {
+ $expectedContent = $this->getExpectedMergedNonCoreJs();
+
+ $this->validateExpectedContent($expectedContent);
+ }
+
+ private function validateMergedStylesheet()
+ {
+ $expectedContent = $this->getExpectedMergedStylesheet();
+
+ $this->validateExpectedContent($expectedContent);
+ }
+
+ /**
+ * @param string $expectedContent
+ */
+ private function validateExpectedContent($expectedContent)
+ {
+ $this->assertEquals($expectedContent, $this->mergedAsset->getContent());
+ }
+
+ /**
+ * @return string
+ */
+ private function getExpectedMergedCoreJs()
+ {
+ return $this->getExpectedMergedJs('ExpectedMergeResultCore.js');
+ }
+
+ /**
+ * @return string
+ */
+ private function getExpectedMergedNonCoreJs()
+ {
+ return $this->getExpectedMergedJs('ExpectedMergeResultNonCore.js');
+ }
+
+ /**
+ * @param string $filename
+ * @return string
+ */
+ private function getExpectedMergedJs($filename)
+ {
+ $expectedMergeResult = new OnDiskUIAsset(PIWIK_USER_PATH, self::ASSET_MANAGER_TEST_DIR .'scripts/' . $filename);
+
+ $expectedContent = $expectedMergeResult->getContent();
+
+ return $this->adjustExpectedJsContent($expectedContent);
+ }
+
+ /**
+ * @param string $expectedJsContent
+ * @return string
+ */
+ private function adjustExpectedJsContent($expectedJsContent)
+ {
+ $expectedJsContent = str_replace("\n", "\r\n", $expectedJsContent);
+
+ $expectedJsContent = $this->specifyCacheBusterInExpectedContent($expectedJsContent, $this->cacheBuster->piwikVersionBasedCacheBuster());
+
+ return $expectedJsContent;
+ }
+
+ /**
+ * @return string
+ */
+ private function getExpectedMergedStylesheet()
+ {
+ $expectedMergeResult = new OnDiskUIAsset(PIWIK_USER_PATH, self::ASSET_MANAGER_TEST_DIR .'stylesheets/ExpectedMergeResult.css');
+
+ $expectedContent = $expectedMergeResult->getContent();
+
+ $expectedContent = $this->specifyCacheBusterInExpectedContent($expectedContent, $this->cacheBuster->md5BasedCacheBuster(''));
+
+ return $expectedContent;
+ }
+
+ /**
+ * @return string
+ */
+ private function getCoreThemeStylesheet()
+ {
+ return self::ASSET_MANAGER_TEST_DIR . 'stylesheets/SimpleBody.css';
+ }
+
+ /**
+ * @param string $content
+ * @param string $cacheBuster
+ * @return string
+ */
+ private function specifyCacheBusterInExpectedContent($content, $cacheBuster)
+ {
+ return str_replace('{{{CACHE-BUSTER-JS}}}', $cacheBuster, $content);
+ }
+
+ /**
+ * @param int $previousDate
+ */
+ private function validateDateDidNotChange($previousDate)
+ {
+ $this->clearDateCache();
+
+ $this->assertEquals($previousDate, $this->mergedAsset->getModificationDate());
+ }
+
+ /**
+ * @param int $previousDate
+ */
+ private function validateDateIsMoreRecent($previousDate)
+ {
+ $this->clearDateCache();
+
+ $this->assertTrue($previousDate < $this->mergedAsset->getModificationDate());
+ }
+
+ /**
+ * @return string
+ */
+ private function getJsTranslationScript()
+ {
+ return
+ '<script type="text/javascript">' . PHP_EOL .
+ 'var translations = [];' . PHP_EOL .
+ 'if (typeof(piwik_translations) == \'undefined\') { var piwik_translations = new Object; }for(var i in translations) { piwik_translations[i] = translations[i];} ' . PHP_EOL .
+ '</script>';
+ }
+
+ /**
+ * @return UIAsset[]
+ */
+ private function generateAllMergedAssets()
+ {
+ $this->triggerGetMergedStylesheet();
+ $stylesheetAsset = $this->mergedAsset;
+
+ $this->triggerGetMergedCoreJavaScript();
+ $coreJsAsset = $this->mergedAsset;
+
+ $this->triggerGetMergedNonCoreJavaScript();
+ $nonCoreJsAsset = $this->mergedAsset;
+
+ $this->assertTrue($stylesheetAsset->exists());
+ $this->assertTrue($coreJsAsset->exists());
+ $this->assertTrue($nonCoreJsAsset->exists());
+
+ return array($stylesheetAsset, $coreJsAsset, $nonCoreJsAsset);
+ }
+
+ /**
+ * @group Core
+ */
+ public function test_getMergedCoreJavaScript_NotGenerated()
+ {
+ $this->setJSCacheBuster(self::FIRST_CACHE_BUSTER_JS);
+
+ $this->triggerGetMergedCoreJavaScript();
+
+ $this->validateMergedCoreJs();
+ }
+
+ /**
+ * @group Core
+ */
+ public function test_getMergedNonCoreJavaScript_NotGenerated()
+ {
+ $this->setJSCacheBuster(self::FIRST_CACHE_BUSTER_JS);
+
+ $this->triggerGetMergedNonCoreJavaScript();
+
+ $this->validateMergedNonCoreJs();
+ }
+
+ /**
+ * @group Core
+ */
+ public function test_getMergedNonCoreJavaScript_NotGenerated_NoNonCorePlugin()
+ {
+ $this->setUpCorePluginOnly();
+
+ $this->setJSCacheBuster(self::FIRST_CACHE_BUSTER_JS);
+
+ $this->triggerGetMergedNonCoreJavaScript();
+
+ $expectedContent = $this->adjustExpectedJsContent('/* Piwik Javascript - cb={{{CACHE-BUSTER-JS}}}*/' . PHP_EOL);
+
+ $this->validateExpectedContent($expectedContent);
+ }
+
+ /**
+ * @group Core
+ */
+ public function test_getMergedCoreJavaScript_AlreadyGenerated_MergedAssetsDisabled_UpToDate()
+ {
+ $this->disableMergedAssets();
+
+ $this->setJSCacheBuster(self::FIRST_CACHE_BUSTER_JS);
+
+ $this->triggerGetMergedCoreJavaScript();
+
+ $modDateBeforeSecondRequest = $this->waitAndGetModificationDate();
+
+ $this->triggerGetMergedCoreJavaScript();
+
+ $this->validateDateDidNotChange($modDateBeforeSecondRequest);
+ }
+
+ /**
+ * @group Core
+ */
+ public function test_getMergedCoreJavaScript_AlreadyGenerated_MergedAssetsDeactivated_Stale()
+ {
+ $this->disableMergedAssets();
+
+ $this->setJSCacheBuster(self::FIRST_CACHE_BUSTER_JS);
+
+ $this->triggerGetMergedCoreJavaScript();
+
+ $modDateBeforeSecondRequest = $this->waitAndGetModificationDate();
+
+ $this->setJSCacheBuster(self::SECOND_CACHE_BUSTER_JS);
+
+ $this->triggerGetMergedCoreJavaScript();
+
+ $this->validateDateIsMoreRecent($modDateBeforeSecondRequest);
+
+ $this->validateMergedCoreJs();
+ }
+
+ /**
+ * @group Core
+ */
+ public function test_getMergedStylesheet_NotGenerated()
+ {
+ $this->setStylesheetCacheBuster(self::FIRST_CACHE_BUSTER_SS);
+
+ $this->triggerGetMergedStylesheet();
+
+ $this->validateMergedStylesheet();
+ }
+
+ /**
+ * We always regenerate if cache buster changes
+ * @group Core
+ */
+ public function test_getMergedStylesheet_Generated_MergedAssetsEnabled_Stale()
+ {
+ $this->activateMergedAssets();
+
+ $this->setStylesheetCacheBuster(self::FIRST_CACHE_BUSTER_SS);
+
+ $this->triggerGetMergedStylesheet();
+
+ $modDateBeforeSecondRequest = $this->waitAndGetModificationDate();
+
+ $this->setStylesheetCacheBuster(self::SECOND_CACHE_BUSTER_SS);
+
+ $this->triggerGetMergedStylesheet();
+
+ $this->validateDateIsMoreRecent($modDateBeforeSecondRequest);
+
+ $this->validateMergedStylesheet();
+ }
+
+ /**
+ * We always regenerate if cache buster changes
+ * @group Core
+ */
+ public function test_getMergedStylesheet_Generated_MergedAssetsDisabled_Stale()
+ {
+ $this->disableMergedAssets();
+
+ $this->setStylesheetCacheBuster(self::FIRST_CACHE_BUSTER_SS);
+
+ $this->triggerGetMergedStylesheet();
+
+ $modDateBeforeSecondRequest = $this->waitAndGetModificationDate();
+
+ $this->setStylesheetCacheBuster(self::SECOND_CACHE_BUSTER_SS);
+
+ $this->triggerGetMergedStylesheet();
+
+ $this->validateDateIsMoreRecent($modDateBeforeSecondRequest);
+
+ $this->validateMergedStylesheet();
+ }
+
+ /**
+ * @group Core
+ */
+ public function test_getMergedStylesheet_Generated_MergedAssetsDisabled_UpToDate()
+ {
+ $this->disableMergedAssets();
+
+ $this->setStylesheetCacheBuster(self::FIRST_CACHE_BUSTER_SS);
+
+ $this->triggerGetMergedStylesheet();
+
+ $modDateBeforeSecondRequest = $this->waitAndGetModificationDate();
+
+ $this->triggerGetMergedStylesheet();
+
+ $this->validateDateDidNotChange($modDateBeforeSecondRequest);
+ }
+
+ /**
+ * @group Core
+ */
+ public function test_getCssInclusionDirective()
+ {
+ $expectedCssInclusionDirective = '<link rel="stylesheet" type="text/css" href="index.php?module=Proxy&action=getCss" />' . PHP_EOL;
+
+ $this->assertEquals($expectedCssInclusionDirective, $this->assetManager->getCssInclusionDirective());
+ }
+
+ /**
+ * @group Core
+ */
+ public function test_getJsInclusionDirective_MergedAssetsDisabled()
+ {
+ $this->disableMergedAssets();
+
+ $expectedJsInclusionDirective =
+ $this->getJsTranslationScript() .
+ '<script type="text/javascript" src="tests/PHPUnit/Unit/AssetManager/scripts/SimpleObject.js"></script>' . PHP_EOL .
+ '<script type="text/javascript" src="tests/PHPUnit/Unit/AssetManager/scripts/SimpleArray.js"></script>' . PHP_EOL .
+ '<script type="text/javascript" src="tests/PHPUnit/Unit/AssetManager/scripts/SimpleComments.js"></script>' . PHP_EOL .
+ '<script type="text/javascript" src="tests/PHPUnit/Unit/AssetManager/scripts/SimpleAlert.js"></script>' . PHP_EOL;
+
+ $this->assertEquals($expectedJsInclusionDirective, $this->assetManager->getJsInclusionDirective());
+ }
+
+ /**
+ * @group Core
+ */
+ public function test_getJsInclusionDirective_MergedAssetsEnabled()
+ {
+ $expectedJsInclusionDirective =
+ $this->getJsTranslationScript() .
+ '<script type="text/javascript" src="index.php?module=Proxy&action=getCoreJs"></script>' . PHP_EOL .
+ '<script type="text/javascript" src="index.php?module=Proxy&action=getNonCoreJs"></script>' . PHP_EOL;
+
+ $this->assertEquals($expectedJsInclusionDirective, $this->assetManager->getJsInclusionDirective());
+ }
+
+ /**
+ * @group Core
+ */
+ public function test_getCompiledBaseCss()
+ {
+ $this->setStylesheetCacheBuster(self::FIRST_CACHE_BUSTER_SS);
+
+ $staticStylesheetList = array_merge($this->getCorePluginStylesheetFiles(), array($this->getCoreThemeStylesheet()));
+
+ $minimalAssetFetcher = new StaticUIAssetFetcher(
+ array_reverse($staticStylesheetList),
+ $staticStylesheetList,
+ $this->getCoreTheme()
+ );
+
+ $this->assetManager->setMinimalStylesheetFetcher($minimalAssetFetcher);
+
+ $this->mergedAsset = $this->assetManager->getCompiledBaseCss();
+
+ $this->validateMergedStylesheet();
+ }
+
+ /**
+ * @group Core
+ */
+ public function test_removeMergedAssets()
+ {
+ list($stylesheetAsset, $coreJsAsset, $nonCoreJsAsset) = $this->generateAllMergedAssets();
+
+ $this->assetManager->removeMergedAssets();
+
+ $this->assertFalse($stylesheetAsset->exists());
+ $this->assertFalse($coreJsAsset->exists());
+ $this->assertFalse($nonCoreJsAsset->exists());
+ }
+
+ /**
+ * @group Core
+ */
+ public function test_removeMergedAssets_PluginNameSpecified_PluginWithoutAssets()
+ {
+ list($stylesheetAsset, $coreJsAsset, $nonCoreJsAsset) = $this->generateAllMergedAssets();
+
+ $this->assetManager->removeMergedAssets(self::CORE_PLUGIN_WITHOUT_ASSETS_NAME);
+
+ $this->assertFalse($stylesheetAsset->exists());
+ $this->assertTrue($coreJsAsset->exists());
+ $this->assertTrue($nonCoreJsAsset->exists());
+ }
+
+ /**
+ * @group Core
+ */
+ public function test_removeMergedAssets_PluginNameSpecified_CorePlugin()
+ {
+ list($stylesheetAsset, $coreJsAsset, $nonCoreJsAsset) = $this->generateAllMergedAssets();
+
+ $this->assetManager->removeMergedAssets(self::CORE_PLUGIN_NAME);
+
+ $this->assertFalse($stylesheetAsset->exists());
+ $this->assertFalse($coreJsAsset->exists());
+ $this->assertTrue($nonCoreJsAsset->exists());
+ }
+
+ /**
+ * @group Core
+ */
+ public function test_removeMergedAssets_PluginNameSpecified_NonCoreThemeWithAssets()
+ {
+ list($stylesheetAsset, $coreJsAsset, $nonCoreJsAsset) = $this->generateAllMergedAssets();
+
+ $this->assetManager->removeMergedAssets(self::NON_CORE_THEME_PLUGIN_NAME);
+
+ $this->assertFalse($stylesheetAsset->exists());
+ $this->assertTrue($coreJsAsset->exists());
+ $this->assertFalse($nonCoreJsAsset->exists());
+ }
+} \ No newline at end of file
diff --git a/tests/PHPUnit/Core/CliMulti/OutputTest.php b/tests/PHPUnit/Unit/CliMulti/OutputTest.php
index 355fe2c4c7..355fe2c4c7 100644
--- a/tests/PHPUnit/Core/CliMulti/OutputTest.php
+++ b/tests/PHPUnit/Unit/CliMulti/OutputTest.php
diff --git a/tests/PHPUnit/Core/CliMulti/ProcessTest.php b/tests/PHPUnit/Unit/CliMulti/ProcessTest.php
index 12ec4c98e8..12ec4c98e8 100644
--- a/tests/PHPUnit/Core/CliMulti/ProcessTest.php
+++ b/tests/PHPUnit/Unit/CliMulti/ProcessTest.php
diff --git a/tests/PHPUnit/Core/Columns/DimensionTest.php b/tests/PHPUnit/Unit/Columns/DimensionTest.php
index 6952b3880f..6952b3880f 100644
--- a/tests/PHPUnit/Core/Columns/DimensionTest.php
+++ b/tests/PHPUnit/Unit/Columns/DimensionTest.php
diff --git a/tests/PHPUnit/Core/CommonTest.php b/tests/PHPUnit/Unit/CommonTest.php
index 86d03c4bdb..86d03c4bdb 100644
--- a/tests/PHPUnit/Core/CommonTest.php
+++ b/tests/PHPUnit/Unit/CommonTest.php
diff --git a/tests/PHPUnit/Core/ConfigTest.php b/tests/PHPUnit/Unit/ConfigTest.php
index 128e198eeb..128e198eeb 100644
--- a/tests/PHPUnit/Core/ConfigTest.php
+++ b/tests/PHPUnit/Unit/ConfigTest.php
diff --git a/tests/PHPUnit/Core/CookieTest.php b/tests/PHPUnit/Unit/CookieTest.php
index 9b77aeddaf..9b77aeddaf 100644
--- a/tests/PHPUnit/Core/CookieTest.php
+++ b/tests/PHPUnit/Unit/CookieTest.php
diff --git a/tests/PHPUnit/Core/DataTable/Filter/AddSummaryRowTest.php b/tests/PHPUnit/Unit/DataTable/Filter/AddSummaryRowTest.php
index 71b41bd429..71b41bd429 100644
--- a/tests/PHPUnit/Core/DataTable/Filter/AddSummaryRowTest.php
+++ b/tests/PHPUnit/Unit/DataTable/Filter/AddSummaryRowTest.php
diff --git a/tests/PHPUnit/Core/DataTable/Filter/ExcludeLowPopulationTest.php b/tests/PHPUnit/Unit/DataTable/Filter/ExcludeLowPopulationTest.php
index 469015a24c..469015a24c 100644
--- a/tests/PHPUnit/Core/DataTable/Filter/ExcludeLowPopulationTest.php
+++ b/tests/PHPUnit/Unit/DataTable/Filter/ExcludeLowPopulationTest.php
diff --git a/tests/PHPUnit/Core/DataTable/Filter/LimitTest.php b/tests/PHPUnit/Unit/DataTable/Filter/LimitTest.php
index 14705926a5..14705926a5 100644
--- a/tests/PHPUnit/Core/DataTable/Filter/LimitTest.php
+++ b/tests/PHPUnit/Unit/DataTable/Filter/LimitTest.php
diff --git a/tests/PHPUnit/Core/DataTable/Filter/PatternRecursiveTest.php b/tests/PHPUnit/Unit/DataTable/Filter/PatternRecursiveTest.php
index 7ab59d8c4a..7ab59d8c4a 100644
--- a/tests/PHPUnit/Core/DataTable/Filter/PatternRecursiveTest.php
+++ b/tests/PHPUnit/Unit/DataTable/Filter/PatternRecursiveTest.php
diff --git a/tests/PHPUnit/Core/DataTable/Filter/PatternTest.php b/tests/PHPUnit/Unit/DataTable/Filter/PatternTest.php
index 1f1c25bc61..1f1c25bc61 100644
--- a/tests/PHPUnit/Core/DataTable/Filter/PatternTest.php
+++ b/tests/PHPUnit/Unit/DataTable/Filter/PatternTest.php
diff --git a/tests/PHPUnit/Core/DataTable/Filter/PivotByDimensionTest.php b/tests/PHPUnit/Unit/DataTable/Filter/PivotByDimensionTest.php
index 9bfa6847ae..9bfa6847ae 100644
--- a/tests/PHPUnit/Core/DataTable/Filter/PivotByDimensionTest.php
+++ b/tests/PHPUnit/Unit/DataTable/Filter/PivotByDimensionTest.php
diff --git a/tests/PHPUnit/Core/DataTable/Filter/RangeCheckTest.php b/tests/PHPUnit/Unit/DataTable/Filter/RangeCheckTest.php
index e9140c3aed..e9140c3aed 100644
--- a/tests/PHPUnit/Core/DataTable/Filter/RangeCheckTest.php
+++ b/tests/PHPUnit/Unit/DataTable/Filter/RangeCheckTest.php
diff --git a/tests/PHPUnit/Core/DataTable/Filter/SortTest.php b/tests/PHPUnit/Unit/DataTable/Filter/SortTest.php
index bf23dbd7dc..bf23dbd7dc 100644
--- a/tests/PHPUnit/Core/DataTable/Filter/SortTest.php
+++ b/tests/PHPUnit/Unit/DataTable/Filter/SortTest.php
diff --git a/tests/PHPUnit/Core/DataTable/Filter/TruncateTest.php b/tests/PHPUnit/Unit/DataTable/Filter/TruncateTest.php
index 2cb53e701f..2cb53e701f 100644
--- a/tests/PHPUnit/Core/DataTable/Filter/TruncateTest.php
+++ b/tests/PHPUnit/Unit/DataTable/Filter/TruncateTest.php
diff --git a/tests/PHPUnit/Core/DataTable/MapTest.php b/tests/PHPUnit/Unit/DataTable/MapTest.php
index de08a14787..de08a14787 100644
--- a/tests/PHPUnit/Core/DataTable/MapTest.php
+++ b/tests/PHPUnit/Unit/DataTable/MapTest.php
diff --git a/tests/PHPUnit/Core/DataTable/Renderer/CSVTest.php b/tests/PHPUnit/Unit/DataTable/Renderer/CSVTest.php
index 64ffcf6a06..64ffcf6a06 100644
--- a/tests/PHPUnit/Core/DataTable/Renderer/CSVTest.php
+++ b/tests/PHPUnit/Unit/DataTable/Renderer/CSVTest.php
diff --git a/tests/PHPUnit/Core/DataTable/Renderer/ConsoleTest.php b/tests/PHPUnit/Unit/DataTable/Renderer/ConsoleTest.php
index 7da7dedb53..7da7dedb53 100644
--- a/tests/PHPUnit/Core/DataTable/Renderer/ConsoleTest.php
+++ b/tests/PHPUnit/Unit/DataTable/Renderer/ConsoleTest.php
diff --git a/tests/PHPUnit/Core/DataTable/Renderer/JSONTest.php b/tests/PHPUnit/Unit/DataTable/Renderer/JSONTest.php
index c18ee12e60..c18ee12e60 100644
--- a/tests/PHPUnit/Core/DataTable/Renderer/JSONTest.php
+++ b/tests/PHPUnit/Unit/DataTable/Renderer/JSONTest.php
diff --git a/tests/PHPUnit/Core/DataTable/Renderer/PHPTest.php b/tests/PHPUnit/Unit/DataTable/Renderer/PHPTest.php
index 7ba4088e5c..7ba4088e5c 100644
--- a/tests/PHPUnit/Core/DataTable/Renderer/PHPTest.php
+++ b/tests/PHPUnit/Unit/DataTable/Renderer/PHPTest.php
diff --git a/tests/PHPUnit/Core/DataTable/Renderer/XMLTest.php b/tests/PHPUnit/Unit/DataTable/Renderer/XMLTest.php
index f8c2a93072..f8c2a93072 100644
--- a/tests/PHPUnit/Core/DataTable/Renderer/XMLTest.php
+++ b/tests/PHPUnit/Unit/DataTable/Renderer/XMLTest.php
diff --git a/tests/PHPUnit/Core/DataTable/RowTest.php b/tests/PHPUnit/Unit/DataTable/RowTest.php
index 2ecb2d3d53..2ecb2d3d53 100644
--- a/tests/PHPUnit/Core/DataTable/RowTest.php
+++ b/tests/PHPUnit/Unit/DataTable/RowTest.php
diff --git a/tests/PHPUnit/Core/DataTableTest.php b/tests/PHPUnit/Unit/DataTableTest.php
index afb3e168fe..afb3e168fe 100644
--- a/tests/PHPUnit/Core/DataTableTest.php
+++ b/tests/PHPUnit/Unit/DataTableTest.php
diff --git a/tests/PHPUnit/Core/DateTest.php b/tests/PHPUnit/Unit/DateTest.php
index 84041f53fd..84041f53fd 100644
--- a/tests/PHPUnit/Core/DateTest.php
+++ b/tests/PHPUnit/Unit/DateTest.php
diff --git a/tests/PHPUnit/Core/DependencyTest.php b/tests/PHPUnit/Unit/DependencyTest.php
index 3c7b783e95..3c7b783e95 100644
--- a/tests/PHPUnit/Core/DependencyTest.php
+++ b/tests/PHPUnit/Unit/DependencyTest.php
diff --git a/tests/PHPUnit/Unit/DeprecatedMethodsTest.php b/tests/PHPUnit/Unit/DeprecatedMethodsTest.php
new file mode 100644
index 0000000000..4d07c93857
--- /dev/null
+++ b/tests/PHPUnit/Unit/DeprecatedMethodsTest.php
@@ -0,0 +1,97 @@
+<?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\AssetManager;
+use Piwik\AssetManager\UIAsset;
+use Piwik\Plugin;
+
+/**
+ * @group Core
+ */
+class DeprecatedMethodsTest extends PHPUnit_Framework_TestCase
+{
+
+ public function test_version2_0_4()
+ {
+ $validTill = '2014-10-20';
+ $this->assertDeprecatedMethodIsRemoved('\Piwik\Period', 'factory', $validTill);
+
+ $validTill = '2014-10-20';
+ $this->assertDeprecatedMethodIsRemoved('\Piwik\Config', 'getConfigSuperUserForBackwardCompatibility', $validTill);
+ $this->assertDeprecatedMethodIsRemoved('\Piwik\Menu\MenuAdmin', 'addEntry', $validTill);
+ $this->assertDeprecatedMethodIsRemoved('\Piwik\Menu\MenuAdmin', 'removeEntry', $validTill);
+ $this->assertDeprecatedMethodIsRemoved('\Piwik\Menu\MenuTop', 'addEntry', $validTill);
+ $this->assertDeprecatedMethodIsRemoved('\Piwik\Menu\MenuTop', 'removeEntry', $validTill);
+
+ $validTill = '2014-10-20';
+ $this->assertDeprecatedMethodIsRemoved('\Piwik\SettingsPiwik', 'rewriteTmpPathWithHostname', $validTill);
+
+ $validTill = '2015-02-06';
+ $this->assertDeprecatedClassIsRemoved('\IntegrationTestCase', $validTill);
+ $this->assertDeprecatedClassIsRemoved('\DatabaseTestCase', $validTill);
+ $this->assertDeprecatedClassIsRemoved('\Piwik\Tests\Fixture', $validTill);
+ $this->assertDeprecatedClassIsRemoved('\Piwik\Tests\OverrideLogin', $validTill);
+
+ $this->assertDeprecatedMethodIsRemovedInPiwik3('\Piwik\Menu\MenuAbstract', 'add');
+ }
+
+ private function assertDeprecatedMethodIsRemoved($className, $method, $removalDate)
+ {
+ $now = \Piwik\Date::now();
+ $removalDate = \Piwik\Date::factory($removalDate);
+
+ $class = new ReflectionClass($className);
+ $methodExists = $class->hasMethod($method);
+
+ if (!$now->isLater($removalDate)) {
+
+ $errorMessage = $className . '::' . $method . ' should still exists until ' . $removalDate . ' although it is deprecated.';
+ $this->assertTrue($methodExists, $errorMessage);
+ return;
+ }
+
+ $errorMessage = $className . '::' . $method . ' should be removed as the method is deprecated but it is not.';
+ $this->assertFalse($methodExists, $errorMessage);
+ }
+
+
+ private function assertDeprecatedClassIsRemoved($className, $removalDate)
+ {
+ $now = \Piwik\Date::now();
+ $removalDate = \Piwik\Date::factory($removalDate);
+
+ $classExists = class_exists($className);
+
+ if (!$now->isLater($removalDate)) {
+
+ $errorMessage = $className . 'should still exists until ' . $removalDate . ' although it is deprecated.';
+ $this->assertTrue($classExists, $errorMessage);
+ return;
+ }
+
+ $errorMessage = $className . ' should be removed as the method is deprecated but it is not.';
+ $this->assertFalse($classExists, $errorMessage);
+ }
+
+ private function assertDeprecatedMethodIsRemovedInPiwik3($className, $method)
+ {
+ $version = \Piwik\Version::VERSION;
+
+ $class = new ReflectionClass($className);
+ $methodExists = $class->hasMethod($method);
+
+ if (-1 === version_compare($version, '3.0.0')) {
+
+ $errorMessage = $className . '::' . $method . ' should still exists until 3.0 although it is deprecated.';
+ $this->assertTrue($methodExists, $errorMessage);
+ return;
+ }
+
+ $errorMessage = $className . '::' . $method . ' should be removed as the method is deprecated but it is not.';
+ $this->assertFalse($methodExists, $errorMessage);
+ }
+} \ No newline at end of file
diff --git a/tests/PHPUnit/Core/FactoryTest.php b/tests/PHPUnit/Unit/FactoryTest.php
index d85efcc2ce..d85efcc2ce 100644
--- a/tests/PHPUnit/Core/FactoryTest.php
+++ b/tests/PHPUnit/Unit/FactoryTest.php
diff --git a/tests/PHPUnit/Core/FilesystemTest.php b/tests/PHPUnit/Unit/FilesystemTest.php
index 26518c1a08..26518c1a08 100644
--- a/tests/PHPUnit/Core/FilesystemTest.php
+++ b/tests/PHPUnit/Unit/FilesystemTest.php
diff --git a/tests/PHPUnit/Core/IPTest.php b/tests/PHPUnit/Unit/IPTest.php
index f12d37dfed..f12d37dfed 100644
--- a/tests/PHPUnit/Core/IPTest.php
+++ b/tests/PHPUnit/Unit/IPTest.php
diff --git a/tests/PHPUnit/Core/Menu/MenuReportingTest.php b/tests/PHPUnit/Unit/Menu/MenuReportingTest.php
index b82c4a1aaf..b82c4a1aaf 100644
--- a/tests/PHPUnit/Core/Menu/MenuReportingTest.php
+++ b/tests/PHPUnit/Unit/Menu/MenuReportingTest.php
diff --git a/tests/PHPUnit/Core/MetricsTest.php b/tests/PHPUnit/Unit/MetricsTest.php
index c7052102e8..c7052102e8 100644
--- a/tests/PHPUnit/Core/MetricsTest.php
+++ b/tests/PHPUnit/Unit/MetricsTest.php
diff --git a/tests/PHPUnit/Core/NonceTest.php b/tests/PHPUnit/Unit/NonceTest.php
index 9d0d8ef37d..9d0d8ef37d 100644
--- a/tests/PHPUnit/Core/NonceTest.php
+++ b/tests/PHPUnit/Unit/NonceTest.php
diff --git a/tests/PHPUnit/Core/Period/DayTest.php b/tests/PHPUnit/Unit/Period/DayTest.php
index eb653fcc5c..eb653fcc5c 100644
--- a/tests/PHPUnit/Core/Period/DayTest.php
+++ b/tests/PHPUnit/Unit/Period/DayTest.php
diff --git a/tests/PHPUnit/Core/Period/MonthTest.php b/tests/PHPUnit/Unit/Period/MonthTest.php
index 5821aceee5..5821aceee5 100644
--- a/tests/PHPUnit/Core/Period/MonthTest.php
+++ b/tests/PHPUnit/Unit/Period/MonthTest.php
diff --git a/tests/PHPUnit/Core/Period/RangeTest.php b/tests/PHPUnit/Unit/Period/RangeTest.php
index b2114a4372..b2114a4372 100644
--- a/tests/PHPUnit/Core/Period/RangeTest.php
+++ b/tests/PHPUnit/Unit/Period/RangeTest.php
diff --git a/tests/PHPUnit/Core/Period/WeekTest.php b/tests/PHPUnit/Unit/Period/WeekTest.php
index 2994f8e13d..2994f8e13d 100644
--- a/tests/PHPUnit/Core/Period/WeekTest.php
+++ b/tests/PHPUnit/Unit/Period/WeekTest.php
diff --git a/tests/PHPUnit/Core/Period/YearTest.php b/tests/PHPUnit/Unit/Period/YearTest.php
index ef28d619d6..ef28d619d6 100644
--- a/tests/PHPUnit/Core/Period/YearTest.php
+++ b/tests/PHPUnit/Unit/Period/YearTest.php
diff --git a/tests/PHPUnit/Core/PeriodTest.php b/tests/PHPUnit/Unit/PeriodTest.php
index 8888c4c763..8888c4c763 100644
--- a/tests/PHPUnit/Core/PeriodTest.php
+++ b/tests/PHPUnit/Unit/PeriodTest.php
diff --git a/tests/PHPUnit/Core/Plugin/ComponentFactoryTest.php b/tests/PHPUnit/Unit/Plugin/ComponentFactoryTest.php
index b7b0f30fc3..b7b0f30fc3 100644
--- a/tests/PHPUnit/Core/Plugin/ComponentFactoryTest.php
+++ b/tests/PHPUnit/Unit/Plugin/ComponentFactoryTest.php
diff --git a/tests/PHPUnit/Core/Plugin/Dimension/ActionDimensionTest.php b/tests/PHPUnit/Unit/Plugin/Dimension/ActionDimensionTest.php
index 5ea77cca84..5ea77cca84 100644
--- a/tests/PHPUnit/Core/Plugin/Dimension/ActionDimensionTest.php
+++ b/tests/PHPUnit/Unit/Plugin/Dimension/ActionDimensionTest.php
diff --git a/tests/PHPUnit/Core/Plugin/Dimension/ConversionDimensionTest.php b/tests/PHPUnit/Unit/Plugin/Dimension/ConversionDimensionTest.php
index 38b2e4856f..38b2e4856f 100644
--- a/tests/PHPUnit/Core/Plugin/Dimension/ConversionDimensionTest.php
+++ b/tests/PHPUnit/Unit/Plugin/Dimension/ConversionDimensionTest.php
diff --git a/tests/PHPUnit/Core/Plugin/Dimension/VisitDimensionTest.php b/tests/PHPUnit/Unit/Plugin/Dimension/VisitDimensionTest.php
index e34806371e..e34806371e 100644
--- a/tests/PHPUnit/Core/Plugin/Dimension/VisitDimensionTest.php
+++ b/tests/PHPUnit/Unit/Plugin/Dimension/VisitDimensionTest.php
diff --git a/tests/PHPUnit/Core/RankingQueryTest.php b/tests/PHPUnit/Unit/RankingQueryTest.php
index 7941c25d35..7941c25d35 100644
--- a/tests/PHPUnit/Core/RankingQueryTest.php
+++ b/tests/PHPUnit/Unit/RankingQueryTest.php
diff --git a/tests/PHPUnit/Core/RegistryTest.php b/tests/PHPUnit/Unit/RegistryTest.php
index c6c2aff894..c6c2aff894 100644
--- a/tests/PHPUnit/Core/RegistryTest.php
+++ b/tests/PHPUnit/Unit/RegistryTest.php
diff --git a/tests/PHPUnit/Core/ScheduledTaskTest.php b/tests/PHPUnit/Unit/ScheduledTaskTest.php
index 5a131521ff..5a131521ff 100644
--- a/tests/PHPUnit/Core/ScheduledTaskTest.php
+++ b/tests/PHPUnit/Unit/ScheduledTaskTest.php
diff --git a/tests/PHPUnit/Core/ScheduledTime/DailyTest.php b/tests/PHPUnit/Unit/ScheduledTime/DailyTest.php
index 1a62019392..1a62019392 100644
--- a/tests/PHPUnit/Core/ScheduledTime/DailyTest.php
+++ b/tests/PHPUnit/Unit/ScheduledTime/DailyTest.php
diff --git a/tests/PHPUnit/Core/ScheduledTime/HourlyTest.php b/tests/PHPUnit/Unit/ScheduledTime/HourlyTest.php
index 14f4ce3c0e..14f4ce3c0e 100644
--- a/tests/PHPUnit/Core/ScheduledTime/HourlyTest.php
+++ b/tests/PHPUnit/Unit/ScheduledTime/HourlyTest.php
diff --git a/tests/PHPUnit/Core/ScheduledTime/MonthlyTest.php b/tests/PHPUnit/Unit/ScheduledTime/MonthlyTest.php
index 17bde4ee6d..17bde4ee6d 100644
--- a/tests/PHPUnit/Core/ScheduledTime/MonthlyTest.php
+++ b/tests/PHPUnit/Unit/ScheduledTime/MonthlyTest.php
diff --git a/tests/PHPUnit/Core/ScheduledTime/WeeklyTest.php b/tests/PHPUnit/Unit/ScheduledTime/WeeklyTest.php
index 62b6fce8ed..62b6fce8ed 100644
--- a/tests/PHPUnit/Core/ScheduledTime/WeeklyTest.php
+++ b/tests/PHPUnit/Unit/ScheduledTime/WeeklyTest.php
diff --git a/tests/PHPUnit/Core/SegmentExpressionTest.php b/tests/PHPUnit/Unit/SegmentExpressionTest.php
index 874df9e2d1..874df9e2d1 100644
--- a/tests/PHPUnit/Core/SegmentExpressionTest.php
+++ b/tests/PHPUnit/Unit/SegmentExpressionTest.php
diff --git a/tests/PHPUnit/Core/TaskSchedulerTest.php b/tests/PHPUnit/Unit/TaskSchedulerTest.php
index 3ec8781df7..3ec8781df7 100644
--- a/tests/PHPUnit/Core/TaskSchedulerTest.php
+++ b/tests/PHPUnit/Unit/TaskSchedulerTest.php
diff --git a/tests/PHPUnit/Core/Translate/Filter/ByBaseTranslationsTest.php b/tests/PHPUnit/Unit/Translate/Filter/ByBaseTranslationsTest.php
index 8ca2f09319..8ca2f09319 100644
--- a/tests/PHPUnit/Core/Translate/Filter/ByBaseTranslationsTest.php
+++ b/tests/PHPUnit/Unit/Translate/Filter/ByBaseTranslationsTest.php
diff --git a/tests/PHPUnit/Core/Translate/Filter/ByParameterCountTest.php b/tests/PHPUnit/Unit/Translate/Filter/ByParameterCountTest.php
index 06c72ed24f..06c72ed24f 100644
--- a/tests/PHPUnit/Core/Translate/Filter/ByParameterCountTest.php
+++ b/tests/PHPUnit/Unit/Translate/Filter/ByParameterCountTest.php
diff --git a/tests/PHPUnit/Core/Translate/Filter/EmptyTranslationsTest.php b/tests/PHPUnit/Unit/Translate/Filter/EmptyTranslationsTest.php
index a083e50a43..a083e50a43 100644
--- a/tests/PHPUnit/Core/Translate/Filter/EmptyTranslationsTest.php
+++ b/tests/PHPUnit/Unit/Translate/Filter/EmptyTranslationsTest.php
diff --git a/tests/PHPUnit/Core/Translate/Filter/EncodedEntitiesTest.php b/tests/PHPUnit/Unit/Translate/Filter/EncodedEntitiesTest.php
index cfad46387b..cfad46387b 100644
--- a/tests/PHPUnit/Core/Translate/Filter/EncodedEntitiesTest.php
+++ b/tests/PHPUnit/Unit/Translate/Filter/EncodedEntitiesTest.php
diff --git a/tests/PHPUnit/Core/Translate/Filter/UnnecassaryWhitespacesTest.php b/tests/PHPUnit/Unit/Translate/Filter/UnnecassaryWhitespacesTest.php
index 3f86b97a0d..3f86b97a0d 100644
--- a/tests/PHPUnit/Core/Translate/Filter/UnnecassaryWhitespacesTest.php
+++ b/tests/PHPUnit/Unit/Translate/Filter/UnnecassaryWhitespacesTest.php
diff --git a/tests/PHPUnit/Core/Translate/Validate/CoreTranslationsTest.php b/tests/PHPUnit/Unit/Translate/Validate/CoreTranslationsTest.php
index 3cde1e42c8..3cde1e42c8 100644
--- a/tests/PHPUnit/Core/Translate/Validate/CoreTranslationsTest.php
+++ b/tests/PHPUnit/Unit/Translate/Validate/CoreTranslationsTest.php
diff --git a/tests/PHPUnit/Core/Translate/Validate/NoScriptsTest.php b/tests/PHPUnit/Unit/Translate/Validate/NoScriptsTest.php
index e0a8f27b80..e0a8f27b80 100644
--- a/tests/PHPUnit/Core/Translate/Validate/NoScriptsTest.php
+++ b/tests/PHPUnit/Unit/Translate/Validate/NoScriptsTest.php
diff --git a/tests/PHPUnit/Core/Translate/WriterTest.php b/tests/PHPUnit/Unit/Translate/WriterTest.php
index 500009941a..500009941a 100644
--- a/tests/PHPUnit/Core/Translate/WriterTest.php
+++ b/tests/PHPUnit/Unit/Translate/WriterTest.php
diff --git a/tests/PHPUnit/Core/TranslateTest.php b/tests/PHPUnit/Unit/TranslateTest.php
index b7a99f70ee..b7a99f70ee 100644
--- a/tests/PHPUnit/Core/TranslateTest.php
+++ b/tests/PHPUnit/Unit/TranslateTest.php
diff --git a/tests/PHPUnit/Core/UrlHelperTest.php b/tests/PHPUnit/Unit/UrlHelperTest.php
index 79ba4fbecd..79ba4fbecd 100644
--- a/tests/PHPUnit/Core/UrlHelperTest.php
+++ b/tests/PHPUnit/Unit/UrlHelperTest.php
diff --git a/tests/PHPUnit/Core/UrlTest.php b/tests/PHPUnit/Unit/UrlTest.php
index c77907ee04..c77907ee04 100644
--- a/tests/PHPUnit/Core/UrlTest.php
+++ b/tests/PHPUnit/Unit/UrlTest.php
diff --git a/tests/PHPUnit/bootstrap.php b/tests/PHPUnit/bootstrap.php
index 2fd701a0e8..8335346c6b 100644
--- a/tests/PHPUnit/bootstrap.php
+++ b/tests/PHPUnit/bootstrap.php
@@ -34,9 +34,12 @@ require_once file_exists(PIWIK_INCLUDE_PATH . '/vendor/autoload.php')
require_once PIWIK_INCLUDE_PATH . '/libs/upgradephp/upgrade.php';
require_once PIWIK_INCLUDE_PATH . '/core/testMinimumPhpVersion.php';
require_once PIWIK_INCLUDE_PATH . '/core/FrontController.php';
+require_once PIWIK_INCLUDE_PATH . '/tests/PHPUnit/Impl/Fixture.php';
require_once PIWIK_INCLUDE_PATH . '/tests/PHPUnit/Fixture.php';
-require_once PIWIK_INCLUDE_PATH . '/tests/PHPUnit/IntegrationTestCase.php';
+require_once PIWIK_INCLUDE_PATH . '/tests/PHPUnit/Impl/SystemTestCase.php';
+require_once PIWIK_INCLUDE_PATH . '/tests/PHPUnit/Impl/IntegrationTestCase.php';
require_once PIWIK_INCLUDE_PATH . '/tests/PHPUnit/DatabaseTestCase.php';
+require_once PIWIK_INCLUDE_PATH . '/tests/PHPUnit/IntegrationTestCase.php';
require_once PIWIK_INCLUDE_PATH . '/tests/PHPUnit/ConsoleCommandTestCase.php';
require_once PIWIK_INCLUDE_PATH . '/tests/PHPUnit/FakeAccess.php';
require_once PIWIK_INCLUDE_PATH . '/tests/PHPUnit/MockPiwikOption.php';
@@ -81,7 +84,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 = \Piwik\Tests\Fixture::getRootUrl();
+ $baseUrl = \Piwik\Tests\Impl\Fixture::getRootUrl();
\Piwik\SettingsPiwik::checkPiwikServerWorking($baseUrl, $acceptInvalidSSLCertificates = true);
}
diff --git a/tests/PHPUnit/phpunit.xml.dist b/tests/PHPUnit/phpunit.xml.dist
index 492b459455..2a8179aee4 100644
--- a/tests/PHPUnit/phpunit.xml.dist
+++ b/tests/PHPUnit/phpunit.xml.dist
@@ -31,17 +31,34 @@
</php>
<testsuites>
- <testsuite name="IntegrationTests">
- <directory>./Integration</directory>
- </testsuite>
- <testsuite name="PluginTests">
- <directory>./Plugins</directory>
- <directory>../../plugins/*/tests</directory>
- <directory>../../plugins/*/Test</directory>
- </testsuite>
- <testsuite name="CoreTests">
- <directory>./Core</directory>
- </testsuite>
+ <testsuite name="SystemTests">
+ <directory>./System</directory>
+ <directory>../../plugins/*/tests</directory><!-- There should be actually a tests/System but this way we make sure to execute all tests even if some are not moved to correct subdirectory. We will execute Unit and Integration tests twice :( ... -->
+ <directory>../../plugins/*/Test</directory>
+ <exclude>../../plugins/*/tests/Integration</exclude><!-- * in exclude is currently not supported by PHPUnit, so it won't work yet. See https://github.com/sebastianbergmann/php-file-iterator/pull/23 -->
+ <exclude>../../plugins/*/Test/Integration</exclude>
+ <exclude>../../plugins/*/tests/Unit</exclude>
+ <exclude>../../plugins/*/Test/Unit</exclude>
+ </testsuite>
+ <testsuite name="IntegrationTests">
+ <directory>./Integration</directory>
+ <directory>../../plugins/*/tests/Integration</directory>
+ <directory>../../plugins/*/Test/Integration</directory>
+ </testsuite>
+ <testsuite name="UnitTests">
+ <directory>./Unit</directory>
+ <directory>../../plugins/*/tests/Unit</directory>
+ <directory>../../plugins/*/Test/Unit</directory>
+ </testsuite>
+ <testsuite name="PluginTests">
+ <directory>../../plugins/*/tests</directory>
+ <directory>../../plugins/*/Test</directory>
+ </testsuite>
+ <testsuite name="CoreTests">
+ <directory>./Unit</directory>
+ <directory>./Integration</directory>
+ <directory>./System</directory>
+ </testsuite>
</testsuites>
<filter>
@@ -55,6 +72,7 @@
<directory suffix=".php">../../plugins/*/Updates</directory>
<directory suffix=".php">../../plugins/*/libs</directory>
<directory suffix=".php">../../plugins/*/tests</directory>
+ <directory suffix=".php">../../plugins/*/Test</directory>
</exclude>
</whitelist>
</filter>
diff --git a/tests/PHPUnit/proxy/index.php b/tests/PHPUnit/proxy/index.php
index 3363d90ba8..213df21cf8 100644
--- a/tests/PHPUnit/proxy/index.php
+++ b/tests/PHPUnit/proxy/index.php
@@ -1,7 +1,7 @@
<?php
/**
* Proxy to index.php, but will use the Test DB
- * Used by tests/PHPUnit/Integration/ImportLogsTest.php and tests/PHPUnit/Integration/UITest.php
+ * Used by tests/PHPUnit/System/ImportLogsTest.php and tests/PHPUnit/System/UITest.php
*/
require realpath(dirname(__FILE__)) . "/includes.php";
diff --git a/tests/README.md b/tests/README.md
index bc35bb93eb..16d1b1ee90 100644
--- a/tests/README.md
+++ b/tests/README.md
@@ -1,4 +1,4 @@
-Piwik comes with unit tests, integration tests, Javascript tests and Webtests.
+Piwik comes with unit tests, integration tests, system tests, Javascript tests and UI tests.
This document briefly describes how to use and modify Piwik tests.
## Continuous Integration
@@ -70,31 +70,64 @@ To execute the tests:
4. Run the tests
- $ cd /path/to/piwik/tests/PHPUnit
- $ phpunit --group Core
- $ phpunit --group Plugins
- $ phpunit --group Integration
+ $ cd /path/to/piwik
+ $ ./console tests:run --testsuite unit
+ $ ./console tests:run --testsuite integration
+ $ ./console tests:run --testsuite system
- There are three main groups of tests: Core, Plugins and Integration
- For example run `phpunit --group Core`
- to run all Core Piwik tests.
+ There are also two main groups of tests: core and plugins
+ For example run `./console tests:run core` to run all Core Piwik tests.
+
+ You can combine testsuite and groups like this:
+ `./console tests:run --testsuite unit core`. This would run all unit tests in core.
+ `./console tests:run --testsuite integration CustomAlerts`. This would run all integration tests of the CustomAlerts plugin.
+ `./console tests:run CustomAlerts`. This would run all unit, integration and system tests of the CustomAlerts plugin. (group only)
+
+ To execute multiple groups you can separate them via a comma:
+ `./console tests:run CustomAlerts,Insights`. This would run all unit, integration and system tests of the CustomAlerts and Insights plugin.
5. Write more tests :)
See ["Writing Unit tests with PHPUnit"](http://www.phpunit.de/manual/current/en/writing-tests-for-phpunit.html)
-## Integration Tests
+## How to differentiate between unit, integration or system tests?
+This can be sometimes hard to decide and often leads to discussions. We consider a test as a unit test when
+it tests only a single method or class. Sometimes two or three classes can still be considered as a Unit for instance if
+ you have to pass a dummy class or something similar but it should actually only test one class or method.
+ If it has a dependency to the filesystem, web, config, database or to other plugins it is not a unit test but an
+ integration test. If the test is slow it is most likely not a unit test but an integration test as well.
+ "Slow" is of course very objective and also depends on the server but if your test does not have any dependencies
+your test will be really fast.
+
+It is an integration test if you have any dependency to a loaded plugin, to the filesystem, web, config, database or something
+similar. It is an integration test if you test multiple classes in one test.
+
+It is a system test if you - for instance - make a call to Piwik itself via HTTP or CLI and the whole system is being tested.
+
+### Why do we split tests in unit, integration, system and ui folders?
+Because they fail for different reasons and the duration of the test execution is different. This allows us to execute
+all unit tests and get a result very quick. Unit tests should not fail on different systems and just run everywhere for
+ example no matter whether you are using NFS or not. Once the unit tests are green one would usually execute all integration
+ tests to see whether the next stage works. They take a bit longer as they have depenencies to the database and filesystem.
+ The system and ui tests take the most time to run as they always run through the whole code.
+
+Another advantage of running the tests separately is that we are getting a more accurate code coverage. For instance when
+running the unit tests we will get the true code coverage as they always only test one class or method. Integration tests
+usually run through a lot of code but often actually only one method is supposed to be tested. Although many methods are
+not tested they would be still marked as tested when running integration tests.
+
+## System Tests
-Integration tests files are in `tests/PHPUnit/Integration/*Test.php`
+System tests files are in `tests/PHPUnit/System/*Test.php`
-Integration tests allow to test how major Piwik components interact together.
+System tests allow to test how major Piwik components interact together.
A test will typically generate hits to the Tracker (record visits and page views)
and then test all API responses and for each API output. It then checks that they match expected XML (or CSV, json, etc.).
If a test fails, you can compare the processed/ and expected/ directories in a graphical
text compare tool, such as WinMerge on Win, or MELD on Linux, to easily view changes between files.
For example using Meld, click on "Start new comparison", "Directory comparison",
-in "Original" select "path/to/piwik/tests/PHPUnit/Integration/expected"
-in "Mine" select "path/to/piwik/tests/PHPUnit/Integration/processed"
+in "Original" select "path/to/piwik/tests/PHPUnit/System/expected"
+in "Mine" select "path/to/piwik/tests/PHPUnit/System/processed"
If changes are expected due to the code changes you make, simply copy the file from processed/ to
expected/, and test will then pass. Copying files is done easily using Meld (ALT+LEFT).
@@ -102,10 +135,10 @@ Otherwise, if you didn't expect to modify the API outputs, it might be that your
### Scheduled Reports Tests
-As part of our integration tests we generate the scheduled reports (in HTML, PDF & SMS).
+As part of our system tests we generate the scheduled reports (in HTML, PDF & SMS).
Some of these scheduled reports contain PNG graphs. Depending on the system under test, generated images can differ.
Therefore, PNG graphs are only tested and compared against "expected" graphs, if the system under test has the same characteristics as the integration server.
-The characteristics of the integration server are described in `IntegrationTestCase::canImagesBeIncludedInScheduledReports()`
+The characteristics of the integration server are described in `SystemTestCase::canImagesBeIncludedInScheduledReports()`
### Running tests on Ubuntu
diff --git a/tests/README.screenshots.md b/tests/README.screenshots.md
index 6203313f71..d6976c5ba6 100644
--- a/tests/README.screenshots.md
+++ b/tests/README.screenshots.md
@@ -36,7 +36,7 @@ To fix a broken build, follow these steps:
(If the screenshot test is for a plugin and not Piwik Core, the expected screenshot should be added to the
plugin's expected screenshot directory. For example: piwik/plugins/DBStats/tests/UI/expected-ui-screenshots.)
- _Note: When determining whether a screenshot is correct, the data displayed is not important. Report data correctness is verified through Integration and other PHP tests. The UI tests should only test UI behavior._
+ _Note: When determining whether a screenshot is correct, the data displayed is not important. Report data correctness is verified through System and other PHP tests. The UI tests should only test UI behavior._
* Push the changes (to your code and/or to the expected-ui-screenshots directory.
* Wait for next UI Tests build [on travis](https://travis-ci.org/piwik/piwik-ui-tests). Hopefully, the build should be green!
diff --git a/tests/README.troubleshooting.md b/tests/README.troubleshooting.md
index 7582b476e2..8e38380634 100644
--- a/tests/README.troubleshooting.md
+++ b/tests/README.troubleshooting.md
@@ -26,12 +26,6 @@ sudo apt-get update
sudo apt-get upgrade
```
-## PHP 5.5: also update PHPUnit to latest
-
-See [PHPUnit update](http://phpunit.de/manual/current/en/installation.html) or try this command:
-
- $ sudo pear install -a phpunit/PHPUnit
-
## Troubleshooting failing tests
If you get any of these errors:
diff --git a/tests/lib/screenshot-testing/support/test-environment.js b/tests/lib/screenshot-testing/support/test-environment.js
index 36807dac89..7c0911d5cc 100644
--- a/tests/lib/screenshot-testing/support/test-environment.js
+++ b/tests/lib/screenshot-testing/support/test-environment.js
@@ -93,7 +93,7 @@ TestingEnvironment.prototype._call = function (params, done) {
TestingEnvironment.prototype.executeConsoleCommand = function (command, args, callback) {
var consoleFile = path.join(PIWIK_INCLUDE_PATH, 'console'),
- commandArgs = [consoleFile, command].concat(args),
+ commandArgs = [consoleFile, command, '-v'].concat(args),
child = require('child_process').spawn(config.php, commandArgs);
var firstLine = true;
diff --git a/tests/travis/initiate_ui_tests.sh b/tests/travis/initiate_ui_tests.sh
index c7c7e2e470..3dc5a3d9b1 100755
--- a/tests/travis/initiate_ui_tests.sh
+++ b/tests/travis/initiate_ui_tests.sh
@@ -1,7 +1,7 @@
#!/bin/bash
-# initiate UI tests before starting integration tests for php 5.5
-if [ "$TEST_SUITE" != "IntegrationTests" ] || [[ "$TRAVIS_PHP_VERSION" != 5\.5* ]]; then
+# initiate UI tests before starting system tests for php 5.5
+if [ "$TEST_SUITE" != "SystemTests" ] || [[ "$TRAVIS_PHP_VERSION" != 5\.5* ]]; then
echo "Not initiating UI tests (\$TEST_SUITE = $TEST_SUITE, \$TRAVIS_PHP_VERSION = $TRAVIS_PHP_VERSION)."
exit
fi
diff --git a/tests/travis/prepare.sh b/tests/travis/prepare.sh
index 217b888335..0343b2c127 100755
--- a/tests/travis/prepare.sh
+++ b/tests/travis/prepare.sh
@@ -38,4 +38,4 @@ mkdir ./tmp/templates_c
mkdir ./tmp/tcpdf
mkdir ./tmp/climulti
chmod a+rw ./tests/lib/geoip-files
-chmod a+rw ./plugins/ExamplePlugin/tests/processed
+chmod a+rw ./plugins/*/tests/System/processed
diff --git a/tests/travis/travis-helper.sh b/tests/travis/travis-helper.sh
index 58ebc4cd55..bf0e5ce2dd 100644
--- a/tests/travis/travis-helper.sh
+++ b/tests/travis/travis-helper.sh
@@ -27,7 +27,6 @@ echo -e "\n${RED}The command \"$TRAVIS_CMD\" exited with $result.${RESET}"
fi
echo -e "\n${GREEN}Log:${RESET}\n"
- cat $log_file
return $result
}
diff --git a/tests/travis/travis.sh b/tests/travis/travis.sh
index 69576a05c5..a996c46ee9 100755
--- a/tests/travis/travis.sh
+++ b/tests/travis/travis.sh
@@ -67,17 +67,17 @@ then
fi
fi
else
- if [ "$COVERAGE" = "Integration" ]
+ if [ "$COVERAGE" = "System" ]
then
- echo "Executing non Integration tests in test suite IntegrationTests..."
- phpunit --configuration phpunit.xml --testsuite IntegrationTests --exclude-group Integration --colors --coverage-clover $TRAVIS_BUILD_DIR/build/logs/clover-integration.xml || true
- elif [ "$COVERAGE" = "Core" ]
+ echo "Executing non System tests in test suite SystemTests..."
+ phpunit --configuration phpunit.xml --testsuite SystemTests --exclude-group System --colors --coverage-clover $TRAVIS_BUILD_DIR/build/logs/clover-system.xml || true
+ elif [ "$COVERAGE" = "Unit" ]
then
- echo "Executing tests in test suite CoreTests..."
- phpunit --configuration phpunit.xml --testsuite CoreTests --colors --coverage-clover $TRAVIS_BUILD_DIR/build/logs/clover-core.xml || true
- elif [ "$COVERAGE" = "Plugins" ]
+ echo "Executing tests in test suite UnitTests..."
+ phpunit --configuration phpunit.xml --testsuite UnitTests --colors --coverage-clover $TRAVIS_BUILD_DIR/build/logs/clover-unit.xml || true
+ elif [ "$COVERAGE" = "Integration" ]
then
- echo "Executing tests in test suite PluginTests..."
- phpunit --configuration phpunit.xml --testsuite PluginTests --colors --coverage-clover $TRAVIS_BUILD_DIR/build/logs/clover-plugins.xml || true
+ echo "Executing tests in test suite IntegrationTests..."
+ phpunit --configuration phpunit.xml --testsuite IntegrationTests --colors --coverage-clover $TRAVIS_BUILD_DIR/build/logs/clover-integration.xml || true
fi;
fi \ No newline at end of file
diff --git a/tests/travis/upload_artifacts.sh b/tests/travis/upload_artifacts.sh
index 98a3f4fffa..325f0448b5 100755
--- a/tests/travis/upload_artifacts.sh
+++ b/tests/travis/upload_artifacts.sh
@@ -1,12 +1,12 @@
#!/bin/bash
-if [ "$TEST_SUITE" = "IntegrationTests" ];
+if [ "$TEST_SUITE" = "SystemTests" ];
then
url="http://builds-artifacts.piwik.org/upload.php?auth_key=$ARTIFACTS_PASS&artifact_name=processed&branch=$TRAVIS_BRANCH&build_id=$TRAVIS_JOB_NUMBER"
echo "Uploading artifacts for $TEST_SUITE..."
- cd ./tests/PHPUnit/Integration
+ cd ./tests/PHPUnit/System
# upload processed tarball
tar -cjf processed.tar.bz2 processed --exclude='.gitkeep'