Skip to content

Commit

Permalink
Add test case for 'boolean' validation
Browse files Browse the repository at this point in the history
  • Loading branch information
gdarko committed Jul 3, 2022
1 parent e73a8f6 commit 3ffc927
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/ValidatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -882,6 +882,29 @@ public function rootAsteriskProvider(): array
];
}

public function testRequiredBoolean()
{
$validation = $this->validator->validate([
'param1' => true,
'param2' => false,
'param3' => 1,
'param4' => 0,
'param5' => "1",
'param6' => "0",
], [
'param1' => 'required|boolean',
'param2' => 'required|boolean',
'param3' => 'required|boolean',
'param4' => 'required|boolean',
'param5' => 'required|boolean',
'param6' => 'required|boolean',
]);

$errors = $validation->errors();

$this->assertEquals($errors->count(), 0);
}

public function testArrayValidation()
{
$validation = $this->validator->validate([
Expand Down

0 comments on commit 3ffc927

Please sign in to comment.