diff options
Diffstat (limited to 'tests')
54 files changed, 559 insertions, 559 deletions
diff --git a/tests/app/Census/CensusColumnFullNameTest.php b/tests/app/Census/CensusColumnFullNameTest.php index 4e4d6112d4..eef46e338c 100644 --- a/tests/app/Census/CensusColumnFullNameTest.php +++ b/tests/app/Census/CensusColumnFullNameTest.php @@ -34,11 +34,11 @@ class CensusColumnFullNameTest extends TestCase { public function xxxtestFullName(): void { - $individual = $this->createStub(Individual::class); + $individual = $this->createMock(Individual::class); $individual->method('getAllNames')->willReturn([['full' => 'Joe Bloggs']]); $individual->method('spouseFamilies')->willReturn(new Collection()); - $census = $this->createStub(CensusInterface::class); + $census = $this->createMock(CensusInterface::class); $census->method('censusDate')->willReturn(''); $column = new CensusColumnFullName($census, '', ''); @@ -59,22 +59,22 @@ class CensusColumnFullNameTest extends TestCase $marriage_date = new Date('02 DATE 2019'); - $marriage = $this->createStub(Fact::class); + $marriage = $this->createMock(Fact::class); $marriage->method('date')->willReturn($marriage_date); - $spouse = $this->createStub(Individual::class); + $spouse = $this->createMock(Individual::class); $spouse->method('getAllNames')->willReturn($husband_names); - $family = $this->createStub(Family::class); + $family = $this->createMock(Family::class); $family->method('facts')->willReturn(new Collection([$marriage])); $family->method('getMarriageDate')->willReturn($marriage_date); $family->method('spouse')->willReturn($spouse); - $individual = $this->createStub(Individual::class); + $individual = $this->createMock(Individual::class); $individual->method('getAllNames')->willReturn($wife_names); $individual->method('spouseFamilies')->willReturn(new Collection([$family])); - $census = $this->createStub(CensusInterface::class); + $census = $this->createMock(CensusInterface::class); $census->method('censusDate')->willReturn('01 JAN 2020'); $column = new CensusColumnFullName($census, '', ''); diff --git a/tests/app/Elements/AgeAtEventTest.php b/tests/app/Elements/AgeAtEventTest.php index 1c779ed683..c1e309da84 100644 --- a/tests/app/Elements/AgeAtEventTest.php +++ b/tests/app/Elements/AgeAtEventTest.php @@ -48,7 +48,7 @@ class AgeAtEventTest extends AbstractElementTestCase public function testValue(): void { - $tree = $this->createStub(Tree::class); + $tree = $this->createMock(Tree::class); self::assertSame('child', self::$element->value('cHiLd', $tree)); self::assertSame('infant', self::$element->value('iNfAnT ', $tree)); diff --git a/tests/app/FactTest.php b/tests/app/FactTest.php index a45dbb3a05..fb6ba99d7f 100644 --- a/tests/app/FactTest.php +++ b/tests/app/FactTest.php @@ -29,7 +29,7 @@ class FactTest extends TestCase public function testAttribute(): void { - $individual = $this->createStub(Individual::class); + $individual = $this->createMock(Individual::class); $individual->method('tag')->willReturn('INDI'); $fact = new Fact("1 BIRT\n2 ADDR address", $individual, ''); @@ -44,7 +44,7 @@ class FactTest extends TestCase */ public function testIssue4417(): void { - $individual = $this->createStub(Individual::class); + $individual = $this->createMock(Individual::class); $individual->method('tag')->willReturn('INDI'); $fact = new Fact("1 BIRT\n2 PLACXYZ\n3 CONT place", $individual, ''); diff --git a/tests/app/Factories/MarkdownFactoryTest.php b/tests/app/Factories/MarkdownFactoryTest.php index c42e172863..bfe45add2a 100644 --- a/tests/app/Factories/MarkdownFactoryTest.php +++ b/tests/app/Factories/MarkdownFactoryTest.php @@ -42,7 +42,7 @@ class MarkdownFactoryTest extends TestCase public function testAutoLinkWithTree(): void { $factory = new MarkdownFactory(); - $tree = $this->createStub(Tree::class); + $tree = $this->createMock(Tree::class); static::assertSame( '<p>FOO <a href="https://example.com">https://example.com</a> BAR</p>', @@ -77,7 +77,7 @@ class MarkdownFactoryTest extends TestCase public function testMarkdownWithTree(): void { - $tree = $this->createStub(Tree::class); + $tree = $this->createMock(Tree::class); $factory = new MarkdownFactory(); static::assertSame( diff --git a/tests/app/Http/RequestHandlers/AccountDeleteTest.php b/tests/app/Http/RequestHandlers/AccountDeleteTest.php index 4c342cfc76..b6e49c617d 100644 --- a/tests/app/Http/RequestHandlers/AccountDeleteTest.php +++ b/tests/app/Http/RequestHandlers/AccountDeleteTest.php @@ -30,7 +30,7 @@ class AccountDeleteTest extends TestCase { public function testHandler(): void { - $user_service = $this->createStub(UserService::class); + $user_service = $this->createMock(UserService::class); $request = self::createRequest(); diff --git a/tests/app/Http/RequestHandlers/AccountEditTest.php b/tests/app/Http/RequestHandlers/AccountEditTest.php index c9632f1a16..93f7847a08 100644 --- a/tests/app/Http/RequestHandlers/AccountEditTest.php +++ b/tests/app/Http/RequestHandlers/AccountEditTest.php @@ -35,9 +35,9 @@ class AccountEditTest extends TestCase public function testHandler(): void { - $user = $this->createStub(User::class); - $message_service = $this->createStub(MessageService::class); - $module_service = $this->createStub(ModuleService::class); + $user = $this->createMock(User::class); + $message_service = $this->createMock(MessageService::class); + $module_service = $this->createMock(ModuleService::class); $module_service->method('findByInterface')->willReturn(new Collection([])); diff --git a/tests/app/Http/RequestHandlers/BroadcastPageTest.php b/tests/app/Http/RequestHandlers/BroadcastPageTest.php index bb8d894366..651e164176 100644 --- a/tests/app/Http/RequestHandlers/BroadcastPageTest.php +++ b/tests/app/Http/RequestHandlers/BroadcastPageTest.php @@ -33,7 +33,7 @@ class BroadcastPageTest extends TestCase public function testMissingParameterTo(): void { - $message_service = $this->createStub(MessageService::class); + $message_service = $this->createMock(MessageService::class); $message_service->method('recipientTypes')->willReturn(['foo' => 'FOO']); $request = self::createRequest() @@ -47,7 +47,7 @@ class BroadcastPageTest extends TestCase } public function testHandler(): void { - $message_service = $this->createStub(MessageService::class); + $message_service = $this->createMock(MessageService::class); $message_service->method('recipientTypes')->willReturn(['foo' => 'FOO', 'bar' => 'BAR']); $message_service->method('recipientUsers')->willReturn(new Collection()); diff --git a/tests/app/Http/RequestHandlers/RedirectAncestryPhpTest.php b/tests/app/Http/RequestHandlers/RedirectAncestryPhpTest.php index c2a50d58a1..084f0f9340 100644 --- a/tests/app/Http/RequestHandlers/RedirectAncestryPhpTest.php +++ b/tests/app/Http/RequestHandlers/RedirectAncestryPhpTest.php @@ -40,20 +40,20 @@ class RedirectAncestryPhpTest extends TestCase public function testRedirect(): void { - $tree = $this->createStub(Tree::class); + $tree = $this->createMock(Tree::class); $tree ->method('name') ->willReturn('tree1'); - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') ->willReturn(new Collection(['tree1' => $tree])); - $individual = $this->createStub(Individual::class); + $individual = $this->createMock(Individual::class); - $individual_factory = $this->createStub(IndividualFactory::class); + $individual_factory = $this->createMock(IndividualFactory::class); $individual_factory ->expects(self::once()) ->method('make') @@ -62,13 +62,13 @@ class RedirectAncestryPhpTest extends TestCase Registry::individualFactory($individual_factory); - $module = $this->createStub(AncestorsChartModule::class); + $module = $this->createMock(AncestorsChartModule::class); $module ->expects(self::once()) ->method('chartUrl') ->willReturn('https://www.example.com'); - $module_service = $this->createStub(ModuleService::class); + $module_service = $this->createMock(ModuleService::class); $module_service ->expects(self::once()) ->method('findByInterface') @@ -90,15 +90,15 @@ class RedirectAncestryPhpTest extends TestCase public function testModuleDisabled(): void { - $module_service = $this->createStub(ModuleService::class); + $module_service = $this->createMock(ModuleService::class); $module_service ->expects(self::once())->method('findByInterface') ->with(AncestorsChartModule::class) ->willReturn(new Collection()); - $tree = $this->createStub(Tree::class); + $tree = $this->createMock(Tree::class); - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') @@ -118,16 +118,16 @@ class RedirectAncestryPhpTest extends TestCase public function testNoSuchTree(): void { - $module = $this->createStub(AncestorsChartModule::class); + $module = $this->createMock(AncestorsChartModule::class); - $module_service = $this->createStub(ModuleService::class); + $module_service = $this->createMock(ModuleService::class); $module_service ->expects(self::once()) ->method('findByInterface') ->with(AncestorsChartModule::class) ->willReturn(new Collection([$module])); - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') diff --git a/tests/app/Http/RequestHandlers/RedirectBranchesPhpTest.php b/tests/app/Http/RequestHandlers/RedirectBranchesPhpTest.php index 6975ed3141..521041ea7c 100644 --- a/tests/app/Http/RequestHandlers/RedirectBranchesPhpTest.php +++ b/tests/app/Http/RequestHandlers/RedirectBranchesPhpTest.php @@ -37,20 +37,20 @@ class RedirectBranchesPhpTest extends TestCase public function testRedirect(): void { - $tree = $this->createStub(Tree::class); + $tree = $this->createMock(Tree::class); $tree ->method('name') ->willReturn('tree1'); - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') ->willReturn(new Collection(['tree1' => $tree])); - $module = $this->createStub(BranchesListModule::class); + $module = $this->createMock(BranchesListModule::class); - $module_service = $this->createStub(ModuleService::class); + $module_service = $this->createMock(ModuleService::class); $module_service ->expects(self::once()) ->method('findByInterface') @@ -78,15 +78,15 @@ class RedirectBranchesPhpTest extends TestCase public function testModuleDisabled(): void { - $module_service = $this->createStub(ModuleService::class); + $module_service = $this->createMock(ModuleService::class); $module_service ->expects(self::once())->method('findByInterface') ->with(BranchesListModule::class) ->willReturn(new Collection()); - $tree = $this->createStub(Tree::class); + $tree = $this->createMock(Tree::class); - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') @@ -106,16 +106,16 @@ class RedirectBranchesPhpTest extends TestCase public function testNoSuchTree(): void { - $module = $this->createStub(BranchesListModule::class); + $module = $this->createMock(BranchesListModule::class); - $module_service = $this->createStub(ModuleService::class); + $module_service = $this->createMock(ModuleService::class); $module_service ->expects(self::once()) ->method('findByInterface') ->with(BranchesListModule::class) ->willReturn(new Collection([$module])); - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') diff --git a/tests/app/Http/RequestHandlers/RedirectCalendarPhpTest.php b/tests/app/Http/RequestHandlers/RedirectCalendarPhpTest.php index 77ead0f2b3..0d54371d33 100644 --- a/tests/app/Http/RequestHandlers/RedirectCalendarPhpTest.php +++ b/tests/app/Http/RequestHandlers/RedirectCalendarPhpTest.php @@ -35,12 +35,12 @@ class RedirectCalendarPhpTest extends TestCase public function testRedirect(): void { - $tree = $this->createStub(Tree::class); + $tree = $this->createMock(Tree::class); $tree ->method('name') ->willReturn('tree1'); - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') @@ -67,7 +67,7 @@ class RedirectCalendarPhpTest extends TestCase public function testNoSuchTree(): void { - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') diff --git a/tests/app/Http/RequestHandlers/RedirectCompactPhpTest.php b/tests/app/Http/RequestHandlers/RedirectCompactPhpTest.php index c694caaefa..5988355585 100644 --- a/tests/app/Http/RequestHandlers/RedirectCompactPhpTest.php +++ b/tests/app/Http/RequestHandlers/RedirectCompactPhpTest.php @@ -40,20 +40,20 @@ class RedirectCompactPhpTest extends TestCase public function testRedirect(): void { - $tree = $this->createStub(Tree::class); + $tree = $this->createMock(Tree::class); $tree ->method('name') ->willReturn('tree1'); - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') ->willReturn(new Collection(['tree1' => $tree])); - $individual = $this->createStub(Individual::class); + $individual = $this->createMock(Individual::class); - $individual_factory = $this->createStub(IndividualFactory::class); + $individual_factory = $this->createMock(IndividualFactory::class); $individual_factory ->expects(self::once()) ->method('make') @@ -62,13 +62,13 @@ class RedirectCompactPhpTest extends TestCase Registry::individualFactory($individual_factory); - $module = $this->createStub(CompactTreeChartModule::class); + $module = $this->createMock(CompactTreeChartModule::class); $module ->expects(self::once()) ->method('chartUrl') ->willReturn('https://www.example.com'); - $module_service = $this->createStub(ModuleService::class); + $module_service = $this->createMock(ModuleService::class); $module_service ->expects(self::once()) ->method('findByInterface') @@ -90,15 +90,15 @@ class RedirectCompactPhpTest extends TestCase public function testModuleDisabled(): void { - $module_service = $this->createStub(ModuleService::class); + $module_service = $this->createMock(ModuleService::class); $module_service ->expects(self::once())->method('findByInterface') ->with(CompactTreeChartModule::class) ->willReturn(new Collection()); - $tree = $this->createStub(Tree::class); + $tree = $this->createMock(Tree::class); - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') @@ -118,16 +118,16 @@ class RedirectCompactPhpTest extends TestCase public function testNoSuchTree(): void { - $module = $this->createStub(CompactTreeChartModule::class); + $module = $this->createMock(CompactTreeChartModule::class); - $module_service = $this->createStub(ModuleService::class); + $module_service = $this->createMock(ModuleService::class); $module_service ->expects(self::once()) ->method('findByInterface') ->with(CompactTreeChartModule::class) ->willReturn(new Collection([$module])); - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') diff --git a/tests/app/Http/RequestHandlers/RedirectDescendancyPhpTest.php b/tests/app/Http/RequestHandlers/RedirectDescendancyPhpTest.php index b2acc697f7..ef4a652794 100644 --- a/tests/app/Http/RequestHandlers/RedirectDescendancyPhpTest.php +++ b/tests/app/Http/RequestHandlers/RedirectDescendancyPhpTest.php @@ -40,20 +40,20 @@ class RedirectDescendancyPhpTest extends TestCase public function testRedirect(): void { - $tree = $this->createStub(Tree::class); + $tree = $this->createMock(Tree::class); $tree ->method('name') ->willReturn('tree1'); - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') ->willReturn(new Collection(['tree1' => $tree])); - $individual = $this->createStub(Individual::class); + $individual = $this->createMock(Individual::class); - $individual_factory = $this->createStub(IndividualFactory::class); + $individual_factory = $this->createMock(IndividualFactory::class); $individual_factory ->expects(self::once()) ->method('make') @@ -62,13 +62,13 @@ class RedirectDescendancyPhpTest extends TestCase Registry::individualFactory($individual_factory); - $descendancy_chart = $this->createStub(DescendancyChartModule::class); + $descendancy_chart = $this->createMock(DescendancyChartModule::class); $descendancy_chart ->expects(self::once()) ->method('chartUrl') ->willReturn('https://www.example.com'); - $module_service = $this->createStub(ModuleService::class); + $module_service = $this->createMock(ModuleService::class); $module_service ->expects(self::once()) ->method('findByInterface') @@ -86,15 +86,15 @@ class RedirectDescendancyPhpTest extends TestCase public function testModuleDisabled(): void { - $module_service = $this->createStub(ModuleService::class); + $module_service = $this->createMock(ModuleService::class); $module_service ->expects(self::once())->method('findByInterface') ->with(DescendancyChartModule::class) ->willReturn(new Collection()); - $tree = $this->createStub(Tree::class); + $tree = $this->createMock(Tree::class); - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') @@ -114,16 +114,16 @@ class RedirectDescendancyPhpTest extends TestCase public function testNoSuchTree(): void { - $module = $this->createStub(DescendancyChartModule::class); + $module = $this->createMock(DescendancyChartModule::class); - $module_service = $this->createStub(ModuleService::class); + $module_service = $this->createMock(ModuleService::class); $module_service ->expects(self::once()) ->method('findByInterface') ->with(DescendancyChartModule::class) ->willReturn(new Collection([$module])); - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') diff --git a/tests/app/Http/RequestHandlers/RedirectFamListPhpTest.php b/tests/app/Http/RequestHandlers/RedirectFamListPhpTest.php index 29f21347ba..7344a5f829 100644 --- a/tests/app/Http/RequestHandlers/RedirectFamListPhpTest.php +++ b/tests/app/Http/RequestHandlers/RedirectFamListPhpTest.php @@ -37,24 +37,24 @@ class RedirectFamListPhpTest extends TestCase public function testRedirect(): void { - $tree = $this->createStub(Tree::class); + $tree = $this->createMock(Tree::class); $tree ->method('name') ->willReturn('tree1'); - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') ->willReturn(new Collection(['tree1' => $tree])); - $module = $this->createStub(FamilyListModule::class); + $module = $this->createMock(FamilyListModule::class); $module ->expects(self::once()) ->method('listUrl') ->willReturn('https://www.example.com'); - $module_service = $this->createStub(ModuleService::class); + $module_service = $this->createMock(ModuleService::class); $module_service ->expects(self::once()) ->method('findByInterface') @@ -73,15 +73,15 @@ class RedirectFamListPhpTest extends TestCase public function testModuleDisabled(): void { - $module_service = $this->createStub(ModuleService::class); + $module_service = $this->createMock(ModuleService::class); $module_service ->expects(self::once())->method('findByInterface') ->with(FamilyListModule::class) ->willReturn(new Collection()); - $tree = $this->createStub(Tree::class); + $tree = $this->createMock(Tree::class); - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') @@ -98,16 +98,16 @@ class RedirectFamListPhpTest extends TestCase public function testNoSuchTree(): void { - $module = $this->createStub(FamilyListModule::class); + $module = $this->createMock(FamilyListModule::class); - $module_service = $this->createStub(ModuleService::class); + $module_service = $this->createMock(ModuleService::class); $module_service ->expects(self::once()) ->method('findByInterface') ->with(FamilyListModule::class) ->willReturn(new Collection([$module])); - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') diff --git a/tests/app/Http/RequestHandlers/RedirectFamilyBookPhpTest.php b/tests/app/Http/RequestHandlers/RedirectFamilyBookPhpTest.php index 65dd0f9f87..d53df5b3da 100644 --- a/tests/app/Http/RequestHandlers/RedirectFamilyBookPhpTest.php +++ b/tests/app/Http/RequestHandlers/RedirectFamilyBookPhpTest.php @@ -40,20 +40,20 @@ class RedirectFamilyBookPhpTest extends TestCase public function testRedirect(): void { - $tree = $this->createStub(Tree::class); + $tree = $this->createMock(Tree::class); $tree ->method('name') ->willReturn('tree1'); - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') ->willReturn(new Collection(['tree1' => $tree])); - $individual = $this->createStub(Individual::class); + $individual = $this->createMock(Individual::class); - $individual_factory = $this->createStub(IndividualFactory::class); + $individual_factory = $this->createMock(IndividualFactory::class); $individual_factory ->expects(self::once()) ->method('make') @@ -62,13 +62,13 @@ class RedirectFamilyBookPhpTest extends TestCase Registry::individualFactory($individual_factory); - $Compact_chart = $this->createStub(FamilyBookChartModule::class); + $Compact_chart = $this->createMock(FamilyBookChartModule::class); $Compact_chart ->expects(self::once()) ->method('chartUrl') ->willReturn('https://www.example.com'); - $module_service = $this->createStub(ModuleService::class); + $module_service = $this->createMock(ModuleService::class); $module_service ->expects(self::once()) ->method('findByInterface') @@ -86,15 +86,15 @@ class RedirectFamilyBookPhpTest extends TestCase public function testModuleDisabled(): void { - $module_service = $this->createStub(ModuleService::class); + $module_service = $this->createMock(ModuleService::class); $module_service ->expects(self::once())->method('findByInterface') ->with(FamilyBookChartModule::class) ->willReturn(new Collection()); - $tree = $this->createStub(Tree::class); + $tree = $this->createMock(Tree::class); - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') @@ -113,16 +113,16 @@ class RedirectFamilyBookPhpTest extends TestCase public function testNoSuchTree(): void { - $module = $this->createStub(FamilyBookChartModule::class); + $module = $this->createMock(FamilyBookChartModule::class); - $module_service = $this->createStub(ModuleService::class); + $module_service = $this->createMock(ModuleService::class); $module_service ->expects(self::once()) ->method('findByInterface') ->with(FamilyBookChartModule::class) ->willReturn(new Collection([$module])); - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') diff --git a/tests/app/Http/RequestHandlers/RedirectFamilyPhpTest.php b/tests/app/Http/RequestHandlers/RedirectFamilyPhpTest.php index 0ffa0de758..a45ae0c374 100644 --- a/tests/app/Http/RequestHandlers/RedirectFamilyPhpTest.php +++ b/tests/app/Http/RequestHandlers/RedirectFamilyPhpTest.php @@ -39,23 +39,23 @@ class RedirectFamilyPhpTest extends TestCase public function testRedirect(): void { - $tree = $this->createStub(Tree::class); + $tree = $this->createMock(Tree::class); $tree ->method('name') ->willReturn('tree1'); - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') ->willReturn(new Collection(['tree1' => $tree])); - $family = $this->createStub(Family::class); + $family = $this->createMock(Family::class); $family ->method('url') ->willReturn('https://www.example.com'); - $family_factory = $this->createStub(FamilyFactory::class); + $family_factory = $this->createMock(FamilyFactory::class); $family_factory ->expects(self::once()) ->method('make') @@ -79,9 +79,9 @@ class RedirectFamilyPhpTest extends TestCase public function testNoSuchRecord(): void { - $tree = $this->createStub(Tree::class); + $tree = $this->createMock(Tree::class); - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') @@ -101,7 +101,7 @@ class RedirectFamilyPhpTest extends TestCase public function testMissingXrefParameter(): void { - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $handler = new RedirectFamilyPhp($tree_service); diff --git a/tests/app/Http/RequestHandlers/RedirectFanChartPhpTest.php b/tests/app/Http/RequestHandlers/RedirectFanChartPhpTest.php index d623dac2a2..6cf2de364f 100644 --- a/tests/app/Http/RequestHandlers/RedirectFanChartPhpTest.php +++ b/tests/app/Http/RequestHandlers/RedirectFanChartPhpTest.php @@ -40,20 +40,20 @@ class RedirectFanChartPhpTest extends TestCase public function testRedirect(): void { - $tree = $this->createStub(Tree::class); + $tree = $this->createMock(Tree::class); $tree ->method('name') ->willReturn('tree1'); - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') ->willReturn(new Collection(['tree1' => $tree])); - $individual = $this->createStub(Individual::class); + $individual = $this->createMock(Individual::class); - $individual_factory = $this->createStub(IndividualFactory::class); + $individual_factory = $this->createMock(IndividualFactory::class); $individual_factory ->expects(self::once()) ->method('make') @@ -62,13 +62,13 @@ class RedirectFanChartPhpTest extends TestCase Registry::individualFactory($individual_factory); - $module = $this->createStub(FanChartModule::class); + $module = $this->createMock(FanChartModule::class); $module ->expects(self::once()) ->method('chartUrl') ->willReturn('https://www.example.com'); - $module_service = $this->createStub(ModuleService::class); + $module_service = $this->createMock(ModuleService::class); $module_service ->expects(self::once()) ->method('findByInterface') @@ -90,15 +90,15 @@ class RedirectFanChartPhpTest extends TestCase public function testModuleDisabled(): void { - $module_service = $this->createStub(ModuleService::class); + $module_service = $this->createMock(ModuleService::class); $module_service ->expects(self::once())->method('findByInterface') ->with(FanChartModule::class) ->willReturn(new Collection()); - $tree = $this->createStub(Tree::class); + $tree = $this->createMock(Tree::class); - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') @@ -118,16 +118,16 @@ class RedirectFanChartPhpTest extends TestCase public function testNoSuchTree(): void { - $module = $this->createStub(FanChartModule::class); + $module = $this->createMock(FanChartModule::class); - $module_service = $this->createStub(ModuleService::class); + $module_service = $this->createMock(ModuleService::class); $module_service ->expects(self::once()) ->method('findByInterface') ->with(FanChartModule::class) ->willReturn(new Collection([$module])); - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') diff --git a/tests/app/Http/RequestHandlers/RedirectGedRecordPhpTest.php b/tests/app/Http/RequestHandlers/RedirectGedRecordPhpTest.php index 3958e40640..f96446b85b 100644 --- a/tests/app/Http/RequestHandlers/RedirectGedRecordPhpTest.php +++ b/tests/app/Http/RequestHandlers/RedirectGedRecordPhpTest.php @@ -39,23 +39,23 @@ class RedirectGedRecordPhpTest extends TestCase public function testRedirect(): void { - $tree = $this->createStub(Tree::class); + $tree = $this->createMock(Tree::class); $tree ->method('name') ->willReturn('tree1'); - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') ->willReturn(new Collection(['tree1' => $tree])); - $gedcom_record = $this->createStub(GedcomRecord::class); + $gedcom_record = $this->createMock(GedcomRecord::class); $gedcom_record ->method('url') ->willReturn('https://www.example.com'); - $gedcom_record_factory = $this->createStub(GedcomRecordFactory::class); + $gedcom_record_factory = $this->createMock(GedcomRecordFactory::class); $gedcom_record_factory ->expects(self::once()) ->method('make') @@ -79,9 +79,9 @@ class RedirectGedRecordPhpTest extends TestCase public function testNoSuchRecord(): void { - $tree = $this->createStub(Tree::class); + $tree = $this->createMock(Tree::class); - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') @@ -101,7 +101,7 @@ class RedirectGedRecordPhpTest extends TestCase public function testMissingXrefParameter(): void { - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $handler = new RedirectGedRecordPhp($tree_service); diff --git a/tests/app/Http/RequestHandlers/RedirectHourGlassPhpTest.php b/tests/app/Http/RequestHandlers/RedirectHourGlassPhpTest.php index 9630f915ec..896f1ce824 100644 --- a/tests/app/Http/RequestHandlers/RedirectHourGlassPhpTest.php +++ b/tests/app/Http/RequestHandlers/RedirectHourGlassPhpTest.php @@ -40,20 +40,20 @@ class RedirectHourGlassPhpTest extends TestCase public function testRedirect(): void { - $tree = $this->createStub(Tree::class); + $tree = $this->createMock(Tree::class); $tree ->method('name') ->willReturn('tree1'); - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') ->willReturn(new Collection(['tree1' => $tree])); - $individual = $this->createStub(Individual::class); + $individual = $this->createMock(Individual::class); - $individual_factory = $this->createStub(IndividualFactory::class); + $individual_factory = $this->createMock(IndividualFactory::class); $individual_factory ->expects(self::once()) ->method('make') @@ -62,13 +62,13 @@ class RedirectHourGlassPhpTest extends TestCase Registry::individualFactory($individual_factory); - $module = $this->createStub(HourglassChartModule::class); + $module = $this->createMock(HourglassChartModule::class); $module ->expects(self::once()) ->method('chartUrl') ->willReturn('https://www.example.com'); - $module_service = $this->createStub(ModuleService::class); + $module_service = $this->createMock(ModuleService::class); $module_service ->expects(self::once()) ->method('findByInterface') @@ -90,15 +90,15 @@ class RedirectHourGlassPhpTest extends TestCase public function testModuleDisabled(): void { - $module_service = $this->createStub(ModuleService::class); + $module_service = $this->createMock(ModuleService::class); $module_service ->expects(self::once())->method('findByInterface') ->with(HourglassChartModule::class) ->willReturn(new Collection()); - $tree = $this->createStub(Tree::class); + $tree = $this->createMock(Tree::class); - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') @@ -118,16 +118,16 @@ class RedirectHourGlassPhpTest extends TestCase public function testNoSuchTree(): void { - $module = $this->createStub(HourglassChartModule::class); + $module = $this->createMock(HourglassChartModule::class); - $module_service = $this->createStub(ModuleService::class); + $module_service = $this->createMock(ModuleService::class); $module_service ->expects(self::once()) ->method('findByInterface') ->with(HourglassChartModule::class) ->willReturn(new Collection([$module])); - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') diff --git a/tests/app/Http/RequestHandlers/RedirectIndiListPhpTest.php b/tests/app/Http/RequestHandlers/RedirectIndiListPhpTest.php index 6b3102bdad..db56286e7c 100644 --- a/tests/app/Http/RequestHandlers/RedirectIndiListPhpTest.php +++ b/tests/app/Http/RequestHandlers/RedirectIndiListPhpTest.php @@ -37,24 +37,24 @@ class RedirectIndiListPhpTest extends TestCase public function testRedirect(): void { - $tree = $this->createStub(Tree::class); + $tree = $this->createMock(Tree::class); $tree ->method('name') ->willReturn('tree1'); - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') ->willReturn(new Collection(['tree1' => $tree])); - $module = $this->createStub(IndividualListModule::class); + $module = $this->createMock(IndividualListModule::class); $module ->expects(self::once()) ->method('listUrl') ->willReturn('https://www.example.com'); - $module_service = $this->createStub(ModuleService::class); + $module_service = $this->createMock(ModuleService::class); $module_service ->expects(self::once()) ->method('findByInterface') @@ -73,15 +73,15 @@ class RedirectIndiListPhpTest extends TestCase public function testModuleDisabled(): void { - $module_service = $this->createStub(ModuleService::class); + $module_service = $this->createMock(ModuleService::class); $module_service ->expects(self::once())->method('findByInterface') ->with(IndividualListModule::class) ->willReturn(new Collection()); - $tree = $this->createStub(Tree::class); + $tree = $this->createMock(Tree::class); - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') @@ -98,16 +98,16 @@ class RedirectIndiListPhpTest extends TestCase public function testNoSuchTree(): void { - $module = $this->createStub(IndividualListModule::class); + $module = $this->createMock(IndividualListModule::class); - $module_service = $this->createStub(ModuleService::class); + $module_service = $this->createMock(ModuleService::class); $module_service ->expects(self::once()) ->method('findByInterface') ->with(IndividualListModule::class) ->willReturn(new Collection([$module])); - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') diff --git a/tests/app/Http/RequestHandlers/RedirectIndividualPhpTest.php b/tests/app/Http/RequestHandlers/RedirectIndividualPhpTest.php index 3bb2d78fea..eb205f50a5 100644 --- a/tests/app/Http/RequestHandlers/RedirectIndividualPhpTest.php +++ b/tests/app/Http/RequestHandlers/RedirectIndividualPhpTest.php @@ -39,23 +39,23 @@ class RedirectIndividualPhpTest extends TestCase public function testRedirect(): void { - $tree = $this->createStub(Tree::class); + $tree = $this->createMock(Tree::class); $tree ->method('name') ->willReturn('tree1'); - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') ->willReturn(new Collection(['tree1' => $tree])); - $individual = $this->createStub(Individual::class); + $individual = $this->createMock(Individual::class); $individual ->method('url') ->willReturn('https://www.example.com'); - $individual_factory = $this->createStub(IndividualFactory::class); + $individual_factory = $this->createMock(IndividualFactory::class); $individual_factory ->expects(self::once()) ->method('make') @@ -79,9 +79,9 @@ class RedirectIndividualPhpTest extends TestCase public function testNoSuchRecord(): void { - $tree = $this->createStub(Tree::class); + $tree = $this->createMock(Tree::class); - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') @@ -101,7 +101,7 @@ class RedirectIndividualPhpTest extends TestCase public function testNoSuchTree(): void { - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') @@ -121,7 +121,7 @@ class RedirectIndividualPhpTest extends TestCase public function testMissingXrefParameter(): void { - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $handler = new RedirectFamilyPhp($tree_service); diff --git a/tests/app/Http/RequestHandlers/RedirectLifeSpanPhpTest.php b/tests/app/Http/RequestHandlers/RedirectLifeSpanPhpTest.php index fd330b96d7..a5371e4224 100644 --- a/tests/app/Http/RequestHandlers/RedirectLifeSpanPhpTest.php +++ b/tests/app/Http/RequestHandlers/RedirectLifeSpanPhpTest.php @@ -37,24 +37,24 @@ class RedirectLifeSpanPhpTest extends TestCase public function testRedirect(): void { - $tree = $this->createStub(Tree::class); + $tree = $this->createMock(Tree::class); $tree ->method('name') ->willReturn('tree1'); - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') ->willReturn(new Collection(['tree1' => $tree])); - $module = $this->createStub(LifespansChartModule::class); + $module = $this->createMock(LifespansChartModule::class); $module ->expects(self::once()) ->method('chartUrl') ->willReturn('https://www.example.com'); - $module_service = $this->createStub(ModuleService::class); + $module_service = $this->createMock(ModuleService::class); $module_service ->expects(self::once()) ->method('findByInterface') @@ -76,15 +76,15 @@ class RedirectLifeSpanPhpTest extends TestCase public function testModuleDisabled(): void { - $module_service = $this->createStub(ModuleService::class); + $module_service = $this->createMock(ModuleService::class); $module_service ->expects(self::once())->method('findByInterface') ->with(LifespansChartModule::class) ->willReturn(new Collection()); - $tree = $this->createStub(Tree::class); + $tree = $this->createMock(Tree::class); - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') @@ -104,16 +104,16 @@ class RedirectLifeSpanPhpTest extends TestCase public function testNoSuchTree(): void { - $module = $this->createStub(LifespansChartModule::class); + $module = $this->createMock(LifespansChartModule::class); - $module_service = $this->createStub(ModuleService::class); + $module_service = $this->createMock(ModuleService::class); $module_service ->expects(self::once()) ->method('findByInterface') ->with(LifespansChartModule::class) ->willReturn(new Collection([$module])); - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') diff --git a/tests/app/Http/RequestHandlers/RedirectMediaListPhpTest.php b/tests/app/Http/RequestHandlers/RedirectMediaListPhpTest.php index 2f19e01309..ec6f0b0b34 100644 --- a/tests/app/Http/RequestHandlers/RedirectMediaListPhpTest.php +++ b/tests/app/Http/RequestHandlers/RedirectMediaListPhpTest.php @@ -37,24 +37,24 @@ class RedirectMediaListPhpTest extends TestCase public function testRedirect(): void { - $tree = $this->createStub(Tree::class); + $tree = $this->createMock(Tree::class); $tree ->method('name') ->willReturn('tree1'); - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') ->willReturn(new Collection(['tree1' => $tree])); - $module = $this->createStub(MediaListModule::class); + $module = $this->createMock(MediaListModule::class); $module ->expects(self::once()) ->method('listUrl') ->willReturn('https://www.example.com'); - $module_service = $this->createStub(ModuleService::class); + $module_service = $this->createMock(ModuleService::class); $module_service ->expects(self::once()) ->method('findByInterface') @@ -73,15 +73,15 @@ class RedirectMediaListPhpTest extends TestCase public function testModuleDisabled(): void { - $module_service = $this->createStub(ModuleService::class); + $module_service = $this->createMock(ModuleService::class); $module_service ->expects(self::once())->method('findByInterface') ->with(MediaListModule::class) ->willReturn(new Collection()); - $tree = $this->createStub(Tree::class); + $tree = $this->createMock(Tree::class); - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') @@ -98,16 +98,16 @@ class RedirectMediaListPhpTest extends TestCase public function testNoSuchTree(): void { - $module = $this->createStub(MediaListModule::class); + $module = $this->createMock(MediaListModule::class); - $module_service = $this->createStub(ModuleService::class); + $module_service = $this->createMock(ModuleService::class); $module_service ->expects(self::once()) ->method('findByInterface') ->with(MediaListModule::class) ->willReturn(new Collection([$module])); - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') diff --git a/tests/app/Http/RequestHandlers/RedirectMediaViewerPhpTest.php b/tests/app/Http/RequestHandlers/RedirectMediaViewerPhpTest.php index 976ccca6e4..269e361d66 100644 --- a/tests/app/Http/RequestHandlers/RedirectMediaViewerPhpTest.php +++ b/tests/app/Http/RequestHandlers/RedirectMediaViewerPhpTest.php @@ -39,23 +39,23 @@ class RedirectMediaViewerPhpTest extends TestCase public function testRedirect(): void { - $tree = $this->createStub(Tree::class); + $tree = $this->createMock(Tree::class); $tree ->method('name') ->willReturn('tree1'); - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') ->willReturn(new Collection(['tree1' => $tree])); - $media = $this->createStub(Media::class); + $media = $this->createMock(Media::class); $media ->method('url') ->willReturn('https://www.example.com'); - $media_factory = $this->createStub(MediaFactory::class); + $media_factory = $this->createMock(MediaFactory::class); $media_factory ->expects(self::once()) ->method('make') @@ -79,9 +79,9 @@ class RedirectMediaViewerPhpTest extends TestCase public function testNoSuchRecord(): void { - $tree = $this->createStub(Tree::class); + $tree = $this->createMock(Tree::class); - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') @@ -101,7 +101,7 @@ class RedirectMediaViewerPhpTest extends TestCase public function testNoSuchTree(): void { - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') @@ -121,7 +121,7 @@ class RedirectMediaViewerPhpTest extends TestCase public function testMissingTreeParameter(): void { - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $handler = new RedirectFamilyPhp($tree_service); @@ -134,7 +134,7 @@ class RedirectMediaViewerPhpTest extends TestCase public function testMissingXrefParameter(): void { - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $handler = new RedirectFamilyPhp($tree_service); diff --git a/tests/app/Http/RequestHandlers/RedirectModulePhpTest.php b/tests/app/Http/RequestHandlers/RedirectModulePhpTest.php index 926d8fe7c1..8c324f021a 100644 --- a/tests/app/Http/RequestHandlers/RedirectModulePhpTest.php +++ b/tests/app/Http/RequestHandlers/RedirectModulePhpTest.php @@ -41,20 +41,20 @@ class RedirectModulePhpTest extends TestCase public function testRedirectPedigreeMap(): void { - $tree = $this->createStub(Tree::class); + $tree = $this->createMock(Tree::class); $tree ->method('name') ->willReturn('tree1'); - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') ->willReturn(new Collection(['tree1' => $tree])); - $individual = $this->createStub(Individual::class); + $individual = $this->createMock(Individual::class); - $individual_factory = $this->createStub(IndividualFactory::class); + $individual_factory = $this->createMock(IndividualFactory::class); $individual_factory ->expects(self::once()) ->method('make') @@ -63,13 +63,13 @@ class RedirectModulePhpTest extends TestCase Registry::individualFactory($individual_factory); - $module = $this->createStub(PedigreeMapModule::class); + $module = $this->createMock(PedigreeMapModule::class); $module ->expects(self::once()) ->method('chartUrl') ->willReturn('https://www.example.com'); - $module_service = $this->createStub(ModuleService::class); + $module_service = $this->createMock(ModuleService::class); $module_service ->expects(self::once()) ->method('findByInterface') @@ -91,20 +91,20 @@ class RedirectModulePhpTest extends TestCase public function testRedirectInteractiveTree(): void { - $tree = $this->createStub(Tree::class); + $tree = $this->createMock(Tree::class); $tree ->method('name') ->willReturn('tree1'); - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') ->willReturn(new Collection(['tree1' => $tree])); - $individual = $this->createStub(Individual::class); + $individual = $this->createMock(Individual::class); - $individual_factory = $this->createStub(IndividualFactory::class); + $individual_factory = $this->createMock(IndividualFactory::class); $individual_factory ->expects(self::once()) ->method('make') @@ -113,13 +113,13 @@ class RedirectModulePhpTest extends TestCase Registry::individualFactory($individual_factory); - $module = $this->createStub(InteractiveTreeModule::class); + $module = $this->createMock(InteractiveTreeModule::class); $module ->expects(self::once()) ->method('chartUrl') ->willReturn('https://www.example.com'); - $module_service = $this->createStub(ModuleService::class); + $module_service = $this->createMock(ModuleService::class); $module_service ->expects(self::once()) ->method('findByInterface') @@ -142,8 +142,8 @@ class RedirectModulePhpTest extends TestCase public function testNoSuchTree(): void { - $module_service = $this->createStub(ModuleService::class); - $tree_service = $this->createStub(TreeService::class); + $module_service = $this->createMock(ModuleService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') @@ -163,12 +163,12 @@ class RedirectModulePhpTest extends TestCase public function testNoSuchIndividual(): void { - $tree = $this->createStub(Tree::class); + $tree = $this->createMock(Tree::class); $tree ->method('name') ->willReturn('tree1'); - $individual_factory = $this->createStub(IndividualFactory::class); + $individual_factory = $this->createMock(IndividualFactory::class); $individual_factory ->expects(self::once()) ->method('make') @@ -176,8 +176,8 @@ class RedirectModulePhpTest extends TestCase ->willReturn(null); Registry::individualFactory($individual_factory); - $module_service = $this->createStub(ModuleService::class); - $tree_service = $this->createStub(TreeService::class); + $module_service = $this->createMock(ModuleService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') @@ -197,20 +197,20 @@ class RedirectModulePhpTest extends TestCase public function testPedigreeMapModuleDisabled(): void { - $tree = $this->createStub(Tree::class); + $tree = $this->createMock(Tree::class); $tree ->method('name') ->willReturn('tree1'); - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') ->willReturn(new Collection(['tree1' => $tree])); - $individual = $this->createStub(Individual::class); + $individual = $this->createMock(Individual::class); - $individual_factory = $this->createStub(IndividualFactory::class); + $individual_factory = $this->createMock(IndividualFactory::class); $individual_factory ->expects(self::once()) ->method('make') @@ -219,7 +219,7 @@ class RedirectModulePhpTest extends TestCase Registry::individualFactory($individual_factory); - $module_service = $this->createStub(ModuleService::class); + $module_service = $this->createMock(ModuleService::class); $module_service ->expects(self::once()) ->method('findByInterface') @@ -240,20 +240,20 @@ class RedirectModulePhpTest extends TestCase public function testInteractiveTreeModuleDisabled(): void { - $tree = $this->createStub(Tree::class); + $tree = $this->createMock(Tree::class); $tree ->method('name') ->willReturn('tree1'); - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') ->willReturn(new Collection(['tree1' => $tree])); - $individual = $this->createStub(Individual::class); + $individual = $this->createMock(Individual::class); - $individual_factory = $this->createStub(IndividualFactory::class); + $individual_factory = $this->createMock(IndividualFactory::class); $individual_factory ->expects(self::once()) ->method('make') @@ -262,7 +262,7 @@ class RedirectModulePhpTest extends TestCase Registry::individualFactory($individual_factory); - $module_service = $this->createStub(ModuleService::class); + $module_service = $this->createMock(ModuleService::class); $module_service ->expects(self::once()) ->method('findByInterface') diff --git a/tests/app/Http/RequestHandlers/RedirectNoteListPhpTest.php b/tests/app/Http/RequestHandlers/RedirectNoteListPhpTest.php index 85311c93f6..a550135eb9 100644 --- a/tests/app/Http/RequestHandlers/RedirectNoteListPhpTest.php +++ b/tests/app/Http/RequestHandlers/RedirectNoteListPhpTest.php @@ -37,24 +37,24 @@ class RedirectNoteListPhpTest extends TestCase public function testRedirect(): void { - $tree = $this->createStub(Tree::class); + $tree = $this->createMock(Tree::class); $tree ->method('name') ->willReturn('tree1'); - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') ->willReturn(new Collection(['tree1' => $tree])); - $module = $this->createStub(NoteListModule::class); + $module = $this->createMock(NoteListModule::class); $module ->expects(self::once()) ->method('listUrl') ->willReturn('https://www.example.com'); - $module_service = $this->createStub(ModuleService::class); + $module_service = $this->createMock(ModuleService::class); $module_service ->expects(self::once()) ->method('findByInterface') @@ -73,15 +73,15 @@ class RedirectNoteListPhpTest extends TestCase public function testModuleDisabled(): void { - $module_service = $this->createStub(ModuleService::class); + $module_service = $this->createMock(ModuleService::class); $module_service ->expects(self::once())->method('findByInterface') ->with(NoteListModule::class) ->willReturn(new Collection()); - $tree = $this->createStub(Tree::class); + $tree = $this->createMock(Tree::class); - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') @@ -98,16 +98,16 @@ class RedirectNoteListPhpTest extends TestCase public function testNoSuchTree(): void { - $module = $this->createStub(NoteListModule::class); + $module = $this->createMock(NoteListModule::class); - $module_service = $this->createStub(ModuleService::class); + $module_service = $this->createMock(ModuleService::class); $module_service ->expects(self::once()) ->method('findByInterface') ->with(NoteListModule::class) ->willReturn(new Collection([$module])); - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') diff --git a/tests/app/Http/RequestHandlers/RedirectNotePhpTest.php b/tests/app/Http/RequestHandlers/RedirectNotePhpTest.php index 0a045e5c2d..3e4b3ad582 100644 --- a/tests/app/Http/RequestHandlers/RedirectNotePhpTest.php +++ b/tests/app/Http/RequestHandlers/RedirectNotePhpTest.php @@ -39,23 +39,23 @@ class RedirectNotePhpTest extends TestCase public function testRedirect(): void { - $tree = $this->createStub(Tree::class); + $tree = $this->createMock(Tree::class); $tree ->method('name') ->willReturn('tree1'); - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') ->willReturn(new Collection(['tree1' => $tree])); - $note = $this->createStub(Note::class); + $note = $this->createMock(Note::class); $note ->method('url') ->willReturn('https://www.example.com'); - $note_factory = $this->createStub(NoteFactory::class); + $note_factory = $this->createMock(NoteFactory::class); $note_factory ->expects(self::once()) ->method('make') @@ -79,9 +79,9 @@ class RedirectNotePhpTest extends TestCase public function testNoSuchRecord(): void { - $tree = $this->createStub(Tree::class); + $tree = $this->createMock(Tree::class); - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') @@ -101,7 +101,7 @@ class RedirectNotePhpTest extends TestCase public function testMissingXrefParameter(): void { - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $handler = new RedirectNotePhp($tree_service); diff --git a/tests/app/Http/RequestHandlers/RedirectPedigreePhpTest.php b/tests/app/Http/RequestHandlers/RedirectPedigreePhpTest.php index c2413cfe6e..356fd787cd 100644 --- a/tests/app/Http/RequestHandlers/RedirectPedigreePhpTest.php +++ b/tests/app/Http/RequestHandlers/RedirectPedigreePhpTest.php @@ -40,20 +40,20 @@ class RedirectPedigreePhpTest extends TestCase public function testRedirect(): void { - $tree = $this->createStub(Tree::class); + $tree = $this->createMock(Tree::class); $tree ->method('name') ->willReturn('tree1'); - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') ->willReturn(new Collection(['tree1' => $tree])); - $individual = $this->createStub(Individual::class); + $individual = $this->createMock(Individual::class); - $individual_factory = $this->createStub(IndividualFactory::class); + $individual_factory = $this->createMock(IndividualFactory::class); $individual_factory ->expects(self::once()) ->method('make') @@ -62,13 +62,13 @@ class RedirectPedigreePhpTest extends TestCase Registry::individualFactory($individual_factory); - $module = $this->createStub(PedigreeChartModule::class); + $module = $this->createMock(PedigreeChartModule::class); $module ->expects(self::once()) ->method('chartUrl') ->willReturn('https://www.example.com'); - $module_service = $this->createStub(ModuleService::class); + $module_service = $this->createMock(ModuleService::class); $module_service ->expects(self::once()) ->method('findByInterface') @@ -90,15 +90,15 @@ class RedirectPedigreePhpTest extends TestCase public function testModuleDisabled(): void { - $module_service = $this->createStub(ModuleService::class); + $module_service = $this->createMock(ModuleService::class); $module_service ->expects(self::once())->method('findByInterface') ->with(PedigreeChartModule::class) ->willReturn(new Collection()); - $tree = $this->createStub(Tree::class); + $tree = $this->createMock(Tree::class); - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') @@ -118,16 +118,16 @@ class RedirectPedigreePhpTest extends TestCase public function testNoSuchTree(): void { - $module = $this->createStub(PedigreeChartModule::class); + $module = $this->createMock(PedigreeChartModule::class); - $module_service = $this->createStub(ModuleService::class); + $module_service = $this->createMock(ModuleService::class); $module_service ->expects(self::once()) ->method('findByInterface') ->with(PedigreeChartModule::class) ->willReturn(new Collection([$module])); - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') diff --git a/tests/app/Http/RequestHandlers/RedirectPlaceListPhpTest.php b/tests/app/Http/RequestHandlers/RedirectPlaceListPhpTest.php index 123e1aba18..5afda3237b 100644 --- a/tests/app/Http/RequestHandlers/RedirectPlaceListPhpTest.php +++ b/tests/app/Http/RequestHandlers/RedirectPlaceListPhpTest.php @@ -37,24 +37,24 @@ class RedirectPlaceListPhpTest extends TestCase public function testRedirect(): void { - $tree = $this->createStub(Tree::class); + $tree = $this->createMock(Tree::class); $tree ->method('name') ->willReturn('tree1'); - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') ->willReturn(new Collection(['tree1' => $tree])); - $module = $this->createStub(PlaceHierarchyListModule::class); + $module = $this->createMock(PlaceHierarchyListModule::class); $module ->expects(self::once()) ->method('listUrl') ->willReturn('https://www.example.com'); - $module_service = $this->createStub(ModuleService::class); + $module_service = $this->createMock(ModuleService::class); $module_service ->expects(self::once()) ->method('findByInterface') @@ -73,15 +73,15 @@ class RedirectPlaceListPhpTest extends TestCase public function testModuleDisabled(): void { - $module_service = $this->createStub(ModuleService::class); + $module_service = $this->createMock(ModuleService::class); $module_service ->expects(self::once())->method('findByInterface') ->with(PlaceHierarchyListModule::class) ->willReturn(new Collection()); - $tree = $this->createStub(Tree::class); + $tree = $this->createMock(Tree::class); - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') @@ -98,16 +98,16 @@ class RedirectPlaceListPhpTest extends TestCase public function testNoSuchTree(): void { - $module = $this->createStub(PlaceHierarchyListModule::class); + $module = $this->createMock(PlaceHierarchyListModule::class); - $module_service = $this->createStub(ModuleService::class); + $module_service = $this->createMock(ModuleService::class); $module_service ->expects(self::once()) ->method('findByInterface') ->with(PlaceHierarchyListModule::class) ->willReturn(new Collection([$module])); - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') diff --git a/tests/app/Http/RequestHandlers/RedirectRelationshipPhpTest.php b/tests/app/Http/RequestHandlers/RedirectRelationshipPhpTest.php index aee8966506..d7154afa35 100644 --- a/tests/app/Http/RequestHandlers/RedirectRelationshipPhpTest.php +++ b/tests/app/Http/RequestHandlers/RedirectRelationshipPhpTest.php @@ -40,20 +40,20 @@ class RedirectRelationshipPhpTest extends TestCase public function testRedirect(): void { - $tree = $this->createStub(Tree::class); + $tree = $this->createMock(Tree::class); $tree ->method('name') ->willReturn('tree1'); - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') ->willReturn(new Collection(['tree1' => $tree])); - $individual = $this->createStub(Individual::class); + $individual = $this->createMock(Individual::class); - $individual_factory = $this->createStub(IndividualFactory::class); + $individual_factory = $this->createMock(IndividualFactory::class); $individual_factory ->expects(self::once()) ->method('make') @@ -62,13 +62,13 @@ class RedirectRelationshipPhpTest extends TestCase Registry::individualFactory($individual_factory); - $module = $this->createStub(RelationshipsChartModule::class); + $module = $this->createMock(RelationshipsChartModule::class); $module ->expects(self::once()) ->method('chartUrl') ->willReturn('https://www.example.com'); - $module_service = $this->createStub(ModuleService::class); + $module_service = $this->createMock(ModuleService::class); $module_service ->expects(self::once()) ->method('findByInterface') @@ -90,15 +90,15 @@ class RedirectRelationshipPhpTest extends TestCase public function testModuleDisabled(): void { - $module_service = $this->createStub(ModuleService::class); + $module_service = $this->createMock(ModuleService::class); $module_service ->expects(self::once())->method('findByInterface') ->with(RelationshipsChartModule::class) ->willReturn(new Collection()); - $tree = $this->createStub(Tree::class); + $tree = $this->createMock(Tree::class); - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') @@ -118,16 +118,16 @@ class RedirectRelationshipPhpTest extends TestCase public function testNoSuchTree(): void { - $module = $this->createStub(RelationshipsChartModule::class); + $module = $this->createMock(RelationshipsChartModule::class); - $module_service = $this->createStub(ModuleService::class); + $module_service = $this->createMock(ModuleService::class); $module_service ->expects(self::once()) ->method('findByInterface') ->with(RelationshipsChartModule::class) ->willReturn(new Collection([$module])); - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') diff --git a/tests/app/Http/RequestHandlers/RedirectRepoListPhpTest.php b/tests/app/Http/RequestHandlers/RedirectRepoListPhpTest.php index e9a4ecbbe5..10a7c52e44 100644 --- a/tests/app/Http/RequestHandlers/RedirectRepoListPhpTest.php +++ b/tests/app/Http/RequestHandlers/RedirectRepoListPhpTest.php @@ -37,24 +37,24 @@ class RedirectRepoListPhpTest extends TestCase public function testRedirect(): void { - $tree = $this->createStub(Tree::class); + $tree = $this->createMock(Tree::class); $tree ->method('name') ->willReturn('tree1'); - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') ->willReturn(new Collection(['tree1' => $tree])); - $module = $this->createStub(RepositoryListModule::class); + $module = $this->createMock(RepositoryListModule::class); $module ->expects(self::once()) ->method('listUrl') ->willReturn('https://www.example.com'); - $module_service = $this->createStub(ModuleService::class); + $module_service = $this->createMock(ModuleService::class); $module_service ->expects(self::once()) ->method('findByInterface') @@ -73,15 +73,15 @@ class RedirectRepoListPhpTest extends TestCase public function testModuleDisabled(): void { - $module_service = $this->createStub(ModuleService::class); + $module_service = $this->createMock(ModuleService::class); $module_service ->expects(self::once())->method('findByInterface') ->with(RepositoryListModule::class) ->willReturn(new Collection()); - $tree = $this->createStub(Tree::class); + $tree = $this->createMock(Tree::class); - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') @@ -98,16 +98,16 @@ class RedirectRepoListPhpTest extends TestCase public function testNoSuchTree(): void { - $module = $this->createStub(RepositoryListModule::class); + $module = $this->createMock(RepositoryListModule::class); - $module_service = $this->createStub(ModuleService::class); + $module_service = $this->createMock(ModuleService::class); $module_service ->expects(self::once()) ->method('findByInterface') ->with(RepositoryListModule::class) ->willReturn(new Collection([$module])); - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') diff --git a/tests/app/Http/RequestHandlers/RedirectReportEnginePhpTest.php b/tests/app/Http/RequestHandlers/RedirectReportEnginePhpTest.php index 137df75569..399c9b4f4b 100644 --- a/tests/app/Http/RequestHandlers/RedirectReportEnginePhpTest.php +++ b/tests/app/Http/RequestHandlers/RedirectReportEnginePhpTest.php @@ -35,12 +35,12 @@ class RedirectReportEnginePhpTest extends TestCase public function testRedirect(): void { - $tree = $this->createStub(Tree::class); + $tree = $this->createMock(Tree::class); $tree ->method('name') ->willReturn('tree1'); - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') @@ -67,7 +67,7 @@ class RedirectReportEnginePhpTest extends TestCase public function testNoSuchTree(): void { - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') diff --git a/tests/app/Http/RequestHandlers/RedirectRepositoryPhpTest.php b/tests/app/Http/RequestHandlers/RedirectRepositoryPhpTest.php index 425aa5ae12..bfd2450663 100644 --- a/tests/app/Http/RequestHandlers/RedirectRepositoryPhpTest.php +++ b/tests/app/Http/RequestHandlers/RedirectRepositoryPhpTest.php @@ -39,23 +39,23 @@ class RedirectRepositoryPhpTest extends TestCase public function testRedirect(): void { - $tree = $this->createStub(Tree::class); + $tree = $this->createMock(Tree::class); $tree ->method('name') ->willReturn('tree1'); - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') ->willReturn(new Collection(['tree1' => $tree])); - $repository = $this->createStub(Repository::class); + $repository = $this->createMock(Repository::class); $repository ->method('url') ->willReturn('https://www.example.com'); - $repository_factory = $this->createStub(RepositoryFactory::class); + $repository_factory = $this->createMock(RepositoryFactory::class); $repository_factory ->expects(self::once()) ->method('make') @@ -79,9 +79,9 @@ class RedirectRepositoryPhpTest extends TestCase public function testNoSuchRecord(): void { - $tree = $this->createStub(Tree::class); + $tree = $this->createMock(Tree::class); - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') @@ -101,7 +101,7 @@ class RedirectRepositoryPhpTest extends TestCase public function testMissingXrefParameter(): void { - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $handler = new RedirectRepositoryPhp($tree_service); diff --git a/tests/app/Http/RequestHandlers/RedirectSourceListPhpTest.php b/tests/app/Http/RequestHandlers/RedirectSourceListPhpTest.php index a9cfae9f6c..5bcc1de965 100644 --- a/tests/app/Http/RequestHandlers/RedirectSourceListPhpTest.php +++ b/tests/app/Http/RequestHandlers/RedirectSourceListPhpTest.php @@ -37,24 +37,24 @@ class RedirectSourceListPhpTest extends TestCase public function testRedirect(): void { - $tree = $this->createStub(Tree::class); + $tree = $this->createMock(Tree::class); $tree ->method('name') ->willReturn('tree1'); - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') ->willReturn(new Collection(['tree1' => $tree])); - $module = $this->createStub(SourceListModule::class); + $module = $this->createMock(SourceListModule::class); $module ->expects(self::once()) ->method('listUrl') ->willReturn('https://www.example.com'); - $module_service = $this->createStub(ModuleService::class); + $module_service = $this->createMock(ModuleService::class); $module_service ->expects(self::once()) ->method('findByInterface') @@ -73,15 +73,15 @@ class RedirectSourceListPhpTest extends TestCase public function testModuleDisabled(): void { - $module_service = $this->createStub(ModuleService::class); + $module_service = $this->createMock(ModuleService::class); $module_service ->expects(self::once())->method('findByInterface') ->with(SourceListModule::class) ->willReturn(new Collection()); - $tree = $this->createStub(Tree::class); + $tree = $this->createMock(Tree::class); - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') @@ -98,16 +98,16 @@ class RedirectSourceListPhpTest extends TestCase public function testNoSuchTree(): void { - $module = $this->createStub(SourceListModule::class); + $module = $this->createMock(SourceListModule::class); - $module_service = $this->createStub(ModuleService::class); + $module_service = $this->createMock(ModuleService::class); $module_service ->expects(self::once()) ->method('findByInterface') ->with(SourceListModule::class) ->willReturn(new Collection([$module])); - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') diff --git a/tests/app/Http/RequestHandlers/RedirectSourcePhpTest.php b/tests/app/Http/RequestHandlers/RedirectSourcePhpTest.php index d6c40d1325..4dc2b8c94f 100644 --- a/tests/app/Http/RequestHandlers/RedirectSourcePhpTest.php +++ b/tests/app/Http/RequestHandlers/RedirectSourcePhpTest.php @@ -39,23 +39,23 @@ class RedirectSourcePhpTest extends TestCase public function testRedirect(): void { - $tree = $this->createStub(Tree::class); + $tree = $this->createMock(Tree::class); $tree ->method('name') ->willReturn('tree1'); - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') ->willReturn(new Collection(['tree1' => $tree])); - $source = $this->createStub(Source::class); + $source = $this->createMock(Source::class); $source ->method('url') ->willReturn('https://www.example.com'); - $source_factory = $this->createStub(SourceFactory::class); + $source_factory = $this->createMock(SourceFactory::class); $source_factory ->expects(self::once()) ->method('make') @@ -79,9 +79,9 @@ class RedirectSourcePhpTest extends TestCase public function testNoSuchRecord(): void { - $tree = $this->createStub(Tree::class); + $tree = $this->createMock(Tree::class); - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') @@ -101,7 +101,7 @@ class RedirectSourcePhpTest extends TestCase public function testMissingXrefParameter(): void { - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $handler = new RedirectSourcePhp($tree_service); diff --git a/tests/app/Http/RequestHandlers/RedirectStatisticsPhpTest.php b/tests/app/Http/RequestHandlers/RedirectStatisticsPhpTest.php index 796fd56d70..14aa742f00 100644 --- a/tests/app/Http/RequestHandlers/RedirectStatisticsPhpTest.php +++ b/tests/app/Http/RequestHandlers/RedirectStatisticsPhpTest.php @@ -37,24 +37,24 @@ class RedirectStatisticsPhpTest extends TestCase public function testRedirect(): void { - $tree = $this->createStub(Tree::class); + $tree = $this->createMock(Tree::class); $tree ->method('name') ->willReturn('tree1'); - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') ->willReturn(new Collection(['tree1' => $tree])); - $module = $this->createStub(StatisticsChartModule::class); + $module = $this->createMock(StatisticsChartModule::class); $module ->expects(self::once()) ->method('chartUrl') ->willReturn('https://www.example.com'); - $module_service = $this->createStub(ModuleService::class); + $module_service = $this->createMock(ModuleService::class); $module_service ->expects(self::once()) ->method('findByInterface') @@ -73,15 +73,15 @@ class RedirectStatisticsPhpTest extends TestCase public function testModuleDisabled(): void { - $module_service = $this->createStub(ModuleService::class); + $module_service = $this->createMock(ModuleService::class); $module_service ->expects(self::once())->method('findByInterface') ->with(StatisticsChartModule::class) ->willReturn(new Collection()); - $tree = $this->createStub(Tree::class); + $tree = $this->createMock(Tree::class); - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') @@ -98,16 +98,16 @@ class RedirectStatisticsPhpTest extends TestCase public function testNoSuchTree(): void { - $module = $this->createStub(StatisticsChartModule::class); + $module = $this->createMock(StatisticsChartModule::class); - $module_service = $this->createStub(ModuleService::class); + $module_service = $this->createMock(ModuleService::class); $module_service ->expects(self::once()) ->method('findByInterface') ->with(StatisticsChartModule::class) ->willReturn(new Collection([$module])); - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') diff --git a/tests/app/Http/RequestHandlers/RedirectTimeLinePhpTest.php b/tests/app/Http/RequestHandlers/RedirectTimeLinePhpTest.php index 96b23fc664..ee3440622b 100644 --- a/tests/app/Http/RequestHandlers/RedirectTimeLinePhpTest.php +++ b/tests/app/Http/RequestHandlers/RedirectTimeLinePhpTest.php @@ -40,20 +40,20 @@ class RedirectTimeLinePhpTest extends TestCase public function testRedirect(): void { - $tree = $this->createStub(Tree::class); + $tree = $this->createMock(Tree::class); $tree ->method('name') ->willReturn('tree1'); - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') ->willReturn(new Collection(['tree1' => $tree])); - $individual = $this->createStub(Individual::class); + $individual = $this->createMock(Individual::class); - $individual_factory = $this->createStub(IndividualFactory::class); + $individual_factory = $this->createMock(IndividualFactory::class); $individual_factory ->expects(self::once()) ->method('make') @@ -62,13 +62,13 @@ class RedirectTimeLinePhpTest extends TestCase Registry::individualFactory($individual_factory); - $module = $this->createStub(TimelineChartModule::class); + $module = $this->createMock(TimelineChartModule::class); $module ->expects(self::once()) ->method('chartUrl') ->willReturn('https://www.example.com'); - $module_service = $this->createStub(ModuleService::class); + $module_service = $this->createMock(ModuleService::class); $module_service ->expects(self::once()) ->method('findByInterface') @@ -90,15 +90,15 @@ class RedirectTimeLinePhpTest extends TestCase public function testModuleDisabled(): void { - $module_service = $this->createStub(ModuleService::class); + $module_service = $this->createMock(ModuleService::class); $module_service ->expects(self::once())->method('findByInterface') ->with(TimelineChartModule::class) ->willReturn(new Collection()); - $tree = $this->createStub(Tree::class); + $tree = $this->createMock(Tree::class); - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') @@ -118,16 +118,16 @@ class RedirectTimeLinePhpTest extends TestCase public function testNoSuchTree(): void { - $module = $this->createStub(TimelineChartModule::class); + $module = $this->createMock(TimelineChartModule::class); - $module_service = $this->createStub(ModuleService::class); + $module_service = $this->createMock(ModuleService::class); $module_service ->expects(self::once()) ->method('findByInterface') ->with(TimelineChartModule::class) ->willReturn(new Collection([$module])); - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service ->expects(self::once()) ->method('all') diff --git a/tests/app/Http/RequestHandlers/SiteLogsDataTest.php b/tests/app/Http/RequestHandlers/SiteLogsDataTest.php index bd99b3f317..dae01c17f5 100644 --- a/tests/app/Http/RequestHandlers/SiteLogsDataTest.php +++ b/tests/app/Http/RequestHandlers/SiteLogsDataTest.php @@ -38,15 +38,15 @@ class SiteLogsDataTest extends TestCase ['tree' => 'a', 'from' => 'b', 'to' => 'c', 'type' => 'd', 'text' => 'e', 'ip' => 'f', 'username' => 'g'] ); - $query = $this->createStub(Builder::class); + $query = $this->createMock(Builder::class); - $site_logs_service = $this->createStub(SiteLogsService::class); + $site_logs_service = $this->createMock(SiteLogsService::class); $site_logs_service->method('logsQuery')->willReturn($query); - $response = $this->createStub(ResponseInterface::class); + $response = $this->createMock(ResponseInterface::class); $response->method('getStatusCode')->willReturn(StatusCodeInterface::STATUS_OK); - $data_tables_service = $this->createStub(DatatablesService::class); + $data_tables_service = $this->createMock(DatatablesService::class); $data_tables_service->method('handleQuery')->willReturn($response); $handler = new SiteLogsData($data_tables_service, $site_logs_service); diff --git a/tests/app/Http/RequestHandlers/SiteLogsDeleteTest.php b/tests/app/Http/RequestHandlers/SiteLogsDeleteTest.php index 49a331ad47..29b7403113 100644 --- a/tests/app/Http/RequestHandlers/SiteLogsDeleteTest.php +++ b/tests/app/Http/RequestHandlers/SiteLogsDeleteTest.php @@ -32,10 +32,10 @@ class SiteLogsDeleteTest extends TestCase { $request = self::createRequest(); - $query = $this->createStub(Builder::class); + $query = $this->createMock(Builder::class); $query->method('delete'); - $site_logs_service = $this->createStub(SiteLogsService::class); + $site_logs_service = $this->createMock(SiteLogsService::class); $site_logs_service->method('logsQuery')->willReturn($query); $handler = new SiteLogsDelete($site_logs_service); diff --git a/tests/app/Http/RequestHandlers/SiteLogsDownloadTest.php b/tests/app/Http/RequestHandlers/SiteLogsDownloadTest.php index d33d76892c..e167bfa344 100644 --- a/tests/app/Http/RequestHandlers/SiteLogsDownloadTest.php +++ b/tests/app/Http/RequestHandlers/SiteLogsDownloadTest.php @@ -33,16 +33,16 @@ class SiteLogsDownloadTest extends TestCase { $request = self::createRequest(); - $query1 = $this->createStub(Builder::class); - $query2 = $this->createStub(Builder::class); - $rows1 = $this->createStub(Collection::class); - $rows2 = $this->createStub(Collection::class); + $query1 = $this->createMock(Builder::class); + $query2 = $this->createMock(Builder::class); + $rows1 = $this->createMock(Collection::class); + $rows2 = $this->createMock(Collection::class); $query1->method('orderBy')->willReturn($query2); $query2->method('get')->willReturn($rows1); $rows1->method('map')->willReturn($rows2); $rows2->method('implode')->willReturn('foo,bar'); - $site_logs_service = $this->createStub(SiteLogsService::class); + $site_logs_service = $this->createMock(SiteLogsService::class); $site_logs_service->method('logsQuery')->willReturn($query1); $handler = new SiteLogsDownload($site_logs_service); diff --git a/tests/app/Http/RequestHandlers/SiteLogsPageTest.php b/tests/app/Http/RequestHandlers/SiteLogsPageTest.php index 79d040612f..62c2974c41 100644 --- a/tests/app/Http/RequestHandlers/SiteLogsPageTest.php +++ b/tests/app/Http/RequestHandlers/SiteLogsPageTest.php @@ -35,10 +35,10 @@ class SiteLogsPageTest extends TestCase { $request = self::createRequest(); - $tree_service = $this->createStub(TreeService::class); + $tree_service = $this->createMock(TreeService::class); $tree_service->method('all')->willReturn(new Collection()); - $user_service = $this->createStub(UserService::class); + $user_service = $this->createMock(UserService::class); $user_service->method('all')->willReturn(new Collection()); $handler = new SiteLogsPage($tree_service, $user_service); diff --git a/tests/app/Module/UpcomingAnniversariesModuleTest.php b/tests/app/Module/UpcomingAnniversariesModuleTest.php index c7f495933a..ba35df3925 100644 --- a/tests/app/Module/UpcomingAnniversariesModuleTest.php +++ b/tests/app/Module/UpcomingAnniversariesModuleTest.php @@ -29,7 +29,7 @@ class UpcomingAnniversariesModuleTest extends TestCase { public function testModuleProperties(): void { - $calendar_service = $this->createStub(CalendarService::class); + $calendar_service = $this->createMock(CalendarService::class); $module = new UpcomingAnniversariesModule($calendar_service); diff --git a/tests/app/NoteTest.php b/tests/app/NoteTest.php index e66c325ce1..7c9d8d5aef 100644 --- a/tests/app/NoteTest.php +++ b/tests/app/NoteTest.php @@ -37,7 +37,7 @@ class NoteTest extends TestCase public function testNoteName(): void { - $tree = $this->createStub(Tree::class); + $tree = $this->createMock(Tree::class); $note = new Note('X123', "0 @X123@ NOTE 1\n1 CONT\n1 CONT 2\n1 CONT 3\n1 CONT 4", null, $tree); self::assertSame('<bdi>1</bdi>', $note->fullName()); @@ -45,7 +45,7 @@ class NoteTest extends TestCase public function testNoteNameWithHtmlEntities(): void { - $tree = $this->createStub(Tree::class); + $tree = $this->createMock(Tree::class); $text = '"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt." "a quote"'; $note = new Note('X123', '0 @X123@ NOTE ' . $text, null, $tree); diff --git a/tests/app/Services/TimeoutServiceTest.php b/tests/app/Services/TimeoutServiceTest.php index 9936e09ee4..d8bfd6b2e3 100644 --- a/tests/app/Services/TimeoutServiceTest.php +++ b/tests/app/Services/TimeoutServiceTest.php @@ -49,7 +49,7 @@ class TimeoutServiceTest extends TestCase { parent::setUp(); - self::$mock_functions = $this->getMockForAbstractClass(MockGlobalFunctions::class); + self::$mock_functions = $this->createMock(MockGlobalFunctions::class); } protected function tearDown(): void diff --git a/tests/app/SurnameTradition/DefaultSurnameTraditionTest.php b/tests/app/SurnameTradition/DefaultSurnameTraditionTest.php index 1915c076f4..7ccf2e1189 100644 --- a/tests/app/SurnameTradition/DefaultSurnameTraditionTest.php +++ b/tests/app/SurnameTradition/DefaultSurnameTraditionTest.php @@ -44,16 +44,16 @@ class DefaultSurnameTraditionTest extends TestCase */ public function testNewChildNames(): void { - $father_fact = $this->createStub(Fact::class); + $father_fact = $this->createMock(Fact::class); $father_fact->method('value')->willReturn('Chris /White/'); - $father = $this->createStub(Individual::class); + $father = $this->createMock(Individual::class); $father->method('facts')->willReturn(new Collection([$father])); - $mother_fact = $this->createStub(Fact::class); + $mother_fact = $this->createMock(Fact::class); $mother_fact->method('value')->willReturn('Chris /White/'); - $mother = $this->createStub(Individual::class); + $mother = $this->createMock(Individual::class); $mother->method('facts')->willReturn(new Collection([$mother_fact])); self::assertSame( @@ -77,10 +77,10 @@ class DefaultSurnameTraditionTest extends TestCase */ public function testNewParentNames(): void { - $fact = $this->createStub(Fact::class); + $fact = $this->createMock(Fact::class); $fact->method('value')->willReturn('Chris /White/'); - $individual = $this->createStub(Individual::class); + $individual = $this->createMock(Individual::class); $individual->method('facts')->willReturn(new Collection([$fact])); self::assertSame( @@ -104,10 +104,10 @@ class DefaultSurnameTraditionTest extends TestCase */ public function testNewSpouseNames(): void { - $fact = $this->createStub(Fact::class); + $fact = $this->createMock(Fact::class); $fact->method('value')->willReturn('Chris /White/'); - $individual = $this->createStub(Individual::class); + $individual = $this->createMock(Individual::class); $individual->method('facts')->willReturn(new Collection([$fact])); self::assertSame( diff --git a/tests/app/SurnameTradition/IcelandicSurnameTraditionTest.php b/tests/app/SurnameTradition/IcelandicSurnameTraditionTest.php index 9758db5186..c82ec8306b 100644 --- a/tests/app/SurnameTradition/IcelandicSurnameTraditionTest.php +++ b/tests/app/SurnameTradition/IcelandicSurnameTraditionTest.php @@ -44,16 +44,16 @@ class IcelandicSurnameTraditionTest extends TestCase */ public function testNewSonNames(): void { - $father_fact = $this->createStub(Fact::class); + $father_fact = $this->createMock(Fact::class); $father_fact->method('value')->willReturn('Jon Einarsson'); - $father = $this->createStub(Individual::class); + $father = $this->createMock(Individual::class); $father->method('facts')->willReturn(new Collection([$father_fact])); - $mother_fact = $this->createStub(Fact::class); + $mother_fact = $this->createMock(Fact::class); $mother_fact->method('value')->willReturn('Eva Stefansdottir'); - $mother = $this->createStub(Individual::class); + $mother = $this->createMock(Individual::class); $mother->method('facts')->willReturn(new Collection([$mother_fact])); self::assertSame( @@ -67,16 +67,16 @@ class IcelandicSurnameTraditionTest extends TestCase */ public function testNewDaughterNames(): void { - $father_fact = $this->createStub(Fact::class); + $father_fact = $this->createMock(Fact::class); $father_fact->method('value')->willReturn('Jon Einarsson'); - $father = $this->createStub(Individual::class); + $father = $this->createMock(Individual::class); $father->method('facts')->willReturn(new Collection([$father_fact])); - $mother_fact = $this->createStub(Fact::class); + $mother_fact = $this->createMock(Fact::class); $mother_fact->method('value')->willReturn('Eva Stefansdottir'); - $mother = $this->createStub(Individual::class); + $mother = $this->createMock(Individual::class); $mother->method('facts')->willReturn(new Collection([$mother_fact])); self::assertSame( @@ -90,16 +90,16 @@ class IcelandicSurnameTraditionTest extends TestCase */ public function testNewChildNames(): void { - $father_fact = $this->createStub(Fact::class); + $father_fact = $this->createMock(Fact::class); $father_fact->method('value')->willReturn('Jon Einarsson'); - $father = $this->createStub(Individual::class); + $father = $this->createMock(Individual::class); $father->method('facts')->willReturn(new Collection([$father_fact])); - $mother_fact = $this->createStub(Fact::class); + $mother_fact = $this->createMock(Fact::class); $mother_fact->method('value')->willReturn('Eva Stefansdottir'); - $mother = $this->createStub(Individual::class); + $mother = $this->createMock(Individual::class); $mother->method('facts')->willReturn(new Collection([$mother_fact])); self::assertSame( @@ -113,10 +113,10 @@ class IcelandicSurnameTraditionTest extends TestCase */ public function testNewFatherNames(): void { - $fact = $this->createStub(Fact::class); + $fact = $this->createMock(Fact::class); $fact->method('value')->willReturn('Jon Einarsson'); - $individual = $this->createStub(Individual::class); + $individual = $this->createMock(Individual::class); $individual->method('facts')->willReturn(new Collection([$fact])); self::assertSame( @@ -130,10 +130,10 @@ class IcelandicSurnameTraditionTest extends TestCase */ public function testNewMotherNames(): void { - $fact = $this->createStub(Fact::class); + $fact = $this->createMock(Fact::class); $fact->method('value')->willReturn('Jon Evasdottir'); - $individual = $this->createStub(Individual::class); + $individual = $this->createMock(Individual::class); $individual->method('facts')->willReturn(new Collection([$fact])); self::assertSame( @@ -147,10 +147,10 @@ class IcelandicSurnameTraditionTest extends TestCase */ public function testNewParentNames(): void { - $fact = $this->createStub(Fact::class); + $fact = $this->createMock(Fact::class); $fact->method('value')->willReturn('Jon Einarsson'); - $individual = $this->createStub(Individual::class); + $individual = $this->createMock(Individual::class); $individual->method('facts')->willReturn(new Collection([$fact])); self::assertSame( @@ -164,10 +164,10 @@ class IcelandicSurnameTraditionTest extends TestCase */ public function testNewSpouseNames(): void { - $fact = $this->createStub(Fact::class); + $fact = $this->createMock(Fact::class); $fact->method('value')->willReturn('Jon Einarsson'); - $individual = $this->createStub(Individual::class); + $individual = $this->createMock(Individual::class); $individual->method('facts')->willReturn(new Collection([$fact])); self::assertSame( diff --git a/tests/app/SurnameTradition/LithuanianSurnameTraditionTest.php b/tests/app/SurnameTradition/LithuanianSurnameTraditionTest.php index 42e57ce19f..2ceae7cca9 100644 --- a/tests/app/SurnameTradition/LithuanianSurnameTraditionTest.php +++ b/tests/app/SurnameTradition/LithuanianSurnameTraditionTest.php @@ -55,16 +55,16 @@ class LithuanianSurnameTraditionTest extends TestCase */ public function testNewSonNames(): void { - $father_fact = $this->createStub(Fact::class); + $father_fact = $this->createMock(Fact::class); $father_fact->method('value')->willReturn('John /White/'); - $father = $this->createStub(Individual::class); + $father = $this->createMock(Individual::class); $father->method('facts')->willReturn(new Collection([$father_fact])); - $mother_fact = $this->createStub(Fact::class); + $mother_fact = $this->createMock(Fact::class); $mother_fact->method('value')->willReturn('Mary /Black/'); - $mother = $this->createStub(Individual::class); + $mother = $this->createMock(Individual::class); $mother->method('facts')->willReturn(new Collection([$mother_fact])); self::assertSame( @@ -78,16 +78,16 @@ class LithuanianSurnameTraditionTest extends TestCase */ public function testNewDaughterNames(): void { - $father_fact = $this->createStub(Fact::class); + $father_fact = $this->createMock(Fact::class); $father_fact->method('value')->willReturn('John /White/'); - $father = $this->createStub(Individual::class); + $father = $this->createMock(Individual::class); $father->method('facts')->willReturn(new Collection([$father_fact])); - $mother_fact = $this->createStub(Fact::class); + $mother_fact = $this->createMock(Fact::class); $mother_fact->method('value')->willReturn('Mary /Black/'); - $mother = $this->createStub(Individual::class); + $mother = $this->createMock(Individual::class); $mother->method('facts')->willReturn(new Collection([$mother_fact])); self::assertSame( @@ -101,16 +101,16 @@ class LithuanianSurnameTraditionTest extends TestCase */ public function testNewDaughterNamesInflected(): void { - $father_fact = $this->createStub(Fact::class); + $father_fact = $this->createMock(Fact::class); $father_fact->method('value')->willReturn('John /Whita/'); - $father = $this->createStub(Individual::class); + $father = $this->createMock(Individual::class); $father->method('facts')->willReturn(new Collection([$father_fact])); - $mother_fact = $this->createStub(Fact::class); + $mother_fact = $this->createMock(Fact::class); $mother_fact->method('value')->willReturn('Mary /Black/'); - $mother = $this->createStub(Individual::class); + $mother = $this->createMock(Individual::class); $mother->method('facts')->willReturn(new Collection([$mother_fact])); self::assertSame( @@ -118,10 +118,10 @@ class LithuanianSurnameTraditionTest extends TestCase $this->surname_tradition->newChildNames($father, $mother, 'F') ); - $father_fact = $this->createStub(Fact::class); + $father_fact = $this->createMock(Fact::class); $father_fact->method('value')->willReturn('John /Whitas/'); - $father = $this->createStub(Individual::class); + $father = $this->createMock(Individual::class); $father->method('facts')->willReturn(new Collection([$father_fact])); self::assertSame( @@ -129,10 +129,10 @@ class LithuanianSurnameTraditionTest extends TestCase $this->surname_tradition->newChildNames($father, $mother, 'F') ); - $father_fact = $this->createStub(Fact::class); + $father_fact = $this->createMock(Fact::class); $father_fact->method('value')->willReturn('John /Whitis/'); - $father = $this->createStub(Individual::class); + $father = $this->createMock(Individual::class); $father->method('facts')->willReturn(new Collection([$father_fact])); self::assertSame( @@ -140,10 +140,10 @@ class LithuanianSurnameTraditionTest extends TestCase $this->surname_tradition->newChildNames($father, $mother, 'F') ); - $father_fact = $this->createStub(Fact::class); + $father_fact = $this->createMock(Fact::class); $father_fact->method('value')->willReturn('John /Whitys/'); - $father = $this->createStub(Individual::class); + $father = $this->createMock(Individual::class); $father->method('facts')->willReturn(new Collection([$father_fact])); self::assertSame( @@ -151,10 +151,10 @@ class LithuanianSurnameTraditionTest extends TestCase $this->surname_tradition->newChildNames($father, $mother, 'F') ); - $father_fact = $this->createStub(Fact::class); + $father_fact = $this->createMock(Fact::class); $father_fact->method('value')->willReturn('John /Whitius/'); - $father = $this->createStub(Individual::class); + $father = $this->createMock(Individual::class); $father->method('facts')->willReturn(new Collection([$father_fact])); self::assertSame( @@ -162,10 +162,10 @@ class LithuanianSurnameTraditionTest extends TestCase $this->surname_tradition->newChildNames($father, $mother, 'F') ); - $father_fact = $this->createStub(Fact::class); + $father_fact = $this->createMock(Fact::class); $father_fact->method('value')->willReturn('John /Whitus/'); - $father = $this->createStub(Individual::class); + $father = $this->createMock(Individual::class); $father->method('facts')->willReturn(new Collection([$father_fact])); self::assertSame( @@ -179,16 +179,16 @@ class LithuanianSurnameTraditionTest extends TestCase */ public function testNewChildNames(): void { - $father_fact = $this->createStub(Fact::class); + $father_fact = $this->createMock(Fact::class); $father_fact->method('value')->willReturn('John /White/'); - $father = $this->createStub(Individual::class); + $father = $this->createMock(Individual::class); $father->method('facts')->willReturn(new Collection([$father_fact])); - $mother_fact = $this->createStub(Fact::class); + $mother_fact = $this->createMock(Fact::class); $mother_fact->method('value')->willReturn('Mary /Black/'); - $mother = $this->createStub(Individual::class); + $mother = $this->createMock(Individual::class); $mother->method('facts')->willReturn(new Collection([$mother_fact])); self::assertSame( @@ -213,10 +213,10 @@ class LithuanianSurnameTraditionTest extends TestCase */ public function testNewFatherNames(): void { - $fact = $this->createStub(Fact::class); + $fact = $this->createMock(Fact::class); $fact->method('value')->willReturn('John /White/'); - $individual = $this->createStub(Individual::class); + $individual = $this->createMock(Individual::class); $individual->method('facts')->willReturn(new Collection([$fact])); self::assertSame( @@ -230,10 +230,10 @@ class LithuanianSurnameTraditionTest extends TestCase */ public function testNewFatherNamesInflected(): void { - $fact = $this->createStub(Fact::class); + $fact = $this->createMock(Fact::class); $fact->method('value')->willReturn('Mary /Whitaitė/'); - $individual = $this->createStub(Individual::class); + $individual = $this->createMock(Individual::class); $individual->method('facts')->willReturn(new Collection([$fact])); self::assertSame( @@ -241,10 +241,10 @@ class LithuanianSurnameTraditionTest extends TestCase $this->surname_tradition->newParentNames($individual, 'M') ); - $fact = $this->createStub(Fact::class); + $fact = $this->createMock(Fact::class); $fact->method('value')->willReturn('Mary /Whitytė/'); - $individual = $this->createStub(Individual::class); + $individual = $this->createMock(Individual::class); $individual->method('facts')->willReturn(new Collection([$fact])); self::assertSame( @@ -252,10 +252,10 @@ class LithuanianSurnameTraditionTest extends TestCase $this->surname_tradition->newParentNames($individual, 'M') ); - $fact = $this->createStub(Fact::class); + $fact = $this->createMock(Fact::class); $fact->method('value')->willReturn('Mary /Whitiūtė/'); - $individual = $this->createStub(Individual::class); + $individual = $this->createMock(Individual::class); $individual->method('facts')->willReturn(new Collection([$fact])); self::assertSame( @@ -263,10 +263,10 @@ class LithuanianSurnameTraditionTest extends TestCase $this->surname_tradition->newParentNames($individual, 'M') ); - $fact = $this->createStub(Fact::class); + $fact = $this->createMock(Fact::class); $fact->method('value')->willReturn('Mary /Whitutė/'); - $individual = $this->createStub(Individual::class); + $individual = $this->createMock(Individual::class); $individual->method('facts')->willReturn(new Collection([$fact])); self::assertSame( @@ -280,10 +280,10 @@ class LithuanianSurnameTraditionTest extends TestCase */ public function testNewMotherNames(): void { - $fact = $this->createStub(Fact::class); + $fact = $this->createMock(Fact::class); $fact->method('value')->willReturn('John /White/'); - $individual = $this->createStub(Individual::class); + $individual = $this->createMock(Individual::class); $individual->method('facts')->willReturn(new Collection([$fact])); self::assertSame( @@ -297,10 +297,10 @@ class LithuanianSurnameTraditionTest extends TestCase */ public function testNewParentNames(): void { - $fact = $this->createStub(Fact::class); + $fact = $this->createMock(Fact::class); $fact->method('value')->willReturn('John /White/'); - $individual = $this->createStub(Individual::class); + $individual = $this->createMock(Individual::class); $individual->method('facts')->willReturn(new Collection([$fact])); self::assertSame( @@ -314,10 +314,10 @@ class LithuanianSurnameTraditionTest extends TestCase */ public function testNewHusbandNames(): void { - $fact = $this->createStub(Fact::class); + $fact = $this->createMock(Fact::class); $fact->method('value')->willReturn('Mary /Black/'); - $individual = $this->createStub(Individual::class); + $individual = $this->createMock(Individual::class); $individual->method('facts')->willReturn(new Collection([$fact])); self::assertSame( @@ -331,10 +331,10 @@ class LithuanianSurnameTraditionTest extends TestCase */ public function testNewWifeNames(): void { - $fact = $this->createStub(Fact::class); + $fact = $this->createMock(Fact::class); $fact->method('value')->willReturn('John /White/'); - $individual = $this->createStub(Individual::class); + $individual = $this->createMock(Individual::class); $individual->method('facts')->willReturn(new Collection([$fact])); self::assertSame( @@ -348,10 +348,10 @@ class LithuanianSurnameTraditionTest extends TestCase */ public function testNewSpouseNames(): void { - $fact = $this->createStub(Fact::class); + $fact = $this->createMock(Fact::class); $fact->method('value')->willReturn('John /White/'); - $individual = $this->createStub(Individual::class); + $individual = $this->createMock(Individual::class); $individual->method('facts')->willReturn(new Collection([$fact])); self::assertSame( diff --git a/tests/app/SurnameTradition/MatrilinealSurnameTraditionTest.php b/tests/app/SurnameTradition/MatrilinealSurnameTraditionTest.php index 36c775d9a1..3b028770de 100644 --- a/tests/app/SurnameTradition/MatrilinealSurnameTraditionTest.php +++ b/tests/app/SurnameTradition/MatrilinealSurnameTraditionTest.php @@ -54,16 +54,16 @@ class MatrilinealSurnameTraditionTest extends TestCase */ public function testNewChildNames(): void { - $father_fact = $this->createStub(Fact::class); + $father_fact = $this->createMock(Fact::class); $father_fact->method('value')->willReturn('John /White/'); - $father = $this->createStub(Individual::class); + $father = $this->createMock(Individual::class); $father->method('facts')->willReturn(new Collection([$father_fact])); - $mother_fact = $this->createStub(Fact::class); + $mother_fact = $this->createMock(Fact::class); $mother_fact->method('value')->willReturn('Mary /Black/'); - $mother = $this->createStub(Individual::class); + $mother = $this->createMock(Individual::class); $mother->method('facts')->willReturn(new Collection([$mother_fact])); self::assertSame( @@ -87,16 +87,16 @@ class MatrilinealSurnameTraditionTest extends TestCase */ public function testNewChildNamesWithSpfx(): void { - $father_fact = $this->createStub(Fact::class); + $father_fact = $this->createMock(Fact::class); $father_fact->method('value')->willReturn('John /de White/'); - $father = $this->createStub(Individual::class); + $father = $this->createMock(Individual::class); $father->method('facts')->willReturn(new Collection([$father_fact])); - $mother_fact = $this->createStub(Fact::class); + $mother_fact = $this->createMock(Fact::class); $mother_fact->method('value')->willReturn('Mary /van Black/'); - $mother = $this->createStub(Individual::class); + $mother = $this->createMock(Individual::class); $mother->method('facts')->willReturn(new Collection([$mother_fact])); self::assertSame( @@ -121,10 +121,10 @@ class MatrilinealSurnameTraditionTest extends TestCase */ public function testNewParentNames(): void { - $fact = $this->createStub(Fact::class); + $fact = $this->createMock(Fact::class); $fact->method('value')->willReturn('Chris /White/'); - $individual = $this->createStub(Individual::class); + $individual = $this->createMock(Individual::class); $individual->method('facts')->willReturn(new Collection([$fact])); @@ -149,10 +149,10 @@ class MatrilinealSurnameTraditionTest extends TestCase */ public function testNewSpouseNames(): void { - $fact = $this->createStub(Fact::class); + $fact = $this->createMock(Fact::class); $fact->method('value')->willReturn('Chris /White/'); - $individual = $this->createStub(Individual::class); + $individual = $this->createMock(Individual::class); $individual->method('facts')->willReturn(new Collection([$fact])); self::assertSame( diff --git a/tests/app/SurnameTradition/PaternalSurnameTraditionTest.php b/tests/app/SurnameTradition/PaternalSurnameTraditionTest.php index 7e4949dd37..ea5415c969 100644 --- a/tests/app/SurnameTradition/PaternalSurnameTraditionTest.php +++ b/tests/app/SurnameTradition/PaternalSurnameTraditionTest.php @@ -44,16 +44,16 @@ class PaternalSurnameTraditionTest extends TestCase */ public function testNewChildNames(): void { - $father_fact = $this->createStub(Fact::class); + $father_fact = $this->createMock(Fact::class); $father_fact->method('value')->willReturn('John /White/'); - $father = $this->createStub(Individual::class); + $father = $this->createMock(Individual::class); $father->method('facts')->willReturn(new Collection([$father_fact])); - $mother_fact = $this->createStub(Fact::class); + $mother_fact = $this->createMock(Fact::class); $mother_fact->method('value')->willReturn('Mary /Black/'); - $mother = $this->createStub(Individual::class); + $mother = $this->createMock(Individual::class); $mother->method('facts')->willReturn(new Collection([$mother_fact])); self::assertSame( @@ -77,16 +77,16 @@ class PaternalSurnameTraditionTest extends TestCase */ public function testNewChildNamesWithSpfx(): void { - $father_fact = $this->createStub(Fact::class); + $father_fact = $this->createMock(Fact::class); $father_fact->method('value')->willReturn('John /de White/'); - $father = $this->createStub(Individual::class); + $father = $this->createMock(Individual::class); $father->method('facts')->willReturn(new Collection([$father_fact])); - $mother_fact = $this->createStub(Fact::class); + $mother_fact = $this->createMock(Fact::class); $mother_fact->method('value')->willReturn('Mary /van Black/'); - $mother = $this->createStub(Individual::class); + $mother = $this->createMock(Individual::class); $mother->method('facts')->willReturn(new Collection([$mother_fact])); self::assertSame( @@ -100,16 +100,16 @@ class PaternalSurnameTraditionTest extends TestCase */ public function testNewChildNamesWithMultipleSpfx(): void { - $father_fact = $this->createStub(Fact::class); + $father_fact = $this->createMock(Fact::class); $father_fact->method('value')->willReturn('John /van der White/'); - $father = $this->createStub(Individual::class); + $father = $this->createMock(Individual::class); $father->method('facts')->willReturn(new Collection([$father_fact])); - $mother_fact = $this->createStub(Fact::class); + $mother_fact = $this->createMock(Fact::class); $mother_fact->method('value')->willReturn('Mary /van Black/'); - $mother = $this->createStub(Individual::class); + $mother = $this->createMock(Individual::class); $mother->method('facts')->willReturn(new Collection([$mother_fact])); self::assertSame( @@ -123,16 +123,16 @@ class PaternalSurnameTraditionTest extends TestCase */ public function testNewChildNamesWithDutchSpfx(): void { - $father_fact = $this->createStub(Fact::class); + $father_fact = $this->createMock(Fact::class); $father_fact->method('value')->willReturn('John /\'t White/'); - $father = $this->createStub(Individual::class); + $father = $this->createMock(Individual::class); $father->method('facts')->willReturn(new Collection([$father_fact])); - $mother_fact = $this->createStub(Fact::class); + $mother_fact = $this->createMock(Fact::class); $mother_fact->method('value')->willReturn('Mary /van Black/'); - $mother = $this->createStub(Individual::class); + $mother = $this->createMock(Individual::class); $mother->method('facts')->willReturn(new Collection([$mother_fact])); self::assertSame( @@ -146,16 +146,16 @@ class PaternalSurnameTraditionTest extends TestCase */ public function testNewChildNamesWithMultipleDutchSpfx(): void { - $father_fact = $this->createStub(Fact::class); + $father_fact = $this->createMock(Fact::class); $father_fact->method('value')->willReturn('John /van \'t White/'); - $father = $this->createStub(Individual::class); + $father = $this->createMock(Individual::class); $father->method('facts')->willReturn(new Collection([$father_fact])); - $mother_fact = $this->createStub(Fact::class); + $mother_fact = $this->createMock(Fact::class); $mother_fact->method('value')->willReturn('Mary /van Black/'); - $mother = $this->createStub(Individual::class); + $mother = $this->createMock(Individual::class); $mother->method('facts')->willReturn(new Collection([$mother_fact])); self::assertSame( @@ -169,10 +169,10 @@ class PaternalSurnameTraditionTest extends TestCase */ public function testNewFatherNames(): void { - $fact = $this->createStub(Fact::class); + $fact = $this->createMock(Fact::class); $fact->method('value')->willReturn('Chris /White/'); - $individual = $this->createStub(Individual::class); + $individual = $this->createMock(Individual::class); $individual->method('facts')->willReturn(new Collection([$fact])); self::assertSame( @@ -186,10 +186,10 @@ class PaternalSurnameTraditionTest extends TestCase */ public function testNewMotherNames(): void { - $fact = $this->createStub(Fact::class); + $fact = $this->createMock(Fact::class); $fact->method('value')->willReturn('Chris /White/'); - $individual = $this->createStub(Individual::class); + $individual = $this->createMock(Individual::class); $individual->method('facts')->willReturn(new Collection([$fact])); self::assertSame( @@ -203,10 +203,10 @@ class PaternalSurnameTraditionTest extends TestCase */ public function testNewParentNames(): void { - $fact = $this->createStub(Fact::class); + $fact = $this->createMock(Fact::class); $fact->method('value')->willReturn('Chris /White/'); - $individual = $this->createStub(Individual::class); + $individual = $this->createMock(Individual::class); $individual->method('facts')->willReturn(new Collection([$fact])); self::assertSame( @@ -220,10 +220,10 @@ class PaternalSurnameTraditionTest extends TestCase */ public function testNewHusbandNames(): void { - $fact = $this->createStub(Fact::class); + $fact = $this->createMock(Fact::class); $fact->method('value')->willReturn('Chris /White/'); - $individual = $this->createStub(Individual::class); + $individual = $this->createMock(Individual::class); $individual->method('facts')->willReturn(new Collection([$fact])); self::assertSame( @@ -237,10 +237,10 @@ class PaternalSurnameTraditionTest extends TestCase */ public function testNewWifeNames(): void { - $fact = $this->createStub(Fact::class); + $fact = $this->createMock(Fact::class); $fact->method('value')->willReturn('Chris /White/'); - $individual = $this->createStub(Individual::class); + $individual = $this->createMock(Individual::class); $individual->method('facts')->willReturn(new Collection([$fact])); self::assertSame( @@ -254,10 +254,10 @@ class PaternalSurnameTraditionTest extends TestCase */ public function testNewWifeNamesWithSpfx(): void { - $fact = $this->createStub(Fact::class); + $fact = $this->createMock(Fact::class); $fact->method('value')->willReturn('Chris /van der White/'); - $individual = $this->createStub(Individual::class); + $individual = $this->createMock(Individual::class); $individual->method('facts')->willReturn(new Collection([$fact])); self::assertSame( @@ -271,10 +271,10 @@ class PaternalSurnameTraditionTest extends TestCase */ public function testNewSpouseNames(): void { - $fact = $this->createStub(Fact::class); + $fact = $this->createMock(Fact::class); $fact->method('value')->willReturn('Chris /White/'); - $individual = $this->createStub(Individual::class); + $individual = $this->createMock(Individual::class); $individual->method('facts')->willReturn(new Collection([$fact])); self::assertSame( diff --git a/tests/app/SurnameTradition/PatrilinealSurnameTraditionTest.php b/tests/app/SurnameTradition/PatrilinealSurnameTraditionTest.php index 6bf573c053..818cc03094 100644 --- a/tests/app/SurnameTradition/PatrilinealSurnameTraditionTest.php +++ b/tests/app/SurnameTradition/PatrilinealSurnameTraditionTest.php @@ -54,16 +54,16 @@ class PatrilinealSurnameTraditionTest extends TestCase */ public function testNewChildNames(): void { - $father_fact = $this->createStub(Fact::class); + $father_fact = $this->createMock(Fact::class); $father_fact->method('value')->willReturn('John /White/'); - $father = $this->createStub(Individual::class); + $father = $this->createMock(Individual::class); $father->method('facts')->willReturn(new Collection([$father_fact])); - $mother_fact = $this->createStub(Fact::class); + $mother_fact = $this->createMock(Fact::class); $mother_fact->method('value')->willReturn('Mary /Black/'); - $mother = $this->createStub(Individual::class); + $mother = $this->createMock(Individual::class); $mother->method('facts')->willReturn(new Collection([$mother_fact])); self::assertSame( @@ -87,16 +87,16 @@ class PatrilinealSurnameTraditionTest extends TestCase */ public function testNewChildNamesWithSpfx(): void { - $father_fact = $this->createStub(Fact::class); + $father_fact = $this->createMock(Fact::class); $father_fact->method('value')->willReturn('John /de White/'); - $father = $this->createStub(Individual::class); + $father = $this->createMock(Individual::class); $father->method('facts')->willReturn(new Collection([$father_fact])); - $mother_fact = $this->createStub(Fact::class); + $mother_fact = $this->createMock(Fact::class); $mother_fact->method('value')->willReturn('Mary /van Black/'); - $mother = $this->createStub(Individual::class); + $mother = $this->createMock(Individual::class); $mother->method('facts')->willReturn(new Collection([$mother_fact])); self::assertSame( @@ -121,10 +121,10 @@ class PatrilinealSurnameTraditionTest extends TestCase */ public function testNewParentNames(): void { - $fact = $this->createStub(Fact::class); + $fact = $this->createMock(Fact::class); $fact->method('value')->willReturn('Chris /White/'); - $individual = $this->createStub(Individual::class); + $individual = $this->createMock(Individual::class); $individual->method('facts')->willReturn(new Collection([$fact])); self::assertSame( @@ -148,10 +148,10 @@ class PatrilinealSurnameTraditionTest extends TestCase */ public function testNewSpouseNames(): void { - $fact = $this->createStub(Fact::class); + $fact = $this->createMock(Fact::class); $fact->method('value')->willReturn('Chris /White/'); - $individual = $this->createStub(Individual::class); + $individual = $this->createMock(Individual::class); $individual->method('facts')->willReturn(new Collection([$fact])); self::assertSame( diff --git a/tests/app/SurnameTradition/PolishSurnameTraditionTest.php b/tests/app/SurnameTradition/PolishSurnameTraditionTest.php index 7bbc701e10..eb25f62a4d 100644 --- a/tests/app/SurnameTradition/PolishSurnameTraditionTest.php +++ b/tests/app/SurnameTradition/PolishSurnameTraditionTest.php @@ -45,16 +45,16 @@ class PolishSurnameTraditionTest extends TestCase */ public function testNewSonNames(): void { - $father_fact = $this->createStub(Fact::class); + $father_fact = $this->createMock(Fact::class); $father_fact->method('value')->willReturn('John /White/'); - $father = $this->createStub(Individual::class); + $father = $this->createMock(Individual::class); $father->method('facts')->willReturn(new Collection([$father_fact])); - $mother_fact = $this->createStub(Fact::class); + $mother_fact = $this->createMock(Fact::class); $mother_fact->method('value')->willReturn('Mary /Black/'); - $mother = $this->createStub(Individual::class); + $mother = $this->createMock(Individual::class); $mother->method('facts')->willReturn(new Collection([$mother_fact])); self::assertSame( @@ -68,16 +68,16 @@ class PolishSurnameTraditionTest extends TestCase */ public function testNewDaughterNames(): void { - $father_fact = $this->createStub(Fact::class); + $father_fact = $this->createMock(Fact::class); $father_fact->method('value')->willReturn('John /White/'); - $father = $this->createStub(Individual::class); + $father = $this->createMock(Individual::class); $father->method('facts')->willReturn(new Collection([$father_fact])); - $mother_fact = $this->createStub(Fact::class); + $mother_fact = $this->createMock(Fact::class); $mother_fact->method('value')->willReturn('Mary /Black/'); - $mother = $this->createStub(Individual::class); + $mother = $this->createMock(Individual::class); $mother->method('facts')->willReturn(new Collection([$mother_fact])); self::assertSame( @@ -91,16 +91,16 @@ class PolishSurnameTraditionTest extends TestCase */ public function testNewDaughterNamesInflected(): void { - $father_fact = $this->createStub(Fact::class); + $father_fact = $this->createMock(Fact::class); $father_fact->method('value')->willReturn('John /Whitecki/'); - $father = $this->createStub(Individual::class); + $father = $this->createMock(Individual::class); $father->method('facts')->willReturn(new Collection([$father_fact])); - $mother_fact = $this->createStub(Fact::class); + $mother_fact = $this->createMock(Fact::class); $mother_fact->method('value')->willReturn('Mary /Black/'); - $mother = $this->createStub(Individual::class); + $mother = $this->createMock(Individual::class); $mother->method('facts')->willReturn(new Collection([$mother_fact])); self::assertSame( @@ -108,16 +108,16 @@ class PolishSurnameTraditionTest extends TestCase $this->surname_tradition->newChildNames($father, $mother, 'F') ); - $father_fact = $this->createStub(Fact::class); + $father_fact = $this->createMock(Fact::class); $father_fact->method('value')->willReturn('John /Whitedzki/'); - $father = $this->createStub(Individual::class); + $father = $this->createMock(Individual::class); $father->method('facts')->willReturn(new Collection([$father_fact])); - $mother_fact = $this->createStub(Fact::class); + $mother_fact = $this->createMock(Fact::class); $mother_fact->method('value')->willReturn('Mary /Black/'); - $mother = $this->createStub(Individual::class); + $mother = $this->createMock(Individual::class); $mother->method('facts')->willReturn(new Collection([$mother_fact])); self::assertSame( @@ -125,16 +125,16 @@ class PolishSurnameTraditionTest extends TestCase $this->surname_tradition->newChildNames($father, $mother, 'F') ); - $father_fact = $this->createStub(Fact::class); + $father_fact = $this->createMock(Fact::class); $father_fact->method('value')->willReturn('John /Whiteski/'); - $father = $this->createStub(Individual::class); + $father = $this->createMock(Individual::class); $father->method('facts')->willReturn(new Collection([$father_fact])); - $mother_fact = $this->createStub(Fact::class); + $mother_fact = $this->createMock(Fact::class); $mother_fact->method('value')->willReturn('Mary /Black/'); - $mother = $this->createStub(Individual::class); + $mother = $this->createMock(Individual::class); $mother->method('facts')->willReturn(new Collection([$mother_fact])); self::assertSame( @@ -142,16 +142,16 @@ class PolishSurnameTraditionTest extends TestCase $this->surname_tradition->newChildNames($father, $mother, 'F') ); - $father_fact = $this->createStub(Fact::class); + $father_fact = $this->createMock(Fact::class); $father_fact->method('value')->willReturn('John /Whiteżki/'); - $father = $this->createStub(Individual::class); + $father = $this->createMock(Individual::class); $father->method('facts')->willReturn(new Collection([$father_fact])); - $mother_fact = $this->createStub(Fact::class); + $mother_fact = $this->createMock(Fact::class); $mother_fact->method('value')->willReturn('Mary /Black/'); - $mother = $this->createStub(Individual::class); + $mother = $this->createMock(Individual::class); $mother->method('facts')->willReturn(new Collection([$mother_fact])); self::assertSame( @@ -165,16 +165,16 @@ class PolishSurnameTraditionTest extends TestCase */ public function testNewChildNames(): void { - $father_fact = $this->createStub(Fact::class); + $father_fact = $this->createMock(Fact::class); $father_fact->method('value')->willReturn('John /White/'); - $father = $this->createStub(Individual::class); + $father = $this->createMock(Individual::class); $father->method('facts')->willReturn(new Collection([$father_fact])); - $mother_fact = $this->createStub(Fact::class); + $mother_fact = $this->createMock(Fact::class); $mother_fact->method('value')->willReturn('Mary /Black/'); - $mother = $this->createStub(Individual::class); + $mother = $this->createMock(Individual::class); $mother->method('facts')->willReturn(new Collection([$mother_fact])); self::assertSame( @@ -199,10 +199,10 @@ class PolishSurnameTraditionTest extends TestCase */ public function testNewFatherNames(): void { - $fact = $this->createStub(Fact::class); + $fact = $this->createMock(Fact::class); $fact->method('value')->willReturn('Chris /White/'); - $individual = $this->createStub(Individual::class); + $individual = $this->createMock(Individual::class); $individual->method('facts')->willReturn(new Collection([$fact])); self::assertSame( @@ -216,10 +216,10 @@ class PolishSurnameTraditionTest extends TestCase */ public function testNewFatherNamesInflected(): void { - $fact = $this->createStub(Fact::class); + $fact = $this->createMock(Fact::class); $fact->method('value')->willReturn('Chris /Whitecka/'); - $individual = $this->createStub(Individual::class); + $individual = $this->createMock(Individual::class); $individual->method('facts')->willReturn(new Collection([$fact])); self::assertSame( @@ -227,10 +227,10 @@ class PolishSurnameTraditionTest extends TestCase $this->surname_tradition->newParentNames($individual, 'M') ); - $fact = $this->createStub(Fact::class); + $fact = $this->createMock(Fact::class); $fact->method('value')->willReturn('Chris /Whitedzka/'); - $individual = $this->createStub(Individual::class); + $individual = $this->createMock(Individual::class); $individual->method('facts')->willReturn(new Collection([$fact])); self::assertSame( @@ -238,10 +238,10 @@ class PolishSurnameTraditionTest extends TestCase $this->surname_tradition->newParentNames($individual, 'M') ); - $fact = $this->createStub(Fact::class); + $fact = $this->createMock(Fact::class); $fact->method('value')->willReturn('Chris /Whiteska/'); - $individual = $this->createStub(Individual::class); + $individual = $this->createMock(Individual::class); $individual->method('facts')->willReturn(new Collection([$fact])); self::assertSame( @@ -249,10 +249,10 @@ class PolishSurnameTraditionTest extends TestCase $this->surname_tradition->newParentNames($individual, 'M') ); - $fact = $this->createStub(Fact::class); + $fact = $this->createMock(Fact::class); $fact->method('value')->willReturn('Chris /Whiteżka/'); - $individual = $this->createStub(Individual::class); + $individual = $this->createMock(Individual::class); $individual->method('facts')->willReturn(new Collection([$fact])); self::assertSame( @@ -266,10 +266,10 @@ class PolishSurnameTraditionTest extends TestCase */ public function testNewMotherNames(): void { - $fact = $this->createStub(Fact::class); + $fact = $this->createMock(Fact::class); $fact->method('value')->willReturn('Chris /White/'); - $individual = $this->createStub(Individual::class); + $individual = $this->createMock(Individual::class); $individual->method('facts')->willReturn(new Collection([$fact])); self::assertSame( @@ -283,10 +283,10 @@ class PolishSurnameTraditionTest extends TestCase */ public function testNewParentNames(): void { - $fact = $this->createStub(Fact::class); + $fact = $this->createMock(Fact::class); $fact->method('value')->willReturn('Chris /White/'); - $individual = $this->createStub(Individual::class); + $individual = $this->createMock(Individual::class); $individual->method('facts')->willReturn(new Collection([$fact])); self::assertSame( @@ -300,10 +300,10 @@ class PolishSurnameTraditionTest extends TestCase */ public function testNewSpouseNames(): void { - $fact = $this->createStub(Fact::class); + $fact = $this->createMock(Fact::class); $fact->method('value')->willReturn('Chris /White/'); - $individual = $this->createStub(Individual::class); + $individual = $this->createMock(Individual::class); $individual->method('facts')->willReturn(new Collection([$fact])); self::assertSame( diff --git a/tests/app/SurnameTradition/PortugueseSurnameTraditionTest.php b/tests/app/SurnameTradition/PortugueseSurnameTraditionTest.php index dceaaa82ef..cb37075baa 100644 --- a/tests/app/SurnameTradition/PortugueseSurnameTraditionTest.php +++ b/tests/app/SurnameTradition/PortugueseSurnameTraditionTest.php @@ -54,16 +54,16 @@ class PortugueseSurnameTraditionTest extends TestCase */ public function testNewChildNames(): void { - $father_fact = $this->createStub(Fact::class); + $father_fact = $this->createMock(Fact::class); $father_fact->method('value')->willReturn('Gabriel /Garcia/ /Iglesias/'); - $father = $this->createStub(Individual::class); + $father = $this->createMock(Individual::class); $father->method('facts')->willReturn(new Collection([$father_fact])); - $mother_fact = $this->createStub(Fact::class); + $mother_fact = $this->createMock(Fact::class); $mother_fact->method('value')->willReturn('Maria /Ruiz/ /Lorca/'); - $mother = $this->createStub(Individual::class); + $mother = $this->createMock(Individual::class); $mother->method('facts')->willReturn(new Collection([$mother_fact])); self::assertSame( @@ -98,16 +98,16 @@ class PortugueseSurnameTraditionTest extends TestCase */ public function testNewChildNamesCompunds(): void { - $father_fact = $this->createStub(Fact::class); + $father_fact = $this->createMock(Fact::class); $father_fact->method('value')->willReturn('Gabriel /Garcia/ y /Iglesias/'); - $father = $this->createStub(Individual::class); + $father = $this->createMock(Individual::class); $father->method('facts')->willReturn(new Collection([$father_fact])); - $mother_fact = $this->createStub(Fact::class); + $mother_fact = $this->createMock(Fact::class); $mother_fact->method('value')->willReturn('Maria /Ruiz/ y /Lorca/'); - $mother = $this->createStub(Individual::class); + $mother = $this->createMock(Individual::class); $mother->method('facts')->willReturn(new Collection([$mother_fact])); self::assertSame( @@ -121,10 +121,10 @@ class PortugueseSurnameTraditionTest extends TestCase */ public function testNewParentNames(): void { - $fact = $this->createStub(Fact::class); + $fact = $this->createMock(Fact::class); $fact->method('value')->willReturn('Gabriel /Garcia/ /Iglesias/'); - $individual = $this->createStub(Individual::class); + $individual = $this->createMock(Individual::class); $individual->method('facts')->willReturn(new Collection([$fact])); self::assertSame( @@ -147,10 +147,10 @@ class PortugueseSurnameTraditionTest extends TestCase */ public function testNewSpouseNames(): void { - $fact = $this->createStub(Fact::class); + $fact = $this->createMock(Fact::class); $fact->method('value')->willReturn('Gabriel /Garcia/ /Iglesias/'); - $individual = $this->createStub(Individual::class); + $individual = $this->createMock(Individual::class); $individual->method('facts')->willReturn(new Collection([$fact])); self::assertSame( diff --git a/tests/app/SurnameTradition/SpanishSurnameTraditionTest.php b/tests/app/SurnameTradition/SpanishSurnameTraditionTest.php index ff3d0eea18..ad57fd6fa2 100644 --- a/tests/app/SurnameTradition/SpanishSurnameTraditionTest.php +++ b/tests/app/SurnameTradition/SpanishSurnameTraditionTest.php @@ -44,16 +44,16 @@ class SpanishSurnameTraditionTest extends TestCase */ public function testNewChildNames(): void { - $father_fact = $this->createStub(Fact::class); + $father_fact = $this->createMock(Fact::class); $father_fact->method('value')->willReturn('Gabriel /Garcia/ /Iglesias/'); - $father = $this->createStub(Individual::class); + $father = $this->createMock(Individual::class); $father->method('facts')->willReturn(new Collection([$father_fact])); - $mother_fact = $this->createStub(Fact::class); + $mother_fact = $this->createMock(Fact::class); $mother_fact->method('value')->willReturn('Gabriel /Ruiz/ /Lorca/'); - $mother = $this->createStub(Individual::class); + $mother = $this->createMock(Individual::class); $mother->method('facts')->willReturn(new Collection([$mother_fact])); self::assertSame( @@ -88,16 +88,16 @@ class SpanishSurnameTraditionTest extends TestCase */ public function testNewChildNamesCompound(): void { - $father_fact = $this->createStub(Fact::class); + $father_fact = $this->createMock(Fact::class); $father_fact->method('value')->willReturn('Gabriel /Garcia/ y /Iglesias/'); - $father = $this->createStub(Individual::class); + $father = $this->createMock(Individual::class); $father->method('facts')->willReturn(new Collection([$father_fact])); - $mother_fact = $this->createStub(Fact::class); + $mother_fact = $this->createMock(Fact::class); $mother_fact->method('value')->willReturn('Gabriel /Ruiz/ y /Lorca/'); - $mother = $this->createStub(Individual::class); + $mother = $this->createMock(Individual::class); $mother->method('facts')->willReturn(new Collection([$mother_fact])); self::assertSame( @@ -111,10 +111,10 @@ class SpanishSurnameTraditionTest extends TestCase */ public function testNewParentNames(): void { - $fact = $this->createStub(Fact::class); + $fact = $this->createMock(Fact::class); $fact->method('value')->willReturn('Gabriel /Garcia/ /Iglesias/'); - $individual = $this->createStub(Individual::class); + $individual = $this->createMock(Individual::class); $individual->method('facts')->willReturn(new Collection([$fact])); self::assertSame( @@ -138,10 +138,10 @@ class SpanishSurnameTraditionTest extends TestCase */ public function testNewSpouseNames(): void { - $fact = $this->createStub(Fact::class); + $fact = $this->createMock(Fact::class); $fact->method('value')->willReturn('Gabriel /Garcia/ /Iglesias/'); - $individual = $this->createStub(Individual::class); + $individual = $this->createMock(Individual::class); $individual->method('facts')->willReturn(new Collection([$fact])); self::assertSame( diff --git a/tests/app/ValidatorTest.php b/tests/app/ValidatorTest.php index b308ef0887..fcce560832 100644 --- a/tests/app/ValidatorTest.php +++ b/tests/app/ValidatorTest.php @@ -31,7 +31,7 @@ class ValidatorTest extends TestCase { public function testAttributes(): void { - $request = $this->createStub(ServerRequestInterface::class); + $request = $this->createMock(ServerRequestInterface::class); $request ->method('getAttributes') ->willReturn(['param' => 'test']); @@ -41,7 +41,7 @@ class ValidatorTest extends TestCase public function testParsedBody(): void { - $request = $this->createStub(ServerRequestInterface::class); + $request = $this->createMock(ServerRequestInterface::class); $request ->method('getParsedBody') ->willReturn(['param' => 'test']); @@ -51,7 +51,7 @@ class ValidatorTest extends TestCase public function testQueryParams(): void { - $request = $this->createStub(ServerRequestInterface::class); + $request = $this->createMock(ServerRequestInterface::class); $request ->method('getQueryParams') ->willReturn(['param' => 'test']); @@ -61,7 +61,7 @@ class ValidatorTest extends TestCase public function testServerParams(): void { - $request = $this->createStub(ServerRequestInterface::class); + $request = $this->createMock(ServerRequestInterface::class); $request ->method('getServerParams') ->willReturn(['param' => 'test']); @@ -71,7 +71,7 @@ class ValidatorTest extends TestCase public function testNonUTF8QueryParameterName(): void { - $request = $this->createStub(ServerRequestInterface::class); + $request = $this->createMock(ServerRequestInterface::class); $request ->method('getQueryParams') ->willReturn(["\xFF" => 'test']); @@ -83,7 +83,7 @@ class ValidatorTest extends TestCase public function testNonUTF8QueryParameterValue(): void { - $request = $this->createStub(ServerRequestInterface::class); + $request = $this->createMock(ServerRequestInterface::class); $request ->method('getQueryParams') ->willReturn(['test' => "\xFF"]); @@ -95,7 +95,7 @@ class ValidatorTest extends TestCase public function testRequiredArrayParameter(): void { - $request = $this->createStub(ServerRequestInterface::class); + $request = $this->createMock(ServerRequestInterface::class); $request ->method('getQueryParams') ->willReturn(['param' => ['test'], 'invalid' => 'not_array']); @@ -110,7 +110,7 @@ class ValidatorTest extends TestCase public function testRequiredBooleanParameter(): void { - $request = $this->createStub(ServerRequestInterface::class); + $request = $this->createMock(ServerRequestInterface::class); $request ->method('getQueryParams') ->willReturn([ @@ -137,7 +137,7 @@ class ValidatorTest extends TestCase public function testRequiredIntegerParameter(): void { - $request = $this->createStub(ServerRequestInterface::class); + $request = $this->createMock(ServerRequestInterface::class); $request ->method('getQueryParams') ->willReturn([ @@ -160,9 +160,9 @@ class ValidatorTest extends TestCase public function testRequiredRouteParameter(): void { - $route = $this->createStub(Route::class); + $route = $this->createMock(Route::class); - $request = $this->createStub(ServerRequestInterface::class); + $request = $this->createMock(ServerRequestInterface::class); $request ->method('getQueryParams') ->willReturn([ @@ -179,7 +179,7 @@ class ValidatorTest extends TestCase public function testRequiredStringParameter(): void { - $request = $this->createStub(ServerRequestInterface::class); + $request = $this->createMock(ServerRequestInterface::class); $request ->method('getQueryParams') ->willReturn(['param' => 'test', 'invalid' => ['not_string']]); @@ -193,9 +193,9 @@ class ValidatorTest extends TestCase public function testRequiredTreeParameter(): void { - $tree = $this->createStub(Tree::class); + $tree = $this->createMock(Tree::class); - $request = $this->createStub(ServerRequestInterface::class); + $request = $this->createMock(ServerRequestInterface::class); $request ->method('getQueryParams') ->willReturn([ @@ -212,9 +212,9 @@ class ValidatorTest extends TestCase public function testOptionalTreeParameter(): void { - $tree = $this->createStub(Tree::class); + $tree = $this->createMock(Tree::class); - $request = $this->createStub(ServerRequestInterface::class); + $request = $this->createMock(ServerRequestInterface::class); $request ->method('getQueryParams') ->willReturn([ @@ -232,9 +232,9 @@ class ValidatorTest extends TestCase public function testRequiredUserParameter(): void { - $user = $this->createStub(UserInterface::class); + $user = $this->createMock(UserInterface::class); - $request = $this->createStub(ServerRequestInterface::class); + $request = $this->createMock(ServerRequestInterface::class); $request ->method('getQueryParams') ->willReturn([ @@ -251,7 +251,7 @@ class ValidatorTest extends TestCase public function testIsBetweenParameter(): void { - $request = $this->createStub(ServerRequestInterface::class); + $request = $this->createMock(ServerRequestInterface::class); $request ->method('getQueryParams') ->willReturn(['param' => '42', 'invalid' => '10', 'wrongtype' => 'not_integer']); @@ -263,7 +263,7 @@ class ValidatorTest extends TestCase public function testIsInArray(): void { - $request = $this->createStub(ServerRequestInterface::class); + $request = $this->createMock(ServerRequestInterface::class); $request ->method('getQueryParams') ->willReturn(['param' => 'foo']); @@ -277,7 +277,7 @@ class ValidatorTest extends TestCase public function testIsInArrayKeys(): void { - $request = $this->createStub(ServerRequestInterface::class); + $request = $this->createMock(ServerRequestInterface::class); $request ->method('getQueryParams') ->willReturn(['param' => 'foo']); @@ -291,7 +291,7 @@ class ValidatorTest extends TestCase public function testIsNotEmpty(): void { - $request = $this->createStub(ServerRequestInterface::class); + $request = $this->createMock(ServerRequestInterface::class); $request ->method('getQueryParams') ->willReturn(['empty' => '', 'not-empty' => 'foo']); @@ -305,7 +305,7 @@ class ValidatorTest extends TestCase public function testIsTagParameter(): void { - $request = $this->createStub(ServerRequestInterface::class); + $request = $this->createMock(ServerRequestInterface::class); $request ->method('getQueryParams') ->willReturn(['valid' => 'BIRT', 'invalid' => '@X1@']); @@ -319,7 +319,7 @@ class ValidatorTest extends TestCase public function testIsXrefParameter(): void { - $request = $this->createStub(ServerRequestInterface::class); + $request = $this->createMock(ServerRequestInterface::class); $request ->method('getQueryParams') ->willReturn(['valid' => 'X1', 'invalid' => '@X1@', 'valid-array' => ['X1'], 'invalid-array' => ['@X1@']]); @@ -335,7 +335,7 @@ class ValidatorTest extends TestCase public function testIsLocalUrlParameter(): void { - $request = $this->createStub(ServerRequestInterface::class); + $request = $this->createMock(ServerRequestInterface::class); $request ->method('getAttribute') ->with('base_url')->willReturn('http://example.local/wt'); @@ -350,7 +350,7 @@ class ValidatorTest extends TestCase public function testIsLocalUrlParameterWrongScheme(): void { - $request = $this->createStub(ServerRequestInterface::class); + $request = $this->createMock(ServerRequestInterface::class); $request ->method('getAttribute') ->with('base_url') @@ -366,7 +366,7 @@ class ValidatorTest extends TestCase public function testIsLocalUrlParameterWrongDomain(): void { - $request = $this->createStub(ServerRequestInterface::class); + $request = $this->createMock(ServerRequestInterface::class); $request ->method('getAttribute') ->with('base_url') @@ -382,7 +382,7 @@ class ValidatorTest extends TestCase public function testIsLocalUrlParameterWrongType(): void { - $request = $this->createStub(ServerRequestInterface::class); + $request = $this->createMock(ServerRequestInterface::class); $request ->method('getQueryParams') ->willReturn(['wrongtype' => ['42']]); diff --git a/tests/feature/RelationshipNamesTest.php b/tests/feature/RelationshipNamesTest.php index ca7c7c4087..883ed52192 100644 --- a/tests/feature/RelationshipNamesTest.php +++ b/tests/feature/RelationshipNamesTest.php @@ -74,8 +74,8 @@ class RelationshipNamesTest extends TestCase // $tree = $this->createMock(Tree::class); - $individual_factory = $this->createStub(IndividualFactory::class); - $family_factory = $this->createStub(FamilyFactory::class); + $individual_factory = $this->createMock(IndividualFactory::class); + $family_factory = $this->createMock(FamilyFactory::class); Registry::familyFactory($family_factory); Registry::individualFactory($individual_factory); |
