diff --git a/src/Expectation.php b/src/Expectation.php index ebfd6302..94097ea8 100644 --- a/src/Expectation.php +++ b/src/Expectation.php @@ -885,6 +885,21 @@ final class Expectation return ToUseNothing::make($this); } + /** + * Asserts that the source code of the given expectation target does not include suspicious characters. + */ + public function toNotIncludeSuspiciousCharacters(): ArchExpectation + { + $checker = new Spoofchecker(); + + return Targeted::make( + $this, + fn (ObjectDescription $object) => ! $checker->isSuspicious(file_get_contents($object->path)), + 'to not include suspicious characters', + FileLineFinder::where(fn (string $line) => $checker->isSuspicious($line)), + ); + } + /** * Not supported. */