Skip to content

Commit 1ad945e

Browse files
committed
updated tests
1 parent d9f9922 commit 1ad945e

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

tests/ModelTest.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@ public function testChunkById(): void
573573
$this->assertEquals(3, $count);
574574
}
575575

576-
public function toSqlTest(): void
576+
public function testToSql(): void
577577
{
578578
$this->assertTrue(
579579
is_string(User::where('age', 30)->toSql())
@@ -582,5 +582,15 @@ public function toSqlTest(): void
582582
$this->assertTrue(
583583
is_string(User::whereRaw(['age' => ['$gt' => 30, '$lt' => 40]])->toSql())
584584
);
585+
586+
$this->assertEquals(
587+
'select * from "users" where "some_field" > ?',
588+
User::where('some_field', '>', 300)->toSql()
589+
);
590+
591+
$this->assertEquals(
592+
'select * from "users" where "some_field" > ? and {"age":{"$gt":30,"$lt":40}}',
593+
User::where('some_field', '>', 300)->whereRaw(['age' => ['$gt' => 30, '$lt' => 40]])->toSql()
594+
);
585595
}
586596
}

0 commit comments

Comments
 (0)