Answer the question
In order to leave comments, you need to log in
How to test sequential method invocation within a method in PHPUNIT?
There is a code:
public function parseAction(){
if ($this->beginParse()) {
$this->parser();
}
$this->endParse();
$handler = $this->getMock('Handler', array('beginParse', 'parser','endParse'));
$handler->expects($this->once())
->method('beginParse')
->will($this->returnValue(true));
$handler->expects($this->once())
->method('parser')
->will($this->returnValue(true));
$handler->expects($this->once())
->method('endParse')
->will($this->returnValue(true));
$handler->parseAction();
Call to undefined method Mock_Handler_8346bbfe::parseAction() in
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question