diff --git a/plugins/bc-mail/src/Model/Table/MailFieldsTable.php b/plugins/bc-mail/src/Model/Table/MailFieldsTable.php index 228f6cff6d..1e10f7f573 100755 --- a/plugins/bc-mail/src/Model/Table/MailFieldsTable.php +++ b/plugins/bc-mail/src/Model/Table/MailFieldsTable.php @@ -159,6 +159,7 @@ public function validationDefault(Validator $validator): Validator * @return array source * @checked * @noTodo + * @unitTest */ public function getControlSource($field = null) { diff --git a/plugins/bc-mail/tests/TestCase/Model/Table/MailFieldsTableTest.php b/plugins/bc-mail/tests/TestCase/Model/Table/MailFieldsTableTest.php index 4aa429f809..fb978b9401 100755 --- a/plugins/bc-mail/tests/TestCase/Model/Table/MailFieldsTableTest.php +++ b/plugins/bc-mail/tests/TestCase/Model/Table/MailFieldsTableTest.php @@ -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']); } /**