1 | <?php |
||
10 | class ValidatorStepTest extends \PHPUnit_Framework_TestCase |
||
11 | { |
||
12 | /** @var ValidatorInterface */ |
||
13 | private $validator; |
||
14 | |||
15 | /** @var ValidatorStep */ |
||
16 | private $filter; |
||
17 | |||
18 | protected function setUp() |
||
23 | |||
24 | public function testProcess() |
||
25 | { |
||
26 | $data = ['title' => null]; |
||
27 | |||
28 | $this->filter->add('title', $constraint = new Constraints\NotNull()); |
||
29 | |||
30 | $list = new ConstraintViolationList(); |
||
31 | $list->add($this->buildConstraintViolation()); |
||
32 | |||
33 | $this->validator->expects($this->once()) |
||
|
|||
34 | ->method('validate') |
||
35 | ->willReturn($list); |
||
36 | |||
37 | $this->assertFalse($this->filter->process($data)); |
||
38 | |||
39 | $this->assertEquals([1 => $list], $this->filter->getViolations()); |
||
40 | } |
||
41 | |||
42 | /** |
||
43 | * @expectedException \Ddeboer\DataImport\Exception\ValidationException |
||
44 | */ |
||
45 | public function testProcessWithExceptions() |
||
46 | { |
||
47 | $data = ['title' => null]; |
||
48 | |||
49 | $this->filter->add('title', $constraint = new Constraints\NotNull()); |
||
50 | $this->filter->throwExceptions(); |
||
51 | |||
52 | $list = new ConstraintViolationList(); |
||
53 | $list->add($this->buildConstraintViolation()); |
||
54 | |||
55 | $this->validator->expects($this->once()) |
||
56 | ->method('validate') |
||
57 | ->willReturn($list); |
||
58 | |||
59 | $this->assertFalse($this->filter->process($data)); |
||
60 | } |
||
61 | |||
62 | public function testProcessWithAllowedExtraFields() |
||
81 | |||
82 | public function testPriority() |
||
86 | |||
87 | private function buildConstraintViolation() |
||
88 | { |
||
93 | } |
||
94 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.