Skip to content

Commit 0501dfe

Browse files
authored
BooleanFilter - Add Tests for Null in IsEmpty and Validate (rappasoft#2077)
* test_can_validate_null_boolean_filter_value * Fix styling * Add IsEmpty Test * Fix styling --------- Co-authored-by: lrljoe <[email protected]>
1 parent 647687e commit 0501dfe

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

tests/Unit/Views/Filters/BooleanFilterTest.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,26 @@ public function test_can_get_if_boolean_filter_not_empty_string(): void
7373
{
7474
$this->assertFalse(self::$filterInstance->isEmpty('0'));
7575
}
76+
77+
public function test_can_validate_null_boolean_filter_value(): void
78+
{
79+
$filter = self::$filterInstance;
80+
$filter->setFilterPillValues([
81+
true => 'Active',
82+
false => 'Inactive',
83+
]);
84+
85+
$this->assertFalse($filter->validate(null));
86+
}
87+
88+
public function test_is_empty_null_boolean_filter_value(): void
89+
{
90+
$filter = self::$filterInstance;
91+
$filter->setFilterPillValues([
92+
true => 'Active',
93+
false => 'Inactive',
94+
]);
95+
96+
$this->assertTrue($filter->isEmpty(null));
97+
}
7698
}

0 commit comments

Comments
 (0)