Skip to content

Instantly share code, notes, and snippets.

@rullzer
Created September 13, 2016 12:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save rullzer/df5db85e89627712583c810d199d5729 to your computer and use it in GitHub Desktop.
Save rullzer/df5db85e89627712583c810d199d5729 to your computer and use it in GitHub Desktop.
/**
* Returns a test double for the specified class.
*
* @param string $originalClassName
*
* @return PHPUnit_Framework_MockObject_MockObject
*
* @throws PHPUnit_Framework_Exception
*
* @since Method available since Release 5.4.0
*/
protected function createMock($originalClassName)
{
return $this->getMockBuilder($originalClassName)
->disableOriginalConstructor()
->disableOriginalClone()
->disableArgumentCloning()
->disallowMockingUnknownTypes()
->getMock();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment