diff --git a/src/FakesCompilation.php b/src/FakesCompilation.php index 270339d..526bf47 100644 --- a/src/FakesCompilation.php +++ b/src/FakesCompilation.php @@ -22,12 +22,21 @@ trait FakesCompilation Assert::assertFalse( $compilations->isEmpty(), - 'The TeX Document "'.$documentClass.'" has not been compiled.' + 'The TeX Document "' . $documentClass . '" has not been compiled.' ); $validDocuments = $compilations->filter(fn ($compilation) => $check($compilation)); - Assert::assertNotEmpty($validDocuments, 'Failed that TeX Document "'.$documentClass.'" has been compiled with given check.'); + Assert::assertNotEmpty($validDocuments, 'Failed that TeX Document "' . $documentClass . '" has been compiled with given check.'); + } + + /** + * @param class-string $documentClass + * @param callable(Document): bool $check + */ + public function assertCompiledContent(string $documentClass, string $content): void + { + $this->assertCompiled($documentClass, fn ($document) => $document->renderBody() === $content); } /** @@ -39,7 +48,7 @@ trait FakesCompilation Assert::assertTrue( $compilations->isEmpty(), - 'The TeX Document "'.$documentClass.'" should not have been compiled.' + 'The TeX Document "' . $documentClass . '" should not have been compiled.' ); }