FUnit::__callStatic PHP Method

__callStatic() public static method

We use this magic method to map various assertion calls to assert_{$name}() This is so we can break out the call to add_assertion_result() and test the assertion methods properly
public static __callStatic ( string $name, array $arguments ) : [type]
$name string the assertion short name
$arguments array arguments to pass to "\FUnit::{$assert_name}()"
return [type]
    public static function __callStatic($name, $arguments)
    {
        $assert_name = 'assert_' . $name;
        $call_str = "\\FUnit::{$assert_name}";
        /**
         * Assertions are called in the context of a suite. By default we use
         * the "current" suite, but we can force a different suite by passing
         * the suite object as the first argument. This is mainly so we can test
         * suites themselves.
         */
        $suite = static::get_current_suite();
        if (isset($arguments[0]) && $arguments[0] instanceof \FUnit\TestSuite) {
            $suite = array_shift($arguments);
        }
        if (method_exists('\\FUnit', $assert_name)) {
            switch ($assert_name) {
                case "assert_fail":
                    if (count($arguments) > 1) {
                        $expected_fail = array_pop($arguments);
                    } else {
                        $expected_fail = false;
                    }
                    $msg = array_pop($arguments);
                    break;
                case "assert_expect_fail":
                    $expected_fail = true;
                    $msg = array_pop($arguments);
                    break;
                default:
                    $expected_fail = false;
                    $refl_meth = new \ReflectionMethod($call_str);
                    if (count($refl_meth->getParameters()) === count($arguments)) {
                        $msg = array_pop($arguments);
                    } else {
                        $msg = null;
                    }
            }
            $ass_rs = call_user_func_array($call_str, $arguments);
            $rs = $ass_rs['result'];
            $fail_info = $ass_rs['fail_info'];
            $btrace = debug_backtrace();
            // shift twice!
            array_shift($btrace);
            $assert_trace = array_shift($btrace);
            $file = $assert_trace['file'];
            $line = $assert_trace['line'];
            static::add_assertion_result($suite, $call_str, $arguments, $rs, $file, $line, $fail_info, $msg, $expected_fail);
            return $rs;
        }
        throw new \BadMethodCallException("Method {$assert_name} does not exist");
    }