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

fix #3172 新規フィールド追加にてテキスト関連設定に数字以外の文字を入力しても保存できてしまう #3197

Merged
merged 1 commit into from
Mar 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ public function validationDefault(Validator $validator): Validator
$validator
->allowEmptyString('size')
->integer('size', __d('baser_core', '横幅サイズは整数を入力してください。'));

$validator
->allowEmptyString('line')
->integer('line', __d('baser_core', '行数は整数を入力してください。'));

$validator
->allowEmptyString('max_length')
->integer('max_length', __d('baser_core', '最大文字数は整数を入力してください。'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,12 @@ public function test_validationDefault()
$errors = $validator->validate([
'name' => 'あ',
'size' => 'a',
'line' => 'a',
'max_length' => 'b',
]);
$this->assertEquals('フィールド名は半角英数字とアンダースコアのみで入力してください。', current($errors['name']));
$this->assertEquals('横幅サイズは整数を入力してください。', current($errors['size']));
$this->assertEquals('行数は整数を入力してください。', current($errors['line']));
$this->assertEquals('最大文字数は整数を入力してください。', current($errors['max_length']));

//validateUnique テスト
Expand Down
Loading