Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Steur <thomas.steur@gmail.com>2015-12-10 00:50:07 +0300
committerThomas Steur <thomas.steur@gmail.com>2015-12-10 00:50:07 +0300
commitebced800c0184f5ce93663afab6b0337c3755cbb (patch)
treefb26c2506d37586ff0d38fb902d63d17701bd883 /tests/PHPUnit/Fixtures
parent3d26af780d8fe0e4f7c5824a88b95c4a0d0d25d7 (diff)
parentdb36ca384809ea36457a465a3b6d1ecf951b0e26 (diff)
Merge master into "3.0"
Conflicts: .travis.yml CHANGELOG.md core/Plugin/ControllerAdmin.php core/Version.php core/testMinimumPhpVersion.php plugins/API/API.php plugins/Actions/Reports/GetPageUrls.php plugins/AnonymousPiwikUsageMeasurement plugins/CoreHome/CoreHome.php plugins/CoreHome/templates/_menu.twig plugins/CoreVisualizations/javascripts/jqplotEvolutionGraph.js plugins/CustomVariables/tests/System/expected/test_CustomVariablesSystemTest__CustomVariables.getCustomVariables_day.xml plugins/Goals/Controller.php tests/PHPUnit/Fixtures/ManyVisitsWithGeoIP.php tests/PHPUnit/Integration/Plugin/ManagerTest.php tests/PHPUnit/System/expected/test_FlattenReports__CustomVariables.getCustomVariables_day.xml tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_html_tables_only__ScheduledReports.generateReport_month.original.html tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getSegmentsMetadata.xml tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_scheduled_report_in_html_tables_only__ScheduledReports.generateReport_week.original.html tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__CustomVariables.getCustomVariables_range.xml tests/PHPUnit/System/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI_pagesegment__CustomVariables.getCustomVariables_range.xml tests/PHPUnit/System/expected/test_reportLimiting__CustomVariables.getCustomVariables_day.xml tests/PHPUnit/System/expected/test_reportLimiting_rankingQuery__CustomVariables.getCustomVariables_day.xml tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_segmentMatchALL_noGoalData__CustomVariables.getCustomVariables_day.xml tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_segmentMatchALL_noGoalData__CustomVariables.getCustomVariables_week.xml tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_segmentMatchVisitorType__CustomVariables.getCustomVariables_day.xml tests/PHPUnit/System/expected/test_twoVisitsWithCustomVariables_segmentMatchVisitorType__CustomVariables.getCustomVariables_week.xml tests/UI/expected-ui-screenshots tests/UI/specs/Overlay_spec.js tests/UI/specs/UIIntegration_spec.js
Diffstat (limited to 'tests/PHPUnit/Fixtures')
-rw-r--r--tests/PHPUnit/Fixtures/ManySitesImportedLogsWithXssAttempts.php5
-rw-r--r--tests/PHPUnit/Fixtures/ManyVisitsWithGeoIP.php3
-rw-r--r--tests/PHPUnit/Fixtures/ManyVisitsWithMockLocationProvider.php2
-rw-r--r--tests/PHPUnit/Fixtures/OmniFixture.php22
-rw-r--r--tests/PHPUnit/Fixtures/SomeVisitsCustomVariablesCampaignsNotHeuristics.php7
-rw-r--r--tests/PHPUnit/Fixtures/TwoSitesManyVisitsOverSeveralDaysWithSearchEngineReferrers.php2
-rw-r--r--tests/PHPUnit/Fixtures/UITestFixture.php3
7 files changed, 36 insertions, 8 deletions
diff --git a/tests/PHPUnit/Fixtures/ManySitesImportedLogsWithXssAttempts.php b/tests/PHPUnit/Fixtures/ManySitesImportedLogsWithXssAttempts.php
index b516c85d65..227e45bd4a 100644
--- a/tests/PHPUnit/Fixtures/ManySitesImportedLogsWithXssAttempts.php
+++ b/tests/PHPUnit/Fixtures/ManySitesImportedLogsWithXssAttempts.php
@@ -57,6 +57,11 @@ class ManySitesImportedLogsWithXssAttempts extends ManySitesImportedLogs
self::createWebsite($this->dateTime, $ecommerce = 0, $siteName = 'Piwik test two',
$siteUrl = 'http://example-site-two.com');
}
+
+ if (!self::siteCreated($idSite = 3)) {
+ self::createWebsite($this->dateTime, $ecommerce = 0, $siteName = 'Piwik test three',
+ $siteUrl = 'http://example-site-three.com');
+ }
}
public function addAnnotations()
diff --git a/tests/PHPUnit/Fixtures/ManyVisitsWithGeoIP.php b/tests/PHPUnit/Fixtures/ManyVisitsWithGeoIP.php
index 9db794269d..ce454b38d2 100644
--- a/tests/PHPUnit/Fixtures/ManyVisitsWithGeoIP.php
+++ b/tests/PHPUnit/Fixtures/ManyVisitsWithGeoIP.php
@@ -265,9 +265,6 @@ class ManyVisitsWithGeoIP extends Fixture
public static function unsetLocationProvider()
{
- // also fails on other PHP, is it really needed?
- return;
-
try {
LocationProvider::setCurrentProvider('default');
} catch(Exception $e) {
diff --git a/tests/PHPUnit/Fixtures/ManyVisitsWithMockLocationProvider.php b/tests/PHPUnit/Fixtures/ManyVisitsWithMockLocationProvider.php
index dd2a2c773c..9fbd6f986d 100644
--- a/tests/PHPUnit/Fixtures/ManyVisitsWithMockLocationProvider.php
+++ b/tests/PHPUnit/Fixtures/ManyVisitsWithMockLocationProvider.php
@@ -33,6 +33,8 @@ class ManyVisitsWithMockLocationProvider extends Fixture
$this->setUpWebsitesAndGoals();
$this->setMockLocationProvider();
$this->trackVisits();
+
+ ManyVisitsWithGeoIP::unsetLocationProvider();
}
public function tearDown()
diff --git a/tests/PHPUnit/Fixtures/OmniFixture.php b/tests/PHPUnit/Fixtures/OmniFixture.php
index dd680e9085..cd6fc0fb34 100644
--- a/tests/PHPUnit/Fixtures/OmniFixture.php
+++ b/tests/PHPUnit/Fixtures/OmniFixture.php
@@ -32,11 +32,29 @@ class OmniFixture extends Fixture
public $fixtures = array();
+ private function requireAllFixtures()
+ {
+ $fixturesToLoad = array(
+ '/tests/PHPUnit/Fixtures/*.php',
+ '/tests/UI/Fixtures/*.php',
+ '/plugins/*/tests/Fixtures/*.php',
+ '/plugins/*/Test/Fixtures/*.php',
+ );
+
+ foreach($fixturesToLoad as $fixturePath) {
+ foreach (glob(PIWIK_INCLUDE_PATH . $fixturePath) as $file) {
+ require_once $file;
+ }
+ }
+ }
+
/**
* Constructor.
*/
public function __construct()
{
+ $this->requireAllFixtures();
+
$date = $this->month . '-01';
$classes = get_declared_classes();
@@ -97,6 +115,8 @@ class OmniFixture extends Fixture
public function setUp()
{
foreach ($this->fixtures as $fixture) {
+ echo "Setting up " . get_class($fixture) . "...\n";
+
$fixture->setUp();
}
@@ -111,6 +131,8 @@ class OmniFixture extends Fixture
public function tearDown()
{
foreach ($this->fixtures as $fixture) {
+ echo "Tearing down " . get_class($fixture) . "...\n";
+
$fixture->tearDown();
}
}
diff --git a/tests/PHPUnit/Fixtures/SomeVisitsCustomVariablesCampaignsNotHeuristics.php b/tests/PHPUnit/Fixtures/SomeVisitsCustomVariablesCampaignsNotHeuristics.php
index 8ba755fabd..a32129c93b 100644
--- a/tests/PHPUnit/Fixtures/SomeVisitsCustomVariablesCampaignsNotHeuristics.php
+++ b/tests/PHPUnit/Fixtures/SomeVisitsCustomVariablesCampaignsNotHeuristics.php
@@ -36,10 +36,9 @@ class SomeVisitsCustomVariablesCampaignsNotHeuristics extends Fixture
private function setPiwikEnvironmentOverrides()
{
- $configOverride = $this->getTestEnvironment()->configOverride;
- $configOverride['Tracker']['create_new_visit_when_website_referrer_changes'] = 1;
- $this->getTestEnvironment()->configOverride = $configOverride;
- $this->getTestEnvironment()->save();
+ $env = $this->getTestEnvironment();
+ $env->overrideConfig('Tracker', 'create_new_visit_when_website_referrer_changes', 1);
+ $env->save();
}
private function setUpWebsitesAndGoals()
diff --git a/tests/PHPUnit/Fixtures/TwoSitesManyVisitsOverSeveralDaysWithSearchEngineReferrers.php b/tests/PHPUnit/Fixtures/TwoSitesManyVisitsOverSeveralDaysWithSearchEngineReferrers.php
index 8983d1eea5..d2740b8aba 100644
--- a/tests/PHPUnit/Fixtures/TwoSitesManyVisitsOverSeveralDaysWithSearchEngineReferrers.php
+++ b/tests/PHPUnit/Fixtures/TwoSitesManyVisitsOverSeveralDaysWithSearchEngineReferrers.php
@@ -23,7 +23,7 @@ class TwoSitesManyVisitsOverSeveralDaysWithSearchEngineReferrers extends Fixture
public $keywords = array(
'free > proprietary', // testing a keyword containing >
'peace "," not war', // testing a keyword containing ,
- 'justice )(&^#%$ NOT corruption!',
+ 'justice )(&^#%$ NOT \'" corruption!',
);
public function setUp()
diff --git a/tests/PHPUnit/Fixtures/UITestFixture.php b/tests/PHPUnit/Fixtures/UITestFixture.php
index 93ae92a6dd..623e7e388d 100644
--- a/tests/PHPUnit/Fixtures/UITestFixture.php
+++ b/tests/PHPUnit/Fixtures/UITestFixture.php
@@ -24,6 +24,7 @@ use Piwik\Plugins\UsersManager\API as UsersManagerAPI;
use Piwik\Plugins\SitesManager\API as SitesManagerAPI;
use Piwik\Tests\Framework\Fixture;
use Piwik\Plugins\VisitsSummary\API as VisitsSummaryAPI;
+use Piwik\Config as PiwikConfig;
/**
* Fixture for UI tests.
@@ -44,7 +45,9 @@ class UITestFixture extends SqlDump
parent::setUp();
+ self::resetPluginsInstalledConfig();
self::updateDatabase();
+ self::installAndActivatePlugins($this->getTestEnvironment());
// make sure site has an early enough creation date (for period selector tests)
Db::get()->update(Common::prefixTable("site"),