?
avatar astridx
astridx
24 Jan 2020

Steps to reproduce the issue

I want to have look at the integration tests. I found this Read.me:

After

  1. Checkout the current Joomla 4.0 development branch from Github
  2. Run composer install in the root
  3. Run libraries/vendor/bin/phpunit

I saw this error message.

$ libraries/vendor/bin/phpunit
PHPUnit 8.3.4 by Sebastian Bergmann and contributors.

....................WWW.W......................................  63 / 540 ( 11%)
.........................................S..................... 126 / 540 ( 23%)
....................................R.......................... 189 / 540 ( 35%)
............................................................... 252 / 540 ( 46%)
............................................................... 315 / 540 ( 58%)
............................................................... 378 / 540 ( 70%)
............................................................... 441 / 540 ( 81%)
............................................................... 504 / 540 ( 93%)
............................EEEEEEEE                            540 / 540 (100%)

Time: 955 ms, Memory: 22.00 MB

There were 8 errors:

1) Joomla\Tests\Integration\Libraries\Cms\Table\TableTest::testObjectHasAttributesFromTable
Joomla\Database\Exception\ConnectionFailureException: Could not connect to database: php_network_getaddresses: getaddrinfo failed: Name or service not known

/var/www/html/joomla-cms4/libraries/vendor/joomla/database/src/Mysqli/MysqliDriver.php:273
/var/www/html/joomla-cms4/libraries/vendor/joomla/database/src/DatabaseDriver.php:1844
/var/www/html/joomla-cms4/tests/Integration/DBTestHelper.php:80
/var/www/html/joomla-cms4/tests/Integration/IntegrationTestCase.php:29
/var/www/html/joomla-cms4/tests/Integration/Libraries/Cms/Table/TableTest.php:45

2) Joomla\Tests\Integration\Libraries\Cms\Table\TableTest::testBindWorksWithArraysAndObjects
mysqli::prepare(): invalid object or resource mysqli


/var/www/html/joomla-cms4/libraries/vendor/joomla/database/src/Mysqli/MysqliStatement.php:137
/var/www/html/joomla-cms4/libraries/vendor/joomla/database/src/Mysqli/MysqliDriver.php:1035
/var/www/html/joomla-cms4/libraries/vendor/joomla/database/src/DatabaseDriver.php:1891
/var/www/html/joomla-cms4/tests/Integration/DBTestHelper.php:80
/var/www/html/joomla-cms4/tests/Integration/IntegrationTestCase.php:29
/var/www/html/joomla-cms4/tests/Integration/Libraries/Cms/Table/TableTest.php:45

3) Joomla\Tests\Integration\Libraries\Cms\Table\TableTest::testBindOnlyBindsTableFields
mysqli::prepare(): invalid object or resource mysqli


/var/www/html/joomla-cms4/libraries/vendor/joomla/database/src/Mysqli/MysqliStatement.php:137
/var/www/html/joomla-cms4/libraries/vendor/joomla/database/src/Mysqli/MysqliDriver.php:1035
/var/www/html/joomla-cms4/libraries/vendor/joomla/database/src/DatabaseDriver.php:1891
/var/www/html/joomla-cms4/tests/Integration/DBTestHelper.php:80
/var/www/html/joomla-cms4/tests/Integration/IntegrationTestCase.php:29
/var/www/html/joomla-cms4/tests/Integration/Libraries/Cms/Table/TableTest.php:45

4) Joomla\Tests\Integration\Libraries\Cms\Table\TableTest::testBindIgnoresFields
mysqli::prepare(): invalid object or resource mysqli


/var/www/html/joomla-cms4/libraries/vendor/joomla/database/src/Mysqli/MysqliStatement.php:137
/var/www/html/joomla-cms4/libraries/vendor/joomla/database/src/Mysqli/MysqliDriver.php:1035
/var/www/html/joomla-cms4/libraries/vendor/joomla/database/src/DatabaseDriver.php:1891
/var/www/html/joomla-cms4/tests/Integration/DBTestHelper.php:80
/var/www/html/joomla-cms4/tests/Integration/IntegrationTestCase.php:29
/var/www/html/joomla-cms4/tests/Integration/Libraries/Cms/Table/TableTest.php:45

5) Joomla\Tests\Integration\Libraries\Cms\Table\TableTest::testBindJSONEncodesFields
mysqli::prepare(): invalid object or resource mysqli


/var/www/html/joomla-cms4/libraries/vendor/joomla/database/src/Mysqli/MysqliStatement.php:137
/var/www/html/joomla-cms4/libraries/vendor/joomla/database/src/Mysqli/MysqliDriver.php:1035
/var/www/html/joomla-cms4/libraries/vendor/joomla/database/src/DatabaseDriver.php:1891
/var/www/html/joomla-cms4/tests/Integration/DBTestHelper.php:80
/var/www/html/joomla-cms4/tests/Integration/IntegrationTestCase.php:29
/var/www/html/joomla-cms4/tests/Integration/Libraries/Cms/Table/TableTest.php:45

6) Joomla\Tests\Integration\Libraries\Cms\Table\TableTest::testBindRequiresArrayOrObject
mysqli::prepare(): invalid object or resource mysqli


