Skip to content

Stub::make() seems to be broken when using PHPUnit 10.4 #46

@W0rma

Description

@W0rma

Stub::make(\DateTime::class); results in the following error:

PHP Fatal error:  Uncaught TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, class PHPUnit\Framework\MockObject\Generator\Generator does not have a method "getMock" in /var/www/html/vendor/codeception/stub/src/Stub.php:455
Stack trace:
#0 /var/www/html/vendor/codeception/stub/src/Stub.php(455): call_user_func_array(Array, Array)
#1 /var/www/html/vendor/codeception/stub/src/Stub.php(418): Codeception\Stub::doGenerateMock(Array)
#2 /var/www/html/vendor/codeception/stub/src/Stub.php(91): Codeception\Stub::generateMock('DateTime', NULL, Array, '', false, false)
#3 /var/www/html/tests/Unit/Entity/DcsCheckCest.php(49): Codeception\Stub::make('DateTime')

Seems like sebastianbergmann/phpunit@614a52a renamed the method Generator::getMock() to testDouble().

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions