/** * @covers Form::setErrorCode */ public function testSetErrorCode() { $this->myForm->addError('fail'); $this->myForm->setErrorCode('fail', 'This field is required'); $this->assertEquals('This field is required', $this->myForm->getError(0)); }