Example #1
0
 public function testErrorMessage_Set_Global()
 {
     $message = 'You must fill in this field';
     Form::defineErrorMessage('required', $message);
     $_POST['username'] = '';
     $form = $this->getLoginForm()->addInputFilterList('username', 'required');
     $this->assertTrue($form->isActive(), 'Form is detected as active');
     $this->assertFalse($form->isValid(), 'Form is detected as invalid');
     $this->assertEquals('required', $form->getInputError('username'), 'One error must be thrown, the field must be required');
     $this->assertEquals($message, $form->getInputErrorMessage('username'), 'The error message is the one set');
 }