Skip to content

Commit 7103d06

Browse files
committed
Improve test on query numerical fields
1 parent 71d4656 commit 7103d06

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
@@ -962,15 +962,19 @@ public function testNumericFieldName(): void
962962
{
963963
$user = new User();
964964
$user->{1} = 'one';
965-
$user->{2} = ['2' => 'two.two'];
965+
$user->{2} = ['3' => 'two.three'];
966966
$user->save();
967967

968968
$found = User::where(1, 'one')->first();
969969
$this->assertInstanceOf(User::class, $found);
970970
$this->assertEquals('one', $found[1]);
971971

972-
$found = User::where('2.2', 'two.two')->first();
972+
$found = User::where('2.3', 'two.three')->first();
973973
$this->assertInstanceOf(User::class, $found);
974-
$this->assertEquals([2 => 'two.two'], $found[2]);
974+
$this->assertEquals([3 => 'two.three'], $found[2]);
975+
976+
$found = User::where(2.3, 'two.three')->first();
977+
$this->assertInstanceOf(User::class, $found);
978+
$this->assertEquals([3 => 'two.three'], $found[2]);
975979
}
976980
}

0 commit comments

Comments
 (0)