Add full string assertion for Document

This commit is contained in:
Philipp Lang 2023-11-29 12:05:56 +01:00
parent 6f162102ef
commit 6d88ccb8f1
1 changed files with 15 additions and 5 deletions

View File

@ -8,8 +8,9 @@ use PHPUnit\Framework\Assert;
use ReflectionClass;
use ReflectionMethod;
use ReflectionProperty;
use Spatie\LaravelData\Data;
abstract class Document
abstract class Document extends Data
{
abstract public function basename(): string;
@ -35,6 +36,15 @@ abstract class Document
);
}
public function assertIsContent(string $content): void
{
Assert::assertEquals(
$content,
$this->renderBody(),
"Failed asserting that Content is {$content}"
);
}
/**
* @param array<int, string> $content
*/