Caused by #5862
Return types on generated actions for methods that return void should not use return since you cannot return a void:
public function voidMethod(): void {
$this->getScenario()->runStep(new \Codeception\Step\Action('voidMethod', func_get_args()));
}
public function voidMethod(): void {
return $this->getScenario()->runStep(new \Codeception\Step\Action('voidMethod', func_get_args()));
}
This causes PHP errors:
Fatal error: A void function must not return a value
Upgrading my project to 4.1.3 still has this problem. This needs reopening.
Upgrading my project to 4.1.3 still has this problem. This needs reopening.
Can confirm, still getting "A void function must not return a value in /var/www/html/tests/_support/_generated/ApiTesterActions.php line 5361"
Have you ran codecept build after upgrade?
Yeah @Naktibalda. codecept build always runs successfully but running tests crashes with the fatal error in 4.1.3 but doesn't crash after applying patch from #5880
Most helpful comment
Yeah @Naktibalda.
codecept buildalways runs successfully but running tests crashes with the fatal error in4.1.3but doesn't crash after applying patch from #5880