mirror of
http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore.git
synced 2026-01-15 06:55:06 +08:00
fix(extend): 修复了解析不到为空不为数组的问题
This commit is contained in:
@@ -9,20 +9,26 @@
|
||||
|
||||
namespace Singularity\HDK\Test\Core\Unit;
|
||||
|
||||
use Hyperf\Utils\ApplicationContext;
|
||||
use Singularity\HDK\Core\Service\ExtendService;
|
||||
use Singularity\HDK\Core\Service\UtilsService;
|
||||
|
||||
/** @var ExtendService $service */
|
||||
$service = make(ExtendService::class, ['utils' => new UtilsService()]);
|
||||
it('asserts no parameters can be parsed.', function () use ($service) {
|
||||
it('asserts no parameters can be parsed.', function (ExtendService $service, $params) {
|
||||
$service->parse(
|
||||
null,
|
||||
null
|
||||
$params
|
||||
);
|
||||
$result = $service->getExtends();
|
||||
expect($result)->toBeArray()->toHaveCount(0)->toBe([]);
|
||||
})->only();
|
||||
})->with([
|
||||
[$service, null],
|
||||
[$service, ''],
|
||||
[$service, []],
|
||||
[$service, ['extends' => '']],
|
||||
[$service, ['extends' => null]],
|
||||
])->only();
|
||||
|
||||
it('asserts query parameters can be parsed.', function () use ($service) {
|
||||
$result = $service->parse(
|
||||
null,
|
||||
|
||||
Reference in New Issue
Block a user