Definition at line 11 of file DatabaseTest.php.
◆ testDuplicateKeys()
Assure that there are no redundant indexes declared in database
Definition at line 16 of file DatabaseTest.php.
18 if (!defined(
'PERCONA_TOOLKIT_BIN_DIR')) {
19 $this->markTestSkipped(
'Path to Percona Toolkit is not specified.');
21 $checkerPath = PERCONA_TOOLKIT_BIN_DIR .
'/pt-duplicate-key-checker';
23 $db = Bootstrap::getInstance()->getBootstrap()->getApplication()->getDbInstance();
24 $command = $checkerPath .
' -d ' . $db->getSchema()
25 .
' h=' . $db->getHost()[
'db-host'] .
',u=' . $db->getUser() .
',p=' . $db->getPassword();
28 $this->assertEquals(0, $exitCode);
30 if (preg_match(
'/Total Duplicate Indexes\s+(\d+)/',
$output, $matches)) {
31 $this->fail($matches[1] .
' duplicate indexes found.' . PHP_EOL . PHP_EOL .
$output);
exec($command, array &$output=null, &$return_var=null)
The documentation for this class was generated from the following file:
- vendor/magento/magento2-base/dev/tests/integration/testsuite/Magento/Test/Integrity/DatabaseTest.php