Ejemplo n.º 1
0
 /**
  * Set up expectations for a template
  *
  * @param Record $record    Record helper
  * @param string $tpl       Template to expect
  * @param string $response  Response to send
  * @param int    $resolveAt Position at which to expect resolve calls
  * @param int    $rendereAt Position at which to expect render calls
  *
  * @return void
  */
 protected function setSuccessTemplate($record, $tpl, $response = 'success', $resolveAt = 0, $renderAt = 1)
 {
     $expectResolve = $resolveAt === '*' ? $this->any() : $this->at($resolveAt);
     $record->getView()->resolver()->expects($expectResolve)->method('resolve')->with($this->equalTo($tpl))->will($this->returnValue(true));
     $expectRender = $renderAt === '*' ? $this->any() : $this->at($renderAt);
     $record->getView()->expects($expectRender)->method('render')->with($this->equalTo($tpl))->will($this->returnValue($response));
 }