diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a486e28..8ff0455 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,4 +22,4 @@ jobs: - name: Run PHPUnit tests run: vendor/bin/phpunit - name: Run PhpStan Analyse Code - run: vendor/bin/phpstan analyse --level=3 src tests \ No newline at end of file + run: vendor/bin/phpstan analyse --level=4 src tests \ No newline at end of file diff --git a/tests/Unit/CategoryTest.php b/tests/Unit/CategoryTest.php index 28f7932..e44ddca 100644 --- a/tests/Unit/CategoryTest.php +++ b/tests/Unit/CategoryTest.php @@ -86,15 +86,12 @@ public function test_findBy_for_each_short_code() public function test_allCategories_for_null_values() { - $hasNull = false; foreach ($this->category->allCategories() as $set) { - if ($hasNull = in_array(null, (array) $set, true)) { + if (in_array(null, (array) $set, true)) { $this->fail('Category dataset can\'t have null values'); - break; } } - - $this->assertTrue(!$hasNull); + $this->assertTrue(true); } public function test_allCategories_for_count() diff --git a/tests/Unit/DistrictTest.php b/tests/Unit/DistrictTest.php index ce0ed79..00e4c03 100644 --- a/tests/Unit/DistrictTest.php +++ b/tests/Unit/DistrictTest.php @@ -81,15 +81,13 @@ public function test_allDistricts_for_count() public function test_allDistricts_for_null_values() { - $hasNull = false; foreach ($this->district->allDistricts() as $set) { - if ($hasNull = in_array(null, (array) $set, true)) { + if (in_array(null, (array) $set, true)) { $this->fail('District dataset can\'t have null values'); - break; } } - $this->assertTrue(!$hasNull); + $this->assertTrue(true); } public function test_district_for_correct_province_id() @@ -103,7 +101,6 @@ public function test_district_for_correct_province_id() if($district && !in_array($district->province_id, range(1,7))){ $correct = false; $this->fail('Invalid Province for District'); - break; } } diff --git a/tests/Unit/MunicipalityTest.php b/tests/Unit/MunicipalityTest.php index 3f44d85..ae68895 100644 --- a/tests/Unit/MunicipalityTest.php +++ b/tests/Unit/MunicipalityTest.php @@ -83,15 +83,13 @@ public function test_allMunicipalities_count() public function test_allMunicipalities_for_null_values() { - $hasNull = false; foreach ($this->municipality->allMunicipalities() as $set) { - if ($hasNull = in_array(null, (array) $set, true)) { + if (in_array(null, (array) $set, true)) { $this->fail('Municipality dataset can\'t have null values'); - break; } } - $this->assertTrue(!$hasNull); + $this->assertTrue(true); } public function test_if_municipality_has_wards_in_range_of_5_to_33() @@ -114,7 +112,6 @@ public function test_if_municipality_has_wards_in_range_of_5_to_33() { $correct = false; $this->fail('Invalid Wards for Municipality'); - break; } } @@ -132,7 +129,6 @@ public function test_if_municipality_has_correct_category_id() if($municipality && !in_array($municipality->category_id, range(1,4))){ $correct = false; $this->fail('Invalid Category for Municipality'); - break; } } @@ -150,7 +146,6 @@ public function test_if_municipality_has_correct_district_id() if($municipality && !in_array($municipality->district_id, range(1,77))){ $correct = false; $this->fail('Invalid District for Municipality'); - break; } } diff --git a/tests/Unit/ProvinceTest.php b/tests/Unit/ProvinceTest.php index f679132..4fa3c79 100644 --- a/tests/Unit/ProvinceTest.php +++ b/tests/Unit/ProvinceTest.php @@ -84,15 +84,13 @@ public function test_allProvinces_count() public function test_allProvinces_for_null_values() { - $hasNull = false; foreach ($this->province->allProvinces() as $set) { - if ($hasNull = in_array(null, (array) $set, true)) { + if (in_array(null, (array) $set, true)) { $this->fail('Province dataset can\'t have null values'); - break; } } - $this->assertTrue(!$hasNull); + $this->assertTrue(true); } public function test_search()