Skip to content

Add support for stubbing and mocking closures #3536

Closed
@HeahDude

Description

@HeahDude
Q A
PHPUnit version 8.1
PHP version 7.x
Installation Method Composer / PHAR

Would you accept a PR to support mocking closure, to ease checking that one is called?

I.e : https://3v4l.org/Yaq5A

public function testClosureIsCalled()
{
    $callback = function () {};

    $this->assertClosureWillBeCalled($callback);

    SomeBusiness:caller($callback);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions