summaryrefslogtreecommitdiff
path: root/tests/app/Module/DescendancyReportModuleTest.php
diff options
context:
space:
mode:
authorGreg Roach <fisharebest@webtrees.net>2019-12-03 17:27:16 +0000
committerGreg Roach <fisharebest@webtrees.net>2019-12-03 17:40:14 +0000
commit69100c6d2f376ba137a90d02f7e41a8ae5929352 (patch)
tree7143c8b819a3c76e79673f5c6faf7edf9faa8269 /tests/app/Module/DescendancyReportModuleTest.php
parent2039a786b3bc8c594218efc913a5c3e973328c15 (diff)
downloadwebtrees-69100c6d2f376ba137a90d02f7e41a8ae5929352.tar.gz
webtrees-69100c6d2f376ba137a90d02f7e41a8ae5929352.tar.bz2
webtrees-69100c6d2f376ba137a90d02f7e41a8ae5929352.zip
Test against PHP 7.4
Diffstat (limited to 'tests/app/Module/DescendancyReportModuleTest.php')
-rw-r--r--tests/app/Module/DescendancyReportModuleTest.php16
1 files changed, 14 insertions, 2 deletions
diff --git a/tests/app/Module/DescendancyReportModuleTest.php b/tests/app/Module/DescendancyReportModuleTest.php
index 66990f20b7..ae3b208883 100644
--- a/tests/app/Module/DescendancyReportModuleTest.php
+++ b/tests/app/Module/DescendancyReportModuleTest.php
@@ -30,6 +30,10 @@ use Fisharebest\Webtrees\User;
use Fisharebest\Webtrees\Webtrees;
use League\Flysystem\Adapter\NullAdapter;
use League\Flysystem\Filesystem;
+use PHPUnit\Framework\Error\Notice;
+
+use function ob_get_clean;
+use function ob_start;
/**
* Test harness for the class DescendancyReportModule
@@ -104,8 +108,16 @@ class DescendancyReportModuleTest extends TestCase
$this->assertStringEndsWith('>', $html);
ob_start();
- new ReportParserGenerate($xml, new PdfRenderer(), $vars, $tree, $data_filesystem);
- $pdf = ob_get_clean();
+ try {
+ if (PHP_VERSION_ID >= 70400) {
+ $this->expectException(Notice::class);
+ $this->expectExceptionMessage('Trying to access array offset on value of type int');
+ }
+
+ new ReportParserGenerate($xml, new PdfRenderer(), $vars, $tree, $data_filesystem);
+ } finally {
+ $pdf = ob_get_clean();
+ }
$this->assertStringStartsWith('%PDF', $pdf);
$this->assertStringEndsWith("%%EOF\n", $pdf);
}