kahlan\Suite::it PHP Method

it() public method

Adds a spec.
public it ( string | Closur\Closure $message, Closure $closure = null, $timeout = null, string $type = 'normal' ) : Specification
$message string | Closur\Closure Description message or a test closure.
$closure Closure A test case closure.
$type string The type.
return Specification
    public function it($message, $closure = null, $timeout = null, $type = 'normal')
    {
        static $inc = 1;
        if ($message instanceof Closure) {
            $type = $timeout;
            $timeout = $closure;
            $closure = $message;
            $message = "spec #" . $inc++;
        }
        $parent = $this;
        $root = $this->_root;
        $timeout = $timeout !== null ? $timeout : $this->timeout();
        $spec = new Specification(compact('message', 'closure', 'parent', 'root', 'timeout', 'type'));
        $this->_children[] = $spec;
        return $this;
    }