8000 [Form] Fixed typo in a test after #21877 · symfony/symfony@b21a097 · GitHub
[go: up one dir, main page]

Skip to content

Commit b21a097

Browse files
committed
[Form] Fixed typo in a test after #21877
1 parent ea8025b commit b21a097

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/Symfony/Component/Form/Tests/SimpleFormTest.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -513,22 +513,20 @@ public function testSetDataIsIgnoredIfDataIsLocked()
513513
$this->assertSame('default', $form->getData());
514514
}
515515

516-
public function testPresSetDataChangesDataIfDataIsLocked()
516+
public function testPreSetDataChangesDataIfDataIsLocked()
517517
{
518518
$config = new FormConfigBuilder('name', null, $this->dispatcher);
519519
$config
520520
->setData('default')
521521
->setDataLocked(true)
522-
->addEventListener(FormEvents::PRE_SUBMIT, function (FormEvent $event) {
522+
->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) {
523523
$event->setData('foobar');
524524
});
525525
$form = new Form($config);
526526

527-
$form->submit(false);
528-
529-
$this->assertTrue($form->isValid());
530-
531527
$this->assertSame('foobar', $form->getData());
528+
$this->assertSame('foobar', $form->getNormData());
529+
$this->assertSame('foobar', $form->getViewData());
532530
}
533531

534532
public function testSubmitConvertsEmptyToNullIfNoTransformer()

0 commit comments

Comments
 (0)
0