Skip to content

Commit bc093e4

Browse files
committed
Added toSql test.
1 parent 6b925dc commit bc093e4

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

tests/ModelTest.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ public function testCarbonDateMockingWorks()
440440

441441
Carbon::setTestNow($fakeDate);
442442
$item = Item::create(['name' => 'sword']);
443-
443+
444444
$this->assertLessThan(1, $fakeDate->diffInSeconds($item->created_at));
445445
}
446446

@@ -572,4 +572,15 @@ public function testChunkById(): void
572572

573573
$this->assertEquals(3, $count);
574574
}
575+
576+
public function toSqlTest(): void
577+
{
578+
$this->assertTrue(
579+
is_string(User::where('age', 30)->toSql())
580+
);
581+
582+
$this->assertTrue(
583+
is_string(User::whereRaw(['age' => ['$gt' => 30, '$lt' => 40]])->toSql())
584+
);
585+
}
575586
}

0 commit comments

Comments
 (0)