File tree 1 file changed +4
-6
lines changed
src/Symfony/Component/Form/Tests
1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -513,22 +513,20 @@ public function testSetDataIsIgnoredIfDataIsLocked()
513
513
$ this ->assertSame ('default ' , $ form ->getData ());
514
514
}
515
515
516
- public function testPresSetDataChangesDataIfDataIsLocked ()
516
+ public function testPreSetDataChangesDataIfDataIsLocked ()
517
517
{
518
518
$ config = new FormConfigBuilder ('name ' , null , $ this ->dispatcher );
519
519
$ config
520
520
->setData ('default ' )
521
521
->setDataLocked (true )
522
- ->addEventListener (FormEvents::PRE_SUBMIT , function (FormEvent $ event ) {
522
+ ->addEventListener (FormEvents::PRE_SET_DATA , function (FormEvent $ event ) {
523
523
$ event ->setData ('foobar ' );
524
524
});
525
525
$ form = new Form ($ config );
526
526
527
- $ form ->submit (false );
528
-
529
- $ this ->assertTrue ($ form ->isValid ());
530
-
531
527
$ this ->assertSame ('foobar ' , $ form ->getData ());
528
+ $ this ->assertSame ('foobar ' , $ form ->getNormData ());
529
+ $ this ->assertSame ('foobar ' , $ form ->getViewData ());
532
530
}
533
531
534
532
public function testSubmitConvertsEmptyToNullIfNoTransformer ()
You can’t perform that action at this time.
0 commit comments