If I try to run PHPUnit functional tests, then it returns "Array to string conversion". Any type of Functional test always returns the same error.

All the errors points to same line parent::setUp();  in the test file.

What is the issue?

me@EMEA1234 /var/www/html/mysite/web/core $ ../../vendor/bin/phpunit --group search --verbose
PHPUnit 4.8.36 by Sebastian Bergmann and contributors.

Runtime:  PHP 7.2.2-1+ubuntu16.04.1+deb.sury.org+1
Configuration:  /var/www/html/mysite/web/core/phpunit.xml

..............EEEEEEEEEEEEE

Time: 1.73 minutes, Memory: 192.50MB

There were 13 errors:

1) Drupal\Tests\search\Functional\SearchSimplifyTest::testSearchSimplifyUnicode
Array to string conversion

/var/www/html/mysite/web/core/includes/install.core.inc:2187
/var/www/html/mysite/web/core/includes/install.core.inc:1033
/var/www/html/mysite/web/core/includes/install.core.inc:671
/var/www/html/mysite/web/core/includes/install.core.inc:549
/var/www/html/mysite/web/core/includes/install.core.inc:117
/var/www/html/mysite/web/core/lib/Drupal/Core/Test/FunctionalTestSetupTrait.php:293
/var/www/html/mysite/web/core/tests/Drupal/Tests/BrowserTestBase.php:995
/var/www/html/mysite/web/core/tests/Drupal/Tests/BrowserTestBase.php:469
/var/www/html/mysite/web/core/modules/search/tests/src/Functional/SearchTestBase.php:21

2) Drupal\Tests\search\Functional\SearchSimplifyTest::testSearchSimplifyPunctuation
Array to string conversion

/var/www/html/mysite/web/core/includes/install.core.inc:2187
/var/www/html/mysite/web/core/includes/install.core.inc:1033
/var/www/html/mysite/web/core/includes/install.core.inc:671
/var/www/html/mysite/web/core/includes/install.core.inc:549
/var/www/html/mysite/web/core/includes/install.core.inc:117
/var/www/html/mysite/web/core/lib/Drupal/Core/Test/FunctionalTestSetupTrait.php:293
/var/www/html/mysite/web/core/tests/Drupal/Tests/BrowserTestBase.php:995
/var/www/html/mysite/web/core/tests/Drupal/Tests/BrowserTestBase.php:469
/var/www/html/mysite/web/core/modules/search/tests/src/Functional/SearchTestBase.php:21

3) Drupal\Tests\search\Functional\SearchCommentCountToggleTest::testSearchCommentCountToggle
Array to string conversion

/var/www/html/mysite/web/core/includes/install.core.inc:2187
/var/www/html/mysite/web/core/includes/install.core.inc:1033
/var/www/html/mysite/web/core/includes/install.core.inc:671
/var/www/html/mysite/web/core/includes/install.core.inc:549
/var/www/html/mysite/web/core/includes/install.core.inc:117
/var/www/html/mysite/web/core/lib/Drupal/Core/Test/FunctionalTestSetupTrait.php:293
/var/www/html/mysite/web/core/tests/Drupal/Tests/BrowserTestBase.php:995
/var/www/html/mysite/web/core/tests/Drupal/Tests/BrowserTestBase.php:469
/var/www/html/mysite/web/core/modules/search/tests/src/Functional/SearchTestBase.php:21
/var/www/html/mysite/web/core/modules/search/tests/src/Functional/SearchCommentCountToggleTest.php:46

4) Drupal\Tests\search\Functional\SearchPageOverrideTest::testSearchPageHook
Array to string conversion

/var/www/html/mysite/web/core/includes/install.core.inc:2187
/var/www/html/mysite/web/core/includes/install.core.inc:1033
/var/www/html/mysite/web/core/includes/install.core.inc:671
/var/www/html/mysite/web/core/includes/install.core.inc:549
/var/www/html/mysite/web/core/includes/install.core.inc:117
/var/www/html/mysite/web/core/lib/Drupal/Core/Test/FunctionalTestSetupTrait.php:293
/var/www/html/mysite/web/core/tests/Drupal/Tests/BrowserTestBase.php:995
/var/www/html/mysite/web/core/tests/Drupal/Tests/BrowserTestBase.php:469
/var/www/html/mysite/web/core/modules/search/tests/src/Functional/SearchTestBase.php:21
/var/www/html/mysite/web/core/modules/search/tests/src/Functional/SearchPageOverrideTest.php:30

5) Drupal\Tests\search\Functional\SearchNodePunctuationTest::testPhraseSearchPunctuation
Array to string conversion