/var/www/html/joomla-cms4/libraries/vendor/joomla/database/src/Mysqli/MysqliStatement.php:137
/var/www/html/joomla-cms4/libraries/vendor/joomla/database/src/Mysqli/MysqliDriver.php:1035
/var/www/html/joomla-cms4/libraries/vendor/joomla/database/src/DatabaseDriver.php:1891
/var/www/html/joomla-cms4/tests/Integration/DBTestHelper.php:80
/var/www/html/joomla-cms4/tests/Integration/IntegrationTestCase.php:29
/var/www/html/joomla-cms4/tests/Integration/Libraries/Cms/Table/TableTest.php:45

7) Joomla\Tests\Integration\Libraries\Cms\Table\TableTest::testBindFiresEvents
mysqli::prepare(): invalid object or resource mysqli


/var/www/html/joomla-cms4/libraries/vendor/joomla/database/src/Mysqli/MysqliStatement.php:137
/var/www/html/joomla-cms4/libraries/vendor/joomla/database/src/Mysqli/MysqliDriver.php:1035
/var/www/html/joomla-cms4/libraries/vendor/joomla/database/src/DatabaseDriver.php:1891
/var/www/html/joomla-cms4/tests/Integration/DBTestHelper.php:80
/var/www/html/joomla-cms4/tests/Integration/IntegrationTestCase.php:29
/var/www/html/joomla-cms4/tests/Integration/Libraries/Cms/Table/TableTest.php:45

8) Joomla\Tests\Integration\Libraries\Cms\Table\TableTest::testReset
mysqli::prepare(): invalid object or resource mysqli


/var/www/html/joomla-cms4/libraries/vendor/joomla/database/src/Mysqli/MysqliStatement.php:137
/var/www/html/joomla-cms4/libraries/vendor/joomla/database/src/Mysqli/MysqliDriver.php:1035
/var/www/html/joomla-cms4/libraries/vendor/joomla/database/src/DatabaseDriver.php:1891
/var/www/html/joomla-cms4/tests/Integration/DBTestHelper.php:80
/var/www/html/joomla-cms4/tests/Integration/IntegrationTestCase.php:29
/var/www/html/joomla-cms4/tests/Integration/Libraries/Cms/Table/TableTest.php:45

--

There were 4 warnings:

1) Joomla\Tests\Unit\Libraries\Cms\Document\DocumentTest::testInjectingOptionsIntoTheObjectConstructor with data set #0 (array('\n'), array('\n', 'utf-8', 'en-gb', 'ltr', '	', '', ''))
assertAttributeSame() is deprecated and will be removed in PHPUnit 9.
readAttribute() is deprecated and will be removed in PHPUnit 9.
getObjectAttribute() is deprecated and will be removed in PHPUnit 9.

2) Joomla\Tests\Unit\Libraries\Cms\Document\DocumentTest::testInjectingOptionsIntoTheObjectConstructor with data set #1 (array('euc-jp', '1a2b3c4d'), array('\n', 'euc-jp', 'en-gb', 'ltr', '	', '', '', '1a2b3c4d'))
assertAttributeSame() is deprecated and will be removed in PHPUnit 9.
readAttribute() is deprecated and will be removed in PHPUnit 9.
getObjectAttribute() is deprecated and will be removed in PHPUnit 9.

3) Joomla\Tests\Unit\Libraries\Cms\Document\DocumentTest::testInjectingOptionsIntoTheObjectConstructor with data set #2 (array('de-de', 'rtl', 'Crazy Tab', 'http://joomla.org', 'http://base.joomla.org/dir'), array('\n', 'utf-8', 'de-de', 'rtl', 'Crazy Tab', 'http://joomla.org', 'http://base.joomla.org/dir'))
assertAttributeSame() is deprecated and will be removed in PHPUnit 9.
readAttribute() is deprecated and will be removed in PHPUnit 9.
getObjectAttribute() is deprecated and will be removed in PHPUnit 9.

4) Joomla\Tests\Unit\Libraries\Cms\Document\DocumentTest::testRetrievingANonExistantTypeFetchesARawDocument
assertAttributeSame() is deprecated and will be removed in PHPUnit 9.
readAttribute() is deprecated and will be removed in PHPUnit 9.
getObjectAttribute() is deprecated and will be removed in PHPUnit 9.

--

There was 1 risky test:

1) Joomla\Tests\Unit\Libraries\Cms\Feed\Parser\AtomParserTest::testProcessFeedEntry
This test did not perform any assertions

/var/www/html/joomla-cms4/tests/Unit/Libraries/Cms/Feed/Parser/AtomParserTest.php:385

ERRORS!
Tests: 540, Assertions: 879, Errors: 8, Warnings: 4, Skipped: 1, Risky: 1.


What do I am wrong?

avatar astridx astridx - open - 24 Jan 2020
avatar joomla-cms-bot joomla-cms-bot - change - 24 Jan 2020
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 24 Jan 2020
avatar wilsonge
wilsonge - comment - 24 Jan 2020

At a guess your PHPUnit file isn't pointing to a valid database? https://github.com/joomla/joomla-cms/blob/4.0-dev/phpunit.xml.dist#L11-L17

avatar brianteeman
brianteeman - comment - 31 Jan 2020

@astridx did you resolve this?

avatar astridx
astridx - comment - 31 Jan 2020

Unfortunately not. I haven't had time to investigate further.

avatar astridx
astridx - comment - 15 Feb 2020

See #27942

avatar astridx astridx - close - 15 Feb 2020
avatar astridx astridx - change - 15 Feb 2020
Status New Closed
Closed_Date 0000-00-00 00:00:00 2020-02-15 22:22:05
Closed_By astridx

Add a Comment

Login with GitHub to post a comment