summaryrefslogtreecommitdiff
path: root/tests/app/Module/IndividualReportModuleTest.php
diff options
context:
space:
mode:
authorGreg Roach <fisharebest@webtrees.net>2019-11-03 23:54:24 +0000
committerGreg Roach <fisharebest@webtrees.net>2019-11-04 01:50:40 +0000
commita04bb9a236e92915034f97b1229f5d47c9bc750f (patch)
tree8c6af0cb01faf99962997494c6c4f427254a5118 /tests/app/Module/IndividualReportModuleTest.php
parent618eece25a0a86b9c141d6ddb2dbe55462254562 (diff)
downloadwebtrees-a04bb9a236e92915034f97b1229f5d47c9bc750f.tar.gz
webtrees-a04bb9a236e92915034f97b1229f5d47c9bc750f.tar.bz2
webtrees-a04bb9a236e92915034f97b1229f5d47c9bc750f.zip
Fix: #2479 - admin manage media showing wrong files; Attach filesystems to request
Diffstat (limited to 'tests/app/Module/IndividualReportModuleTest.php')
-rw-r--r--tests/app/Module/IndividualReportModuleTest.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/app/Module/IndividualReportModuleTest.php b/tests/app/Module/IndividualReportModuleTest.php
index 1500b783c8..5e49d421ab 100644
--- a/tests/app/Module/IndividualReportModuleTest.php
+++ b/tests/app/Module/IndividualReportModuleTest.php
@@ -27,6 +27,8 @@ use Fisharebest\Webtrees\Report\ReportPdf;
use Fisharebest\Webtrees\Services\UserService;
use Fisharebest\Webtrees\TestCase;
use Fisharebest\Webtrees\Webtrees;
+use League\Flysystem\Adapter\NullAdapter;
+use League\Flysystem\Filesystem;
/**
* Test harness for the class IndividualReportModule
@@ -77,6 +79,8 @@ class IndividualReportModuleTest extends TestCase
*/
public function testReportRunsWithoutError(): void
{
+ $data_filesystem = new Filesystem(new NullAdapter());
+
$user = (new UserService())->create('user', 'User', 'user@example.com', 'secret');
$user->setPreference('canadmin', '1');
Auth::login($user);
@@ -96,13 +100,13 @@ class IndividualReportModuleTest extends TestCase
$this->assertIsArray($report->reportProperties());
ob_start();
- new ReportParserGenerate($xml, new ReportHtml(), $vars, $tree);
+ new ReportParserGenerate($xml, new ReportHtml(), $vars, $tree, $data_filesystem);
$html = ob_get_clean();
$this->assertStringStartsWith('<', $html);
$this->assertStringEndsWith('>', $html);
ob_start();
- new ReportParserGenerate($xml, new ReportPdf(), $vars, $tree);
+ new ReportParserGenerate($xml, new ReportPdf(), $vars, $tree, $data_filesystem);
$pdf = ob_get_clean();
$this->assertStringStartsWith('%PDF', $pdf);
$this->assertStringEndsWith("%%EOF\n", $pdf);