In PHPUnit, how do I mock parent methods?
I want to test a class method that calls upon a parent method with the same name. Is there a way to do this?
class Parent {
function foo() {
echo 'bar';
}
}
class Child {
function foo() {
$foo = parent::foo();
return $foo;
}
}
class ChildTest extend PHPUnit_TestCase {
function testFoo() {
$mock = $this->getMock('Child', array('foo'));
//how do i mock parent methods and simulate responses?
}
}