PHPUnit_Framework_Exception: Argument #2 (No Value) of PHPUnit_Framework_Assert::assertCount() must be a countable or traversable

all over the PHP 5.5 + Drupal 8.7 test runs. I think something changed in Drupal 8.7 for PHP 5, but not sure what yet.

This is blocking #3015325: [ignore] support issue for the core patch and #2843147: Add JSON:API to core as a stable module.

CommentFileSizeAuthor
#4 3035676-4.patch746 byteswim leers
#2 3035676-2-do-not-test.patch468 byteswim leers

Comments

Wim Leers created an issue. See original summary.

wim leers’s picture

Status: Active » Needs review
StatusFileSize
new468 bytes

Let's trigger the failure.

wim leers’s picture

Based on https://www.drupal.org/pift-ci-job/1188059, we know that at least on Feb 1 this was still passing tests just fine. Core's composer.json and composer.lock were last changed on Jan 15 in SA-CORE-2019-002 (commit 7e1a53c). I have no idea how this is possible. The detailed logs for old test runs aren't available.

Installing PHP 5…

wim leers’s picture

StatusFileSize
new746 bytes

Testbot--
Testbot--
Testbot--

Testing started at 21:20 ...
/usr/local/bin/php /private/var/folders/4l/5sndwsz50tqgxjh2525n10br0000gp/T/ide-phpunit.php --configuration /Users/wim.leers/Work/d8/core/phpunit.xml Drupal\Tests\jsonapi\Kernel\Normalizer\JsonApiDocumentTopLevelNormalizerTest /Users/wim.leers/Work/d8/modules/jsonapi/tests/src/Kernel/Normalizer/JsonApiDocumentTopLevelNormalizerTest.php
#!/usr/bin/env php
PHPUnit 4.8.36 by Sebastian Bergmann and contributors.

Testing Drupal\Tests\jsonapi\Kernel\Normalizer\JsonApiDocumentTopLevelNormalizerTest
EIE.......

Time: 14.64 seconds, Memory: 8.75MB

There were 2 errors:

1) Drupal\Tests\jsonapi\Kernel\Normalizer\JsonApiDocumentTopLevelNormalizerTest::testNormalize
PHPUnit_Framework_Exception: PHP Fatal error:  Default value for parameters with a class type hint can only be NULL in /Users/wim.leers/Work/d8/modules/jsonapi/src/JsonApiResource/ResourceObjectData.php on line 25
Fatal error: Default value for parameters with a class type hint can only be NULL in /Users/wim.leers/Work/d8/modules/jsonapi/src/JsonApiResource/ResourceObjectData.php on line 25

/Users/wim.leers/Work/d8/vendor/phpunit/phpunit/phpunit:52

2) Drupal\Tests\jsonapi\Kernel\Normalizer\JsonApiDocumentTopLevelNormalizerTest::testNormalizeUuid
PHPUnit_Framework_Exception: PHP Fatal error:  Default value for parameters with a class type hint can only be NULL in /Users/wim.leers/Work/d8/modules/jsonapi/src/JsonApiResource/ResourceObjectData.php on line 25
Fatal error: Default value for parameters with a class type hint can only be NULL in /Users/wim.leers/Work/d8/modules/jsonapi/src/JsonApiResource/ResourceObjectData.php on line 25

/Users/wim.leers/Work/d8/vendor/phpunit/phpunit/phpunit:52

FAILURES!
Tests: 10, Assertions: 67, Errors: 2, Incomplete: 1.

At last, actionable feedback.

wim leers’s picture

Title: Figure out why PHP 5.5 + Drupal 8.7 test runs are suddenly failing » Follow-up for #3033123: PHP 5.5 + Drupal 8.7 test runs are suddenly failing

#3033123: Add ResourceObjectData, IncludedData, and RelationshipData specializations of Data introduced a PHP 7 typehint. This is what apparently caused all this. And because d.o once again forgot about our configured daily test runs (sadly only one environment combination possible for on-commit test runs), we weren't notified of this PHP 5 failure. 😢

wim leers’s picture

wim leers’s picture

Status: Needs review » Reviewed & tested by the community

🥳 Green! ✅

  • Wim Leers committed 3e062ac on 8.x-2.x
    Issue #3035676 by Wim Leers: Follow-up for #3033123: PHP 5.5 + Drupal 8....
wim leers’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.