/var/www/html/mysite/web/core/includes/install.core.inc:2187
/var/www/html/mysite/web/core/includes/install.core.inc:1033
/var/www/html/mysite/web/core/includes/install.core.inc:671
/var/www/html/mysite/web/core/includes/install.core.inc:549
/var/www/html/mysite/web/core/includes/install.core.inc:117
/var/www/html/mysite/web/core/lib/Drupal/Core/Test/FunctionalTestSetupTrait.php:293
/var/www/html/mysite/web/core/tests/Drupal/Tests/BrowserTestBase.php:995
/var/www/html/mysite/web/core/tests/Drupal/Tests/BrowserTestBase.php:469
/var/www/html/mysite/web/core/modules/search/tests/src/Functional/SearchTestBase.php:21
/var/www/html/mysite/web/core/modules/search/tests/src/Functional/SearchNodePunctuationTest.php:20

6) Drupal\Tests\search\Functional\SearchExactTest::testExactQuery
Array to string conversion

/var/www/html/mysite/web/core/includes/install.core.inc:2187
/var/www/html/mysite/web/core/includes/install.core.inc:1033
/var/www/html/mysite/web/core/includes/install.core.inc:671
/var/www/html/mysite/web/core/includes/install.core.inc:549
/var/www/html/mysite/web/core/includes/install.core.inc:117
/var/www/html/mysite/web/core/lib/Drupal/Core/Test/FunctionalTestSetupTrait.php:293
/var/www/html/mysite/web/core/tests/Drupal/Tests/BrowserTestBase.php:995
/var/www/html/mysite/web/core/tests/Drupal/Tests/BrowserTestBase.php:469
/var/www/html/mysite/web/core/modules/search/tests/src/Functional/SearchTestBase.php:21

7) Drupal\Tests\search\Functional\SearchKeywordsConditionsTest::testSearchKeywordsConditions
Array to string conversion

/var/www/html/mysite/web/core/includes/install.core.inc:2187
/var/www/html/mysite/web/core/includes/install.core.inc:1033
/var/www/html/mysite/web/core/includes/install.core.inc:671
/var/www/html/mysite/web/core/includes/install.core.inc:549
/var/www/html/mysite/web/core/includes/install.core.inc:117
/var/www/html/mysite/web/core/lib/Drupal/Core/Test/FunctionalTestSetupTrait.php:293
/var/www/html/mysite/web/core/tests/Drupal/Tests/BrowserTestBase.php:995
/var/www/html/mysite/web/core/tests/Drupal/Tests/BrowserTestBase.php:469
/var/www/html/mysite/web/core/modules/search/tests/src/Functional/SearchTestBase.php:21
/var/www/html/mysite/web/core/modules/search/tests/src/Functional/SearchKeywordsConditionsTest.php:33

8) Drupal\Tests\search\Functional\SearchDateIntervalTest::testDateIntervalQueryAlter
Array to string conversion

/var/www/html/mysite/web/core/includes/install.core.inc:2187
/var/www/html/mysite/web/core/includes/install.core.inc:1033
/var/www/html/mysite/web/core/includes/install.core.inc:671
/var/www/html/mysite/web/core/includes/install.core.inc:549
/var/www/html/mysite/web/core/includes/install.core.inc:117
/var/www/html/mysite/web/core/lib/Drupal/Core/Test/FunctionalTestSetupTrait.php:293
/var/www/html/mysite/web/core/tests/Drupal/Tests/BrowserTestBase.php:995
/var/www/html/mysite/web/core/tests/Drupal/Tests/BrowserTestBase.php:469
/var/www/html/mysite/web/core/modules/search/tests/src/Functional/SearchTestBase.php:21
/var/www/html/mysite/web/core/modules/search/tests/src/Functional/SearchDateIntervalTest.php:22

9) Drupal\Tests\search\Functional\SearchMultilingualEntityTest::testMultilingualSearch
Array to string conversion

/var/www/html/mysite/web/core/includes/install.core.inc:2187
/var/www/html/mysite/web/core/includes/install.core.inc:1033
/var/www/html/mysite/web/core/includes/install.core.inc:671
/var/www/html/mysite/web/core/includes/install.core.inc:549
/var/www/html/mysite/web/core/includes/install.core.inc:117
/var/www/html/mysite/web/core/lib/Drupal/Core/Test/FunctionalTestSetupTrait.php:293
/var/www/html/mysite/web/core/tests/Drupal/Tests/BrowserTestBase.php:995
/var/www/html/mysite/web/core/tests/Drupal/Tests/BrowserTestBase.php:469
/var/www/html/mysite/web/core/modules/search/tests/src/Functional/SearchTestBase.php:21
/var/www/html/mysite/web/core/modules/search/tests/src/Functional/SearchMultilingualEntityTest.php:32

