Add full body assertion
This commit is contained in:
parent
5a5f1756e1
commit
8654d13e81
|
@ -22,12 +22,21 @@ trait FakesCompilation
|
||||||
|
|
||||||
Assert::assertFalse(
|
Assert::assertFalse(
|
||||||
$compilations->isEmpty(),
|
$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));
|
$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<Document> $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(
|
Assert::assertTrue(
|
||||||
$compilations->isEmpty(),
|
$compilations->isEmpty(),
|
||||||
'The TeX Document "'.$documentClass.'" should not have been compiled.'
|
'The TeX Document "' . $documentClass . '" should not have been compiled.'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue