lithium\test\Unit::_runTestMethod()

protected method

Runs an individual test method, collecting results and catching exceptions along the way.

Parameters

  • string $method

    The name of the test method to run.

  • array $options

Returns

mixed

Filter

Executes filters applied to this class' run method.

Source

	protected function _runTestMethod($method, $options) {
		try {
			$this->setUp();
		} catch (Throwable $e) {
			$this->_handleException($e, __LINE__ - 2);
			return $this->_results;
		}
		$params = compact('options', 'method');

		$passed = Filters::run($this, 'run', $params, function($params) {
			try {
				$method = $params['method'];
				$lineFlag = __LINE__ + 1;
				$this->{$method}();
			} catch (Throwable $e) {
				$this->_handleException($e);
			}
		});
		try {
			$this->tearDown();
		} catch (Throwable $e) {
			$this->_handleException($e, __LINE__ - 2);
		}
		return $passed;
	}