Skip to content

Commit 111f92a

Browse files
committed
minor #13744 Fix form unit testing code sample (yoannrenard)
This PR was merged into the 3.4 branch. Discussion ---------- Fix form unit testing code sample Quick fix of this little bit of code that was misleading. Commits ------- 62aee7c Fix form unit testing code sample
2 parents c3c7636 + 62aee7c commit 111f92a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

form/unit_testing.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ The simplest ``TypeTestCase`` implementation looks like the following::
5454
'test2' => 'test2',
5555
];
5656

57-
$formData = new TestObject();
57+
$model = new TestObject();
5858
// $formData will retrieve data from the form submission; pass it as the second argument
59-
$form = $this->factory->create(TestedType::class, $formData);
59+
$form = $this->factory->create(TestedType::class, $model);
6060

6161
$expected = new TestObject();
6262
// ...populate $object properties with the data stored in $formData
@@ -68,7 +68,7 @@ The simplest ``TypeTestCase`` implementation looks like the following::
6868
$this->assertTrue($form->isSynchronized());
6969

7070
// check that $formData was modified as expected when the form was submitted
71-
$this->assertEquals($expected, $formData);
71+
$this->assertEquals($expected, $model);
7272
}
7373

7474
public function testCustomFormView()

0 commit comments

Comments
 (0)