diff options
author | dizzy <diosmosis@users.noreply.github.com> | 2021-04-11 20:13:27 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-11 20:13:27 +0300 |
commit | d76d7e2eb6d88f8e1756f10f43aa49211319c826 (patch) | |
tree | fcbdafd8fbbd968b6893c8d7afdea019f5894498 /tests/PHPUnit/Framework | |
parent | 17180b5b2b94c2d1ea1f55a977686b178c738769 (diff) |
speed up integration tests by not using DbHelper::getTablesInstalled() (#17440)
* speed up integration tests by not using DbHelper::getTablesInstalled()
* apply review feedback
Diffstat (limited to 'tests/PHPUnit/Framework')
-rw-r--r-- | tests/PHPUnit/Framework/TestCase/SystemTestCase.php | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/PHPUnit/Framework/TestCase/SystemTestCase.php b/tests/PHPUnit/Framework/TestCase/SystemTestCase.php index da1e1dfb23..802b22ecf5 100644 --- a/tests/PHPUnit/Framework/TestCase/SystemTestCase.php +++ b/tests/PHPUnit/Framework/TestCase/SystemTestCase.php @@ -726,10 +726,13 @@ abstract class SystemTestCase extends TestCase DbHelper::truncateAllTables(); // insert data - $existingTables = DbHelper::getTablesInstalled(); + $archiveTables = Db::fetchAll("SHOW TABLES LIKE '%archive_%'"); + if (!empty($archiveTables)) { + $archiveTables = array_column($archiveTables, key($archiveTables[0])); + } foreach ($tables as $table => $rows) { // create table if it's an archive table - if (strpos($table, 'archive_') !== false && !in_array($table, $existingTables)) { + if (strpos($table, 'archive_') !== false && !in_array($table, $archiveTables)) { $tableType = strpos($table, 'archive_numeric') !== false ? 'archive_numeric' : 'archive_blob'; $createSql = DbHelper::getTableCreateSql($tableType); |