/**
  * Handle errors.
  *
  * @param $data
  * @return void
  */
 public function onError($error, WorkerInterface $worker)
 {
     $info = $worker->getJobInfo();
     $this->errors[$info->file] = $error;
     $failures = $this->result->getFailureCount();
     $this->result->setFailureCount(++$failures);
 }
Пример #2
0
                $emitted = $test;
            });
            $test = new Test('spec', function () {
            });
            $test->setPending(true);
            $this->result->pendTest($test);
            assert($emitted === $test, 'should have emitted test.pending event');
        });
    });
    describe('pending test accessors', function () {
        it('should allow access to the total number of pending tests', function () {
            $result = new TestResult($this->eventEmitter);
            $result->setPendingCount(1);
            assert($result->getPendingCount() === 1, 'should have returned pending count');
        });
    });
    describe('failure accessors', function () {
        it('should allow access to the total number of failures', function () {
            $result = new TestResult($this->eventEmitter);
            $result->setFailureCount(1);
            assert($result->getFailureCount() === 1, 'should have returned failure count');
        });
    });
    describe('test count accessors', function () {
        it('should allow access to the total number of tests', function () {
            $result = new TestResult($this->eventEmitter);
            $result->setTestCount(1);
            assert($result->getTestCount() === 1, 'should have returned test count');
        });
    });
});