コード例 #1
0
ファイル: SpecReporterSpec.php プロジェクト: ciarand/pho
            $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) {
            $suite = new Suite('test', function () {
            });
            $spec = new Spec('testspec', function () {
                throw new \Exception('test');
            }, $suite);
            $spec->run();
            $afterSpec = function () use($console, $spec) {
                $reporter = new SpecReporter($console);
                $reporter->afterSpec($spec);
            };
            $specTitle = $console->formatter->red($spec->getTitle());
            expect($afterSpec)->toPrint($specTitle . PHP_EOL);
        });
        it('prints the spec title in cyan if incomplete', function () use(&$console, $spec) {
            $suite = new Suite('test', function () {
            });
            $spec = new Spec('testspec', null, $suite);
            $spec->run();
            $afterSpec = function () use($console, $spec) {
                $reporter = new SpecReporter($console);
                $reporter->afterSpec($spec);
            };
            $specTitle = $console->formatter->cyan($spec->getTitle());
            expect($afterSpec)->toPrint($specTitle . PHP_EOL);
        });
    });
});