10) Drupal\Tests\search\Functional\SearchTokenizerTest::testTokenizer
Array to string conversion

/var/www/html/mysite/web/core/includes/install.core.inc:2187
/var/www/html/mysite/web/core/includes/install.core.inc:1033
/var/www/html/mysite/web/core/includes/install.core.inc:671
/var/www/html/mysite/web/core/includes/install.core.inc:549
/var/www/html/mysite/web/core/includes/install.core.inc:117
/var/www/html/mysite/web/core/lib/Drupal/Core/Test/FunctionalTestSetupTrait.php:293
/var/www/html/mysite/web/core/tests/Drupal/Tests/BrowserTestBase.php:995
/var/www/html/mysite/web/core/tests/Drupal/Tests/BrowserTestBase.php:469
/var/www/html/mysite/web/core/modules/search/tests/src/Functional/SearchTestBase.php:21

11) Drupal\Tests\search\Functional\SearchTokenizerTest::testNoTokenizer
Array to string conversion

/var/www/html/mysite/web/core/includes/install.core.inc:2187
/var/www/html/mysite/web/core/includes/install.core.inc:1033
/var/www/html/mysite/web/core/includes/install.core.inc:671
/var/www/html/mysite/web/core/includes/install.core.inc:549
/var/www/html/mysite/web/core/includes/install.core.inc:117
/var/www/html/mysite/web/core/lib/Drupal/Core/Test/FunctionalTestSetupTrait.php:293
/var/www/html/mysite/web/core/tests/Drupal/Tests/BrowserTestBase.php:995
/var/www/html/mysite/web/core/tests/Drupal/Tests/BrowserTestBase.php:469
/var/www/html/mysite/web/core/modules/search/tests/src/Functional/SearchTestBase.php:21

12) Drupal\Tests\search\Functional\SearchNodeDiacriticsTest::testPhraseSearchPunctuation
Array to string conversion

/var/www/html/mysite/web/core/includes/install.core.inc:2187
/var/www/html/mysite/web/core/includes/install.core.inc:1033
/var/www/html/mysite/web/core/includes/install.core.inc:671
/var/www/html/mysite/web/core/includes/install.core.inc:549
/var/www/html/mysite/web/core/includes/install.core.inc:117
/var/www/html/mysite/web/core/lib/Drupal/Core/Test/FunctionalTestSetupTrait.php:293
/var/www/html/mysite/web/core/tests/Drupal/Tests/BrowserTestBase.php:995
/var/www/html/mysite/web/core/tests/Drupal/Tests/BrowserTestBase.php:469
/var/www/html/mysite/web/core/modules/search/tests/src/Functional/SearchTestBase.php:21
/var/www/html/mysite/web/core/modules/search/tests/src/Functional/SearchNodeDiacriticsTest.php:20

13) Drupal\Tests\search\Functional\SearchSetLocaleTest::testSearchWithNumericLocale
Array to string conversion

/var/www/html/mysite/web/core/includes/install.core.inc:2187
/var/www/html/mysite/web/core/includes/install.core.inc:1033
/var/www/html/mysite/web/core/includes/install.core.inc:671
/var/www/html/mysite/web/core/includes/install.core.inc:549
/var/www/html/mysite/web/core/includes/install.core.inc:117
/var/www/html/mysite/web/core/lib/Drupal/Core/Test/FunctionalTestSetupTrait.php:293
/var/www/html/mysite/web/core/tests/Drupal/Tests/BrowserTestBase.php:995
/var/www/html/mysite/web/core/tests/Drupal/Tests/BrowserTestBase.php:469
/var/www/html/mysite/web/core/modules/search/tests/src/Functional/SearchTestBase.php:21
/var/www/html/mysite/web/core/modules/search/tests/src/Functional/SearchSetLocaleTest.php:27

FAILURES!
Tests: 27, Assertions: 249, Errors: 13.

Comments

Jaypan’s picture

Something in your code is trying to use an array as a string, which it cannot do since they are fundamentally different. You'll need to track down where in this code it is happening.

gopisathya’s picture

I am running core tests on stable core 8.x version, so it should not be a problem with the code. I was using PHP7.2.  I downgraded it to PHP7.1 in my Ubunutu 16.04 LTS version. Now the problem is gone and is fixed.

czigor’s picture

I had the same issue after upgrading from php 5.6 to php7.1. It turned out to be because of a missing php7.1-gd library.

Manuel Garcia’s picture

There is a bug in core about this: https://www.drupal.org/project/drupal/issues/2864980