Skip to content

Commit

Permalink
Add method to retrieve path to temp file
Browse files Browse the repository at this point in the history
  • Loading branch information
sgtpepper9907 committed Apr 15, 2019
1 parent 8876de7 commit 7ac097c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Wrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,18 @@ protected function browsershot(): Browsershot
return $this->browsershot;
}

/**
* Gets the temp file path
*
* @return string
*/
public function getTempFilePath(): string
{
$this->generateTempFile();

return $this->tempFile;
}

/**
* Reads the output from the generated temp file
*
Expand Down
10 changes: 10 additions & 0 deletions tests/FacadePDFTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,14 @@ public function it_generates_different_content_from_the_facades_once_it_has_been

$this->assertNotEquals($googleContent, $githubContent);
}

/** @test */
public function it_returns_the_path_to_the_temp_file()
{
$pdf = PDF::loadView('test');

$path = $pdf->getTempFilePath();

$this->assertFileExists($path);
}
}

0 comments on commit 7ac097c

Please sign in to comment.