lithium\test\MockerChain::with()
Will further narrow down the original 'called' method.
Valides the cached method name was called with these args
Parameters
-
mixed
$arg,...
Optional arguments to test against
Returns
objectSource
public function with() {
if (!$this->_data['success']) {
return $this;
}
$method = $this->_data['method'];
$this->_data['args'] = $args = func_get_args();
foreach ($this->_data['results'][$method] as $call) {
$correctTime = $this->_data['callTime'] <= $call['time'];
$correctArgs = $args === $call['args'];
if ($correctTime && $correctArgs) {
$this->_data['callTime'] = $call['time'];
return $this;
}
}
$this->_data['success'] = false;
return $this;
}