2
PHPUnit_Framework_MockObject_Generator::generate('Foo', array(), 'MockFoo', TRUE)
7
public function __construct($bar);
10
class Foo implements IFoo
12
public function __construct($bar)
17
require __DIR__ . '/../../vendor/autoload.php';
19
$generator = new PHPUnit_Framework_MockObject_Generator;
21
$mock = $generator->generate(
31
class MockFoo extends Foo implements PHPUnit_Framework_MockObject_MockObject
33
private $__phpunit_invocationMocker;
34
private $__phpunit_originalObject;
36
public function __clone()
38
$this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationMocker();
41
public function expects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher)
43
return $this->__phpunit_getInvocationMocker()->expects($matcher);
46
public function method()
48
$any = new PHPUnit_Framework_MockObject_Matcher_AnyInvokedCount;
49
$expects = $this->expects($any);
50
return call_user_func_array(array($expects, 'method'), func_get_args());
53
public function __phpunit_setOriginalObject($originalObject)
55
$this->__phpunit_originalObject = $originalObject;
58
public function __phpunit_getInvocationMocker()
60
if ($this->__phpunit_invocationMocker === NULL) {
61
$this->__phpunit_invocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker;
64
return $this->__phpunit_invocationMocker;
67
public function __phpunit_hasMatchers()
69
return $this->__phpunit_getInvocationMocker()->hasMatchers();
72
public function __phpunit_verify()
74
$this->__phpunit_getInvocationMocker()->verify();
75
$this->__phpunit_invocationMocker = NULL;