Skip to content

Commit

Permalink
fix: update toString() params
Browse files Browse the repository at this point in the history
1) CodeIgniter\Database\DatabaseTestCase\DatabaseTestCaseMigrationOnce1Test::testMigrationDone
TypeError: json_encode(): Argument #2 ($flags) must be of type int, bool given

/home/runner/work/CodeIgniter4/CodeIgniter4/system/Test/Constraints/SeeInDatabase.php:118
/home/runner/work/CodeIgniter4/CodeIgniter4/system/Test/DatabaseTestTrait.php:282
/home/runner/work/CodeIgniter4/CodeIgniter4/tests/system/Database/DatabaseTestCase/DatabaseTestCaseMigrationOnce1Test.php:86
  • Loading branch information
kenjis committed Apr 7, 2024
1 parent 100ea8a commit 5bf6de9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions system/Test/Constraints/SeeInDatabase.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ protected function failureDescription($table): string
return sprintf(
"a row in the table [%s] matches the attributes \n%s\n\n%s",
$table,
$this->toString(JSON_PRETTY_PRINT),
$this->toString(false, JSON_PRETTY_PRINT),
$this->getAdditionalInfo($table)
);
}
Expand Down Expand Up @@ -113,7 +113,7 @@ protected function getAdditionalInfo(string $table): string
*
* @param int $options
*/
public function toString($options = 0): string
public function toString(bool $exportObjects = false, $options = 0): string
{
return json_encode($this->data, $options);
}
Expand Down

0 comments on commit 5bf6de9

Please sign in to comment.