From 2deb952bf14ca3680845ea41959ed589f4283dc5 Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Thu, 23 Mar 2023 08:05:14 +0100 Subject: [PATCH] Update ArrayHelperTest.php --- .../{TestArrayHelper.php => ArrayHelperTest.php} | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) rename tests/Unit/Helper/{TestArrayHelper.php => ArrayHelperTest.php} (72%) diff --git a/tests/Unit/Helper/TestArrayHelper.php b/tests/Unit/Helper/ArrayHelperTest.php similarity index 72% rename from tests/Unit/Helper/TestArrayHelper.php rename to tests/Unit/Helper/ArrayHelperTest.php index a3784fa0..fb2924c1 100644 --- a/tests/Unit/Helper/TestArrayHelper.php +++ b/tests/Unit/Helper/ArrayHelperTest.php @@ -6,23 +6,23 @@ use PHPUnit\Framework\TestCase; require_once __DIR__ . '/../../../application/helpers/array_helper.php'; -class TestArrayHelper extends TestCase { - public function test_is_assoc_returns_true_on_associative_array() +class ArrayHelperTest extends TestCase { + public function testIsAssocReturnsTrueOnAssociativeArray() { $this->assertTrue(is_assoc(['test' => 'value'])); } - public function test_is_assoc_returns_false_on_indexed_array() + public function testIsAssocReturnsFalseOnIndexedArray() { $this->assertFalse(is_assoc(['one', 'two', 'three'])); } - public function test_is_assoc_returns_true_on_mixed_array() + public function testIsAssocReturnsTrueOnMixedArray() { $this->assertTrue(is_assoc(['one', 'two', 'three' => 'value'])); } - public function test_array_find_returns_correct_element() + public function testArrayFindReturnsCorrectElement() { $arr = [ [ @@ -39,7 +39,7 @@ class TestArrayHelper extends TestCase { $this->assertSame($arr[0], array_find($arr, fn($element) => $element['id'] === 1)); } - public function test_array_fields_returns_stripped_array() + public function testArrayFieldsReturnsStrippedArray() { $arr = [ 'name' => 'John', @@ -49,6 +49,7 @@ class TestArrayHelper extends TestCase { $stripped = array_fields($arr, ['name']); $this->assertArrayHasKey('name', $stripped); + $this->assertArrayNotHasKey('email', $stripped); } }