Skip to content

Instantly share code, notes, and snippets.

@immutef
Last active August 29, 2015 14:05
Show Gist options
  • Save immutef/fbf9ccca05917e4d20a3 to your computer and use it in GitHub Desktop.
Save immutef/fbf9ccca05917e4d20a3 to your computer and use it in GitHub Desktop.
Mock
<?php
$mock = \Mockery::mock('FQCN');
$mock
->shouldReceive('foo')
->with(\Mockery::mustBe('bar'))
->andReturn('bar')
->once();
<?php
$mock = $this->getMock('FQCN');
$mock
->expects($this->once())
->with($this->equalTo('foo'))
->will($this->returnValue('bar'));
<?php
$mock = $prophet->prophesize('FQCN');
$mock
->foo(Argument::exact('bar'))
->willReturn('bar')
->shouldBeCalled();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment