lithium\test\MockerChain::called()

public method

Valides the method was called after the last call.

Parameters

  • string $method

    Method to assert

Returns

object

Source

	public function called($method) {
		if (!$this->_data['success']) {
			return $this;
		}

		$this->_data['method'] = $method;
		$this->_data['args'] = false;
		if (!isset($this->_data['results'][$method])) {
			$this->_data['success'] = false;
			return $this;
		}

		foreach ($this->_data['results'][$method] as $call) {
			if ($this->_data['callTime'] < $call['time']) {
				$this->_data['callTime'] = $call['time'];
				return $this;
			}
		}

		$this->_data['success'] = false;
		return $this;
	}