Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions src/LiveComponent/tests/Functional/Form/ComponentWithFormTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,19 +199,19 @@ public function testHandleCheckboxChanges(): void
->throwExceptions()
->get($getUrl($dehydratedProps))
->assertSuccessful()
->assertContains('<input type="checkbox" id="form_choice_multiple_1" name="form[choice_multiple][]" value="2" checked="checked" />')
->assertContains('<input type="checkbox" id="form_choice_multiple_0" name="form[choice_multiple][]" value="1" />')
->assertContains('<input type="checkbox" id="form_checkbox" name="form[checkbox]" required="required" value="1" />')
->assertContains('<input type="checkbox" id="form_checkbox_checked" name="form[checkbox_checked]" required="required" value="1" checked="checked" />')
->assertContains('<input type="checkbox" id="form_choice_multiple_1" name="form[choice_multiple][]" value="2" checked="checked"')
->assertContains('<input type="checkbox" id="form_choice_multiple_0" name="form[choice_multiple][]" value="1"')
->assertContains('<input type="checkbox" id="form_checkbox" name="form[checkbox]" required="required" value="1"')
->assertContains('<input type="checkbox" id="form_checkbox_checked" name="form[checkbox_checked]" required="required" value="1" checked="checked"')
;

// check both multiple fields
$updatedProps = ['form' => ['choice_multiple' => ['1', '2']]];

$crawler = $browser
->get($getUrl($dehydratedProps, $updatedProps))
->assertContains('<input type="checkbox" id="form_choice_multiple_1" name="form[choice_multiple][]" value="2" checked="checked" />')
->assertContains('<input type="checkbox" id="form_choice_multiple_0" name="form[choice_multiple][]" value="1" checked="checked" />')
->assertContains('<input type="checkbox" id="form_choice_multiple_1" name="form[choice_multiple][]" value="2" checked="checked"')
->assertContains('<input type="checkbox" id="form_choice_multiple_0" name="form[choice_multiple][]" value="1" checked="checked"')
->crawler()
;
$dehydratedProps = json_decode(
Expand All @@ -228,10 +228,10 @@ public function testHandleCheckboxChanges(): void

$crawler = $browser
->get($getUrl($dehydratedProps, $updatedProps))
->assertContains('<input type="checkbox" id="form_choice_multiple_1" name="form[choice_multiple][]" value="2" />')
->assertContains('<input type="checkbox" id="form_choice_multiple_0" name="form[choice_multiple][]" value="1" />')
->assertContains('<input type="checkbox" id="form_checkbox" name="form[checkbox]" required="required" value="1" checked="checked" />')
->assertContains('<input type="checkbox" id="form_checkbox_checked" name="form[checkbox_checked]" required="required" value="1" />')
->assertContains('<input type="checkbox" id="form_choice_multiple_1" name="form[choice_multiple][]" value="2"')
->assertContains('<input type="checkbox" id="form_choice_multiple_0" name="form[choice_multiple][]" value="1"')
->assertContains('<input type="checkbox" id="form_checkbox" name="form[checkbox]" required="required" value="1" checked="checked"')
->assertContains('<input type="checkbox" id="form_checkbox_checked" name="form[checkbox_checked]" required="required" value="1"')
->crawler()
;
$dehydratedProps = json_decode(
Expand Down