Skip to content

Commit

Permalink
Merge pull request #4052 from HungDV2022/unittest_MailFieldsTable_get…
Browse files Browse the repository at this point in the history
…ControlSource

MailFieldsTable::getControlSource() ユニットテスト
  • Loading branch information
HungDV2022 authored Nov 29, 2024
2 parents 209995d + 508d0c4 commit d31ef49
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions plugins/bc-mail/src/Model/Table/MailFieldsTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ public function validationDefault(Validator $validator): Validator
* @return array source
* @checked
* @noTodo
* @unitTest
*/
public function getControlSource($field = null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,16 @@ public function test_validationDefaultDuplicate()
*/
public function testGetControlSource()
{
$this->markTestIncomplete('このテストは、まだ実装されていません。');
//$field = null
$rs = $this->MailFieldsTable->getControlSource();
$this->assertEquals('テキスト', $rs['type']['text']);
$this->assertEquals('Eメール形式チェック', $rs['valid_ex']['VALID_EMAIL']);
$this->assertEquals('半角変換', $rs['auto_convert']['CONVERT_HANKAKU']);

//$field != null
$rs = $this->MailFieldsTable->getControlSource('type');
$this->assertEquals('テキストエリア', $rs['textarea']);
$this->assertEquals('隠しフィールド', $rs['hidden']);
}

/**
Expand Down

0 comments on commit d31ef49

Please sign in to comment.