2
PHPUnit_Framework_MockObject_Generator::generate('NS\Foo', array(), 'MockFoo', TRUE)
9
public function __construct($bar);
12
class Foo implements IFoo
14
public function __construct($bar)
19
require __DIR__ . '/../../vendor/autoload.php';
21
$generator = new \PHPUnit_Framework_MockObject_Generator;
23
$mock = $generator->generate(
33
class MockFoo extends NS\Foo implements PHPUnit_Framework_MockObject_MockObject
35
private $__phpunit_invocationMocker;
36
private $__phpunit_originalObject;
38
public function __clone()
40
$this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationMocker();
43
public function expects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher)
45
return $this->__phpunit_getInvocationMocker()->expects($matcher);
48
public function method()
50
$any = new PHPUnit_Framework_MockObject_Matcher_AnyInvokedCount;
51
$expects = $this->expects($any);
52
return call_user_func_array(array($expects, 'method'), func_get_args());
55
public function __phpunit_setOriginalObject($originalObject)
57
$this->__phpunit_originalObject = $originalObject;
60
public function __phpunit_getInvocationMocker()
62
if ($this->__phpunit_invocationMocker === NULL) {
63
$this->__phpunit_invocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker;
66
return $this->__phpunit_invocationMocker;
69
public function __phpunit_hasMatchers()
71
return $this->__phpunit_getInvocationMocker()->hasMatchers();
74
public function __phpunit_verify()
76
$this->__phpunit_getInvocationMocker()->verify();
77
$this->__phpunit_invocationMocker = NULL;