diff options
author | diosmosis <benaka@piwik.pro> | 2015-04-07 03:33:58 +0300 |
---|---|---|
committer | diosmosis <benaka@piwik.pro> | 2015-04-07 03:33:58 +0300 |
commit | 29692df109baf946d65e168dcbcac5601dbadbcd (patch) | |
tree | 3615a0e8f1efae4c777dd6bb559eb5488308fe4c /tests | |
parent | edc4a1b6c1850889d8845c66a886958e64f0d69c (diff) |
Fixing two more system test failures, including one caused by the static cache in Archive.php never being cleared, and the environment not existing in web archiving.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/PHPUnit/Framework/Fixture.php | 2 | ||||
-rwxr-xr-x | tests/PHPUnit/System/TwoVisitsWithCustomVariablesSegmentMatchNONETest.php | 9 |
2 files changed, 7 insertions, 4 deletions
diff --git a/tests/PHPUnit/Framework/Fixture.php b/tests/PHPUnit/Framework/Fixture.php index c9f6ba2f9d..04d63cdce9 100644 --- a/tests/PHPUnit/Framework/Fixture.php +++ b/tests/PHPUnit/Framework/Fixture.php @@ -10,6 +10,7 @@ namespace Piwik\Tests\Framework; use Piwik\Access; use Piwik\Application\Environment; use Piwik\Application\Kernel\GlobalSettingsProvider\IniSettingsProvider; +use Piwik\Archive; use Piwik\Cache\Backend\File; use Piwik\Cache as PiwikCache; use Piwik\Common; @@ -311,6 +312,7 @@ class Fixture extends \PHPUnit_Framework_Assert public function clearInMemoryCaches() { + Archive::clearStaticCache(); DataTableManager::getInstance()->deleteAll(); Option::clearCache(); Site::clearCache(); diff --git a/tests/PHPUnit/System/TwoVisitsWithCustomVariablesSegmentMatchNONETest.php b/tests/PHPUnit/System/TwoVisitsWithCustomVariablesSegmentMatchNONETest.php index 9cbc606a1f..4ab45a24fc 100755 --- a/tests/PHPUnit/System/TwoVisitsWithCustomVariablesSegmentMatchNONETest.php +++ b/tests/PHPUnit/System/TwoVisitsWithCustomVariablesSegmentMatchNONETest.php @@ -26,22 +26,23 @@ class TwoVisitsWithCustomVariablesSegmentMatchNONETest extends SystemTestCase */ public function testApi($api, $params) { + if (!array_key_exists('segment', $params)) { + $params['segment'] = $this->getSegmentToTest(); // this method can access the DB, so we get it here instead of the data provider + } + $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())) + 'setDateLastN' => true)) ); } |