tests: adds more tests regarding snapshots multiple

This commit is contained in:
Nuno Maduro
2023-08-02 23:02:00 +01:00
parent 43107c1743
commit 00109e9976
29 changed files with 79 additions and 26 deletions

View File

@ -189,29 +189,7 @@ final class TestCaseFactory
private static \$__filename = '$filename';
private array \$__snapshotChanges = [];
$methodsCode
/** @postCondition */
protected function __MarkTestIncompleteIfSnapshotHaveChanged(): void
{
if (empty(\$this->__snapshotChanges)) {
return;
}
if (count(\$this->__snapshotChanges) === 1) {
\$this->markTestIncomplete(\$this->__snapshotChanges[0]);
return;
}
\$formattedMessages = implode(PHP_EOL, array_map(function (string \$message) {
return "- \$message";
}, \$this->__snapshotChanges));
\$this->markTestIncomplete(\$formattedMessages);
}
}
PHP;