From 673c1ab3bfb81007197985909f80916ad3b4a86b Mon Sep 17 00:00:00 2001 From: thangnn Date: Tue, 19 Nov 2024 13:55:10 +0700 Subject: [PATCH] Add unitTest_CustomContentAdminHelper_displayPluginMeta --- .../View/Helper/CustomContentAdminHelper.php | 1 + .../Helper/CustomContentAdminHelperTest.php | 20 +++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/plugins/bc-custom-content/src/View/Helper/CustomContentAdminHelper.php b/plugins/bc-custom-content/src/View/Helper/CustomContentAdminHelper.php index c812732534..0b4901bbde 100644 --- a/plugins/bc-custom-content/src/View/Helper/CustomContentAdminHelper.php +++ b/plugins/bc-custom-content/src/View/Helper/CustomContentAdminHelper.php @@ -319,6 +319,7 @@ public function getEntryIndexTitle(CustomTable $table, CustomEntry $entry) * プラグインのメタフィールドを表示する * @checked * @noTodo + * @unitTest */ public function displayPluginMeta() { diff --git a/plugins/bc-custom-content/tests/TestCase/View/Helper/CustomContentAdminHelperTest.php b/plugins/bc-custom-content/tests/TestCase/View/Helper/CustomContentAdminHelperTest.php index 9867cac4d1..a5767ee56a 100644 --- a/plugins/bc-custom-content/tests/TestCase/View/Helper/CustomContentAdminHelperTest.php +++ b/plugins/bc-custom-content/tests/TestCase/View/Helper/CustomContentAdminHelperTest.php @@ -4,6 +4,7 @@ use BaserCore\Service\BcDatabaseServiceInterface; use BaserCore\TestSuite\BcTestCase; +use BcBlog\View\BlogAdminAppView; use BcCustomContent\Model\Entity\CustomEntry; use BcCustomContent\Service\CustomEntriesServiceInterface; use BcCustomContent\Service\CustomTablesServiceInterface; @@ -462,4 +463,23 @@ public function test_isEnabledMoveDownEntry() $result = $this->CustomContentAdminHelper->isEnabledMoveDownEntry($entries, $currentEntry); $this->assertFalse($result); } + + /** + * test displayPluginMeta + */ + public function testDisplayPluginMeta() + { + //準備 + $view = new BlogAdminAppView($this->getRequest('/baser/admin')); + $view->loadHelper('BcAdminForm'); + $this->CustomContentAdminHelper = new CustomContentAdminHelper($view); + + //テスト + ob_start(); + $this->CustomContentAdminHelper->displayPluginMeta(); + $output = ob_get_clean(); + + //戻り値を確認 + $this->assertTextContains(' ', $output); + } }