Commit 6bd447a Christian Leucht
committed
1 parent 699c974 commit 6bd447a Copy full SHA for 6bd447a
File tree 2 files changed +7
-1
lines changed
tests/phpunit/Unit/Element
2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -124,7 +124,11 @@ public function isValid(): bool
124
124
125
125
// Either on "submit" we have erroneous Elements, or the
126
126
// Form itself has errors assigned through Form::withErrors().
127
- return $ this ->hasErrors () || $ this ->isValid ;
127
+ if ($ this ->hasErrors ()) {
128
+ return false ;
129
+ }
130
+
131
+ return $ this ->isValid ;
128
132
}
129
133
130
134
/**
Original file line number Diff line number Diff line change @@ -61,6 +61,8 @@ public function testIsValid(): void
61
61
->andReturn ($ expected_value );
62
62
$ element ->allows ('withErrors ' )
63
63
->with ($ expected_error );
64
+ $ element ->allows ('hasErrors ' )
65
+ ->andReturnTrue ();
64
66
$ element ->allows ('validate ' )
65
67
->andReturnFalse ();
66
68
You can’t perform that action at this time.
0 commit comments