Skip to content

PHP Fatal Error: With PHPunit 10 and above getting a php fatal error of overriding final methods #1155

Open
@apathak18

Description

@apathak18

Steps to reproduce

include OutputAwareTrait or IO in your phpunit test case which extends PHPUnit\Framework\TestCase
On running that particular will throw a php fatal error:
PHP Fatal error: Cannot override final method PHPUnit\Framework\TestCase::output() in /Project-Dir/vendor/consolidation/robo/src/Common/OutputAwareTrait.php on line 33

Expected behavior

Phpunit will run without php fatal error.

Actual behavior

PHP Fatal error: Cannot override final method PHPUnit\Framework\TestCase::output() in /Project-Dir/vendor/consolidation/robo/src/Common/OutputAwareTrait.php on line 33

System Configuration

PHP version: 8.2
PHPunit: 10.5.12

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions