From c9d097e26f72c778329864c7988fa74e721c5fd4 Mon Sep 17 00:00:00 2001 From: Inhere Date: Tue, 30 Nov 2021 23:05:45 +0800 Subject: [PATCH] fix: unit tests error, add more asserts check --- src/Collection.php | 3 +-- test/ConfigBoxTest.php | 5 ++++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Collection.php b/src/Collection.php index 88f53b2..a5775d7 100644 --- a/src/Collection.php +++ b/src/Collection.php @@ -37,7 +37,6 @@ */ class Collection extends \Toolkit\Stdlib\Std\Collection { - /** * @var int */ @@ -58,7 +57,7 @@ class Collection extends \Toolkit\Stdlib\Std\Collection * * @return mixed */ - public function set(string $key, $value): self + public function set(string $key, mixed $value): self { if ($this->keyPathSep && strpos($key, $this->keyPathSep) > 0) { Arr::setByPath($this->data, $key, $value, $this->keyPathSep); diff --git a/test/ConfigBoxTest.php b/test/ConfigBoxTest.php index da52b7f..eee55b8 100644 --- a/test/ConfigBoxTest.php +++ b/test/ConfigBoxTest.php @@ -22,6 +22,9 @@ public function testNewFromFiles(): void ]); vdump($c); - $this->assertEquals('inher', $c->get('name')); + $this->assertEquals('inhere', $c->get('name')); + $this->assertTrue($c->has('atIni')); + $this->assertTrue($c->has('atNeon')); + $this->assertTrue($c->has('atYaml')); } }