Skip to content

Commit

Permalink
Modify break statement in FakePdfBuilder.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Lintume committed Feb 6, 2024
1 parent 91fb895 commit e193c88
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/FakePdfBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down

0 comments on commit e193c88

Please sign in to comment.