diff options
author | Thomas Steur <thomas.steur@gmail.com> | 2015-03-31 01:26:28 +0300 |
---|---|---|
committer | Thomas Steur <thomas.steur@gmail.com> | 2015-03-31 05:27:07 +0300 |
commit | bcf12baf6307283e9895b8bf0567d5bc21a08c9f (patch) | |
tree | 406d970f69fb0c08e6347b4479646b6a5a3580aa /tests/PHPUnit/System | |
parent | be9dc8ecb9c74d515a1d510fddf09bbbb455fe5a (diff) |
fix broken tests
Diffstat (limited to 'tests/PHPUnit/System')
-rwxr-xr-x | tests/PHPUnit/System/OneVisitorOneWebsiteSeveralDaysDateRangeArchivingTestsTest.php | 7 | ||||
-rwxr-xr-x | tests/PHPUnit/System/TwoVisitsWithCustomVariablesSegmentMatchVisitorTypeTest.php | 15 |
2 files changed, 11 insertions, 11 deletions
diff --git a/tests/PHPUnit/System/OneVisitorOneWebsiteSeveralDaysDateRangeArchivingTestsTest.php b/tests/PHPUnit/System/OneVisitorOneWebsiteSeveralDaysDateRangeArchivingTestsTest.php index d879c07fb7..83110d149a 100755 --- a/tests/PHPUnit/System/OneVisitorOneWebsiteSeveralDaysDateRangeArchivingTestsTest.php +++ b/tests/PHPUnit/System/OneVisitorOneWebsiteSeveralDaysDateRangeArchivingTestsTest.php @@ -182,15 +182,16 @@ class OneVisitorOneWebsiteSeveralDaysDateRangeArchivingTest extends SystemTestCa 'archive_blob_2011_01' => 3, ); $chunk = new Chunk(); + $chunkName = $chunk->getRecordNameForTableId('Actions_actions_url', 0); + foreach ($tests as $table => $expectedNumSubtables) { - $chunkAppendix = $chunk->getRecordNameForTableId(0); - $sql = "SELECT value FROM " . Common::prefixTable($table) . " WHERE period = " . Piwik::$idPeriods['range'] . " and `name` ='Actions_actions_url_$chunkAppendix'"; + $sql = "SELECT value FROM " . Common::prefixTable($table) . " WHERE period = " . Piwik::$idPeriods['range'] . " and `name` ='$chunkName'"; $blob = Db::get()->fetchOne($sql); $blob = gzuncompress($blob); $blob = unserialize($blob); $countSubtables = count($blob); - $this->assertEquals($expectedNumSubtables, $countSubtables, "Actions_actions_url_subtables in $table expected to contain $expectedNumSubtables subtables, got $countSubtables"); + $this->assertEquals($expectedNumSubtables, $countSubtables, "Actions_actions_url_chunk_0_99 in $table expected to contain $expectedNumSubtables subtables, got $countSubtables"); } } diff --git a/tests/PHPUnit/System/TwoVisitsWithCustomVariablesSegmentMatchVisitorTypeTest.php b/tests/PHPUnit/System/TwoVisitsWithCustomVariablesSegmentMatchVisitorTypeTest.php index a2c1d06672..05f6ef79d9 100755 --- a/tests/PHPUnit/System/TwoVisitsWithCustomVariablesSegmentMatchVisitorTypeTest.php +++ b/tests/PHPUnit/System/TwoVisitsWithCustomVariablesSegmentMatchVisitorTypeTest.php @@ -117,24 +117,23 @@ class TwoVisitsWithCustomVariablesSegmentMatchVisitorTypeTest extends SystemTest public function test_checkArchiveRecords_shouldMergeSubtablesIntoOneRow() { $chunk = new Chunk(); - $chunkBlobId = $chunk->getRecordNameForTableId(0); $tests = array( 'archive_blob_2010_01' => array( - 'CustomVariables_valueByName_' . $chunkBlobId => 6, - 'Referrers_keywordBySearchEngine_' . $chunkBlobId => 1, - 'Referrers_searchEngineByKeyword_' . $chunkBlobId => 1, + $chunk->getRecordNameForTableId('CustomVariables_valueByName', 0) => 6, + $chunk->getRecordNameForTableId('Referrers_keywordBySearchEngine', 0) => 1, + $chunk->getRecordNameForTableId('Referrers_searchEngineByKeyword', 0) => 1 ), 'archive_blob_2009_12' => array( - 'CustomVariables_valueByName_' . $chunkBlobId => 6, - 'Referrers_keywordBySearchEngine_' . $chunkBlobId => 1, - 'Referrers_searchEngineByKeyword_' . $chunkBlobId => 1, + $chunk->getRecordNameForTableId('CustomVariables_valueByName', 0) => 6, + $chunk->getRecordNameForTableId('Referrers_keywordBySearchEngine', 0) => 1, + $chunk->getRecordNameForTableId('Referrers_searchEngineByKeyword', 0) => 1, ) ); $numTests = 0; foreach ($tests as $table => $expectedSubtables) { foreach ($expectedSubtables as $name => $expectedNumSubtables) { - $sql = "SELECT `value` FROM " . Common::prefixTable($table) . " WHERE `name` ='$name'"; + $sql = "SELECT `value` FROM " . Common::prefixTable($table) . " WHERE `name` ='$name'"; $blobs = Db::get()->fetchAll($sql); foreach ($blobs as $blob) { |