Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b21a097

Browse filesBrowse files
committed
[Form] Fixed typo in a test after #21877
1 parent ea8025b commit b21a097
Copy full SHA for b21a097

File tree

1 file changed

+4
-6
lines changed
Filter options

1 file changed

+4
-6
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Tests/SimpleFormTest.php
+4-6Lines 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)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.