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
path: root/tests
diff options
context:
space:
mode:
authordiosmosis <benaka@piwik.pro>2015-03-18 03:34:29 +0300
committerdiosmosis <benaka@piwik.pro>2015-03-18 03:34:49 +0300
commit56150a206c8b5babe2ba63f9d1ac8294803fb773 (patch)
tree7f1c6245ab1ede50d3571ae2ec6e0126e4f12658 /tests
parent74f0d0ff2529aed1ce07bb2409ea204c9cadd99c (diff)
Fixes #7462, optimize InnoDB tables if MariaDB v10.1.1 or greater is used.
Diffstat (limited to 'tests')
-rw-r--r--tests/PHPUnit/Unit/DbTest.php32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/PHPUnit/Unit/DbTest.php b/tests/PHPUnit/Unit/DbTest.php
new file mode 100644
index 0000000000..acd6f1f497
--- /dev/null
+++ b/tests/PHPUnit/Unit/DbTest.php
@@ -0,0 +1,32 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+namespace Piwik\Tests\Unit\Db;
+
+use Piwik\Db;
+
+class DbTest extends \PHPUnit_Framework_TestCase
+{
+ /**
+ * @dataProvider getIsOptimizeInnoDBTestData
+ */
+ public function test_isOptimizeInnoDBSupported_ReturnsCorrectResult($version, $expectedResult)
+ {
+ $result = Db::isOptimizeInnoDBSupported($version);
+ $this->assertEquals($expectedResult, $result);
+ }
+
+ public function getIsOptimizeInnoDBTestData()
+ {
+ return array(
+ array("10.0.17-MariaDB-1~trusty", false),
+ array("10.1.1-MariaDB-1~trusty", true),
+ array("10.2.0-MariaDB-1~trusty", true),
+ array("10.6.19-0ubuntu0.14.04.1", false)
+ );
+ }
+} \ No newline at end of file