diff --git a/src/Http/Validation/Rules/Checked.php b/src/Http/Validation/Rules/Checked.php new file mode 100644 index 00000000..d4778919 --- /dev/null +++ b/src/Http/Validation/Rules/Checked.php @@ -0,0 +1,13 @@ +assertTrue($rule->validate('yes')); + $this->assertTrue($rule->validate('on')); + $this->assertTrue($rule->validate(1)); + $this->assertTrue($rule->validate('1')); + $this->assertTrue($rule->validate('true')); + $this->assertTrue($rule->validate(true)); + + $this->assertFalse($rule->validate('no')); + $this->assertFalse($rule->validate('off')); + $this->assertFalse($rule->validate(0)); + $this->assertFalse($rule->validate('0')); + $this->assertFalse($rule->validate('false')); + $this->assertFalse($rule->validate(false)); + $this->assertFalse($rule->validate(null)); + } +}