Example #1
0
 /**
  * @covers ::setCurrentFunction
  * @covers ::addError
  * @covers ::getErrors
  */
 public function testAddErrorForFunction()
 {
     $file = new File($this->createMockProject(), 'filename', '');
     // Add two errors for function 1.
     $file->setCurrentFunction('function1');
     $file->addError('error #1');
     $file->addError('error #2');
     // None for function 2.
     $file->setCurrentFunction('function2');
     // And one for function 3.
     $file->setCurrentFunction('function3');
     $file->addError('error #3');
     $this->assertEquals(array('function1' => array('error #1', 'error #2'), 'function3' => array('error #3')), $file->getErrors());
 }