Skip to content
Snippets Groups Projects
Commit 757f4422 authored by eileen's avatar eileen
Browse files

[Civi\Test] Fix test output noise

Seeing this is test logs

Warning: Invalid argument supplied for foreach() in /home/jenkins/bknix-dfl/build/core-18634-8zcf7/web/sites/all/modules/civicrm/Civi/Test/Schema.php on line 29

Call Stack:
    0.0007     530944   1. {main}() /home/jenkins/bknix-dfl/extern/phpunit7/phpunit7.phar:0
    0.0498    9999808   2. PHPUnit\TextUI\Command::main() /home/jenkins/bknix-dfl/extern/phpunit7/phpunit7.phar:615
    0.0498   10008600   3. PHPUnit\TextUI\Command->run() phar:///home/jenkins/bknix-dfl/extern/phpunit7/phpunit7.phar/phpunit/TextUI/Command.php:162
    1.1684  104654872   4. PHPUnit\TextUI\TestRunner->doRun() phar:///home/jenkins/bknix-dfl/extern/phpunit7/phpunit7.phar/phpunit/TextUI/Command.php:206
    1.2327  104791840   5. PHPUnit\Framework\TestSuite->run() phar:///home/jenkins/bknix-dfl/extern/phpunit7/phpunit7.phar/phpunit/TextUI/TestRunner.php:652
 3300.8182  675188928   6. PHPUnit\Framework\TestSuite->run() phar:///home/jenkins/bknix-dfl/extern/phpunit7/phpunit7.phar/phpunit/Framework/TestSuite.php:746
 3300.8199  675188928   7. CiviUnitTestCase::setUpBeforeClass() phar:///home/jenkins/bknix-dfl/extern/phpunit7/phpunit7.phar/phpunit/Framework/TestSuite.php:703
 3300.8199  675188928   8. CiviUnitTestCase::_populateDB() /home/jenkins/bknix-dfl/build/core-18634-8zcf7/web/sites/all/modules/civicrm/tests/phpunit/CiviTest/CiviUnitTestCase.php:311
 3300.8199  675188928   9. Civi\Test\Data->populate() /home/jenkins/bknix-dfl/build/core-18634-8zcf7/web/sites/all/modules/civicrm/tests/phpunit/CiviTest/CiviUnitTestCase.php:305
 3300.8199  675189248  10. Civi\Test::asPreInstall() /home/jenkins/bknix-dfl/build/core-18634-8zcf7/web/sites/all/modules/civicrm/Civi/Test/Data.php:45
:
parent 4fc8726b
Branches
Tags
No related merge requests found
......@@ -26,8 +26,10 @@ class Schema {
);
$tables = $pdo->query($query);
$result = [];
foreach ($tables as $table) {
$result[] = $table['TABLE_NAME'] ?? $table['table_name'];
if (!empty($tables)) {
foreach ($tables as $table) {
$result[] = $table['TABLE_NAME'] ?? $table['table_name'];
}
}
return $result;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment