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

add MailFieldsTable_sourceMailField #3369

Merged
merged 5 commits into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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'],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thangnnmd @HungDV2022 195 - 198 については、本当の結果は、true のはずです。
なぜ assertEquals がパスするのかわからないですが、テストが良くないです。

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i sorry @ryuring, there's a bit of confusion.
I didn't check the code again :(

['select', ['data' => ['type' => 'radio']], 'select'],
['multi_check', ['data' => ['type' => 'radio']], 'multi_check'],
['autozip', ['data' => ['type' => 'radio']], 'autozip'],
['text', ['data' => ['type' => 'text']], true]
];
}


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