Add full string assertion for Document
This commit is contained in:
parent
6f162102ef
commit
6d88ccb8f1
|
@ -8,8 +8,9 @@ use PHPUnit\Framework\Assert;
|
||||||
use ReflectionClass;
|
use ReflectionClass;
|
||||||
use ReflectionMethod;
|
use ReflectionMethod;
|
||||||
use ReflectionProperty;
|
use ReflectionProperty;
|
||||||
|
use Spatie\LaravelData\Data;
|
||||||
|
|
||||||
abstract class Document
|
abstract class Document extends Data
|
||||||
{
|
{
|
||||||
abstract public function basename(): string;
|
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
|
* @param array<int, string> $content
|
||||||
*/
|
*/
|
||||||
|
@ -80,12 +90,12 @@ abstract class Document
|
||||||
|
|
||||||
public function filename(): string
|
public function filename(): string
|
||||||
{
|
{
|
||||||
return $this->basename().'.tex';
|
return $this->basename() . '.tex';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function compiledFilename(): string
|
public function compiledFilename(): string
|
||||||
{
|
{
|
||||||
return $this->basename().'.pdf';
|
return $this->basename() . '.pdf';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue