Skip to content

Commit

Permalink
Merge pull request #789 from robertbasic/fix/issue788
Browse files Browse the repository at this point in the history
allows does not allow multiple return values
  • Loading branch information
davedevelopment committed Sep 27, 2017
2 parents 89db0ca + 8616ee5 commit 87fc5f6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions docs/reference/alternative_should_receive_syntax.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ all, were they called.
$mock = \Mockery::mock('MyClass');
$mock->allows([
'name_of_method_1' => ['1st call return value', '2nd call return value'],
'name_of_method_2' => ['1st call return value', '2nd call return value'],
'name_of_method_1' => 'return value',
'name_of_method_2' => 'return value',
]);
This is equivalent with the following ``shouldReceive`` syntax:
Expand All @@ -30,8 +30,8 @@ This is equivalent with the following ``shouldReceive`` syntax:
$mock = \Mockery::mock('MyClass');
$mock->shouldReceive([
'name_of_method_1' => ['1st call return value', '2nd call return value'],
'name_of_method_2' => ['1st call return value', '2nd call return value'],
'name_of_method_1' => 'return value',
'name_of_method_2' => 'return value',
]);
Note that with this format, we also tell Mockery that we don't care about the
Expand All @@ -44,7 +44,7 @@ If we do care about the arguments, we would do it like so:
$mock = \Mockery::mock('MyClass');
$mock->allows()
->name_of_method_1($arg1)
->andReturn(['1st call return value', '2nd call return value']);
->andReturn('return value');
This is equivalent with the following ``shouldReceive`` syntax:

Expand All @@ -53,7 +53,7 @@ This is equivalent with the following ``shouldReceive`` syntax:
$mock = \Mockery::mock('MyClass');
$mock->shouldReceive('name_of_method_1')
->with($arg1)
->andReturn(['1st call return value', '2nd call return value']);
->andReturn('return value');
Expects
-------
Expand Down

0 comments on commit 87fc5f6

Please sign in to comment.