Skip to content

Test execution errrors on PHP 8.5 when data provider provides INF or NAN as value #6406

@bkdotcom

Description

@bkdotcom
Q A
PHPUnit version 9.6.29
PHP version 8.5.1-dev
Installation Method Composer

Summary

if a @dataProvider contains INF:
execution halts with the error: "The float INF is not representable as an int, cast occurred"

if a @dataProvider contains NAN
execution halts with the error: "unexpected NAN value was coerced to string"

class InfTest extends TestCaseBase
{
    /**
     * @dataProvider dataProvider
     */
    public function testStuff($value)
    {
        self::assertTrue(true);
    }

    public function dataProvider()
    {
        return [
            'inf' => [INF],
            'nan' => [NAN],
        ];
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/change-in-php-requires-adaptationA change in PHP requires a change so that existing PHPUnit functionality continues to workversion/9Something affects PHPUnit 9

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions