From 8160f11b4d47d9ef9190df53ef8c2817ffc392a0 Mon Sep 17 00:00:00 2001 From: LRLJoe Date: Wed, 20 Nov 2024 03:11:11 +0000 Subject: [PATCH 1/4] test_can_validate_null_boolean_filter_value --- tests/Unit/Views/Filters/BooleanFilterTest.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/Unit/Views/Filters/BooleanFilterTest.php b/tests/Unit/Views/Filters/BooleanFilterTest.php index 0215c4a89..1aca4362b 100644 --- a/tests/Unit/Views/Filters/BooleanFilterTest.php +++ b/tests/Unit/Views/Filters/BooleanFilterTest.php @@ -73,4 +73,16 @@ public function test_can_get_if_boolean_filter_not_empty_string(): void { $this->assertFalse(self::$filterInstance->isEmpty('0')); } + + public function test_can_validate_null_boolean_filter_value(): void + { + $filter = self::$filterInstance; + $filter->setFilterPillValues([ + true => 'Active', + false => 'Inactive', + ]); + + $this->assertFalse($filter->validate(null)); + } + } From ee047d60ab1f6698895c7aabe05c16fe71e4b5a4 Mon Sep 17 00:00:00 2001 From: lrljoe Date: Wed, 20 Nov 2024 03:11:40 +0000 Subject: [PATCH 2/4] Fix styling --- tests/Unit/Views/Filters/BooleanFilterTest.php | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/Unit/Views/Filters/BooleanFilterTest.php b/tests/Unit/Views/Filters/BooleanFilterTest.php index 1aca4362b..e4ba0cd7a 100644 --- a/tests/Unit/Views/Filters/BooleanFilterTest.php +++ b/tests/Unit/Views/Filters/BooleanFilterTest.php @@ -84,5 +84,4 @@ public function test_can_validate_null_boolean_filter_value(): void $this->assertFalse($filter->validate(null)); } - } From 758e8308bed2a22cd57d346a11e5356ab59db424 Mon Sep 17 00:00:00 2001 From: LRLJoe Date: Wed, 20 Nov 2024 03:14:07 +0000 Subject: [PATCH 3/4] Add IsEmpty Test --- tests/Unit/Views/Filters/BooleanFilterTest.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/Unit/Views/Filters/BooleanFilterTest.php b/tests/Unit/Views/Filters/BooleanFilterTest.php index e4ba0cd7a..82759d8e9 100644 --- a/tests/Unit/Views/Filters/BooleanFilterTest.php +++ b/tests/Unit/Views/Filters/BooleanFilterTest.php @@ -84,4 +84,16 @@ public function test_can_validate_null_boolean_filter_value(): void $this->assertFalse($filter->validate(null)); } + + public function test_is_empty_null_boolean_filter_value(): void + { + $filter = self::$filterInstance; + $filter->setFilterPillValues([ + true => 'Active', + false => 'Inactive', + ]); + + $this->assertTrue($filter->isEmpty(null)); + } + } From 3a3fae852a3cc1581ec4f8c54e1de80de746d5ab Mon Sep 17 00:00:00 2001 From: lrljoe Date: Wed, 20 Nov 2024 03:14:38 +0000 Subject: [PATCH 4/4] Fix styling --- tests/Unit/Views/Filters/BooleanFilterTest.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/Unit/Views/Filters/BooleanFilterTest.php b/tests/Unit/Views/Filters/BooleanFilterTest.php index 82759d8e9..5e834a339 100644 --- a/tests/Unit/Views/Filters/BooleanFilterTest.php +++ b/tests/Unit/Views/Filters/BooleanFilterTest.php @@ -84,7 +84,7 @@ public function test_can_validate_null_boolean_filter_value(): void $this->assertFalse($filter->validate(null)); } - + public function test_is_empty_null_boolean_filter_value(): void { $filter = self::$filterInstance; @@ -95,5 +95,4 @@ public function test_is_empty_null_boolean_filter_value(): void $this->assertTrue($filter->isEmpty(null)); } - }