File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ public function process()
9292 }
9393
9494 $ this ->form ->handleRequest ($ request );
95- if (! $ this ->form ->isValid ()) {
95+ if ($ this ->form ->isSubmitted () && $ this -> form -> isValid () === false ) {
9696 return false ;
9797 }
9898
Original file line number Diff line number Diff line change @@ -369,6 +369,13 @@ public function testProcessWillHandleRequestOnPost()
369369 ->willReturn ($ this ->form )
370370 ;
371371
372+ $ this ->form
373+ ->expects ($ this ->once ())
374+ ->method ('isSubmitted ' )
375+ ->with ()
376+ ->willReturn (true )
377+ ;
378+
372379 $ this ->form
373380 ->expects ($ this ->once ())
374381 ->method ('isValid ' )
@@ -428,6 +435,13 @@ public function testProcessWillHandleRequestOnPostAndWillProcessDataIfFormIsVali
428435 ->willReturn ($ this ->form )
429436 ;
430437
438+ $ this ->form
439+ ->expects ($ this ->once ())
440+ ->method ('isSubmitted ' )
441+ ->with ()
442+ ->willReturn (true )
443+ ;
444+
431445 $ this ->form
432446 ->expects ($ this ->once ())
433447 ->method ('isValid ' )
You can’t perform that action at this time.
0 commit comments