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-08-12 10:13:00 +0300
committerGitHub <noreply@github.com>2021-08-12 10:13:00 +0300
commit9873cb71e66be0f80839c76e923c3b866dd23b46 (patch)
tree3973fe06503f6099998c85e5cf435146b1b9a711 /tests/PHPUnit/Integration
parent99136cbf3183833b5d9dedb7943873fb8c3a8da5 (diff)
avoid large amounts of notifications being added to the session (#17736)
* impose limit on notification message size when logging to notifications * if in memory notification count exceeds max notification size in session, do not attempt to new ones it to the session * Detect when session was too large to read and provide warning to user. * add some tests for Notification\ManagerTest.php * add tests for relevant DbTable members * Change session data column type to allow larger session data values. * update to rc3 * trigger new build? * fix namespace * fix test namespaces * bump version correctly
Diffstat (limited to 'tests/PHPUnit/Integration')
-rw-r--r--tests/PHPUnit/Integration/Session/SaveHandler/DbTableTest.php37
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/PHPUnit/Integration/Session/SaveHandler/DbTableTest.php b/tests/PHPUnit/Integration/Session/SaveHandler/DbTableTest.php
new file mode 100644
index 0000000000..e71af20a32
--- /dev/null
+++ b/tests/PHPUnit/Integration/Session/SaveHandler/DbTableTest.php
@@ -0,0 +1,37 @@
+<?php
+/**
+ * Matomo - free/libre analytics platform
+ *
+ * @link https://matomo.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+
+namespace Piwik\Tests\Integration\Session\SaveHandler;
+
+use Piwik\Session;
+use Piwik\Session\SaveHandler\DbTable;
+use Piwik\Tests\Framework\TestCase\IntegrationTestCase;
+
+class DbTableTest extends IntegrationTestCase
+{
+ /**
+ * @var DbTable
+ */
+ private $testInstance;
+
+ public function setUp(): void
+ {
+ parent::setUp();
+ $this->testInstance = new DbTable(Session::getDbTableConfig());
+ }
+
+ public function test_read_returnsTheSessionDataCorrectly()
+ {
+ $this->testInstance->write('testid', 'testdata');
+
+ $result = $this->testInstance->read('testid');
+
+ $this->assertEquals('testdata', $result);
+ }
+} \ No newline at end of file