Adjust state & make tests green

This commit is contained in:
Benjamin Beganović 2020-07-13 13:51:54 +02:00
parent 94976054dd
commit 92b2295db1
2 changed files with 10 additions and 5 deletions

View File

@ -18,7 +18,7 @@ class PdfMaker
private $xpath; private $xpath;
public function __construct(array $data = []) public function __construct(array $data)
{ {
$this->data = $data; $this->data = $data;
} }

View File

@ -6,9 +6,14 @@ use Tests\TestCase;
class PdfMakerTest extends TestCase class PdfMakerTest extends TestCase
{ {
public $state = [
'template' => [],
'variables' => [],
];
public function testDesignLoadsCorrectly() public function testDesignLoadsCorrectly()
{ {
$maker = new PdfMaker(); $maker = new PdfMaker($this->state);
$maker->design(Business::class); $maker->design(Business::class);
@ -17,18 +22,18 @@ class PdfMakerTest extends TestCase
public function testHtmlDesignLoadsCorrectly() public function testHtmlDesignLoadsCorrectly()
{ {
$maker = new PdfMaker(); $maker = new PdfMaker($this->state);
$maker $maker
->design(Business::class) ->design(Business::class)
->build(); ->build();
$this->assertStringContainsString('<!-- Business -->', $maker->html); $this->assertStringContainsString('<!-- Business -->', $maker->getCompiledHTML());
} }
public function testGetSectionUtility() public function testGetSectionUtility()
{ {
$maker = new PdfMaker(); $maker = new PdfMaker($this->state);
$maker $maker
->design(Business::class) ->design(Business::class)