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:
authordizzy <diosmosis@users.noreply.github.com>2021-07-30 05:37:44 +0300
committerGitHub <noreply@github.com>2021-07-30 05:37:44 +0300
commite0b50ad27fa96596a961c1115b8f68379fae953a (patch)
treece38e241f28c16baa75afd0f9696efe79d2edd42 /tests/PHPUnit/Unit
parentaf066cb6267258c660fe66c795d358d8ac91be0d (diff)
make sure summary rows are serialized with their in-db subtable ID and not in memory one (#17831)
* make sure summary rows are serialized with their in-db subtable ID and not in memory one * apply review feedback
Diffstat (limited to 'tests/PHPUnit/Unit')
-rw-r--r--tests/PHPUnit/Unit/DataTableTest.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/PHPUnit/Unit/DataTableTest.php b/tests/PHPUnit/Unit/DataTableTest.php
index 75a4f67e3c..57b5297910 100644
--- a/tests/PHPUnit/Unit/DataTableTest.php
+++ b/tests/PHPUnit/Unit/DataTableTest.php
@@ -471,6 +471,15 @@ class DataTableTest extends \PHPUnit\Framework\TestCase
$this->assertCount(2, $results);
$this->assertStringContainsString('dimval1', $results[0]);
$this->assertStringContainsString('subtabledimension', $results[1]);
+
+ $tableUnserialized = DataTable::fromSerializedArray($results[0]);
+ $this->assertEquals(1, $tableUnserialized->getSummaryRow()->getIdSubDataTable());
+
+ $expectedResults = [
+ 'a:2:{i:0;a:3:{i:0;a:2:{s:5:"label";s:7:"dimval1";s:6:"visits";i:245;}i:1;a:0:{}i:3;N;}i:-1;a:3:{i:0;a:2:{s:5:"label";s:6:"others";s:6:"visits";i:500;}i:1;a:0:{}i:3;i:1;}}',
+ 'a:1:{i:0;a:3:{i:0;a:2:{s:5:"label";s:17:"subtabledimension";s:6:"visits";i:100;}i:1;a:0:{}i:3;N;}}',
+ ];
+ $this->assertEquals($expectedResults, $results);
}
/**