Skip to content

Commit

Permalink
fix baserproject#3172 新規フィールド追加にてテキスト関連設定に数字以外の文字を入力しても保存できてしまう (base…
Browse files Browse the repository at this point in the history
…rproject#3197)

Co-authored-by: Đỗ Văn Hùng <[email protected]>
  • Loading branch information
HungDV2022 and dovanhung authored Mar 5, 2024
1 parent 7bdc8c4 commit 5bf7870
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
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

0 comments on commit 5bf7870

Please sign in to comment.