|
@@ 28-36 (lines=9) @@
|
| 25 |
|
$this->validatorExtension = new ValidatorExtension($this->validator); |
| 26 |
|
} |
| 27 |
|
|
| 28 |
|
public function testGetError() |
| 29 |
|
{ |
| 30 |
|
$this->assertEquals('', $this->validatorExtension->getError('username')); |
| 31 |
|
|
| 32 |
|
$this->validator->addError('username', 'Bad username'); |
| 33 |
|
$this->validator->addError('username', 'Too short!'); |
| 34 |
|
|
| 35 |
|
$this->assertEquals('Bad username', $this->validatorExtension->getError('username')); |
| 36 |
|
} |
| 37 |
|
|
| 38 |
|
public function testGetErrors() |
| 39 |
|
{ |
|
@@ 68-75 (lines=8) @@
|
| 65 |
|
$this->assertEquals('Required', $this->validatorExtension->getRuleError('username', 'notBlank')); |
| 66 |
|
} |
| 67 |
|
|
| 68 |
|
public function testGetValue() |
| 69 |
|
{ |
| 70 |
|
$this->assertEquals('', $this->validatorExtension->getValue('username')); |
| 71 |
|
|
| 72 |
|
$this->validator->setValues(['username' => 'awurth']); |
| 73 |
|
|
| 74 |
|
$this->assertEquals('awurth', $this->validatorExtension->getValue('username')); |
| 75 |
|
} |
| 76 |
|
|
| 77 |
|
public function testHasError() |
| 78 |
|
{ |