You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running a test using the Codeception\Example class with PHP 8.1
What do you get instead?
❯ vendor/bin/codecept run
Codeception PHP Testing Framework v4.1.23
Powered by PHPUnit 9.5.10 by Sebastian Bergmann and contributors.
Fatal error: During inheritance of ArrayAccess: Uncaught PHPUnit\Framework\Exception: Return type of
Codeception\Example::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(
mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress
the notice at vendor/codeception/codeception/src/Codeception/Example.php:27
/home/www/http/vendor/composer/ClassLoader.php:571
/home/www/http/vendor/composer/ClassLoader.php:428
in /home/www/http/vendor/codeception/codeception/src/Codeception/Example.php on line 6
Adding the #[\ReturnTypeWillChange] attribute to the offsetExists method fixes the issue. The same error appears for the other interface methods in Example as well. I can PR if appreciated.
What are you trying to achieve?
Running a test using the
Codeception\Example
class with PHP 8.1What do you get instead?
Adding the
#[\ReturnTypeWillChange]
attribute to theoffsetExists
method fixes the issue. The same error appears for the other interface methods inExample
as well. I can PR if appreciated.Related issue: #6288
Details
The text was updated successfully, but these errors were encountered: