kahlan\matcher\ToThrow::expected PHP 메소드

expected() 공개 정적인 메소드

Normalise the expected value as an Exception.
public static expected ( mixed $expected, integer $code ) : mixed
$expected mixed The expected value to be normalized.
$code integer The expected `Exception` code if `$expected` is a string.
리턴 mixed The normalised value.
    public static function expected($expected, $code = 0)
    {
        if ($expected === null || is_string($expected)) {
            return new AnyException($expected, $code);
        }
        return $expected;
    }