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

add MailFieldsTable_sourceMailField #3369

merged 5 commits into from
Apr 29, 2024

Conversation

thangnnmd
Copy link
Collaborator

add MailFieldsTable_sourceMailField

@HungDV2022
Copy link
Collaborator

@ryuring レビューをお願いします。

@HungDV2022 HungDV2022 assigned thangnnmd and ryuring and unassigned HungDV2022 and thangnnmd Apr 22, 2024
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 :(

@ryuring ryuring assigned HungDV2022 and thangnnmd and unassigned ryuring Apr 23, 2024
@ryuring ryuring added the Reviewed レビュー済 label Apr 23, 2024
@thangnnmd thangnnmd assigned ryuring and unassigned HungDV2022 and thangnnmd Apr 23, 2024
@ryuring
Copy link
Collaborator

ryuring commented Apr 24, 2024

@thangnnmd @HungDV2022 元のコードを見てください。

    public function sourceMailField(string $value, array $context)
    {
        switch($context['data']['type']) {
            case 'radio':        // ラジオボタン
            case 'select':        // セレクトボックス
            case 'multi_check':    // マルチチェックボックス
            case 'autozip':        // 自動保管郵便番号
                return !empty($value);
        }
        return true;
    }

return は、 bool になっているため、 truefalse しか返却しない仕様となっています。

テストの $expected は、'radio' や 'select' になっています。
これは間違いではないですか?

@ryuring ryuring assigned HungDV2022 and thangnnmd and unassigned ryuring Apr 24, 2024
@momofff momofff added this to the 5.1.0 milestone Apr 25, 2024
@thangnnmd thangnnmd removed their assignment Apr 25, 2024
@thangnnmd
Copy link
Collaborator Author

@HungDV2022 check giúp anh nhé, đúng sai cái cơ bản ;(

@HungDV2022
Copy link
Collaborator

@ryuring すみません、修正しましたのでもう一度確認お願いします。

@HungDV2022 HungDV2022 assigned ryuring and unassigned HungDV2022 Apr 25, 2024
@ryuring
Copy link
Collaborator

ryuring commented Apr 29, 2024

ありがとうございます、マージします!

@ryuring ryuring merged commit 83526ab into baserproject:dev-5.1 Apr 29, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Reviewed レビュー済
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants