I'm migrating some tests from codecption 4 to codecptyion 5 due to an upgrade from PHP 7 to php8 and this test is not working anymore:

    public function testValidateRequestParams()
    {
        $this->specify("Given unexpected param will throw exception", function () {
            $params = [
                'unknown_param' => 'bad date'
            ];
    
            $this->assertThrowsWithMessage(
                BadRequestHttpException::class,
                'one or more of the specified query params not supported - unknown_param',
                function () use ($params) {
                    EventTriggerRequestValidator::validateRequestParams($params);
                }
            );
        });

    }

It's throwing the following error:

[TypeError] Codeception\Specify\SpecifyTest::run(): Return value must be of type PHPUnit\Framework\TestResult, null returned

It's not clear for me what the fix should be and the examples on the page do not have anything clear referring to that.

Does someone here knows what the fix is for this?

0

There are 0 best solutions below