}); context('when test.failed event is emitted', function () { beforeEach(function () { $this->emitter->emit('test.failed', [$this->test, $this->exception]); }); it('should store the test and exception on the suite entry', function () { $suites = $this->reporter->getSuites(); $entry = $suites[__FILE__][0]; expect($entry['test'])->to->equal($this->test); expect($entry['exception'])->to->equal($this->exception); }); }); context('when a peridot.concurrency.worker.completed event is emitted', function () { it('should associated elapsed time from the worker', function () { $worker = new Worker('/path/to/executable.php', $this->emitter, new TmpfileOpen()); $worker->run(__FILE__); $worker->getJobInfo()->end = microtime(true); $this->emitter->emit('test.passed', [$this->test]); $this->emitter->emit('peridot.concurrency.worker.completed', [$worker]); $info = $worker->getJobInfo(); $time = $this->reporter->getTimeFor(__FILE__); expect($time)->to->equal($info->end - $info->start); }); }); context('when a peridot.concurrency.runner.end event is emitted', function () { it('should output a run time', function () { $this->emitter->emit('peridot.concurrency.runner.end', [0, []]); $output = $this->output->fetch(); expect($output)->to->have->string('Run time: 0 ms'); }); it('should output error if present', function () {