diff --git a/src/Components/database/tests/config/config.php b/src/Components/database/tests/config/config.php index 16954ae05..3b7950c2d 100644 --- a/src/Components/database/tests/config/config.php +++ b/src/Components/database/tests/config/config.php @@ -10,6 +10,16 @@ 'Database' => 'Imi\Db', ], + 'beans' => [ + 'ErrorLog' => [ + 'catchLevel' => \E_ALL, + 'exceptionLevel' => \E_ALL, + 'errorEventHandlers' => [ + \Imi\Test\Component\ErrorEventHandler::class, + ], + ], + ], + // 日志配置 'logger' => [ 'channels' => [ diff --git a/src/Components/redis/src/Handler/PhpRedisClusterHandler.php b/src/Components/redis/src/Handler/PhpRedisClusterHandler.php index 2507db302..c9f29e33c 100644 --- a/src/Components/redis/src/Handler/PhpRedisClusterHandler.php +++ b/src/Components/redis/src/Handler/PhpRedisClusterHandler.php @@ -51,6 +51,7 @@ public function flushdbEx(): bool { foreach ($this->getNodes() as $node) { + // @phpstan-ignore-next-line $this->client->flushDB($node); } @@ -61,6 +62,7 @@ public function flushallEx(): bool { foreach ($this->getNodes() as $node) { + // @phpstan-ignore-next-line $this->client->flushAll($node); } diff --git a/src/Components/redis/src/Handler/PredisClusterHandler.php b/src/Components/redis/src/Handler/PredisClusterHandler.php index 35e2cbe45..988729246 100644 --- a/src/Components/redis/src/Handler/PredisClusterHandler.php +++ b/src/Components/redis/src/Handler/PredisClusterHandler.php @@ -70,6 +70,7 @@ public function flushdbEx(): bool return false; } } + return true; } @@ -83,6 +84,7 @@ public function flushallEx(): bool return false; } } + return true; } diff --git a/tests/unit/Component/ErrorEventHandler.php b/tests/unit/Component/ErrorEventHandler.php index 0fa000eaf..c187ce53c 100644 --- a/tests/unit/Component/ErrorEventHandler.php +++ b/tests/unit/Component/ErrorEventHandler.php @@ -12,7 +12,8 @@ class ErrorEventHandler extends AbstractErrorEventHandler { public function handleError(int $errNo, string $errStr, string $errFile, int $errLine): void { - // 解决 idea 单文件测试引发异常情况 + // 解决 idea 单文件测试引发异常 + // 解决部分情况下不应该把错误转换为异常 if (str_contains($errFile, '/phpunit/src/')) { $this->stopPropagation();