Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CustomContentAppHelperTest::__construct() & loadPluginHelper() ユニットテスト #3957

Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class CustomContentAppHelper extends Helper
* @param array $config
* @checked
* @noTodo
* @unitTest
*/
public function __construct(View $view, array $config = [])
{
Expand All @@ -67,6 +68,7 @@ public function __construct(View $view, array $config = [])
* プラグインのヘルパーを読み込む
* @checked
* @noTodo
* @unitTest
*/
public function loadPluginHelper(): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ public function test_getPluginSetting()
$rs = CustomContentUtil::getPluginSetting('testPlugin');
$this->assertEquals(['testSetting' => 'testValue'], $rs);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use BaserCore\Service\BcDatabaseServiceInterface;
use BaserCore\Test\Scenario\SitesScenario;
use BaserCore\TestSuite\BcTestCase;
use BaserCore\Utility\BcUtil;
use BcCustomContent\Model\Entity\CustomLink;
use BcCustomContent\Service\CustomContentsServiceInterface;
use BcCustomContent\Service\CustomEntriesServiceInterface;
Expand All @@ -18,6 +19,10 @@
use Cake\View\View;
use CakephpFixtureFactories\Scenario\ScenarioAwareTrait;

/**
* class CustomContentAppHelperTest
* @property CustomContentAppHelper $CustomContentAppHelper
*/
class CustomContentAppHelperTest extends BcTestCase
{
/**
Expand All @@ -44,12 +49,28 @@ public function tearDown(): void
parent::tearDown();
}

/**
* test __construct
*/
public function test__construct()
{
//プラグインのヘルパーが読み込めるか確認すること
$this->assertNotNull($this->CustomContentAppHelper->BcCcAutoZip);
$this->assertNotNull($this->CustomContentAppHelper->BcCcCheckbox);
$this->assertNotNull($this->CustomContentAppHelper->BcCcDate);
}

/**
* test loadPluginHelper
*/
public function test_loadPluginHelper()
{
$this->markTestIncomplete('このテストはまだ実装されていません。');
//プラグインのヘルパーが読み込めるか確認すること
$this->assertNotNull($this->CustomContentAppHelper->BcCcAutoZip);
$this->assertNotNull($this->CustomContentAppHelper->BcCcCheckbox);
$this->assertNotNull($this->CustomContentAppHelper->BcCcDate);
$this->assertNotNull($this->CustomContentAppHelper->BcCcEmail);
$this->assertNotNull($this->CustomContentAppHelper->BcCcFile);
}
/**
* test isEnableField
Expand Down
Loading