Skip to content

Commit

Permalink
test: add test for numeric field name
Browse files Browse the repository at this point in the history
  • Loading branch information
kenjis committed Aug 22, 2024
1 parent 655bd1d commit dbff203
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/system/Validation/ValidationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,16 @@ public function testRunDoesTheBasics(): void
$this->assertSame([], $this->validation->getValidated());
}

public function testRunWithNumericFieldName(): void
{
// The array key will be int.
$data = ['123' => 'notanumber'];
$this->validation->setRules(['123' => 'is_numeric']);

$this->assertFalse($this->validation->run($data));
$this->assertSame([], $this->validation->getValidated());
}

public function testClosureRule(): void
{
$this->validation->setRules(
Expand Down

0 comments on commit dbff203

Please sign in to comment.