unittest\Output::unknown_assertion PHP Method

unknown_assertion() public method

Generates an error indicating an unknown assertion has been called.
public unknown_assertion ( $signal, string $func, array $args, object $assertion ) : void
$func string Assertion function called
$args array Array of arguments passed to the assertion
$assertion object The assertion object used
return void
    public function unknown_assertion($signal, $func, $args, $assertion)
    {
        $assertions = array_keys($assertion->get_storage());
        $suggestions = array_filter($assertions, function ($var) use($func) {
            if (\similar_text($var, $func) >= 5) {
                return true;
            }
            return false;
        });
        $this->send_linebreak(self::ERROR);
        $this->send(sprintf("TEST : %s%sASSERTION : [ %s ] is not a valid assertion %s", $signal->get_index(), PHP_EOL, $func, count($suggestions) != 0 ? 'did you want (' . implode(', ', $suggestions) . ')?' : 'no suggestions found.'), self::ERROR);
        $this->send_linebreak(self::ERROR);
        $this->send($this->get_assertion_call_line(), self::ERROR);
        $this->send_linebreak(self::ERROR);
        // reset break count
        $this->__breakcount = 0;
    }