diff --git a/example/tests/ExampleTest.php b/example/tests/ExampleTest.php index 0bd11d3..2289043 100644 --- a/example/tests/ExampleTest.php +++ b/example/tests/ExampleTest.php @@ -8,6 +8,7 @@ // +---------------------------------------------------------------------- // | Author: yunwuxin <448901948@qq.com> // +---------------------------------------------------------------------- +namespace tests; class ExampleTest extends TestCase { diff --git a/example/tests/TestCase.php b/example/tests/TestCase.php index ddc5d1e..6237a68 100644 --- a/example/tests/TestCase.php +++ b/example/tests/TestCase.php @@ -8,6 +8,7 @@ // +---------------------------------------------------------------------- // | Author: yunwuxin <448901948@qq.com> // +---------------------------------------------------------------------- +namespace tests; class TestCase extends \think\testing\TestCase { diff --git a/src/command/Test.php b/src/command/Test.php index 854f34a..3a10f09 100644 --- a/src/command/Test.php +++ b/src/command/Test.php @@ -28,8 +28,8 @@ public function configure() public function execute(Input $input, Output $output) { - Loader::addClassMap('TestCase', ROOT_PATH . 'tests/TestCase.php'); - Loader::addClassMap('think\App', CORE_PATH . 'App' . EXT); + //注册命名空间 + Loader::addNamespace('tests', ROOT_PATH . 'tests'); Session::init(); $argv = $_SERVER['argv'];