From 0e54067872bcb826547b26968af7182102ee880d Mon Sep 17 00:00:00 2001 From: thinkphp Date: Sun, 28 Feb 2016 16:26:09 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/thinkphp/library/think/hookTest.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/thinkphp/library/think/hookTest.php b/tests/thinkphp/library/think/hookTest.php index 9c6d5f5c..930ecf53 100644 --- a/tests/thinkphp/library/think/hookTest.php +++ b/tests/thinkphp/library/think/hookTest.php @@ -24,7 +24,7 @@ class hookTest extends \PHPUnit_Framework_TestCase public function testRun() { Hook::add('my_pos', '\tests\thinkphp\library\think\behavior\One'); - Hook::add('my_pos', '\tests\thinkphp\library\think\behavior\Two'); + Hook::add('my_pos', ['\tests\thinkphp\library\think\behavior\Two']); Hook::add('my_pos', '\tests\thinkphp\library\think\behavior\Three', true); $data['id'] = 0; $data['name'] = 'thinkphp'; @@ -44,10 +44,13 @@ class hookTest extends \PHPUnit_Framework_TestCase '\tests\thinkphp\library\think\behavior\One', '\tests\thinkphp\library\think\behavior\Three'], ]); + Hook::import(['my_pos' => ['\tests\thinkphp\library\think\behavior\Two']], false); + Hook::import(['my_pos' => ['\tests\thinkphp\library\think\behavior\Three', '_overlay' => true]]); $data['id'] = 0; $data['name'] = 'thinkphp'; Hook::listen('my_pos', $data); $this->assertEquals(3, $data['id']); + } public function testExec()