X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=Civi%2FTest%2FSchema.php;h=b5a9aa525cab92cf6a11834b0f039357e613b545;hb=af48bd5228c8305df52abe3e58422306441693ac;hp=7c3bb4655dbe7a6db502780fccfa3f8e8d7a116f;hpb=1158b3dfd6ac65c3a471116117a66502aa14dfe9;p=civicrm-core.git diff --git a/Civi/Test/Schema.php b/Civi/Test/Schema.php index 7c3bb4655d..b5a9aa525c 100644 --- a/Civi/Test/Schema.php +++ b/Civi/Test/Schema.php @@ -25,7 +25,7 @@ class Schema { $pdo->quote($type) ); $tables = $pdo->query($query); - $result = array(); + $result = []; foreach ($tables as $table) { $result[] = $table['table_name']; } @@ -35,20 +35,20 @@ class Schema { public function setStrict($checks) { $dbName = \Civi\Test::dsn('database'); if ($checks) { - $queries = array( + $queries = [ "USE {$dbName};", "SET global innodb_flush_log_at_trx_commit = 1;", "SET SQL_MODE='STRICT_ALL_TABLES';", "SET foreign_key_checks = 1;", - ); + ]; } else { - $queries = array( + $queries = [ "USE {$dbName};", "SET foreign_key_checks = 0", "SET SQL_MODE='STRICT_ALL_TABLES';", "SET global innodb_flush_log_at_trx_commit = 2;", - ); + ]; } foreach ($queries as $query) { if (\Civi\Test::execute($query) === FALSE) { @@ -59,7 +59,7 @@ class Schema { } public function dropAll() { - $queries = array(); + $queries = []; foreach ($this->getTables('VIEW') as $table) { if (preg_match('/^(civicrm_|log_)/', $table)) { $queries[] = "DROP VIEW $table"; @@ -89,8 +89,8 @@ class Schema { public function truncateAll() { $tables = \Civi\Test::schema()->getTables('BASE TABLE'); - $truncates = array(); - $drops = array(); + $truncates = []; + $drops = []; foreach ($tables as $table) { // skip log tables if (substr($table, 0, 4) == 'log_') {