Skip to content

Commit d21acd5

Browse files
committed
Improve test on query numerical fields
1 parent b2ebded commit d21acd5

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

tests/ModelTest.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -976,15 +976,19 @@ public function testNumericFieldName(): void
976976
{
977977
$user = new User();
978978
$user->{1} = 'one';
979-
$user->{2} = ['2' => 'two.two'];
979+
$user->{2} = ['3' => 'two.three'];
980980
$user->save();
981981

982982
$found = User::where(1, 'one')->first();
983983
$this->assertInstanceOf(User::class, $found);
984984
$this->assertEquals('one', $found[1]);
985985

986-
$found = User::where('2.2', 'two.two')->first();
986+
$found = User::where('2.3', 'two.three')->first();
987987
$this->assertInstanceOf(User::class, $found);
988-
$this->assertEquals([2 => 'two.two'], $found[2]);
988+
$this->assertEquals([3 => 'two.three'], $found[2]);
989+
990+
$found = User::where(2.3, 'two.three')->first();
991+
$this->assertInstanceOf(User::class, $found);
992+
$this->assertEquals([3 => 'two.three'], $found[2]);
989993
}
990994
}

0 commit comments

Comments
 (0)