PHPSpec2\Matcher\ObjectStateMatcher::positiveMatch PHP Method

positiveMatch() public method

public positiveMatch ( $name, $subject, array $arguments )
$arguments array
    public function positiveMatch($name, $subject, array $arguments)
    {
        preg_match($this->regex, $name, $matches);
        $method = ('be' === $matches[1] ? 'is' : 'has') . $matches[2];
        if (!method_exists($subject, $method)) {
            throw new MethodNotFoundException($subject, $method);
        }
        $callable = array($subject, $method);
        if (true !== ($result = call_user_func_array($callable, $arguments))) {
            throw $this->getFailureExceptionFor($callable, true, $result);
        }
    }