コード例 #1
0
ファイル: SpecReporterSpec.php プロジェクト: ciarand/pho
         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) {
         $suite = new Suite('test', function () {
コード例 #2
0
ファイル: SpecReporterSpec.php プロジェクト: gsouf/pho
     });
     it('pads nested suites', function () {
         $beforeSuite = function () {
             $suite = new Suite('test suite', function () {
             });
             $reporter = $this->reporter;
             $reporter->beforeSuite($suite);
         };
         expect($beforeSuite)->toPrint("    test suite" . PHP_EOL);
     });
 });
 context('beforeSpec', function () {
     it('increments the spec count', function () {
         $reporter = new SpecReporter($this->console);
         $countBefore = $reporter->getSpecCount();
         $reporter->beforeSpec($this->spec);
         $countAfter = $reporter->getSpecCount();
         expect($countAfter)->toEqual($countBefore + 1);
     });
 });
 context('afterSpec', function () {
     it('prints the spec title in grey if it passed', function () {
         $reporter = new SpecReporter($this->console);
         $afterSpec = function () use($reporter) {
             $reporter->afterSpec($this->spec);
         };
         $console = $this->console;
         $title = $this->console->formatter->grey($this->spec->getTitle());
         expect($afterSpec)->toPrint($title . PHP_EOL);
     });
     it('prints the spec title in red if it failed', function () {