}); it('should output time', function () { $time = PHP_Timer::secondsToTimeString($this->reporter->getTime()); assert(strstr($this->contents, $time) !== false, 'should contain time text'); }); it('should output failure text', function () { assert(strstr($this->contents, '1 failing') !== false, 'should contain failure text'); }); it('should output pending count', function () { assert(strstr($this->contents, '1 pending') !== false, 'should contain pending text'); }); it('should display exception stacks and messages', function () { $expectedExceptionMessage = " ooops" . PHP_EOL . " nextline"; assert(strstr($this->contents, $expectedExceptionMessage) !== false, "should include exception message"); $trace = preg_replace('/^#/m', " #", $this->exception->getTraceAsString()); assert(strstr($this->contents, $trace) !== false, "should include exception stack"); }); it('should honor peridot exception traces', function () { $output = new BufferedOutput(); $emitter = new EventEmitter(); $reporter = new SpecReporter($output, $emitter, Context::getInstance()); $exception = new PeridotException('message'); $exception->setTraceString('trace!!'); $emitter->emit('test.failed', new Test('failing test', function () { }), $exception); $reporter->footer(); $contents = $output->fetch(); assert(strstr($contents, 'trace!!') !== false, 'should contain manually set trace'); }); }); });