hyperf-chat/test/Cases/Helper/ArrayHelperTest.php

19 lines
597 B
PHP
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<?php
declare(strict_types=1);
namespace HyperfTest\Cases\Helper;
use App\Helper\ArrayHelper;
use HyperfTest\HttpTestCase;
class ArrayHelperTest extends HttpTestCase
{
public function testIsRelationArray()
{
$this->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');
}
}