Skip to content

Wrong method name passed to DataProviderMethodCalled event value object #6378

@nikophil

Description

@nikophil
Q A
PHPUnit version 12.4.0
PHP version any
Installation Method Composer

Summary

This commit introduced a small BC break in the method name passed to event DataProviderMethodCalled / DataProviderMethodFinished when the test is in a parent class.

Current behavior

given this code:

abstract class ParentTestCase extends TestCase { #[DataProvider('data_provider')] public function testSomething() { // .... } public static function data_provider() { // .... } } class ChildTest extends ParentTestCase {} 

In 12.3, the DataProviderMethodCalled::$testMethod was new ClassMethod(ChildTest::class, 'testSomething').

Now, in 12.4 it is new ClassMethod(ParentTestCase::class, 'testSomething')

Expected behavior

I think this event should still reference the child class, because it is the one we're executing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/bugSomething is broken

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions