Conditions | 1 |
Paths | 1 |
Total Lines | 21 |
Code Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
18 | public function testValidatorReceivesFilteredValueInContext() |
||
19 | { |
||
20 | $input1 = new Input('input1'); |
||
21 | $input1->getFilterChain()->attach(new StringTrim()); |
||
22 | |||
23 | $validator = $this->getMock('Zend\Validator\ValidatorInterface'); |
||
24 | $validator |
||
25 | ->expects($this->once()) |
||
26 | ->method('isValid') |
||
27 | ->with('value1', ['input1' => 'value1']); |
||
28 | |||
29 | $validator |
||
30 | ->expects($this->once()) |
||
31 | ->method('getMessages') |
||
32 | ->will($this->returnValue([])); |
||
33 | |||
34 | $input1->getValidatorChain()->attach($validator); |
||
35 | |||
36 | $input1->setValue(' value1 '); |
||
37 | $input1->isValid(['input1' => ' value1 ']); |
||
38 | } |
||
39 | } |
||
40 |