Brain-WP/BrainMonkey

Allow mocking same functions with different arguments

Closed this issue · 1 comments

At the moment is not possible to mock same function with different arguments.

For example following code does not work as expected:

Functions::expect('function_name')
     ->with(true)
     ->once()
     ->andReturn('First');

Functions::expect('function_name')
    ->with(false)
    ->once()
    ->andReturn('Second');

If function_name() is called in the SUT two times, once with true and once with false test fails because of errors on Mockery argument expectations.

Fixed with f4515cc