Conditions | 1 |
Paths | 1 |
Total Lines | 30 |
Code Lines | 18 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
12 | public function testSubmitValidData() |
||
13 | { |
||
14 | $formData = [ |
||
15 | 'contents' => [ |
||
16 | [ |
||
17 | 'id' => 1, |
||
18 | 'text' => 'Text 1', |
||
19 | ], |
||
20 | [ |
||
21 | 'id' => 2, |
||
22 | 'text' => 'Text 2', |
||
23 | ], |
||
24 | ], |
||
25 | ]; |
||
26 | |||
27 | $form = $this->factory->create(BatchType::class); |
||
28 | |||
29 | $object = new Batch(); |
||
30 | $object->contents[] = new BatchContent(); |
||
31 | $object->contents[] = new BatchContent(); |
||
32 | $object->contents[0]->id = 1; |
||
33 | $object->contents[1]->id = 2; |
||
34 | $object->contents[0]->text = 'Text 1'; |
||
35 | $object->contents[1]->text = 'Text 2'; |
||
36 | |||
37 | $form->submit($formData); |
||
38 | |||
39 | $this->assertTrue($form->isSynchronized()); |
||
40 | $this->assertEquals($object, $form->getData()); |
||
41 | } |
||
42 | } |
||
43 |