summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/TestCase.php2
-rw-r--r--tests/app/Module/AhnentafelReportModuleTest.php11
-rw-r--r--tests/app/Module/BirthDeathMarriageReportModuleTest.php11
-rw-r--r--tests/app/Module/BirthReportModuleTest.php13
-rw-r--r--tests/app/Module/CemeteryReportModuleTest.php13
-rw-r--r--tests/app/Module/ChangeReportModuleTest.php13
-rw-r--r--tests/app/Module/DeathReportModuleTest.php13
-rw-r--r--tests/app/Module/DescendancyReportModuleTest.php11
-rw-r--r--tests/app/Module/FactSourcesReportModuleTest.php13
-rw-r--r--tests/app/Module/FamilyGroupReportModuleTest.php13
-rw-r--r--tests/app/Module/IndividualFamiliesReportModuleTest.php11
-rw-r--r--tests/app/Module/IndividualReportModuleTest.php11
-rw-r--r--tests/app/Module/MarriageReportModuleTest.php11
-rw-r--r--tests/app/Module/MissingFactsReportModuleTest.php11
-rw-r--r--tests/app/Module/OccupationReportModuleTest.php11
-rw-r--r--tests/app/Module/PedigreeReportModuleTest.php11
-rw-r--r--tests/app/Module/RelatedIndividualsReportModuleTest.php11
-rw-r--r--tests/views/AbstractViewTest.php6
18 files changed, 96 insertions, 100 deletions
diff --git a/tests/TestCase.php b/tests/TestCase.php
index e3f2a19c60..bb17428bae 100644
--- a/tests/TestCase.php
+++ b/tests/TestCase.php
@@ -139,7 +139,7 @@ class TestCase extends \PHPUnit\Framework\TestCase
* @param array<string> $query
* @param array<string> $params
* @param array<UploadedFileInterface> $files
- * @param array<string> $attributes
+ * @param array<string|Tree> $attributes
*
* @return ServerRequestInterface
*/
diff --git a/tests/app/Module/AhnentafelReportModuleTest.php b/tests/app/Module/AhnentafelReportModuleTest.php
index 70f93d520c..5ff54529a0 100644
--- a/tests/app/Module/AhnentafelReportModuleTest.php
+++ b/tests/app/Module/AhnentafelReportModuleTest.php
@@ -25,7 +25,6 @@ use Fisharebest\Webtrees\Report\HtmlRenderer;
use Fisharebest\Webtrees\Report\PdfRenderer;
use Fisharebest\Webtrees\Report\ReportParserGenerate;
use Fisharebest\Webtrees\Report\ReportParserSetup;
-use Fisharebest\Webtrees\Services\ModuleService;
use Fisharebest\Webtrees\Services\UserService;
use Fisharebest\Webtrees\TestCase;
@@ -74,16 +73,16 @@ class AhnentafelReportModuleTest extends TestCase
*/
public function testReportRunsWithoutError(): void
{
- $module_service = new ModuleService();
-
$user = (new UserService())->create('user', 'User', 'user@example.com', 'secret');
$user->setPreference(UserInterface::PREF_IS_ADMINISTRATOR, '1');
Auth::login($user);
$tree = $this->importTree('demo.ged');
- $module = $module_service->findByInterface(AhnentafelReportModule::class)->first();
- $xml = 'resources/' . $module->xmlFilename();
- $vars = [
+ $module = new AhnentafelReportModule();
+ $module->setName('ahnentafel_report');
+
+ $xml = 'resources/' . $module->xmlFilename();
+ $vars = [
'pid' => ['id' => 'X1030'],
'maxgen' => ['id' => '3'],
'sources' => ['id' => 'on'],
diff --git a/tests/app/Module/BirthDeathMarriageReportModuleTest.php b/tests/app/Module/BirthDeathMarriageReportModuleTest.php
index 543f933baf..5571b50851 100644
--- a/tests/app/Module/BirthDeathMarriageReportModuleTest.php
+++ b/tests/app/Module/BirthDeathMarriageReportModuleTest.php
@@ -23,7 +23,6 @@ use Fisharebest\Webtrees\Report\HtmlRenderer;
use Fisharebest\Webtrees\Report\PdfRenderer;
use Fisharebest\Webtrees\Report\ReportParserGenerate;
use Fisharebest\Webtrees\Report\ReportParserSetup;
-use Fisharebest\Webtrees\Services\ModuleService;
use Fisharebest\Webtrees\TestCase;
/**
@@ -68,12 +67,12 @@ class BirthDeathMarriageReportModuleTest extends TestCase
*/
public function testReportRunsWithoutError(): void
{
- $module_service = new ModuleService();
-
$tree = $this->importTree('demo.ged');
- $module = $module_service->findByInterface(BirthDeathMarriageReportModule::class)->first();
- $xml = 'resources/' . $module->xmlFilename();
- $vars = [
+ $module = new BirthDeathMarriageReportModule();
+ $module->setName('bdm_report');
+
+ $xml = 'resources/' . $module->xmlFilename();
+ $vars = [
'name' => ['id' => ''],
'bdmplace' => ['id' => ''],
'birthdate1' => ['id' => ''],
diff --git a/tests/app/Module/BirthReportModuleTest.php b/tests/app/Module/BirthReportModuleTest.php
index bba3d24089..cfb6919700 100644
--- a/tests/app/Module/BirthReportModuleTest.php
+++ b/tests/app/Module/BirthReportModuleTest.php
@@ -25,10 +25,11 @@ use Fisharebest\Webtrees\Report\HtmlRenderer;
use Fisharebest\Webtrees\Report\PdfRenderer;
use Fisharebest\Webtrees\Report\ReportParserGenerate;
use Fisharebest\Webtrees\Report\ReportParserSetup;
-use Fisharebest\Webtrees\Services\ModuleService;
use Fisharebest\Webtrees\Services\UserService;
use Fisharebest\Webtrees\TestCase;
+use function ob_get_clean;
+
/**
* Test harness for the class BirthReportModule
*/
@@ -71,16 +72,16 @@ class BirthReportModuleTest extends TestCase
*/
public function testReportRunsWithoutError(): void
{
- $module_service = new ModuleService();
-
$user = (new UserService())->create('user', 'User', 'user@example.com', 'secret');
$user->setPreference(UserInterface::PREF_IS_ADMINISTRATOR, '1');
Auth::login($user);
$tree = $this->importTree('demo.ged');
- $module = $module_service->findByInterface(BirthReportModule::class)->first();
- $xml = 'resources/' . $module->xmlFilename();
- $vars = [
+ $module = new BirthReportModule();
+ $module->setName('birth_report');
+
+ $xml = 'resources/' . $module->xmlFilename();
+ $vars = [
'name' => ['id' => ''],
'birthplace' => ['id' => ''],
'birthdate1' => ['id' => ''],
diff --git a/tests/app/Module/CemeteryReportModuleTest.php b/tests/app/Module/CemeteryReportModuleTest.php
index d6c17ebe0f..51fae08481 100644
--- a/tests/app/Module/CemeteryReportModuleTest.php
+++ b/tests/app/Module/CemeteryReportModuleTest.php
@@ -25,10 +25,11 @@ use Fisharebest\Webtrees\Report\HtmlRenderer;
use Fisharebest\Webtrees\Report\PdfRenderer;
use Fisharebest\Webtrees\Report\ReportParserGenerate;
use Fisharebest\Webtrees\Report\ReportParserSetup;
-use Fisharebest\Webtrees\Services\ModuleService;
use Fisharebest\Webtrees\Services\UserService;
use Fisharebest\Webtrees\TestCase;
+use function ob_get_clean;
+
/**
* Test harness for the class CemeteryReportModule
*/
@@ -71,16 +72,16 @@ class CemeteryReportModuleTest extends TestCase
*/
public function testReportRunsWithoutError(): void
{
- $module_service = new ModuleService();
-
$user = (new UserService())->create('user', 'User', 'user@example.com', 'secret');
$user->setPreference(UserInterface::PREF_IS_ADMINISTRATOR, '1');
Auth::login($user);
$tree = $this->importTree('demo.ged');
- $module = $module_service->findByInterface(CemeteryReportModule::class)->first();
- $xml = 'resources/' . $module->xmlFilename();
- $vars = [
+ $module = new CemeteryReportModule();
+ $module->setName('cemetery_report');
+
+ $xml = 'resources/' . $module->xmlFilename();
+ $vars = [
'deathplace' => ['id' => ''],
'adlist' => ['id' => 'none'],
'sortby' => ['id' => 'NAME'],
diff --git a/tests/app/Module/ChangeReportModuleTest.php b/tests/app/Module/ChangeReportModuleTest.php
index 9335053df4..40f09fdcf7 100644
--- a/tests/app/Module/ChangeReportModuleTest.php
+++ b/tests/app/Module/ChangeReportModuleTest.php
@@ -26,10 +26,11 @@ use Fisharebest\Webtrees\Report\HtmlRenderer;
use Fisharebest\Webtrees\Report\PdfRenderer;
use Fisharebest\Webtrees\Report\ReportParserGenerate;
use Fisharebest\Webtrees\Report\ReportParserSetup;
-use Fisharebest\Webtrees\Services\ModuleService;
use Fisharebest\Webtrees\Services\UserService;
use Fisharebest\Webtrees\TestCase;
+use function ob_get_clean;
+
/**
* Test harness for the class ChangeReportModule
*/
@@ -72,16 +73,16 @@ class ChangeReportModuleTest extends TestCase
*/
public function testReportRunsWithoutError(): void
{
- $module_service = new ModuleService();
-
$user = (new UserService())->create('user', 'User', 'user@example.com', 'secret');
$user->setPreference(UserInterface::PREF_IS_ADMINISTRATOR, '1');
Auth::login($user);
$tree = $this->importTree('demo.ged');
- $module = $module_service->findByInterface(ChangeReportModule::class)->first();
- $xml = 'resources/' . $module->xmlFilename();
- $vars = [
+ $module = new ChangeReportModule();
+ $module->setName('change_report');
+
+ $xml = 'resources/' . $module->xmlFilename();
+ $vars = [
'changeRangeStart' => ['id' => Registry::timestampFactory()->now()->subtractMonths(1)->format('d M Y')],
'changeRangeEnd' => ['id' => Registry::timestampFactory()->now()->format('d M Y')],
'pending' => ['id' => 'yes'],
diff --git a/tests/app/Module/DeathReportModuleTest.php b/tests/app/Module/DeathReportModuleTest.php
index 6578ffe8f6..a36d4148c7 100644
--- a/tests/app/Module/DeathReportModuleTest.php
+++ b/tests/app/Module/DeathReportModuleTest.php
@@ -25,10 +25,11 @@ use Fisharebest\Webtrees\Report\HtmlRenderer;
use Fisharebest\Webtrees\Report\PdfRenderer;
use Fisharebest\Webtrees\Report\ReportParserGenerate;
use Fisharebest\Webtrees\Report\ReportParserSetup;
-use Fisharebest\Webtrees\Services\ModuleService;
use Fisharebest\Webtrees\Services\UserService;
use Fisharebest\Webtrees\TestCase;
+use function ob_get_clean;
+
/**
* Test harness for the class FactSourcesReportModule
*/
@@ -71,16 +72,16 @@ class DeathReportModuleTest extends TestCase
*/
public function testReportRunsWithoutError(): void
{
- $module_service = new ModuleService();
-
$user = (new UserService())->create('user', 'User', 'user@example.com', 'secret');
$user->setPreference(UserInterface::PREF_IS_ADMINISTRATOR, '1');
Auth::login($user);
$tree = $this->importTree('demo.ged');
- $module = $module_service->findByInterface(DeathReportModule::class)->first();
- $xml = 'resources/' . $module->xmlFilename();
- $vars = [
+ $module = new DeathReportModule();
+ $module->setName('death_report');
+
+ $xml = 'resources/' . $module->xmlFilename();
+ $vars = [
'name' => ['id' => ''],
'deathplace' => ['id' => ''],
'deathdate1' => ['id' => ''],
diff --git a/tests/app/Module/DescendancyReportModuleTest.php b/tests/app/Module/DescendancyReportModuleTest.php
index 4c09e16f91..7ae7e0b754 100644
--- a/tests/app/Module/DescendancyReportModuleTest.php
+++ b/tests/app/Module/DescendancyReportModuleTest.php
@@ -25,7 +25,6 @@ use Fisharebest\Webtrees\Report\HtmlRenderer;
use Fisharebest\Webtrees\Report\PdfRenderer;
use Fisharebest\Webtrees\Report\ReportParserGenerate;
use Fisharebest\Webtrees\Report\ReportParserSetup;
-use Fisharebest\Webtrees\Services\ModuleService;
use Fisharebest\Webtrees\Services\UserService;
use Fisharebest\Webtrees\TestCase;
@@ -74,16 +73,16 @@ class DescendancyReportModuleTest extends TestCase
*/
public function testReportRunsWithoutError(): void
{
- $module_service = new ModuleService();
-
$user = (new UserService())->create('user', 'User', 'user@example.com', 'secret');
$user->setPreference(UserInterface::PREF_IS_ADMINISTRATOR, '1');
Auth::login($user);
$tree = $this->importTree('demo.ged');
- $module = $module_service->findByInterface(DescendancyReportModule::class)->first();
- $xml = 'resources/' . $module->xmlFilename();
- $vars = [
+ $module = new DescendancyReportModule();
+ $module->setName('descendancy_report');
+
+ $xml = 'resources/' . $module->xmlFilename();
+ $vars = [
'pid' => ['id' => 'X1030'],
'maxgen' => ['id' => '3'],
'sources' => ['id' => 'on'],
diff --git a/tests/app/Module/FactSourcesReportModuleTest.php b/tests/app/Module/FactSourcesReportModuleTest.php
index 507fabeeed..2035f6fbc9 100644
--- a/tests/app/Module/FactSourcesReportModuleTest.php
+++ b/tests/app/Module/FactSourcesReportModuleTest.php
@@ -25,10 +25,11 @@ use Fisharebest\Webtrees\Report\HtmlRenderer;
use Fisharebest\Webtrees\Report\PdfRenderer;
use Fisharebest\Webtrees\Report\ReportParserGenerate;
use Fisharebest\Webtrees\Report\ReportParserSetup;
-use Fisharebest\Webtrees\Services\ModuleService;
use Fisharebest\Webtrees\Services\UserService;
use Fisharebest\Webtrees\TestCase;
+use function ob_get_clean;
+
/**
* Test harness for the class FactSourcesReportModule
*/
@@ -71,16 +72,16 @@ class FactSourcesReportModuleTest extends TestCase
*/
public function testReportRunsWithoutError(): void
{
- $module_service = new ModuleService();
-
$user = (new UserService())->create('user', 'User', 'user@example.com', 'secret');
$user->setPreference(UserInterface::PREF_IS_ADMINISTRATOR, '1');
Auth::login($user);
$tree = $this->importTree('demo.ged');
- $module = $module_service->findByInterface(FactSourcesReportModule::class)->first();
- $xml = 'resources/' . $module->xmlFilename();
- $vars = [
+ $module = new FactSourcesReportModule();
+ $module->setName('fact_sources');
+
+ $xml = 'resources/' . $module->xmlFilename();
+ $vars = [
'id' => ['id' => 's1'],
'stype' => ['id' => 'facts'],
'sortby' => ['id' => 'BIRT:DATE'],
diff --git a/tests/app/Module/FamilyGroupReportModuleTest.php b/tests/app/Module/FamilyGroupReportModuleTest.php
index 989d7b231f..4e86f36a4d 100644
--- a/tests/app/Module/FamilyGroupReportModuleTest.php
+++ b/tests/app/Module/FamilyGroupReportModuleTest.php
@@ -25,10 +25,11 @@ use Fisharebest\Webtrees\Report\HtmlRenderer;
use Fisharebest\Webtrees\Report\PdfRenderer;
use Fisharebest\Webtrees\Report\ReportParserGenerate;
use Fisharebest\Webtrees\Report\ReportParserSetup;
-use Fisharebest\Webtrees\Services\ModuleService;
use Fisharebest\Webtrees\Services\UserService;
use Fisharebest\Webtrees\TestCase;
+use function ob_get_clean;
+
/**
* Test harness for the class FamilyGroupReportModule
*/
@@ -71,16 +72,16 @@ class FamilyGroupReportModuleTest extends TestCase
*/
public function testReportRunsWithoutError(): void
{
- $module_service = new ModuleService();
-
$user = (new UserService())->create('user', 'User', 'user@example.com', 'secret');
$user->setPreference(UserInterface::PREF_IS_ADMINISTRATOR, '1');
Auth::login($user);
$tree = $this->importTree('demo.ged');
- $module = $module_service->findByInterface(FamilyGroupReportModule::class)->first();
- $xml = 'resources/' . $module->xmlFilename();
- $vars = [
+ $module = new FamilyGroupReportModule();
+ $module->setName('family_group_report');
+
+ $xml = 'resources/' . $module->xmlFilename();
+ $vars = [
'id' => ['id' => 'f1'],
'sources' => ['id' => 'on'],
'notes' => ['id' => 'on'],
diff --git a/tests/app/Module/IndividualFamiliesReportModuleTest.php b/tests/app/Module/IndividualFamiliesReportModuleTest.php
index d2304ad2e8..a1971fa929 100644
--- a/tests/app/Module/IndividualFamiliesReportModuleTest.php
+++ b/tests/app/Module/IndividualFamiliesReportModuleTest.php
@@ -25,7 +25,6 @@ use Fisharebest\Webtrees\Report\HtmlRenderer;
use Fisharebest\Webtrees\Report\PdfRenderer;
use Fisharebest\Webtrees\Report\ReportParserGenerate;
use Fisharebest\Webtrees\Report\ReportParserSetup;
-use Fisharebest\Webtrees\Services\ModuleService;
use Fisharebest\Webtrees\Services\UserService;
use Fisharebest\Webtrees\TestCase;
@@ -74,16 +73,16 @@ class IndividualFamiliesReportModuleTest extends TestCase
*/
public function testReportRunsWithoutError(): void
{
- $module_service = new ModuleService();
-
$user = (new UserService())->create('user', 'User', 'user@example.com', 'secret');
$user->setPreference(UserInterface::PREF_IS_ADMINISTRATOR, '1');
Auth::login($user);
$tree = $this->importTree('demo.ged');
- $module = $module_service->findByInterface(IndividualFamiliesReportModule::class)->first();
- $xml = 'resources/' . $module->xmlFilename();
- $vars = [
+ $module = new IndividualFamiliesReportModule();
+ $module->setName('individual_ext_report');
+
+ $xml = 'resources/' . $module->xmlFilename();
+ $vars = [
'pid' => ['id' => 'X1030'],
'relatives' => ['id' => 'child-families'],
'maxgen' => ['id' => '4'],
diff --git a/tests/app/Module/IndividualReportModuleTest.php b/tests/app/Module/IndividualReportModuleTest.php
index 5c5aa17552..9aa34cf9c2 100644
--- a/tests/app/Module/IndividualReportModuleTest.php
+++ b/tests/app/Module/IndividualReportModuleTest.php
@@ -25,7 +25,6 @@ use Fisharebest\Webtrees\Report\HtmlRenderer;
use Fisharebest\Webtrees\Report\PdfRenderer;
use Fisharebest\Webtrees\Report\ReportParserGenerate;
use Fisharebest\Webtrees\Report\ReportParserSetup;
-use Fisharebest\Webtrees\Services\ModuleService;
use Fisharebest\Webtrees\Services\UserService;
use Fisharebest\Webtrees\TestCase;
@@ -71,16 +70,16 @@ class IndividualReportModuleTest extends TestCase
*/
public function testReportRunsWithoutError(): void
{
- $module_service = new ModuleService();
-
$user = (new UserService())->create('user', 'User', 'user@example.com', 'secret');
$user->setPreference(UserInterface::PREF_IS_ADMINISTRATOR, '1');
Auth::login($user);
$tree = $this->importTree('demo.ged');
- $module = $module_service->findByInterface(IndividualReportModule::class)->first();
- $xml = 'resources/' . $module->xmlFilename();
- $vars = [
+ $module = new IndividualReportModule();
+ $module->setName('individual_report');
+
+ $xml = 'resources/' . $module->xmlFilename();
+ $vars = [
'id' => ['id' => 'X1030'],
'sources' => ['id' => 'on'],
'notes' => ['id' => 'on'],
diff --git a/tests/app/Module/MarriageReportModuleTest.php b/tests/app/Module/MarriageReportModuleTest.php
index b437839711..99fcdcf2bc 100644
--- a/tests/app/Module/MarriageReportModuleTest.php
+++ b/tests/app/Module/MarriageReportModuleTest.php
@@ -25,7 +25,6 @@ use Fisharebest\Webtrees\Report\HtmlRenderer;
use Fisharebest\Webtrees\Report\PdfRenderer;
use Fisharebest\Webtrees\Report\ReportParserGenerate;
use Fisharebest\Webtrees\Report\ReportParserSetup;
-use Fisharebest\Webtrees\Services\ModuleService;
use Fisharebest\Webtrees\Services\UserService;
use Fisharebest\Webtrees\TestCase;
@@ -71,16 +70,16 @@ class MarriageReportModuleTest extends TestCase
*/
public function testReportRunsWithoutError(): void
{
- $module_service = new ModuleService();
-
$user = (new UserService())->create('user', 'User', 'user@example.com', 'secret');
$user->setPreference(UserInterface::PREF_IS_ADMINISTRATOR, '1');
Auth::login($user);
$tree = $this->importTree('demo.ged');
- $module = $module_service->findByInterface(MarriageReportModule::class)->first();
- $xml = 'resources/' . $module->xmlFilename();
- $vars = [
+ $module = new MarriageReportModule();
+ $module->setName('marriage_report');
+
+ $xml = 'resources/' . $module->xmlFilename();
+ $vars = [
'name' => ['id' => ''],
'marrplace' => ['id' => ''],
'marrdate1' => ['id' => ''],
diff --git a/tests/app/Module/MissingFactsReportModuleTest.php b/tests/app/Module/MissingFactsReportModuleTest.php
index 72e0df11a0..e87500a411 100644
--- a/tests/app/Module/MissingFactsReportModuleTest.php
+++ b/tests/app/Module/MissingFactsReportModuleTest.php
@@ -25,7 +25,6 @@ use Fisharebest\Webtrees\Report\HtmlRenderer;
use Fisharebest\Webtrees\Report\PdfRenderer;
use Fisharebest\Webtrees\Report\ReportParserGenerate;
use Fisharebest\Webtrees\Report\ReportParserSetup;
-use Fisharebest\Webtrees\Services\ModuleService;
use Fisharebest\Webtrees\Services\UserService;
use Fisharebest\Webtrees\TestCase;
@@ -71,16 +70,16 @@ class MissingFactsReportModuleTest extends TestCase
*/
public function testReportRunsWithoutError(): void
{
- $module_service = new ModuleService();
-
$user = (new UserService())->create('user', 'User', 'user@example.com', 'secret');
$user->setPreference(UserInterface::PREF_IS_ADMINISTRATOR, '1');
Auth::login($user);
$tree = $this->importTree('demo.ged');
- $module = $module_service->findByInterface(MissingFactsReportModule::class)->first();
- $xml = 'resources/' . $module->xmlFilename();
- $vars = [
+ $module = new MissingFactsReportModule();
+ $module->setName('missing_facts_report');
+
+ $xml = 'resources/' . $module->xmlFilename();
+ $vars = [
'pid' => ['id' => 'X1030'],
'relatives' => ['id' => 'direct-ancestors'],
'maxgen' => ['id' => '*'],
diff --git a/tests/app/Module/OccupationReportModuleTest.php b/tests/app/Module/OccupationReportModuleTest.php
index 1d67d09e71..b54890f74b 100644
--- a/tests/app/Module/OccupationReportModuleTest.php
+++ b/tests/app/Module/OccupationReportModuleTest.php
@@ -25,7 +25,6 @@ use Fisharebest\Webtrees\Report\HtmlRenderer;
use Fisharebest\Webtrees\Report\PdfRenderer;
use Fisharebest\Webtrees\Report\ReportParserGenerate;
use Fisharebest\Webtrees\Report\ReportParserSetup;
-use Fisharebest\Webtrees\Services\ModuleService;
use Fisharebest\Webtrees\Services\UserService;
use Fisharebest\Webtrees\TestCase;
@@ -71,16 +70,16 @@ class OccupationReportModuleTest extends TestCase
*/
public function testReportRunsWithoutError(): void
{
- $module_service = new ModuleService();
-
$user = (new UserService())->create('user', 'User', 'user@example.com', 'secret');
$user->setPreference(UserInterface::PREF_IS_ADMINISTRATOR, '1');
Auth::login($user);
$tree = $this->importTree('demo.ged');
- $module = $module_service->findByInterface(OccupationReportModule::class)->first();
- $xml = 'resources/' . $module->xmlFilename();
- $vars = [
+ $module = new OccupationReportModule();
+ $module->setName('occupation_report');
+
+ $xml = 'resources/' . $module->xmlFilename();
+ $vars = [
'occupation' => ['id' => 'king'],
'pageSize' => ['id' => 'A4'],
'sortby' => ['id' => 'NAME'],
diff --git a/tests/app/Module/PedigreeReportModuleTest.php b/tests/app/Module/PedigreeReportModuleTest.php
index 7f71f25315..8a13124c45 100644
--- a/tests/app/Module/PedigreeReportModuleTest.php
+++ b/tests/app/Module/PedigreeReportModuleTest.php
@@ -25,7 +25,6 @@ use Fisharebest\Webtrees\Report\HtmlRenderer;
use Fisharebest\Webtrees\Report\PdfRenderer;
use Fisharebest\Webtrees\Report\ReportParserGenerate;
use Fisharebest\Webtrees\Report\ReportParserSetup;
-use Fisharebest\Webtrees\Services\ModuleService;
use Fisharebest\Webtrees\Services\UserService;
use Fisharebest\Webtrees\TestCase;
@@ -73,16 +72,16 @@ class PedigreeReportModuleTest extends TestCase
*/
public function testReportRunsWithoutError(): void
{
- $module_service = new ModuleService();
-
$user = (new UserService())->create('user', 'User', 'user@example.com', 'secret');
$user->setPreference(UserInterface::PREF_IS_ADMINISTRATOR, '1');
Auth::login($user);
$tree = $this->importTree('demo.ged');
- $module = $module_service->findByInterface(PedigreeReportModule::class)->first();
- $xml = 'resources/' . $module->xmlFilename();
- $vars = [
+ $module = new PedigreeReportModule();
+ $module->setName('pedigree_report');
+
+ $xml = 'resources/' . $module->xmlFilename();
+ $vars = [
'pid' => ['id' => 'X1030'],
'spouses' => ['id' => 'on'],
'orientation' => ['id' => 'portrait'],
diff --git a/tests/app/Module/RelatedIndividualsReportModuleTest.php b/tests/app/Module/RelatedIndividualsReportModuleTest.php
index 6ef19ba7f2..5aa0298118 100644
--- a/tests/app/Module/RelatedIndividualsReportModuleTest.php
+++ b/tests/app/Module/RelatedIndividualsReportModuleTest.php
@@ -25,7 +25,6 @@ use Fisharebest\Webtrees\Report\HtmlRenderer;
use Fisharebest\Webtrees\Report\PdfRenderer;
use Fisharebest\Webtrees\Report\ReportParserGenerate;
use Fisharebest\Webtrees\Report\ReportParserSetup;
-use Fisharebest\Webtrees\Services\ModuleService;
use Fisharebest\Webtrees\Services\UserService;
use Fisharebest\Webtrees\TestCase;
@@ -71,16 +70,16 @@ class RelatedIndividualsReportModuleTest extends TestCase
*/
public function testReportRunsWithoutError(): void
{
- $module_service = new ModuleService();
-
$user = (new UserService())->create('user', 'User', 'user@example.com', 'secret');
$user->setPreference(UserInterface::PREF_IS_ADMINISTRATOR, '1');
Auth::login($user);
$tree = $this->importTree('demo.ged');
- $module = $module_service->findByInterface(RelatedIndividualsReportModule::class)->first();
- $xml = 'resources/' . $module->xmlFilename();
- $vars = [
+ $module = new RelatedIndividualsReportModule();
+ $module->setName('relative_ext_report');
+
+ $xml = 'resources/' . $module->xmlFilename();
+ $vars = [
'pid' => ['id' => 'X1030'],
'relatives' => ['id' => 'child-family'],
'maxgen' => ['id' => '4'],
diff --git a/tests/views/AbstractViewTest.php b/tests/views/AbstractViewTest.php
index c8ec597932..8ec41f7211 100644
--- a/tests/views/AbstractViewTest.php
+++ b/tests/views/AbstractViewTest.php
@@ -36,7 +36,7 @@ abstract class AbstractViewTest extends TestCase
* Check the view runs without error and generates valid HTML
*
* @param string $view
- * @param array<array<string,array<string,mixed>>> $data
+ * @param array<string,array<int,mixed>> $data
*/
protected function doTestView(string $view, array $data): void
{
@@ -48,9 +48,9 @@ abstract class AbstractViewTest extends TestCase
}
/**
- * @param array<string,array<string,mixed>> $input
+ * @param array<string,array<int,mixed>> $input
*
- * @return array<array<string,array<string,mixed>>>
+ * @return array<int,array<string,mixed>>
*/
private function cartesian(array $input): array
{