Skip to content

Commit 1a5790d

Browse files
committed
minor #21882 [Form] Fixed typo in a test after #21877 (HeahDude)
This PR was merged into the 2.7 branch. Discussion ---------- [Form] Fixed typo in a test after #21877 | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | ~ | License | MIT | Doc PR | ~ Reviewing the diff on GitHub, I realized I've missed some typos in a new test of #21877. Sorry! Commits ------- b21a0978de [Form] Fixed typo in a test after #21877
2 parents 8e83a3f + 4b75b98 commit 1a5790d

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

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)