Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Exception Message is unclear #7

Open
@jmauerhan

Description

First of all I just want to say I really like the library, thank you so much for creating it :)

I do think this Exception Message should be improved.

When I create a mocked function like so:

$passthru = $this->getFunctionMock('My\Project', 'passthru');
$passthru->expects($this->exactly(2))->withConsecutive(['arg1'], ['arg2']);

The error message that I get when the test fails (because the code being tested doesn't actually call passthru() yet) is like this:

1) Tests\MyProjectTest::myTestMethod 
Expectation failed for method name is equal to <string:delegate> when invoked 2 time(s). 
Method was expected to be called 2 times, actually called 0 times. 

Instead of <string:delegate> it would be helpful if it said passthru, or even better, something like: Expectation failed for passthru to be invoked 2 time(s)

I know the matchers and exceptions come from PHPUnit, but is there a way to send in better messages?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /