If the autoloader is enabled:
$mock = $this->getMockBuilder('MyNamespace\sub\ClassToMock')
->setMethods(array('methodToMock', 'methodToMock2'))
//->disableOriginalConstructor()
->getMock();
works in phpunit 3.6.7, with or without a namespace specified at the top of the test class.
RSS Feed
Twitter
Posted in 