diff options
author | Benaka <diosmosis@users.noreply.github.com> | 2015-03-18 04:10:13 +0300 |
---|---|---|
committer | Benaka <diosmosis@users.noreply.github.com> | 2015-03-18 04:10:13 +0300 |
commit | 7e0d617359f0baf167d3f053f3e99a60e3c09a86 (patch) | |
tree | 278eaca557d72b77adc0a1b631a273e819a5b952 /tests | |
parent | 00c394065d518e32cb535b6452bb657dc7672035 (diff) | |
parent | 317fdce1c7a7116f6879f46f78ade506c5057f46 (diff) |
Merge pull request #7464 from piwik/7462_optimize_tables_mariadb
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.php | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/PHPUnit/Unit/DbTest.php b/tests/PHPUnit/Unit/DbTest.php new file mode 100644 index 0000000000..70b4338866 --- /dev/null +++ b/tests/PHPUnit/Unit/DbTest.php @@ -0,0 +1,39 @@ +<?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), + + // for sanity. maybe not ours. + array("", false), + array(0, false), + array(false, false), + array("slkdf(@*#lkesjfMariaDB", false), + array("slkdfjq3rujlkv", false), + ); + } +}
\ No newline at end of file |