Skip to content

Commit

Permalink
add unitTest_MailFieldsTable_sourceMailField
Browse files Browse the repository at this point in the history
  • Loading branch information
thangnn committed Apr 22, 2024
1 parent 381fed3 commit fcb7d15
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
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 @@ -248,6 +248,7 @@ public function halfTextMailField(string $value)
* @return bool
* @checked
* @noTodo
* @unitTest
*/
public function sourceMailField(string $value, array $context)
{
Expand Down
18 changes: 16 additions & 2 deletions plugins/bc-mail/tests/TestCase/Model/Table/MailFieldsTableTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,12 +181,26 @@ public function testHalfTextMailField()

/**
* 選択リストの入力チェック
* @dataProvider sourceMailFieldDataProvider
*/
public function testSourceMailField()
public function test_sourceMailField($value, $context, $expected)
{
$this->markTestIncomplete('このテストは、まだ実装されていません。');
$result = $this->MailFieldsTable->sourceMailField($value, $context);
$this->assertEquals($expected, $result);
}

public static function sourceMailFieldDataProvider()
{
return [
['radio', ['data' => ['type' => 'radio']], 'radio'],
['select', ['data' => ['type' => 'radio']], 'select'],
['multi_check', ['data' => ['type' => 'radio']], 'multi_check'],
['autozip', ['data' => ['type' => 'radio']], 'autozip'],
['text', ['data' => ['type' => 'text']], true]
];
}


/**
* フィールドデータをコピーする
*
Expand Down

0 comments on commit fcb7d15

Please sign in to comment.