}; expect($beforeSuite)->toPrint(PHP_EOL . "test suite" . PHP_EOL); }); it('pads nested suites', function () use(&$reporter) { $beforeSuite = function () use(&$reporter) { $suite = new Suite('test suite', function () { }); $reporter->beforeSuite($suite); }; expect($beforeSuite)->toPrint(" test suite" . PHP_EOL); }); }); context('beforeSpec', function () use(&$console, &$spec) { it('increments the spec count', function () use(&$console, &$spec) { $reporter = new SpecReporter($console); $countBefore = $reporter->getSpecCount(); $reporter->beforeSpec($spec); $countAfter = $reporter->getSpecCount(); expect($countAfter)->toEqual($countBefore + 1); }); }); context('afterSpec', function () use(&$console, &$spec) { it('prints the spec title in grey if it passed', function () use(&$console, &$spec) { $reporter = new SpecReporter($console); $afterSpec = function () use($reporter, $spec) { $reporter->afterSpec($spec); }; $title = $console->formatter->grey($spec->getTitle()); expect($afterSpec)->toPrint($title . PHP_EOL); }); it('prints the spec title in red if it failed', function () use(&$console, &$spec) {