PHPUnit warnings: mismatched function returns

Created on 23 February 2024, about 1 year ago
Updated 18 April 2024, 12 months ago

Problem/Motivation

I'm running PHPUnit tests against the site and get these in the warnings report:

1x: Return type of Drupal\feeds_ex\File\LineIterator::rewind() should either be compatible with SplFileObject::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
1x in JsonPathLinesParserTest::testSimpleParsing from Drupal\Tests\feeds_ex\Unit\Feeds\Parser

1x: Return type of Drupal\feeds_ex\File\LineIterator::valid() should either be compatible with SplFileObject::valid(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
1x in JsonPathLinesParserTest::testSimpleParsing from Drupal\Tests\feeds_ex\Unit\Feeds\Parser

1x: Return type of Drupal\feeds_ex\File\LineIterator::next() should either be compatible with SplFileObject::next(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
1x in JsonPathLinesParserTest::testSimpleParsing from Drupal\Tests\feeds_ex\Unit\Feeds\Parser

Steps to reproduce

Install PHPUnit as Drupal recommends, changing the config file as needed to reflect your site path structure, and run:

phpunit --testsuite="unit"

πŸ› Bug report
Status

Closed: duplicate

Component

Code

Created by

πŸ‡¨πŸ‡¦Canada ryanrobinson_wlu

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024