Skip to content

Commit

Permalink
Merge pull request #58 from patrickomeara/3.x
Browse files Browse the repository at this point in the history
Fix casting models to strings in database assertions
  • Loading branch information
nunomaduro authored Jan 24, 2025
2 parents 1c4e994 + d7868f5 commit acc614b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Database.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*
* @return TestCase
*/
function assertDatabaseHas(string $table, array $data, ?string $connection = null)
function assertDatabaseHas($table, array $data = [], ?string $connection = null)
{
return test()->assertDatabaseHas(...func_get_args());
}
Expand All @@ -23,7 +23,7 @@ function assertDatabaseHas(string $table, array $data, ?string $connection = nul
*
* @return TestCase
*/
function assertDatabaseMissing(string $table, array $data, ?string $connection = null)
function assertDatabaseMissing($table, array $data = [], ?string $connection = null)
{
return test()->assertDatabaseMissing(...func_get_args());
}
Expand All @@ -33,7 +33,7 @@ function assertDatabaseMissing(string $table, array $data, ?string $connection =
*
* @return TestCase
*/
function assertDatabaseEmpty(string $table, ?string $connection = null)
function assertDatabaseEmpty($table, ?string $connection = null)
{
return test()->assertDatabaseEmpty(...func_get_args());
}
Expand Down Expand Up @@ -63,7 +63,7 @@ function assertModelMissing(Model $model)
*
* @return TestCase
*/
function assertDatabaseCount(string $table, int $count, ?string $connection = null)
function assertDatabaseCount($table, int $count, ?string $connection = null)
{
return test()->assertDatabaseCount(...func_get_args());
}
Expand Down

0 comments on commit acc614b

Please sign in to comment.