示例#1
0
     it('should emit a test.pending event', function () {
         $emitted = null;
         $this->emitter->on('test.pending', function ($test) use(&$emitted) {
             $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');