From d7728ebc25dc0739e9c1a3bb44f08fc8d6e2ab64 Mon Sep 17 00:00:00 2001 From: crazywhalecc Date: Wed, 4 May 2022 22:25:42 +0800 Subject: [PATCH] change test and PHPDoc --- src/ZM/global_functions.php | 5 +---- tests/ZM/Utils/TerminalTest.php | 4 ++-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/ZM/global_functions.php b/src/ZM/global_functions.php index 6e5aa045..ac223c53 100644 --- a/src/ZM/global_functions.php +++ b/src/ZM/global_functions.php @@ -15,7 +15,6 @@ use ZM\ConnectionManager\ManagerGM; use ZM\Console\Console; use ZM\Container\Container; use ZM\Container\ContainerInterface; -use ZM\Container\EntryResolutionException; use ZM\Context\Context; use ZM\Context\ContextInterface; use ZM\Event\EventManager; @@ -736,8 +735,7 @@ function container(): ContainerInterface * 解析类实例(使用容器) * * @template T - * @param class-string $abstract - * @throws EntryResolutionException + * @param class-string $abstract * @return Closure|mixed|T */ function resolve(string $abstract, array $parameters = []) @@ -750,7 +748,6 @@ function resolve(string $abstract, array $parameters = []) * * @template T * @param null|class-string $abstract - * @throws EntryResolutionException * @return Closure|ContainerInterface|mixed|T */ function app(string $abstract = null, array $parameters = []) diff --git a/tests/ZM/Utils/TerminalTest.php b/tests/ZM/Utils/TerminalTest.php index 5d847ac1..438ec9c1 100644 --- a/tests/ZM/Utils/TerminalTest.php +++ b/tests/ZM/Utils/TerminalTest.php @@ -18,7 +18,7 @@ class TerminalTest extends TestCase { Console::setLevel(4); Terminal::init(); - $this->assertStringContainsString('Initializing Terminal', $this->getActualOutput()); + $this->expectOutputRegex('/Initializing\ Terminal/'); } /** @@ -28,6 +28,6 @@ class TerminalTest extends TestCase { Console::setLevel(2); Terminal::executeCommand('echo zhamao-framework'); - $this->assertStringContainsString('zhamao-framework', $this->getActualOutput()); + $this->expectOutputRegex('/zhamao-framework/'); } }