From 508d0c4ba0e08e36f2e3950494145308e10b26fc Mon Sep 17 00:00:00 2001 From: HungDV2022 Date: Thu, 28 Nov 2024 12:05:47 +0900 Subject: [PATCH] =?UTF-8?q?MailFieldsTable::getControlSource()=20=E3=83=A6?= =?UTF-8?q?=E3=83=8B=E3=83=83=E3=83=88=E3=83=86=E3=82=B9=E3=83=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/bc-mail/src/Model/Table/MailFieldsTable.php | 1 + .../TestCase/Model/Table/MailFieldsTableTest.php | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) 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']); } /**