Skip to content

Instantly share code, notes, and snippets.

@oaltman
Created July 29, 2013 07:59
Show Gist options
  • Save oaltman/6102760 to your computer and use it in GitHub Desktop.
Save oaltman/6102760 to your computer and use it in GitHub Desktop.
Mock
public function testFormattingDatesBasedOnConfig()
{
$stub = $this->getMock('Henry\Config',array('get'));
$stub->expects($this->any())
->method('get')
->will($this->returnValue('c'));
$formatter = new DateFormatter($stub);
$this->assertEquals('c',$stub->get('param'));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment