diff --git a/tests/Tags/Concerns/RendersFormsTest.php b/tests/Tags/Concerns/RendersFormsTest.php index ceae4c5bf5..796bf5d96c 100644 --- a/tests/Tags/Concerns/RendersFormsTest.php +++ b/tests/Tags/Concerns/RendersFormsTest.php @@ -164,21 +164,21 @@ public function renders_textarea_fields($value, $default, $old, $expected) public static function renderTextProvider() { return [ - 'no value, missing' => ['value' => null, 'default' => null, 'old' => self::MISSING, 'expectedValue' => null], - 'no value, filled' => ['value' => null, 'default' => null, 'old' => 'old', 'expectedValue' => 'old'], - 'no value, empty' => ['value' => null, 'default' => null, 'old' => null, 'expectedValue' => null], + 'no value, missing' => ['value' => null, 'default' => null, 'old' => self::MISSING, 'expected' => null], + 'no value, filled' => ['value' => null, 'default' => null, 'old' => 'old', 'expected' => 'old'], + 'no value, empty' => ['value' => null, 'default' => null, 'old' => null, 'expected' => null], - 'value, missing' => ['value' => 'existing', 'default' => null, 'old' => self::MISSING, 'expectedValue' => 'existing'], - 'value, filled' => ['value' => 'existing', 'default' => null, 'old' => 'old', 'expectedValue' => 'old'], - 'value, empty' => ['value' => 'existing', 'default' => null, 'old' => null, 'expectedValue' => null], + 'value, missing' => ['value' => 'existing', 'default' => null, 'old' => self::MISSING, 'expected' => 'existing'], + 'value, filled' => ['value' => 'existing', 'default' => null, 'old' => 'old', 'expected' => 'old'], + 'value, empty' => ['value' => 'existing', 'default' => null, 'old' => null, 'expected' => null], - 'no value, default, missing' => ['value' => null, 'default' => 'default', 'old' => self::MISSING, 'expectedValue' => 'default'], - 'no value, default, filled' => ['value' => null, 'default' => 'default', 'old' => 'old', 'expectedValue' => 'old'], - 'no value, default, empty' => ['value' => null, 'default' => 'default', 'old' => null, 'expectedValue' => null], + 'no value, default, missing' => ['value' => null, 'default' => 'default', 'old' => self::MISSING, 'expected' => 'default'], + 'no value, default, filled' => ['value' => null, 'default' => 'default', 'old' => 'old', 'expected' => 'old'], + 'no value, default, empty' => ['value' => null, 'default' => 'default', 'old' => null, 'expected' => null], - 'value, default, missing' => ['value' => 'existing', 'default' => 'default', 'old' => self::MISSING, 'expectedValue' => 'existing'], - 'value, default, filled' => ['value' => 'existing', 'default' => 'default', 'old' => 'old', 'expectedValue' => 'old'], - 'value, default, empty' => ['value' => 'existing', 'default' => 'default', 'old' => null, 'expectedValue' => null], + 'value, default, missing' => ['value' => 'existing', 'default' => 'default', 'old' => self::MISSING, 'expected' => 'existing'], + 'value, default, filled' => ['value' => 'existing', 'default' => 'default', 'old' => 'old', 'expected' => 'old'], + 'value, default, empty' => ['value' => 'existing', 'default' => 'default', 'old' => null, 'expected' => null], ]; } @@ -204,37 +204,37 @@ public function renders_toggles($value, $default, $old, $expected) public static function renderToggleProvider() { return [ - 'no value, missing' => ['value' => null, 'default' => null, 'old' => self::MISSING, 'expectedValue' => false], - 'no value, checked' => ['value' => null, 'default' => null, 'old' => '1', 'expectedValue' => true], - 'no value, unchecked' => ['value' => null, 'default' => null, 'old' => '0', 'expectedValue' => false], + 'no value, missing' => ['value' => null, 'default' => null, 'old' => self::MISSING, 'expected' => false], + 'no value, checked' => ['value' => null, 'default' => null, 'old' => '1', 'expected' => true], + 'no value, unchecked' => ['value' => null, 'default' => null, 'old' => '0', 'expected' => false], - 'value true, missing' => ['value' => true, 'default' => null, 'old' => self::MISSING, 'expectedValue' => true], - 'value true, checked' => ['value' => true, 'default' => null, 'old' => '1', 'expectedValue' => true], - 'value true, unchecked' => ['value' => true, 'default' => null, 'old' => '0', 'expectedValue' => false], + 'value true, missing' => ['value' => true, 'default' => null, 'old' => self::MISSING, 'expected' => true], + 'value true, checked' => ['value' => true, 'default' => null, 'old' => '1', 'expected' => true], + 'value true, unchecked' => ['value' => true, 'default' => null, 'old' => '0', 'expected' => false], - 'value false, missing' => ['value' => false, 'default' => null, 'old' => self::MISSING, 'expectedValue' => false], - 'value false, checked' => ['value' => false, 'default' => null, 'old' => '1', 'expectedValue' => true], - 'value false, unchecked' => ['value' => false, 'default' => null, 'old' => '0', 'expectedValue' => false], + 'value false, missing' => ['value' => false, 'default' => null, 'old' => self::MISSING, 'expected' => false], + 'value false, checked' => ['value' => false, 'default' => null, 'old' => '1', 'expected' => true], + 'value false, unchecked' => ['value' => false, 'default' => null, 'old' => '0', 'expected' => false], - 'no value, default true, missing' => ['value' => null, 'default' => true, 'old' => self::MISSING, 'expectedValue' => true], - 'no value, default true, checked' => ['value' => null, 'default' => true, 'old' => '1', 'expectedValue' => true], - 'no value, default true, unchecked' => ['value' => null, 'default' => true, 'old' => '0', 'expectedValue' => false], + 'no value, default true, missing' => ['value' => null, 'default' => true, 'old' => self::MISSING, 'expected' => true], + 'no value, default true, checked' => ['value' => null, 'default' => true, 'old' => '1', 'expected' => true], + 'no value, default true, unchecked' => ['value' => null, 'default' => true, 'old' => '0', 'expected' => false], - 'no value, default false, missing' => ['value' => null, 'default' => false, 'old' => self::MISSING, 'expectedValue' => false], - 'no value, default false, checked' => ['value' => null, 'default' => false, 'old' => '1', 'expectedValue' => true], - 'no value, default false, unchecked' => ['value' => null, 'default' => false, 'old' => '0', 'expectedValue' => false], + 'no value, default false, missing' => ['value' => null, 'default' => false, 'old' => self::MISSING, 'expected' => false], + 'no value, default false, checked' => ['value' => null, 'default' => false, 'old' => '1', 'expected' => true], + 'no value, default false, unchecked' => ['value' => null, 'default' => false, 'old' => '0', 'expected' => false], - 'value true, default true, missing' => ['value' => true, 'default' => true, 'old' => self::MISSING, 'expectedValue' => true], - 'value true, default true, checked' => ['value' => true, 'default' => true, 'old' => '1', 'expectedValue' => true], - 'value true, default true, unchecked' => ['value' => true, 'default' => true, 'old' => '0', 'expectedValue' => false], + 'value true, default true, missing' => ['value' => true, 'default' => true, 'old' => self::MISSING, 'expected' => true], + 'value true, default true, checked' => ['value' => true, 'default' => true, 'old' => '1', 'expected' => true], + 'value true, default true, unchecked' => ['value' => true, 'default' => true, 'old' => '0', 'expected' => false], - 'value true, default false, missing' => ['value' => true, 'default' => false, 'old' => self::MISSING, 'expectedValue' => true], - 'value true, default false, checked' => ['value' => true, 'default' => false, 'old' => '1', 'expectedValue' => true], - 'value true, default false, unchecked' => ['value' => true, 'default' => false, 'old' => '0', 'expectedValue' => false], + 'value true, default false, missing' => ['value' => true, 'default' => false, 'old' => self::MISSING, 'expected' => true], + 'value true, default false, checked' => ['value' => true, 'default' => false, 'old' => '1', 'expected' => true], + 'value true, default false, unchecked' => ['value' => true, 'default' => false, 'old' => '0', 'expected' => false], - 'value false, default true, missing' => ['value' => false, 'default' => true, 'old' => self::MISSING, 'expectedValue' => false], - 'value false, default true, checked' => ['value' => false, 'default' => true, 'old' => '1', 'expectedValue' => true], - 'value false, default true, unchecked' => ['value' => false, 'default' => true, 'old' => '0', 'expectedValue' => false], + 'value false, default true, missing' => ['value' => false, 'default' => true, 'old' => self::MISSING, 'expected' => false], + 'value false, default true, checked' => ['value' => false, 'default' => true, 'old' => '1', 'expected' => true], + 'value false, default true, unchecked' => ['value' => false, 'default' => true, 'old' => '0', 'expected' => false], ]; } @@ -302,17 +302,17 @@ public function renders_radio_fields($value, $default, $old, $expected) public static function renderSingleSelectProvider() { return [ - 'no value, no default, missing' => ['value' => null, 'default' => null, 'old' => self::MISSING, 'expectedValue' => null], - 'no value, no default, selected' => ['value' => null, 'default' => null, 'old' => 'bravo', 'expectedValue' => 'bravo'], + 'no value, no default, missing' => ['value' => null, 'default' => null, 'old' => self::MISSING, 'expected' => null], + 'no value, no default, selected' => ['value' => null, 'default' => null, 'old' => 'bravo', 'expected' => 'bravo'], - 'value, no default, missing' => ['value' => 'alfa', 'default' => null, 'old' => self::MISSING, 'expectedValue' => 'alfa'], - 'value, no default, selected' => ['value' => 'alfa', 'default' => null, 'old' => 'bravo', 'expectedValue' => 'bravo'], + 'value, no default, missing' => ['value' => 'alfa', 'default' => null, 'old' => self::MISSING, 'expected' => 'alfa'], + 'value, no default, selected' => ['value' => 'alfa', 'default' => null, 'old' => 'bravo', 'expected' => 'bravo'], - 'no value, default, missing' => ['value' => null, 'default' => 'alfa', 'old' => self::MISSING, 'expectedValue' => 'alfa'], - 'no value, default, selected' => ['value' => null, 'default' => 'alfa', 'old' => 'bravo', 'expectedValue' => 'bravo'], + 'no value, default, missing' => ['value' => null, 'default' => 'alfa', 'old' => self::MISSING, 'expected' => 'alfa'], + 'no value, default, selected' => ['value' => null, 'default' => 'alfa', 'old' => 'bravo', 'expected' => 'bravo'], - 'value, default, missing' => ['value' => 'alfa', 'default' => 'bravo', 'old' => self::MISSING, 'expectedValue' => 'alfa'], - 'value, default, selected' => ['value' => 'alfa', 'default' => 'bravo', 'old' => 'charlie', 'expectedValue' => 'charlie'], + 'value, default, missing' => ['value' => 'alfa', 'default' => 'bravo', 'old' => self::MISSING, 'expected' => 'alfa'], + 'value, default, selected' => ['value' => 'alfa', 'default' => 'bravo', 'old' => 'charlie', 'expected' => 'charlie'], ]; } @@ -389,25 +389,25 @@ public function renders_checkboxes_fields($value, $default, $old, $expected) public static function renderMultipleSelectProvider() { return [ - 'no value, no default, missing' => ['value' => null, 'default' => null, 'old' => self::MISSING, 'expectedValue' => null], - 'no value, no default, selected' => ['value' => null, 'default' => null, 'old' => ['alfa'], 'expectedValue' => ['alfa']], - 'no value, no default, selected multiple' => ['value' => null, 'default' => null, 'old' => ['alfa', 'bravo'], 'expectedValue' => ['alfa', 'bravo']], - 'no value, no default, selected none' => ['value' => null, 'default' => null, 'old' => [], 'expectedValue' => []], - - 'value, no default, missing' => ['value' => ['alfa'], 'default' => null, 'old' => self::MISSING, 'expectedValue' => ['alfa']], - 'value, no default, selected' => ['value' => ['alfa'], 'default' => null, 'old' => ['bravo'], 'expectedValue' => ['bravo']], - 'value, no default, selected multiple' => ['value' => ['alfa'], 'default' => null, 'old' => ['bravo', 'charlie'], 'expectedValue' => ['bravo', 'charlie']], - 'value, no default, selected none' => ['value' => ['alfa'], 'default' => null, 'old' => [], 'expectedValue' => []], - - 'no value, default, missing' => ['value' => null, 'default' => ['alfa'], 'old' => self::MISSING, 'expectedValue' => ['alfa']], - 'no value, default, selected' => ['value' => null, 'default' => ['alfa'], 'old' => ['bravo'], 'expectedValue' => ['bravo']], - 'no value, default, selected multiple' => ['value' => null, 'default' => ['alfa'], 'old' => ['bravo', 'charlie'], 'expectedValue' => ['bravo', 'charlie']], - 'no value, default, selected none' => ['value' => null, 'default' => ['alfa'], 'old' => [], 'expectedValue' => []], - - 'value, default, missing' => ['value' => ['alfa'], 'default' => ['bravo'], 'old' => self::MISSING, 'expectedValue' => ['alfa']], - 'value, default, selected' => ['value' => ['alfa'], 'default' => ['bravo'], 'old' => ['charlie'], 'expectedValue' => ['charlie']], - 'value, default, selected multiple' => ['value' => ['alfa'], 'default' => ['bravo'], 'old' => ['charlie', 'delta'], 'expectedValue' => ['charlie', 'delta']], - 'value, default, selected none' => ['value' => ['alfa'], 'default' => ['bravo'], 'old' => [], 'expectedValue' => []], + 'no value, no default, missing' => ['value' => null, 'default' => null, 'old' => self::MISSING, 'expected' => null], + 'no value, no default, selected' => ['value' => null, 'default' => null, 'old' => ['alfa'], 'expected' => ['alfa']], + 'no value, no default, selected multiple' => ['value' => null, 'default' => null, 'old' => ['alfa', 'bravo'], 'expected' => ['alfa', 'bravo']], + 'no value, no default, selected none' => ['value' => null, 'default' => null, 'old' => [], 'expected' => []], + + 'value, no default, missing' => ['value' => ['alfa'], 'default' => null, 'old' => self::MISSING, 'expected' => ['alfa']], + 'value, no default, selected' => ['value' => ['alfa'], 'default' => null, 'old' => ['bravo'], 'expected' => ['bravo']], + 'value, no default, selected multiple' => ['value' => ['alfa'], 'default' => null, 'old' => ['bravo', 'charlie'], 'expected' => ['bravo', 'charlie']], + 'value, no default, selected none' => ['value' => ['alfa'], 'default' => null, 'old' => [], 'expected' => []], + + 'no value, default, missing' => ['value' => null, 'default' => ['alfa'], 'old' => self::MISSING, 'expected' => ['alfa']], + 'no value, default, selected' => ['value' => null, 'default' => ['alfa'], 'old' => ['bravo'], 'expected' => ['bravo']], + 'no value, default, selected multiple' => ['value' => null, 'default' => ['alfa'], 'old' => ['bravo', 'charlie'], 'expected' => ['bravo', 'charlie']], + 'no value, default, selected none' => ['value' => null, 'default' => ['alfa'], 'old' => [], 'expected' => []], + + 'value, default, missing' => ['value' => ['alfa'], 'default' => ['bravo'], 'old' => self::MISSING, 'expected' => ['alfa']], + 'value, default, selected' => ['value' => ['alfa'], 'default' => ['bravo'], 'old' => ['charlie'], 'expected' => ['charlie']], + 'value, default, selected multiple' => ['value' => ['alfa'], 'default' => ['bravo'], 'old' => ['charlie', 'delta'], 'expected' => ['charlie', 'delta']], + 'value, default, selected none' => ['value' => ['alfa'], 'default' => ['bravo'], 'old' => [], 'expected' => []], ]; } }