diff --git a/app/Helper/ArrayHelper.php b/app/Helper/ArrayHelper.php index 781aca3..fb776fd 100644 --- a/app/Helper/ArrayHelper.php +++ b/app/Helper/ArrayHelper.php @@ -3,7 +3,6 @@ declare(strict_types=1); namespace App\Helper; - class ArrayHelper { /** diff --git a/test/Cases/Helper/ArrayHelperTest.php b/test/Cases/Helper/ArrayHelperTest.php new file mode 100644 index 0000000..8c5549c --- /dev/null +++ b/test/Cases/Helper/ArrayHelperTest.php @@ -0,0 +1,18 @@ +assertTrue(!ArrayHelper::isRelationArray([1, 2, 3, 4, 5]), '判断是否是关联数组失败1!'); + $this->assertTrue(ArrayHelper::isRelationArray([1, 6 => 2, 3, 4, 5]), '判断是否是关联数组失败2!'); + $this->assertTrue(ArrayHelper::isRelationArray(['k1' => 'test', 'k2' => 'test2']), '判断是否是关联数组失败3!'); + } +}