pho\Runner\Runner::describe PHP Method

describe() public method

Constructs a test Suite, assigning it the given title and anonymous function. If it's a child of another suite, a reference to the parent suite is stored. This is done by tracking the current and previously defined suites.
public describe ( string $title, Closure $closure )
$title string A title to be associated with the suite
$closure Closure The closure to invoke when the suite is ran
    public function describe($title, \Closure $closure)
    {
        $previous = $this->current;
        $suite = new Suite($title, $closure, $previous);
        // If current is null, this is the root suite for the file
        if ($this->current === null) {
            $this->suites[] = $suite;
        } else {
            $this->current->addSuite($suite);
        }
        $this->current = $suite;
        $suite->getClosure()->__invoke();
        $this->current = $previous;
    }