elliotchance / concise

✅ Concise is test framework for using plain English and minimal code, built on PHPUnit.
MIT License
45 stars 3 forks source link

Chaining stub() and with() does not work as expected #264

Closed elliotchance closed 9 years ago

elliotchance commented 9 years ago

This works:

$calculatorMock = $this->mock('\Calculator')
                       ->stub('add')->with(3, 5)->andReturn(8)
                                    ->with(2, 7)->andReturn(9)
                       ->done();

This doesn't:

$calculatorMock = $this->mock('\Calculator')
                       ->stub('add')->with(3, 5)->andReturn(8)
                       ->stub('add')->with(2, 7)->andReturn(9)
                       ->done();

The second stub('add') overrides the first. It should act the same in both cases.

elliotchance commented 9 years ago

Cannot reproduce.

scrutinizer-notifier commented 9 years ago

The inspection completed: No new issues