From 5bf6de94164b1eefef7543c1cbe04d8a5f707066 Mon Sep 17 00:00:00 2001 From: kenjis Date: Tue, 5 Mar 2024 17:03:56 +0900 Subject: [PATCH] fix: update toString() params 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 --- system/Test/Constraints/SeeInDatabase.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system/Test/Constraints/SeeInDatabase.php b/system/Test/Constraints/SeeInDatabase.php index 31297f53a0d7..faf874be9ce8 100644 --- a/system/Test/Constraints/SeeInDatabase.php +++ b/system/Test/Constraints/SeeInDatabase.php @@ -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) ); } @@ -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); }