From e193c888875a99c41c06114f61b9813ac4f564b0 Mon Sep 17 00:00:00 2001 From: "lialia.sakhno" Date: Tue, 6 Feb 2024 14:49:20 +0200 Subject: [PATCH] Modify break statement in FakePdfBuilder. Break is not interrupt if, only foreach, for, switch... https://www.php.net/manual/ru/control-structures.break.php Because of this mistake behavior of assertSee function was wrong. --- src/FakePdfBuilder.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/FakePdfBuilder.php b/src/FakePdfBuilder.php index 2b6f195..a61f00e 100644 --- a/src/FakePdfBuilder.php +++ b/src/FakePdfBuilder.php @@ -112,7 +112,7 @@ public function assertSee(string|array $text): void foreach ($this->savedPdfs as $savedPdf) { foreach ($text as $singleText) { if (! str_contains($savedPdf['pdf']->html, $singleText)) { - break 2; // jump out of if branch and the inner foreach loop + break; // jump out of the inner foreach loop } }