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
protected function setUp(): void
{
parent::setUp();
BypassFinals::enable();
}
and also tried to use it inside my test:
public function testCountTokens(): int
{
BypassFinals::enable();
.....
}
I got the same error regardless of the alternative: Mockery\Exception: The class \Gemini is marked final and its methods cannot be replaced. Classes marked final can be passed in to \Mockery::mock() as instantiated objects to create a partial mock, but only if the mock is not subject to type hinting checks.
The text was updated successfully, but these errors were encountered:
This can be caused by having dataProviders using classes that are marked final. This is because, with PHPUnit 10, the testSuite is build before the extensions are executed. Part of building the testSuite is that all the data providers are being invoked.
I could not make the tool work. I may be doing something wrong.
I'm using phpunit 11 and mockery.
I tried adding the extension to phpunit.xml
And tried to use enable on setUp:
and also tried to use it inside my test:
I got the same error regardless of the alternative:
Mockery\Exception: The class \Gemini is marked final and its methods cannot be replaced. Classes marked final can be passed in to \Mockery::mock() as instantiated objects to create a partial mock, but only if the mock is not subject to type hinting checks.
The text was updated successfully, but these errors were encountered: