shouldReceive('bar->baz->qux->quux') ->with(123) ->andReturn('awesome!'); $mock->shouldReceive('bar->baz->qux->quux') ->with(321) ->andReturn('cool!'); $bar = new \Ramsey\Talks\Bar; $this->assertEquals("Now, we're awesome!", $bar->getSomething($mock, null, 123)); $this->assertEquals("Now, we're cool!", $bar->getSomething($mock, null, 321)); } public function testFluentInterfacesWithInterveningParameters() { $baz = \Mockery::mock('baz'); $baz->shouldReceive('qux->quux') ->with(321) ->andReturn('rad!'); $mock = \Mockery::mock('Ramsey\\Talks\\Foo'); $mock->shouldReceive('bar->baz') ->with(123) ->andReturn($baz); $bar = new \Ramsey\Talks\Bar; $this->assertEquals("Now, we're rad!", $bar->getSomething($mock, 123, 321)); } }