From c777b7b1046a157baa75538341ef8d833bdc803a Mon Sep 17 00:00:00 2001 From: thangnn Date: Thu, 21 Nov 2024 14:07:06 +0700 Subject: [PATCH] Add unitTest_BcEventListener_construct --- plugins/baser-core/src/Event/BcEventListener.php | 1 + .../tests/TestCase/Event/BcEventListenerTest.php | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/plugins/baser-core/src/Event/BcEventListener.php b/plugins/baser-core/src/Event/BcEventListener.php index 355b454a40..462cec063a 100644 --- a/plugins/baser-core/src/Event/BcEventListener.php +++ b/plugins/baser-core/src/Event/BcEventListener.php @@ -64,6 +64,7 @@ class BcEventListener implements EventListenerInterface * コンストラクタ * @checked * @noTodo + * @unitTest */ public function __construct() { diff --git a/plugins/baser-core/tests/TestCase/Event/BcEventListenerTest.php b/plugins/baser-core/tests/TestCase/Event/BcEventListenerTest.php index 3fdebf0398..bd88410c70 100644 --- a/plugins/baser-core/tests/TestCase/Event/BcEventListenerTest.php +++ b/plugins/baser-core/tests/TestCase/Event/BcEventListenerTest.php @@ -20,6 +20,19 @@ public function tearDown(): void parent::tearDown(); } + /** + * test __construct + */ + public function test__construct() + { + $this->BcEventListener = $this->getMockBuilder(BcEventListener::class) + ->onlyMethods(['getAction']) + ->setMockClassName('TestAction') + ->getMock(); + + $this->assertEquals('TestAction', $this->BcEventListener->plugin); + } + /** * Test getAction *