diff options
209 files changed, 8474 insertions, 221 deletions
diff --git a/app/Contracts/ElementInterface.php b/app/Contracts/ElementInterface.php index b23ea45e83..9b1f18649d 100644 --- a/app/Contracts/ElementInterface.php +++ b/app/Contracts/ElementInterface.php @@ -83,11 +83,9 @@ interface ElementInterface public function labelValue(string $value, Tree $tree): string; /** - * @param Tree $tree - * * @return array<string,string> */ - public function subtags(Tree $tree): array; + public function subtags(): array; /** * Display the value of this type of element. diff --git a/app/Elements/AbstractElement.php b/app/Elements/AbstractElement.php index 7101c3154e..ac38d1c802 100644 --- a/app/Elements/AbstractElement.php +++ b/app/Elements/AbstractElement.php @@ -220,11 +220,9 @@ abstract class AbstractElement implements ElementInterface } /** - * @param Tree $tree - * * @return array<string,string> */ - public function subtags(Tree $tree): array + public function subtags(): array { return $this->subtags; } diff --git a/app/Elements/AddressLine.php b/app/Elements/AddressLine.php index df9847bb0a..ce668a6409 100644 --- a/app/Elements/AddressLine.php +++ b/app/Elements/AddressLine.php @@ -43,7 +43,7 @@ class AddressLine extends AbstractElement public function canonical(string $value): string { // Browsers use MS-DOS line endings in multi-line data. - return strtr($value, ["\r\n" => "\n", "\r" => "\n"]); + return strtr($value, ["\t" => ' ', "\r\n" => "\n", "\r" => "\n"]); } /** diff --git a/app/Elements/AgeAtEvent.php b/app/Elements/AgeAtEvent.php index b8ac5913db..7f8f7ce6bc 100644 --- a/app/Elements/AgeAtEvent.php +++ b/app/Elements/AgeAtEvent.php @@ -39,7 +39,7 @@ use function strtoupper; * MM = number of months * DDD = number of days * CHILD = age < 8 years - * INFANT = age<1year + * INFANT = age <1year * STILLBORN = died just prior, at, or near birth, 0 years */ class AgeAtEvent extends AbstractElement @@ -49,15 +49,12 @@ class AgeAtEvent extends AbstractElement public function canonical(string $value): string { $value = parent::canonical($value); - $upper = strtoupper($value); if ($upper === 'CHILD' || $upper === 'INFANT' || $upper === 'STILLBORN') { - $value = $upper; - } else { - $value = strtolower($value); + return $upper; } - return $value; + return strtolower($value); } } diff --git a/app/Elements/DateValue.php b/app/Elements/DateValue.php index 9f1b70496a..da7a4be936 100644 --- a/app/Elements/DateValue.php +++ b/app/Elements/DateValue.php @@ -98,6 +98,6 @@ class DateValue extends AbstractElement $date = new Date($canonical); - return $date->display(true); + return $date->display(); } } diff --git a/app/Elements/EventsRecorded.php b/app/Elements/EventsRecorded.php index 4ff3efe2bc..15e9ecc011 100644 --- a/app/Elements/EventsRecorded.php +++ b/app/Elements/EventsRecorded.php @@ -28,7 +28,9 @@ use Ramsey\Uuid\Uuid; use function array_map; use function explode; use function implode; +use function strpos; use function strtoupper; +use function trim; use function view; /** @@ -101,7 +103,13 @@ class EventsRecorded extends AbstractElement */ public function canonical(string $value): string { - return strtoupper(strtr(parent::canonical($value), [' ' => ''])); + $value = strtoupper(strtr(parent::canonical($value), [' ' => ','])); + + while (strpos($value, ',,') !== false) { + $value = strtr($value, [',,' => ',']); + } + + return trim($value, ','); } /** @@ -163,7 +171,7 @@ class EventsRecorded extends AbstractElement } } - return $tag; + return e($tag); }, $tags); return implode(I18N::$list_separator, $events); diff --git a/app/Elements/FamilyStatusText.php b/app/Elements/FamilyStatusText.php new file mode 100644 index 0000000000..e230e7e0ce --- /dev/null +++ b/app/Elements/FamilyStatusText.php @@ -0,0 +1,69 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +use Fisharebest\Webtrees\I18N; + +use function array_key_exists; +use function strtoupper; + +/** + * For Gedcom-L + * Programs with internal data fields "not married" or "never married" or a data field + * "Status", should introduce a user-defined tag _STAT directly below of FAM: + * _STAT can have the following values: + * <STATUS_TEXT>:= [NOT MARRIED | NEVER MARRIED | UNKNOWN |<plain text of the user>] + */ +class FamilyStatusText extends AbstractElement +{ + /** + * Convert a value to a canonical form. + * + * @param string $value + * + * @return string + */ + public function canonical(string $value): string + { + $value = parent::canonical($value); + $upper = strtoupper($value); + + if (array_key_exists($upper, $this->values())) { + return $upper; + } + + return $value; + } + + /** + * A list of controlled values for this element + * + * @return array<int|string,string> + */ + public function values(): array + { + return [ + '' => '', + 'NOT MARRIED' => I18N::translate('Not married'), + 'NEVER MARRIED' => I18N::translate('Never married'), + 'UNKNOWN' => I18N::translate('Unknown'), + ]; + } +} diff --git a/app/Elements/FileName.php b/app/Elements/FileName.php index 7f6b4242a6..ba6ff8cf95 100644 --- a/app/Elements/FileName.php +++ b/app/Elements/FileName.php @@ -37,7 +37,7 @@ class FileName extends AbstractElement */ public function canonical(string $value): string { - // Don't change spaces. " Foo bar.jpeg" is a valid file name! - return $value; + // Leading/trailing/multiple spaces are valid in filenames. + return strtr($value, ["\t" => '', "\r" => '', "\n" => '']); } } diff --git a/app/Elements/GovId.php b/app/Elements/GovIdentifier.php index ac880f5a30..bc9c5fceac 100644 --- a/app/Elements/GovId.php +++ b/app/Elements/GovIdentifier.php @@ -28,7 +28,7 @@ use function strtoupper; /** * A custom field used in _LOC records */ -class GovId extends AbstractElement +class GovIdentifier extends AbstractElement { protected const EXTERNAL_URL = 'https://gov.genealogy.net/item/show/'; diff --git a/app/Elements/MultimediaFileReference.php b/app/Elements/MultimediaFileReference.php index 9bf23161a3..694bd45406 100644 --- a/app/Elements/MultimediaFileReference.php +++ b/app/Elements/MultimediaFileReference.php @@ -48,7 +48,7 @@ class MultimediaFileReference extends AbstractElement public function canonical(string $value): string { // Leading/trailing/multiple spaces are valid in filenames. - return strtr($value, ["\t" => ' ', "\r" => ' ', "\n" => ' ']); + return strtr($value, ["\t" => '', "\r" => '', "\n" => '']); } /** diff --git a/app/Elements/NamePersonal.php b/app/Elements/NamePersonal.php index e4c96bc854..4897d5799a 100644 --- a/app/Elements/NamePersonal.php +++ b/app/Elements/NamePersonal.php @@ -103,11 +103,9 @@ class NamePersonal extends AbstractElement } /** - * @param Tree $tree - * * @return array<string,string> */ - public function subtags(Tree $tree): array + public function subtags(): array { $language = I18N::languageTag(); diff --git a/app/Elements/NoteStructure.php b/app/Elements/NoteStructure.php index 27fbf7276d..0f53b4bb25 100644 --- a/app/Elements/NoteStructure.php +++ b/app/Elements/NoteStructure.php @@ -34,6 +34,6 @@ class NoteStructure extends AbstractElement public function canonical(string $value): string { // Browsers use MS-DOS line endings in multi-line data. - return strtr($value, ["\r\n" => "\n", "\r" => "\n"]); + return strtr($value, ["\t" => ' ', "\r\n" => "\n", "\r" => "\n"]); } } diff --git a/app/Elements/ResearchTask.php b/app/Elements/ResearchTask.php index d6e30fafda..86ad66b469 100644 --- a/app/Elements/ResearchTask.php +++ b/app/Elements/ResearchTask.php @@ -41,7 +41,7 @@ class ResearchTask extends AbstractElement public function canonical(string $value): string { // Browsers use MS-DOS line endings in multi-line data. - return strtr($value, ["\r\n" => "\n", "\r" => "\n"]); + return strtr($value, ["\t" => ' ', "\r\n" => "\n", "\r" => "\n"]); } /** diff --git a/app/Elements/ResearchTaskPriority.php b/app/Elements/ResearchTaskPriority.php new file mode 100644 index 0000000000..a7052edeeb --- /dev/null +++ b/app/Elements/ResearchTaskPriority.php @@ -0,0 +1,62 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +use Fisharebest\Webtrees\I18N; +use Fisharebest\Webtrees\Tree; + +/** + * <PRIORITY>:= integer 0 to 8, defined values: 0 = high, 5 = medium, 8 = low + */ +class ResearchTaskPriority extends AbstractElement +{ + /** + * Create a default value for this element. + * + * @param Tree $tree + * + * @return string + */ + public function default(Tree $tree): string + { + return '4'; + } + + /** + * A list of controlled values for this element + * + * @return array<int|string,string> + */ + public function values(): array + { + return [ + '' => '', + 0 => I18N::translate(I18N::number(0)), + 1 => I18N::translate(I18N::number(1)), + 2 => I18N::translate(I18N::number(2)), + 3 => I18N::translate(I18N::number(3)), + 4 => I18N::translate(I18N::number(4)), + 5 => I18N::translate(I18N::number(5)), + 6 => I18N::translate(I18N::number(6)), + 7 => I18N::translate(I18N::number(7)), + 8 => I18N::translate(I18N::number(8)), + ]; + } +} diff --git a/app/Elements/ResearchTaskStatus.php b/app/Elements/ResearchTaskStatus.php new file mode 100644 index 0000000000..274affb30b --- /dev/null +++ b/app/Elements/ResearchTaskStatus.php @@ -0,0 +1,56 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +use Fisharebest\Webtrees\I18N; +use Fisharebest\Webtrees\Tree; + +/** + * <TYPE_OF_TODO>:= Status, by values [ open | completed | auto ] + * ("auto" = created by the program) + */ +class ResearchTaskStatus extends AbstractElement +{ + /** + * Create a default value for this element. + * + * @param Tree $tree + * + * @return string + */ + public function default(Tree $tree): string + { + return '1'; + } + /** + * A list of controlled values for this element + * + * @return array<int|string,string> + */ + public function values(): array + { + return [ + '' => '', + 'open' => I18N::translate('Research'), + 'completed' => I18N::translate('Correspondence'), + 'auto' => I18N::translate('Other'), + ]; + } +} diff --git a/app/Elements/ResearchTaskType.php b/app/Elements/ResearchTaskType.php new file mode 100644 index 0000000000..ff8835463c --- /dev/null +++ b/app/Elements/ResearchTaskType.php @@ -0,0 +1,55 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +use Fisharebest\Webtrees\I18N; +use Fisharebest\Webtrees\Tree; + +/** + * <TYPE_OF_TODO>:= integer 0 to 2, Type of task, 0=Research 1=Correspondence 2=Others + */ +class ResearchTaskType extends AbstractElement +{ + /** + * Create a default value for this element. + * + * @param Tree $tree + * + * @return string + */ + public function default(Tree $tree): string + { + return '1'; + } + /** + * A list of controlled values for this element + * + * @return array<int|string,string> + */ + public function values(): array + { + return [ + '' => '', + 0 => I18N::translate('Research'), + 1 => I18N::translate('Correspondence'), + 2 => I18N::translate('Other'), + ]; + } +} diff --git a/app/Elements/SexXValue.php b/app/Elements/SexXValue.php index badb9eb7bc..20ff029c36 100644 --- a/app/Elements/SexXValue.php +++ b/app/Elements/SexXValue.php @@ -29,7 +29,7 @@ use function view; * A modification to the standard SEX record, which allows 'X'. * Gedcom-L defines this as 'Intersex'. We use the more general term 'Other'. */ -class SexXValue extends AbstractElement +class SexXValue extends SexValue { /** * A list of controlled values for this element diff --git a/app/Elements/SourceData.php b/app/Elements/SourceData.php index 80019f1137..8a83f06f13 100644 --- a/app/Elements/SourceData.php +++ b/app/Elements/SourceData.php @@ -30,22 +30,4 @@ class SourceData extends EmptyElement 'DATE' => '0:1', 'TEXT' => '0:M', ]; - - protected const ABRIDGED_SUBTAGS = [ - 'TEXT' => '0:M', - ]; - - /** - * @param Tree $tree - * - * @return array<string,string> - */ - public function subtags(Tree $tree): array - { - if ($tree->getPreference('FULL_SOURCES') === '1') { - return static::SUBTAGS; - } - - return static::ABRIDGED_SUBTAGS; - } } diff --git a/app/Elements/SourceMediaType.php b/app/Elements/SourceMediaType.php index fae0b9ac58..909494293c 100644 --- a/app/Elements/SourceMediaType.php +++ b/app/Elements/SourceMediaType.php @@ -60,9 +60,9 @@ class SourceMediaType extends AbstractElement 'audio' => /* I18N: Type of media object */ I18N::translate('Audio'), 'book' => /* I18N: Type of media object */ I18N::translate('Book'), 'card' => /* I18N: Type of media object */ I18N::translate('Card'), - 'certificate' => /* I18N: Type of media object */ I18N::translate('Certificate'), // *** - 'coat' => /* I18N: Type of media object */ I18N::translate('Coat of arms'), // *** - 'document' => /* I18N: Type of media object */ I18N::translate('Document'), // *** + 'certificate' => /* I18N: Type of media object */ I18N::translate('Certificate'), + 'coat' => /* I18N: Type of media object */ I18N::translate('Coat of arms'), + 'document' => /* I18N: Type of media object */ I18N::translate('Document'), 'electronic' => /* I18N: Type of media object */ I18N::translate('Electronic'), 'fiche' => /* I18N: Type of media object */ I18N::translate('Microfiche'), 'film' => /* I18N: Type of media object */ I18N::translate('Microfilm'), @@ -70,9 +70,9 @@ class SourceMediaType extends AbstractElement 'manuscript' => /* I18N: Type of media object */ I18N::translate('Manuscript'), 'map' => /* I18N: Type of media object */ I18N::translate('Map'), 'newspaper' => /* I18N: Type of media object */ I18N::translate('Newspaper'), - 'other' => /* I18N: Type of media object */ I18N::translate('Other'), // *** + 'other' => /* I18N: Type of media object */ I18N::translate('Other'), 'photo' => /* I18N: Type of media object */ I18N::translate('Photo'), - 'painting' => /* I18N: Type of media object */ I18N::translate('Painting'), // *** + 'painting' => /* I18N: Type of media object */ I18N::translate('Painting'), 'tombstone' => /* I18N: Type of media object */ I18N::translate('Tombstone'), 'video' => /* I18N: Type of media object */ I18N::translate('Video'), ]; diff --git a/app/Elements/SubmitterText.php b/app/Elements/SubmitterText.php index 583d9c937c..8d70e3b508 100644 --- a/app/Elements/SubmitterText.php +++ b/app/Elements/SubmitterText.php @@ -37,7 +37,7 @@ class SubmitterText extends AbstractElement public function canonical(string $value): string { // Browsers use MS-DOS line endings in multi-line data. - return strtr($value, ["\r\n" => "\n", "\r" => "\n"]); + return strtr($value, ["\t" => ' ', "\r\n" => "\n", "\r" => "\n"]); } /** diff --git a/app/Elements/TextFromSource.php b/app/Elements/TextFromSource.php index 3bbd5092ec..7acac56eab 100644 --- a/app/Elements/TextFromSource.php +++ b/app/Elements/TextFromSource.php @@ -43,7 +43,7 @@ class TextFromSource extends AbstractElement public function canonical(string $value): string { // Browsers use MS-DOS line endings in multi-line data. - return strtr($value, ["\r\n" => "\n", "\r" => "\n"]); + return strtr($value, ["\t" => ' ', "\r\n" => "\n", "\r" => "\n"]); } /** diff --git a/app/Elements/XrefSource.php b/app/Elements/XrefSource.php index 8cf861eb32..6ffb635db0 100644 --- a/app/Elements/XrefSource.php +++ b/app/Elements/XrefSource.php @@ -44,12 +44,6 @@ class XrefSource extends AbstractXrefElement 'QUAY' => '0:1', ]; - protected const ABRIDGED_SUBTAGS = [ - 'PAGE' => '0:1', - 'DATA' => '0:1', - 'OBJE' => '0:M', - ]; - /** * An edit control for this data. * @@ -82,20 +76,6 @@ class XrefSource extends AbstractXrefElement } /** - * @param Tree $tree - * - * @return array<string,string> - */ - public function subtags(Tree $tree): array - { - if ($tree->getPreference('FULL_SOURCES') === '1') { - return static::SUBTAGS; - } - - return static::ABRIDGED_SUBTAGS; - } - - /** * Display the value of this type of element. * * @param string $value diff --git a/app/Factories/ElementFactory.php b/app/Factories/ElementFactory.php index 4ecbd2af87..3a556048b1 100644 --- a/app/Factories/ElementFactory.php +++ b/app/Factories/ElementFactory.php @@ -62,6 +62,9 @@ use Fisharebest\Webtrees\Elements\CopyrightSourceData; use Fisharebest\Webtrees\Elements\CountOfChildren; use Fisharebest\Webtrees\Elements\CountOfMarriages; use Fisharebest\Webtrees\Elements\Cremation; +use Fisharebest\Webtrees\Elements\CustomElement; +use Fisharebest\Webtrees\Elements\CustomEvent; +use Fisharebest\Webtrees\Elements\CustomFact; use Fisharebest\Webtrees\Elements\DateLdsOrd; use Fisharebest\Webtrees\Elements\DateValue; use Fisharebest\Webtrees\Elements\Death; @@ -78,14 +81,17 @@ use Fisharebest\Webtrees\Elements\EventOrFactClassification; use Fisharebest\Webtrees\Elements\EventsRecorded; use Fisharebest\Webtrees\Elements\EventTypeCitedFrom; use Fisharebest\Webtrees\Elements\FamilyRecord; +use Fisharebest\Webtrees\Elements\FamilyStatusText; use Fisharebest\Webtrees\Elements\FileName; use Fisharebest\Webtrees\Elements\FirstCommunion; use Fisharebest\Webtrees\Elements\Form; use Fisharebest\Webtrees\Elements\Gedcom; use Fisharebest\Webtrees\Elements\GenerationsOfAncestors; use Fisharebest\Webtrees\Elements\GenerationsOfDescendants; +use Fisharebest\Webtrees\Elements\GovIdentifier; use Fisharebest\Webtrees\Elements\Graduation; use Fisharebest\Webtrees\Elements\HeaderRecord; +use Fisharebest\Webtrees\Elements\HierarchicalRelationship; use Fisharebest\Webtrees\Elements\Immigration; use Fisharebest\Webtrees\Elements\IndividualRecord; use Fisharebest\Webtrees\Elements\LanguageId; @@ -98,6 +104,8 @@ use Fisharebest\Webtrees\Elements\LdsEndowment; use Fisharebest\Webtrees\Elements\LdsEndowmentDateStatus; use Fisharebest\Webtrees\Elements\LdsSpouseSealing; use Fisharebest\Webtrees\Elements\LdsSpouseSealingDateStatus; +use Fisharebest\Webtrees\Elements\LocationRecord; +use Fisharebest\Webtrees\Elements\MaidenheadLocator; use Fisharebest\Webtrees\Elements\Marriage; use Fisharebest\Webtrees\Elements\MarriageBanns; use Fisharebest\Webtrees\Elements\MarriageContract; @@ -152,6 +160,9 @@ use Fisharebest\Webtrees\Elements\RelationIsDescriptor; use Fisharebest\Webtrees\Elements\ReligiousAffiliation; use Fisharebest\Webtrees\Elements\RepositoryRecord; use Fisharebest\Webtrees\Elements\ResearchTask; +use Fisharebest\Webtrees\Elements\ResearchTaskPriority; +use Fisharebest\Webtrees\Elements\ResearchTaskStatus; +use Fisharebest\Webtrees\Elements\ResearchTaskType; use Fisharebest\Webtrees\Elements\Residence; use Fisharebest\Webtrees\Elements\ResponsibleAgency; use Fisharebest\Webtrees\Elements\RestrictionNotice; @@ -160,6 +171,7 @@ use Fisharebest\Webtrees\Elements\RoleInEvent; use Fisharebest\Webtrees\Elements\RomanizedType; use Fisharebest\Webtrees\Elements\ScholasticAchievement; use Fisharebest\Webtrees\Elements\SexValue; +use Fisharebest\Webtrees\Elements\SexXValue; use Fisharebest\Webtrees\Elements\SocialSecurityNumber; use Fisharebest\Webtrees\Elements\SourceCallNumber; use Fisharebest\Webtrees\Elements\SourceData; @@ -187,6 +199,7 @@ use Fisharebest\Webtrees\Elements\WhereWithinSource; use Fisharebest\Webtrees\Elements\Will; use Fisharebest\Webtrees\Elements\XrefFamily; use Fisharebest\Webtrees\Elements\XrefIndividual; +use Fisharebest\Webtrees\Elements\XrefLocation; use Fisharebest\Webtrees\Elements\XrefMedia; use Fisharebest\Webtrees\Elements\XrefRepository; use Fisharebest\Webtrees\Elements\XrefSource; @@ -202,8 +215,8 @@ use function strpos; */ class ElementFactory implements ElementFactoryInterface { - /** @var null|array<string,ElementInterface> */ - private $elements; + /** @var array<string,ElementInterface> */ + private $elements = []; /** * Create a GEDCOM element that corresponds to a GEDCOM tag. @@ -220,36 +233,6 @@ class ElementFactory implements ElementFactoryInterface } /** - * @param string $tag - * - * @return ElementInterface|null - */ - private function findElementByWildcard(string $tag): ?ElementInterface - { - foreach ($this->elements() as $tags => $element) { - if (strpos($tags, '*') !== false) { - $regex = '/^' . strtr($tags, ['*' => '[^:]+']) . '$/'; - - if (preg_match($regex, $tag)) { - return $element; - } - } - } - - return null; - } - - /** - * Register more elements. - * - * @param array<string,ElementInterface> $elements - */ - public function register(array $elements): void - { - $this->elements = array_merge($this->elements(), $elements); - } - - /** * Association between GEDCOM tags and GEDCOM elements. * We can't initialise this in the constructor, as the I18N package isn't available then. * @@ -257,8 +240,8 @@ class ElementFactory implements ElementFactoryInterface */ private function elements(): array { - if ($this->elements === null) { - // Custom tags are indicated with *** + if ($this->elements === []) { + // Gedcom 5.5.1 $this->elements = [ 'FAM' => new FamilyRecord(I18N::translate('Family')), 'FAM:*:ADDR' => new AddressLine(I18N::translate('Address')), @@ -305,14 +288,12 @@ class ElementFactory implements ElementFactoryInterface 'FAM:*:WIFE' => new EmptyElement(I18N::translate('Wife'), ['AGE' => '0:1']), 'FAM:*:WIFE:AGE' => new AgeAtEvent(I18N::translate('Wife’s age')), 'FAM:*:WWW' => new AddressWebPage(I18N::translate('URL')), - 'FAM:*:_ASSO' => new XrefIndividual(I18N::translate('Associate')), // *** - 'FAM:*:_ASSO:RELA' => new RelationIsDescriptor(I18N::translate('Relationship')), // *** 'FAM:ANUL' => new Annulment(I18N::translate('Annulment')), 'FAM:CENS' => new Census(I18N::translate('Census')), 'FAM:CHAN' => new Change(I18N::translate('Last change')), 'FAM:CHAN:DATE' => new ChangeDate(I18N::translate('Date of last change')), 'FAM:CHAN:DATE:TIME' => new TimeValue(I18N::translate('Time')), - 'FAM:CHAN:_WT_USER' => new WebtreesUser(I18N::translate('Author of last change')), // *** webtrees + 'FAM:CHAN:NOTE' => new NoteStructure(I18N::translate('Note')), 'FAM:CHIL' => new XrefIndividual(I18N::translate('Child')), 'FAM:DIV' => new Divorce(I18N::translate('Divorce')), 'FAM:DIVF' => new DivorceFiled(I18N::translate('Divorce filed')), @@ -346,7 +327,7 @@ class ElementFactory implements ElementFactoryInterface 'FAM:SLGS:PLAC' => new PlaceLivingOrdinance(I18N::translate('Place')), 'FAM:SLGS:STAT' => new LdsSpouseSealingDateStatus(I18N::translate('Status')), 'FAM:SLGS:STAT:DATE' => new ChangeDate(I18N::translate('Status change date')), - 'FAM:SLGS:TEMP' => new TempleCode(/* I18N: https://en.wikipedia.org/wiki/Temple_(LDS_Church)*/ I18N::translate('Temple')), + 'FAM:SLGS:TEMP' => new TempleCode(I18N::translate('Temple')), 'FAM:SOUR' => new XrefSource(I18N::translate('Source')), 'FAM:SOUR:DATA' => new SourceData(I18N::translate('Data')), 'FAM:SOUR:DATA:DATE' => new EntryRecordingDate(I18N::translate('Date of entry in original source')), @@ -359,10 +340,6 @@ class ElementFactory implements ElementFactoryInterface 'FAM:SOUR:QUAY' => new CertaintyAssessment(I18N::translate('Quality of data')), 'FAM:SUBM' => new XrefSubmitter(I18N::translate('Submitter')), 'FAM:WIFE' => new XrefIndividual(I18N::translate('Wife')), - 'FAM:_TODO' => new ResearchTask(I18N::translate('Research task')), // *** webtrees - 'FAM:_TODO:DATE' => new TransmissionDate(I18N::translate('Date')), // *** webtrees - 'FAM:_TODO:_WT_USER' => new WebtreesUser(I18N::translate('User')), // *** webtrees - 'FAM:_UID' => new PafUid(I18N::translate('Unique identifier')), // *** 'HEAD' => new HeaderRecord(I18N::translate('Header')), 'HEAD:CHAR' => new CharacterSet(I18N::translate('Character set')), 'HEAD:CHAR:VERS' => new VersionNumber(I18N::translate('Version')), @@ -410,8 +387,6 @@ class ElementFactory implements ElementFactoryInterface 'INDI:*:ADDR:STAE' => new AddressState(I18N::translate('State')), 'INDI:*:AGE' => new AgeAtEvent(I18N::translate('Age')), 'INDI:*:AGNC' => new ResponsibleAgency(I18N::translate('Agency')), - 'INDI:*:ASSO' => new XrefIndividual(I18N::translate('Associate')), // *** - 'INDI:*:ASSO:RELA' => new RelationIsDescriptor(I18N::translate('Relationship')), 'INDI:*:CAUS' => new CauseOfEvent(I18N::translate('Cause')), 'INDI:*:DATE' => new DateValue(I18N::translate('Date')), 'INDI:*:EMAIL' => new AddressEmail(I18N::translate('Email address')), @@ -429,7 +404,6 @@ class ElementFactory implements ElementFactoryInterface 'INDI:*:PLAC:NOTE' => new NoteStructure(I18N::translate('Note')), 'INDI:*:PLAC:ROMN' => new PlaceRomanizedVariation(I18N::translate('Romanized place')), 'INDI:*:PLAC:ROMN:TYPE' => new RomanizedType(I18N::translate('Type')), - 'INDI:*:PLAC:_HEB' => new NoteStructure(I18N::translate('Place in Hebrew')), // *** 'INDI:*:RELI' => new ReligiousAffiliation(I18N::translate('Religion')), 'INDI:*:RESN' => new RestrictionNotice(I18N::translate('Restriction')), 'INDI:*:SOUR' => new XrefSource(I18N::translate('Source')), @@ -444,8 +418,6 @@ class ElementFactory implements ElementFactoryInterface 'INDI:*:SOUR:QUAY' => new CertaintyAssessment(I18N::translate('Quality of data')), 'INDI:*:TYPE' => new EventOrFactClassification(I18N::translate('Type')), 'INDI:*:WWW' => new AddressWebPage(I18N::translate('URL')), - 'INDI:*:_ASSO' => new XrefIndividual(I18N::translate('Associate')), // *** - 'INDI:*:_ASSO:RELA' => new RelationIsDescriptor(I18N::translate('Relationship')), // *** 'INDI:ADOP' => new Adoption(I18N::translate('Adoption')), 'INDI:ADOP:DATE' => new DateValue(I18N::translate('Date of adoption')), 'INDI:ADOP:FAMC' => new XrefFamily(I18N::translate('Adoptive parents')), @@ -457,13 +429,14 @@ class ElementFactory implements ElementFactoryInterface 'INDI:ASSO' => new XrefIndividual(I18N::translate('Associate')), 'INDI:ASSO:NOTE' => new NoteStructure(I18N::translate('Note')), 'INDI:ASSO:RELA' => new RelationIsDescriptor(I18N::translate('Relationship')), + 'INDI:ASSO:SOUR' => new XrefSource(I18N::translate('Source citation')), 'INDI:BAPL' => new LdsBaptism(I18N::translate('LDS baptism')), 'INDI:BAPL:DATE' => new DateLdsOrd(I18N::translate('Date of LDS baptism')), 'INDI:BAPL:NOTE' => new NoteStructure(I18N::translate('Note')), 'INDI:BAPL:PLAC' => new PlaceLivingOrdinance(I18N::translate('Place of LDS baptism')), 'INDI:BAPL:STAT' => new LdsBaptismDateStatus(I18N::translate('Status')), 'INDI:BAPL:STAT:DATE' => new ChangeDate(I18N::translate('Status change date')), - 'INDI:BAPL:TEMP' => new TempleCode(/* I18N: https://en.wikipedia.org/wiki/Temple_(LDS_Church)*/ I18N::translate('Temple')), + 'INDI:BAPL:TEMP' => new TempleCode(I18N::translate('Temple')), 'INDI:BAPM' => new Baptism(I18N::translate('Baptism')), 'INDI:BAPM:DATE' => new DateValue(I18N::translate('Date of baptism')), 'INDI:BAPM:PLAC' => new PlaceName(I18N::translate('Place of baptism')), @@ -490,7 +463,7 @@ class ElementFactory implements ElementFactoryInterface 'INDI:CHAN' => new Change(I18N::translate('Last change')), 'INDI:CHAN:DATE' => new ChangeDate(I18N::translate('Date of last change')), 'INDI:CHAN:DATE:TIME' => new TimeValue(I18N::translate('Time')), - 'INDI:CHAN:_WT_USER' => new WebtreesUser(I18N::translate('Author of last change')), // *** webtrees + 'INDI:CHAN:NOTE' => new NoteStructure(I18N::translate('Note')), 'INDI:CHR' => new Christening(I18N::translate('Christening')), 'INDI:CHR:DATE' => new DateValue(I18N::translate('Date of christening')), 'INDI:CHR:FAMC' => new XrefFamily(I18N::translate('Godparents')), @@ -505,7 +478,7 @@ class ElementFactory implements ElementFactoryInterface 'INDI:CONL:PLAC' => new PlaceLivingOrdinance(I18N::translate('Place of LDS confirmation')), 'INDI:CONL:STAT' => new LdsSpouseSealingDateStatus(I18N::translate('Status')), 'INDI:CONL:STAT:DATE' => new ChangeDate(I18N::translate('Status change date')), - 'INDI:CONL:TEMP' => new TempleCode(/* I18N: https://en.wikipedia.org/wiki/Temple_(LDS_Church)*/ I18N::translate('Temple')), + 'INDI:CONL:TEMP' => new TempleCode(I18N::translate('Temple')), 'INDI:CREM' => new Cremation(I18N::translate('Cremation')), 'INDI:CREM:DATE' => new Cremation(I18N::translate('Date of cremation')), 'INDI:CREM:PLAC' => new Cremation(I18N::translate('Place of cremation')), @@ -526,7 +499,7 @@ class ElementFactory implements ElementFactoryInterface 'INDI:ENDL:PLAC' => new PlaceLivingOrdinance(I18N::translate('Place of LDS endowment')), 'INDI:ENDL:STAT' => new LdsEndowmentDateStatus(I18N::translate('Status')), 'INDI:ENDL:STAT:DATE' => new ChangeDate(I18N::translate('Status change date')), - 'INDI:ENDL:TEMP' => new TempleCode(/* I18N: https://en.wikipedia.org/wiki/Temple_(LDS_Church)*/ I18N::translate('Temple')), + 'INDI:ENDL:TEMP' => new TempleCode(I18N::translate('Temple')), 'INDI:EVEN' => new EventDescriptor(I18N::translate('Event')), 'INDI:EVEN:DATE' => new DateValue(I18N::translate('Date of event')), 'INDI:EVEN:PLAC' => new PlaceName(I18N::translate('Place of event')), @@ -607,7 +580,7 @@ class ElementFactory implements ElementFactoryInterface 'INDI:SLGC:PLAC' => new PlaceLivingOrdinance(I18N::translate('Place of LDS child sealing')), 'INDI:SLGC:STAT' => new LdsChildSealingDateStatus(I18N::translate('Status')), 'INDI:SLGC:STAT:DATE' => new ChangeDate(I18N::translate('Status change date')), - 'INDI:SLGC:TEMP' => new TempleCode(/* I18N: https://en.wikipedia.org/wiki/Temple_(LDS_Church)*/ I18N::translate('Temple')), + 'INDI:SLGC:TEMP' => new TempleCode(I18N::translate('Temple')), 'INDI:SOUR' => new XrefSource(I18N::translate('Source')), 'INDI:SOUR:DATA' => new SourceData(I18N::translate('Data')), 'INDI:SOUR:DATA:DATE' => new EntryRecordingDate(I18N::translate('Date of entry in original source')), @@ -622,22 +595,15 @@ class ElementFactory implements ElementFactoryInterface 'INDI:SUBM' => new XrefSubmitter(I18N::translate('Submitter')), 'INDI:TITL' => new NobilityTypeTitle(I18N::translate('Title')), 'INDI:WILL' => new Will(I18N::translate('Will')), - 'INDI:_TODO' => new ResearchTask(I18N::translate('Research task')), // *** webtrees - 'INDI:_TODO:DATE' => new TransmissionDate(I18N::translate('Date')), // *** webtrees - 'INDI:_TODO:_WT_USER' => new WebtreesUser(I18N::translate('User')), // *** webtrees - 'INDI:_UID' => new PafUid(I18N::translate('Unique identifier')), // *** - 'INDI:_WT_OBJE_SORT' => new XrefMedia(I18N::translate('Re-order media')), // *** webtrees 1.7 'NOTE' => new NoteRecord(I18N::translate('Note')), 'NOTE:CHAN' => new Change(I18N::translate('Last change')), 'NOTE:CHAN:DATE' => new ChangeDate(I18N::translate('Date of last change')), 'NOTE:CHAN:DATE:TIME' => new TimeValue(I18N::translate('Time')), 'NOTE:CHAN:NOTE' => new NoteStructure(I18N::translate('Note')), - 'NOTE:CHAN:_WT_USER' => new WebtreesUser(I18N::translate('Author of last change')), // *** webtrees 'NOTE:CONC' => new SubmitterText(I18N::translate('Note')), 'NOTE:CONT' => new SubmitterText(I18N::translate('Continued')), 'NOTE:REFN' => new UserReferenceNumber(I18N::translate('Reference number')), 'NOTE:REFN:TYPE' => new UserReferenceType(I18N::translate('Type')), - 'NOTE:RESN' => new RestrictionNotice(I18N::translate('Restriction')), // *** webtrees 'NOTE:RIN' => new AutomatedRecordId(I18N::translate('Record ID number')), 'NOTE:SOUR' => new XrefSource(I18N::translate('Source')), 'NOTE:SOUR:DATA' => new SourceData(I18N::translate('Data')), @@ -649,13 +615,11 @@ class ElementFactory implements ElementFactoryInterface 'NOTE:SOUR:OBJE' => new XrefMedia(I18N::translate('Media object')), 'NOTE:SOUR:PAGE' => new WhereWithinSource(I18N::translate('Citation details')), 'NOTE:SOUR:QUAY' => new CertaintyAssessment(I18N::translate('Quality of data')), - 'NOTE:_UID' => new PafUid(I18N::translate('Unique identifier')), // *** 'OBJE' => new MediaRecord(I18N::translate('Media object')), 'OBJE:CHAN' => new Change(I18N::translate('Last change')), 'OBJE:CHAN:DATE' => new ChangeDate(I18N::translate('Date of last change')), 'OBJE:CHAN:DATE:TIME' => new TimeValue(I18N::translate('Time')), 'OBJE:CHAN:NOTE' => new NoteStructure(I18N::translate('Note')), - 'OBJE:CHAN:_WT_USER' => new WebtreesUser(I18N::translate('Author of last change')), // *** webtrees 'OBJE:FILE' => new MultimediaFileReference(I18N::translate('Filename')), 'OBJE:FILE:FORM' => new MultimediaFormat(I18N::translate('Format')), 'OBJE:FILE:FORM:TYPE' => new SourceMediaType(I18N::translate('Media type')), @@ -663,7 +627,6 @@ class ElementFactory implements ElementFactoryInterface 'OBJE:NOTE' => new NoteStructure(I18N::translate('Note')), 'OBJE:REFN' => new UserReferenceNumber(I18N::translate('Reference number')), 'OBJE:REFN:TYPE' => new UserReferenceType(I18N::translate('Type')), - 'OBJE:RESN' => new RestrictionNotice(I18N::translate('Restriction')), // *** webtrees 'OBJE:RIN' => new AutomatedRecordId(I18N::translate('Record ID number')), 'OBJE:SOUR' => new XrefSource(I18N::translate('Source')), 'OBJE:SOUR:DATA' => new SourceData(I18N::translate('Data')), @@ -675,7 +638,6 @@ class ElementFactory implements ElementFactoryInterface 'OBJE:SOUR:OBJE' => new XrefMedia(I18N::translate('Media object')), 'OBJE:SOUR:PAGE' => new WhereWithinSource(I18N::translate('Citation details')), 'OBJE:SOUR:QUAY' => new CertaintyAssessment(I18N::translate('Quality of data')), - 'OBJE:_UID' => new PafUid(I18N::translate('Unique identifier')), // *** 'REPO' => new RepositoryRecord(I18N::translate('Repository')), 'REPO:ADDR' => new AddressLine(I18N::translate('Address')), 'REPO:ADDR:ADR1' => new AddressLine1(I18N::translate('Address line 1')), @@ -689,7 +651,6 @@ class ElementFactory implements ElementFactoryInterface 'REPO:CHAN:DATE' => new ChangeDate(I18N::translate('Date of last change')), 'REPO:CHAN:DATE:TIME' => new TimeValue(I18N::translate('Time')), 'REPO:CHAN:NOTE' => new NoteStructure(I18N::translate('Note')), - 'REPO:CHAN:_WT_USER' => new WebtreesUser(I18N::translate('Author of last change')), // *** webtrees 'REPO:EMAIL' => new AddressEmail(I18N::translate('Email address')), 'REPO:FAX' => new AddressFax(I18N::translate('Fax')), 'REPO:NAME' => new NameOfRepository(I18N::translateContext('Repository', 'Name')), @@ -697,10 +658,8 @@ class ElementFactory implements ElementFactoryInterface 'REPO:PHON' => new PhoneNumber(I18N::translate('Phone')), 'REPO:REFN' => new UserReferenceNumber(I18N::translate('Reference number')), 'REPO:REFN:TYPE' => new UserReferenceType(I18N::translate('Type')), - 'REPO:RESN' => new RestrictionNotice(I18N::translate('Restriction')), // *** webtrees 'REPO:RIN' => new AutomatedRecordId(I18N::translate('Record ID number')), 'REPO:WWW' => new AddressWebPage(I18N::translate('URL')), - 'REPO:_UID' => new PafUid(I18N::translate('Unique identifier')), // *** 'SOUR' => new SourceRecord(I18N::translate('Source')), 'SOUR:ABBR' => new SourceFiledByEntry(I18N::translate('Abbreviation')), 'SOUR:AUTH' => new SourceOriginator(I18N::translate('Author')), @@ -708,7 +667,6 @@ class ElementFactory implements ElementFactoryInterface 'SOUR:CHAN:DATE' => new ChangeDate(I18N::translate('Date of last change')), 'SOUR:CHAN:DATE:TIME' => new TimeValue(I18N::translate('Time')), 'SOUR:CHAN:NOTE' => new NoteStructure(I18N::translate('Note')), - 'SOUR:CHAN:_WT_USER' => new WebtreesUser(I18N::translate('Author of last change')), // *** webtrees 'SOUR:DATA' => new EmptyElement(I18N::translate('Data'), ['EVEN' => '0:M', 'AGNC' => '0:1', 'NOTE' => '0:M']), 'SOUR:DATA:AGNC' => new ResponsibleAgency(I18N::translate('Agency')), 'SOUR:DATA:EVEN' => new EventsRecorded(I18N::translate('Events')), @@ -724,11 +682,9 @@ class ElementFactory implements ElementFactoryInterface 'SOUR:REPO:CALN' => new SourceCallNumber(I18N::translate('Call number')), 'SOUR:REPO:CALN:MEDI' => new SourceMediaType(I18N::translate('Media type')), 'SOUR:REPO:NOTE' => new NoteStructure(I18N::translate('Note')), - 'SOUR:RESN' => new RestrictionNotice(I18N::translate('Restriction')), // *** webtrees 'SOUR:RIN' => new AutomatedRecordId(I18N::translate('Record ID number')), 'SOUR:TEXT' => new TextFromSource(I18N::translate('Text')), 'SOUR:TITL' => new DescriptiveTitle(I18N::translate('Title')), - 'SOUR:_UID' => new PafUid(I18N::translate('Unique identifier')), // *** 'SUBM' => new SubmitterRecord(I18N::translate('Submitter')), 'SUBM:ADDR' => new AddressLine(I18N::translate('Address')), 'SUBM:ADDR:ADR1' => new AddressLine1(I18N::translate('Address line 1')), @@ -742,7 +698,6 @@ class ElementFactory implements ElementFactoryInterface 'SUBM:CHAN:DATE' => new ChangeDate(I18N::translate('Date of last change')), 'SUBM:CHAN:DATE:TIME' => new TimeValue(I18N::translate('Time')), 'SUBM:CHAN:NOTE' => new NoteStructure(I18N::translate('Note')), - 'SUBM:CHAN:_WT_USER' => new WebtreesUser(I18N::translate('Author of last change')), // *** webtrees 'SUBM:EMAIL' => new AddressEmail(I18N::translate('Email address')), 'SUBM:FAX' => new AddressFax(I18N::translate('Fax')), 'SUBM:LANG' => new LanguageId(I18N::translate('Language')), @@ -750,31 +705,683 @@ class ElementFactory implements ElementFactoryInterface 'SUBM:NOTE' => new NoteStructure(I18N::translate('Note')), 'SUBM:OBJE' => new XrefMedia(I18N::translate('Media object')), 'SUBM:PHON' => new PhoneNumber(I18N::translate('Phone')), - 'SUBM:RESN' => new RestrictionNotice(I18N::translate('Restriction')), // *** webtrees 'SUBM:RFN' => new SubmitterRegisteredRfn(I18N::translate('Record file number')), 'SUBM:RIN' => new AutomatedRecordId(I18N::translate('Record ID number')), 'SUBM:WWW' => new AddressWebPage(I18N::translate('URL')), - 'SUBM:_UID' => new PafUid(I18N::translate('Unique identifier')), // *** 'SUBN' => new SubmissionRecord(I18N::translate('Submission')), 'SUBN:ANCE' => new GenerationsOfAncestors(I18N::translate('Generations of ancestors')), 'SUBN:CHAN' => new Change(I18N::translate('Last change')), 'SUBN:CHAN:DATE' => new ChangeDate(I18N::translate('Date of last change')), 'SUBN:CHAN:DATE:TIME' => new TimeValue(I18N::translate('Time')), 'SUBN:CHAN:NOTE' => new NoteStructure(I18N::translate('Note')), - 'SUBN:CHAN:_WT_USER' => new WebtreesUser(I18N::translate('Author of last change')), // *** webtrees 'SUBN:DESC' => new GenerationsOfDescendants(I18N::translate('Generations of descendants')), 'SUBN:FAMF' => new NameOfFamilyFile(I18N::translate('Family file')), 'SUBN:NOTE' => new NoteStructure(I18N::translate('Note')), 'SUBN:ORDI' => new OrdinanceProcessFlag(I18N::translate('Ordinance')), - 'SUBN:RESN' => new RestrictionNotice(I18N::translate('Restriction')), // *** webtrees 'SUBN:RIN' => new AutomatedRecordId(I18N::translate('Record ID number')), 'SUBN:SUBM' => new XrefSubmitter(I18N::translate('Submitter')), 'SUBN:TEMP' => new TempleCode(/* I18N: https://en.wikipedia.org/wiki/Temple_(LDS_Church)*/ I18N::translate('Temple')), - 'SUBN:_UID' => new PafUid(I18N::translate('Unique identifier')), // *** 'TRLR' => new EmptyElement(I18N::translate('Trailer')), ]; + + // Aldfaer extensions + $this->register([ + 'FAM:MARR_CIVIL' => new CustomEvent(I18N::translate('Civil marriage')), + 'FAM:MARR_RELIGIOUS' => new CustomEvent(I18N::translate('Religious marriage')), + 'FAM:MARR_PARTNERS' => new CustomEvent(I18N::translate('Registered partnership')), + 'FAM:MARR_UNKNOWN' => new CustomEvent(I18N::translate('Marriage type unknown')), + ]); + + // Ancestry extensions + $this->register([ + 'INDI:*:SOUR:_APID' => new CustomElement(I18N::translate('Ancestry PID')), + 'INDI:_EMPLOY' => new CustomEvent(I18N::translate('Occupation')), + ]); + + // Brother’s Keeper extensions + $this->register([ + 'FAM:*:_EVN' => new CustomElement('Event number'), + 'FAM:CHIL:_FREL' => new CustomElement('Relationship to father'), + 'FAM:CHIL:_MREL' => new CustomElement('Relationship to mother'), + 'FAM:_COML' => new CustomEvent(I18N::translate('Common law marriage')), + 'FAM:_MARI' => new CustomEvent(I18N::translate('Marriage intention')), + 'FAM:_MBON' => new CustomEvent(I18N::translate('Marriage bond')), + 'FAM:_NMR' => new CustomEvent(I18N::translate('Not married'), ['NOTE' => '0:M', 'SOUR' => '0:M']), + 'FAM:_PRMN' => new CustomElement(I18N::translate('Permanent number')), + 'FAM:_SEPR' => new CustomEvent(I18N::translate('Separated')), + 'FAM:_TODO' => new CustomElement(I18N::translate('Research task')), + 'INDI:*:_EVN' => new CustomElement('Event number'), + 'INDI:NAME:_ADPN' => new NamePersonal(I18N::translate('Adopted name')), + 'INDI:NAME:_AKAN' => new NamePersonal(I18N::translate('Also known as')), + 'INDI:NAME:_BIRN' => new NamePersonal(I18N::translate('Birth name')), + 'INDI:NAME:_CALL' => new NamePersonal('Called name'), + 'INDI:NAME:_CENN' => new NamePersonal('Census name'), + 'INDI:NAME:_CURN' => new NamePersonal('Current name'), + 'INDI:NAME:_FARN' => new NamePersonal(I18N::translate('Estate name')), + 'INDI:NAME:_FKAN' => new NamePersonal('Formal name'), + 'INDI:NAME:_FRKA' => new NamePersonal('Formerly known as'), + 'INDI:NAME:_GERN' => new NamePersonal('German name'), + 'INDI:NAME:_HEBN' => new NamePersonal(I18N::translate('Hebrew name')), + 'INDI:NAME:_HNM' => new NamePersonal(I18N::translate('Hebrew name')), + 'INDI:NAME:_INDG' => new NamePersonal('Indigenous name'), + 'INDI:NAME:_INDN' => new NamePersonal('Indian name'), + 'INDI:NAME:_LNCH' => new NamePersonal('Legal name change'), + 'INDI:NAME:_MARN' => new NamePersonal('Married name'), + 'INDI:NAME:_MARNM' => new NamePersonal('Married name'), + 'INDI:NAME:_OTHN' => new NamePersonal('Other name'), + 'INDI:NAME:_RELN' => new NamePersonal('Religious name'), + 'INDI:NAME:_SHON' => new NamePersonal('Short name'), + 'INDI:NAME:_SLDN' => new NamePersonal('Soldier name'), + 'INDI:_ADPF' => new CustomElement(I18N::translate('Adopted by father')), + 'INDI:_ADPM' => new CustomElement(I18N::translate('Adopted by mother')), + 'INDI:_BRTM' => new CustomEvent(I18N::translate('Brit milah')), + 'INDI:_BRTM:DATE' => new DateValue(I18N::translate('Date of brit milah')), + 'INDI:_BRTM:PLAC' => new PlaceName(I18N::translate('Place of brit milah')), + 'INDI:_EMAIL' => new AddressEmail(I18N::translate('Email address')), + 'INDI:_EYEC' => new CustomFact(I18N::translate('Eye color')), + 'INDI:_FRNL' => new CustomElement(I18N::translate('Funeral')), + 'INDI:_HAIR' => new CustomFact(I18N::translate('Hair color')), + 'INDI:_HEIG' => new CustomFact(I18N::translate('Height')), + 'INDI:_INTE' => new CustomElement(I18N::translate('Interment')), + 'INDI:_MEDC' => new CustomFact(I18N::translate('Medical')), + 'INDI:_MILT' => new CustomElement(I18N::translate('Military service')), + 'INDI:_NLIV' => new CustomFact(I18N::translate('Not living')), + 'INDI:_NMAR' => new CustomEvent(I18N::translate('Never married'), ['NOTE' => '0:M', 'SOUR' => '0:M']), + 'INDI:_PRMN' => new CustomElement(I18N::translate('Permanent number')), + 'INDI:_TODO' => new CustomElement(I18N::translate('Research task')), + 'INDI:_WEIG' => new CustomFact(I18N::translate('Weight')), + 'INDI:_YART' => new CustomEvent(I18N::translate('Yahrzeit')), + // 1 XXXX + // 2 _EVN ## + // 1 ASSO @Xnnn@ + // 2 RELA Witness at event _EVN ## + ]); + + // Family Tree Builder extensions + $this->register([ + '*:_UPD' => new CustomElement(I18N::translate('Last change')), // e.g. "1 _UPD 14 APR 2012 00:14:10 GMT-5" + 'INDI:NAME:_AKA' => new NamePersonal(I18N::translate('Also known as')), + 'OBJE:_ALBUM' => new CustomElement(I18N::translate('Album')), // XREF to an album + 'OBJE:_DATE' => new DateValue(I18N::translate('Date')), + 'OBJE:_FILESIZE' => new CustomElement(I18N::translate('File size')), + 'OBJE:_PHOTO_RIN' => new CustomElement(I18N::translate('Photo')), + 'OBJE:_PLACE' => new PlaceName(I18N::translate('Place')), + '_ALBUM:_PHOTO' => new CustomElement(I18N::translate('Photo')), + '_ALBUM:_PHOTO:_PRIN' => new CustomElement(I18N::translate('Highlighted image')), + ]); + + // Family Tree Maker extensions + $this->register([ + 'FAM:CHIL:_FREL' => new CustomElement(I18N::translate('Relationship to father')), + 'FAM:CHIL:_MREL' => new CustomElement(I18N::translate('Relationship to mother')), + 'FAM:_DETS' => new CustomElement(I18N::translate('Death of one spouse')), + 'FAM:_FA1' => new CustomElement('Fact 1'), + 'FAM:_FA10' => new CustomElement('Fact 10'), + 'FAM:_FA11' => new CustomElement('Fact 11'), + 'FAM:_FA12' => new CustomElement('Fact 12'), + 'FAM:_FA13' => new CustomElement('Fact 13'), + 'FAM:_FA2' => new CustomElement('Fact 2'), + 'FAM:_FA3' => new CustomElement('Fact 3'), + 'FAM:_FA4' => new CustomElement('Fact 4'), + 'FAM:_FA5' => new CustomElement('Fact 5'), + 'FAM:_FA6' => new CustomElement('Fact 6'), + 'FAM:_FA7' => new CustomElement('Fact 7'), + 'FAM:_FA8' => new CustomElement('Fact 8'), + 'FAM:_FA9' => new CustomElement('Fact 9'), + 'FAM:_MEND' => new CustomElement(I18N::translate('Marriage ending status')), + 'FAM:_MSTAT' => new CustomElement(I18N::translate('Marriage beginning status')), + 'FAM:_SEPR' => new CustomElement(I18N::translate('Separation')), + 'HEAD:_SCHEMA' => new CustomElement('Schema'), + 'HEAD:_SCHEMA:FAM' => new CustomElement(I18N::translate('Family')), + 'HEAD:_SCHEMA:FAM:_FA*:LABL' => new CustomElement(I18N::translate('Label')), + 'HEAD:_SCHEMA:FAM:_FA1' => new CustomElement(I18N::translate('Fact 1')), + 'HEAD:_SCHEMA:FAM:_FA10' => new CustomElement(I18N::translate('Fact 10')), + 'HEAD:_SCHEMA:FAM:_FA11' => new CustomElement(I18N::translate('Fact 11')), + 'HEAD:_SCHEMA:FAM:_FA12' => new CustomElement(I18N::translate('Fact 12')), + 'HEAD:_SCHEMA:FAM:_FA13' => new CustomElement(I18N::translate('Fact 13')), + 'HEAD:_SCHEMA:FAM:_FA2' => new CustomElement(I18N::translate('Fact 2')), + 'HEAD:_SCHEMA:FAM:_FA3' => new CustomElement(I18N::translate('Fact 3')), + 'HEAD:_SCHEMA:FAM:_FA4' => new CustomElement(I18N::translate('Fact 4')), + 'HEAD:_SCHEMA:FAM:_FA5' => new CustomElement(I18N::translate('Fact 5')), + 'HEAD:_SCHEMA:FAM:_FA6' => new CustomElement(I18N::translate('Fact 6')), + 'HEAD:_SCHEMA:FAM:_FA7' => new CustomElement(I18N::translate('Fact 7')), + 'HEAD:_SCHEMA:FAM:_FA8' => new CustomElement(I18N::translate('Fact 8')), + 'HEAD:_SCHEMA:FAM:_FA9' => new CustomElement(I18N::translate('Fact 9')), + 'HEAD:_SCHEMA:FAM:_M*:LABL' => new CustomElement(I18N::translate('Label')), + 'HEAD:_SCHEMA:FAM:_MEND' => new CustomElement(I18N::translate('Marriage ending status')), + 'HEAD:_SCHEMA:FAM:_MSTAT' => new CustomElement(I18N::translate('Marriage beginning status')), + 'HEAD:_SCHEMA:INDI' => new CustomElement(I18N::translate('Individual')), + 'HEAD:_SCHEMA:INDI:_FA*:LABL' => new CustomElement(I18N::translate('Label')), + 'HEAD:_SCHEMA:INDI:_FA1' => new CustomElement(I18N::translate('Fact 1')), + 'HEAD:_SCHEMA:INDI:_FA10' => new CustomElement(I18N::translate('Fact 10')), + 'HEAD:_SCHEMA:INDI:_FA11' => new CustomElement(I18N::translate('Fact 11')), + 'HEAD:_SCHEMA:INDI:_FA12' => new CustomElement(I18N::translate('Fact 12')), + 'HEAD:_SCHEMA:INDI:_FA13' => new CustomElement(I18N::translate('Fact 13')), + 'HEAD:_SCHEMA:INDI:_FA2' => new CustomElement(I18N::translate('Fact 2')), + 'HEAD:_SCHEMA:INDI:_FA3' => new CustomElement(I18N::translate('Fact 3')), + 'HEAD:_SCHEMA:INDI:_FA4' => new CustomElement(I18N::translate('Fact 4')), + 'HEAD:_SCHEMA:INDI:_FA5' => new CustomElement(I18N::translate('Fact 5')), + 'HEAD:_SCHEMA:INDI:_FA6' => new CustomElement(I18N::translate('Fact 6')), + 'HEAD:_SCHEMA:INDI:_FA7' => new CustomElement(I18N::translate('Fact 7')), + 'HEAD:_SCHEMA:INDI:_FA8' => new CustomElement(I18N::translate('Fact 8')), + 'HEAD:_SCHEMA:INDI:_FA9' => new CustomElement(I18N::translate('Fact 9')), + 'HEAD:_SCHEMA:INDI:_FREL' => new CustomElement('Relationship to father'), + 'HEAD:_SCHEMA:INDI:_M*:LABL' => new CustomElement(I18N::translate('Label')), + 'HEAD:_SCHEMA:INDI:_MREL' => new CustomElement('Relationship to mother'), + 'INDI:*:SOUR:_APID' => new CustomElement('Ancestry.com source identifier'), + 'INDI:*:SOUR:_LINK' => new CustomElement('External link'), + 'INDI:NAME:_AKA' => new NamePersonal(I18N::translate('Also known as')), + 'INDI:NAME:_MARNM' => new NamePersonal(I18N::translate('Married name')), + 'INDI:_CIRC' => new CustomElement('Circumcision'), + 'INDI:_DCAUSE' => new CustomElement(I18N::translate('Cause of death')), + 'INDI:_DEG' => new CustomElement(I18N::translate('Degree')), + 'INDI:_DNA' => new CustomElement(I18N::translate('DNA markers')), + 'INDI:_ELEC' => new CustomElement('Elected'), + 'INDI:_EMPLOY' => new CustomElement('Employment'), + 'INDI:_EXCM' => new CustomElement('Excommunicated'), + 'INDI:_FA1' => new CustomElement('Fact 1'), + 'INDI:_FA10' => new CustomElement('Fact 10'), + 'INDI:_FA11' => new CustomElement('Fact 11'), + 'INDI:_FA12' => new CustomElement('Fact 12'), + 'INDI:_FA13' => new CustomElement('Fact 13'), + 'INDI:_FA2' => new CustomElement('Fact 2'), + 'INDI:_FA3' => new CustomElement('Fact 3'), + 'INDI:_FA4' => new CustomElement('Fact 4'), + 'INDI:_FA5' => new CustomElement('Fact 5'), + 'INDI:_FA6' => new CustomElement('Fact 6'), + 'INDI:_FA7' => new CustomElement('Fact 7'), + 'INDI:_FA8' => new CustomElement('Fact 8'), + 'INDI:_FA9' => new CustomElement('Fact 9'), + 'INDI:_MDCL' => new CustomElement('Medical'), + 'INDI:_MILT' => new CustomElement(I18N::translate('Military service')), + 'INDI:_MILTID' => new CustomElement('Military ID number'), + 'INDI:_MISN' => new CustomElement('Mission'), + 'INDI:_NAMS' => new CustomElement(I18N::translate('Namesake')), + 'INDI:_UNKN' => new CustomElement(I18N::translate('Unknown')), // Special individual ID code for later file comparisons + // The context and meaning of these tags is unknown + '_FOOT' => new CustomElement(''), + '_FUN' => new CustomElement(''), + '_JUST' => new CustomElement(''), + '_PHOTO' => new CustomElement(''), + ]); + + // Gedcom 5.3 extensions + $this->register([ + 'EVEN' => new CustomElement('Event'), + 'EVEN:*:*:NAME' => new NamePersonal(I18N::translate('Name')), + 'EVEN:*:AUDIO' => new CustomElement(I18N::translate('Audio')), + 'EVEN:*:BROT' => new PlaceName('Brother'), + 'EVEN:*:BUYR' => new PlaceName('Buyer'), + 'EVEN:*:CHIL' => new PlaceName('Child'), + 'EVEN:*:DATE' => new DateValue('Date'), + 'EVEN:*:FATH' => new PlaceName('Father'), + 'EVEN:*:GODP' => new PlaceName('Godparent'), + 'EVEN:*:HDOH' => new PlaceName('Head of household'), + 'EVEN:*:HEIR' => new PlaceName('Heir'), + 'EVEN:*:HFAT' => new PlaceName('Husband’s father'), + 'EVEN:*:HMOT' => new PlaceName('Husband’s mother'), + 'EVEN:*:HUSB' => new PlaceName('Husband'), + 'EVEN:*:IMAGE' => new CustomElement('Image'), + 'EVEN:*:INDI' => new PlaceName('Individual'), + 'EVEN:*:INFT' => new PlaceName('Informant'), + 'EVEN:*:LEGA' => new PlaceName('Legatee'), + 'EVEN:*:MBR' => new PlaceName('Member'), + 'EVEN:*:MOTH' => new PlaceName('Mother'), + 'EVEN:*:OFFI' => new PlaceName('Official'), + 'EVEN:*:PARE' => new PlaceName('Parent'), + 'EVEN:*:PHOTO' => new CustomElement(I18N::translate('Photo')), + 'EVEN:*:PHUS' => new PlaceName('Previous husband'), + 'EVEN:*:PLAC' => new PlaceName('Place'), + 'EVEN:*:PWIF' => new PlaceName('Previous wife'), + 'EVEN:*:RECO' => new PlaceName('Recorder'), + 'EVEN:*:REL' => new PlaceName('Relative'), + 'EVEN:*:SELR' => new PlaceName('Seller'), + 'EVEN:*:SIBL' => new PlaceName('Sibling'), + 'EVEN:*:SIST' => new PlaceName('Sister'), + 'EVEN:*:SPOU' => new PlaceName('Spouse'), + 'EVEN:*:TXPY' => new PlaceName('Taxpayer'), + 'EVEN:*:VIDEO' => new CustomElement(I18N::translate('Video')), + 'EVEN:*:WFAT' => new PlaceName('Wife’s father'), + 'EVEN:*:WIFE' => new PlaceName('Wife'), + 'EVEN:*:WITN' => new PlaceName('Witness'), + 'EVEN:*:WMOT' => new PlaceName('Wife’s mother'), + 'EVEN:TYPE' => new CustomElement('Type of event'), + 'FAM:*:*:QUAY' => new CertaintyAssessment(I18N::translate('Quality of data')), + 'FAM:*:PLAC:SITE' => new CustomElement('Site'), + 'FAM:*:QUAY' => new CertaintyAssessment(I18N::translate('Quality of data')), + 'FAM:AUDIO' => new CustomElement(I18N::translate('Audio')), + 'FAM:IMAGE' => new CustomElement('Image'), + 'FAM:PHOTO' => new CustomElement(I18N::translate('Photo')), + 'FAM:VIDEO' => new CustomElement(I18N::translate('Video')), + 'HEAD:SCHEMA' => new CustomElement(I18N::translate('Unknown')), + 'HEAD:SCHEMA:FAM' => new CustomElement(I18N::translate('Family')), + 'HEAD:SCHEMA:FAM:*:_*' => new CustomElement('Custom event'), + 'HEAD:SCHEMA:FAM:*:_*:DEFN' => new CustomElement('Definition'), + 'HEAD:SCHEMA:FAM:*:_*:ISA' => new CustomElement('Type of event'), + 'HEAD:SCHEMA:FAM:*:_*:LABL' => new CustomElement('Label'), + 'HEAD:SCHEMA:FAM:_*' => new CustomElement('Custom event'), + 'HEAD:SCHEMA:FAM:_*:DEFN' => new CustomElement('Definition'), + 'HEAD:SCHEMA:FAM:_*:ISA' => new CustomElement('Type of event'), + 'HEAD:SCHEMA:FAM:_*:LABL' => new CustomElement('Label'), + 'HEAD:SCHEMA:INDI' => new CustomElement(I18N::translate('Individual')), + 'HEAD:SCHEMA:INDI:*:_*' => new CustomElement('Custom event'), + 'HEAD:SCHEMA:INDI:*:_*:DEFN' => new CustomElement('Definition'), + 'HEAD:SCHEMA:INDI:*:_*:ISA' => new CustomElement('Type of event'), + 'HEAD:SCHEMA:INDI:*:_*:LABL' => new CustomElement('Label'), + 'HEAD:SCHEMA:INDI:_*' => new CustomElement('Custom event'), + 'HEAD:SCHEMA:INDI:_*:DEFN' => new CustomElement('Definition'), + 'HEAD:SCHEMA:INDI:_*:ISA' => new CustomElement('Type of event'), + 'HEAD:SCHEMA:INDI:_*:LABL' => new CustomElement('Label'), + 'INDI:*:*:QUAY' => new CertaintyAssessment(I18N::translate('Quality of data')), + 'INDI:*:PLAC:SITE' => new CustomElement('Site'), + 'INDI:*:QUAY' => new CertaintyAssessment(I18N::translate('Quality of data')), + 'INDI:AUDIO' => new CustomElement(I18N::translate('Audio')), + 'INDI:BURI:PLAC:CEME' => new CustomElement(I18N::translate('Cemetery')), + 'INDI:BURI:PLAC:CEME:PLOT' => new CustomElement('Burial plot'), + 'INDI:IMAGE' => new CustomElement('Image'), + 'INDI:NAMR' => new CustomElement(I18N::translate('Religious name')), + 'INDI:NAMS' => new CustomElement(I18N::translate('Namesake')), + 'INDI:PHOTO' => new CustomElement(I18N::translate('Photo')), + 'INDI:SIGN' => new CustomElement('Signature'), + 'INDI:VIDEO' => new CustomElement(I18N::translate('Video')), + 'REPO:CALN:ITEM' => new CustomElement('Item'), + 'REPO:CALN:PAGE' => new CustomElement('Page'), + 'REPO:CALN:SHEE' => new CustomElement('Sheet'), + 'REPO:CNTC' => new CustomElement('Contact person'), + 'REPO:MEDI' => new SourceMediaType(I18N::translate('Media type')), + 'REPO:REFN' => new CustomElement('Reference number'), + 'SOUR:AUDIO' => new CustomElement(I18N::translate('Audio')), + 'SOUR:CENS' => new CustomElement('Census'), + 'SOUR:CENS:DATE' => new CustomElement('Census'), + 'SOUR:CENS:DWEL' => new CustomElement('Dwelling number'), + 'SOUR:CENS:FAMN' => new CustomElement('Family number'), + 'SOUR:CENS:LINE' => new CustomElement('Line number'), + 'SOUR:CLAS' => new CustomElement('Source classification'), + 'SOUR:CPLR' => new CustomElement('Compiler'), + 'SOUR:EDTR' => new CustomElement('Editor'), + 'SOUR:EVEN' => new CustomElement('Source events'), + 'SOUR:FIDE' => new CustomElement('Fidelity'), + 'SOUR:FILM' => new CustomElement(I18N::translate('Microfilm')), + 'SOUR:IMAGE' => new CustomElement('Image'), + 'SOUR:INDX' => new CustomElement('Indexed'), + 'SOUR:INTV' => new CustomElement('Interviewer'), + 'SOUR:ORIG' => new CustomElement('Originator'), + 'SOUR:ORIG:NAME' => new CustomElement('Name'), + 'SOUR:ORIG:NOTE' => new CustomElement('Note'), + 'SOUR:ORIG:TYPE' => new CustomElement('Type'), + 'SOUR:PERI' => new CustomElement('Date period'), + 'SOUR:PHOTO' => new CustomElement(I18N::translate('Photo')), + 'SOUR:PUBL:DATE' => new CustomElement('Date'), + 'SOUR:PUBL:EDTN' => new CustomElement('Edition'), + 'SOUR:PUBL:ISSU' => new CustomElement('Issue'), + 'SOUR:PUBL:LCCN' => new CustomElement('Library of Congress call number'), + 'SOUR:PUBL:NAME' => new CustomElement('Name'), + 'SOUR:PUBL:PUBR' => new CustomElement('Publisher'), + 'SOUR:PUBL:SERS' => new CustomElement('Series'), + 'SOUR:PUBL:TYPE' => new CustomElement('Type'), + 'SOUR:QUAY' => new CertaintyAssessment(I18N::translate('Quality of data')), + 'SOUR:RECO' => new CustomElement('Recording agency?'), + 'SOUR:REFS' => new XrefSource('Referenced source'), + 'SOUR:REPO' => new XrefRepository('Repository'), + 'SOUR:REPO:DPRT:ARVL' => new CustomElement('Departure'), + 'SOUR:REPO:DPRT:ARVL:DATE' => new DateValue('Date'), + 'SOUR:REPO:DPRT:ARVL:PLAC' => new PlaceName('Place'), + 'SOUR:REPO:NAME' => new CustomElement('Name of vessel'), + 'SOUR:REPO:NOTE' => new NoteStructure(I18N::translate('Note')), + 'SOUR:REPO:PORT' => new CustomElement('Port'), + 'SOUR:REPO:PORT:ARVL' => new CustomElement('Arrival'), + 'SOUR:REPO:PORT:ARVL:DATE' => new DateValue('Date'), + 'SOUR:REPO:PORT:ARVL:PLAC' => new PlaceName('Place'), + 'SOUR:REPO:TEXT' => new TextFromSource(I18N::translate('Text')), + 'SOUR:SEQU' => new CustomElement('Sequence'), + 'SOUR:STAT' => new CustomElement('Search status'), + 'SOUR:STAT:DATE' => new DateValue('Date'), + 'SOUR:TEXT' => new TextFromSource(I18N::translate('Text')), + 'SOUR:TYPE' => new CustomElement('Type of source'), + 'SOUR:VIDEO' => new CustomElement(I18N::translate('Video')), + 'SOUR:XLTR' => new CustomElement('Translator'), + ]); + + // Gedcom 5.5 extensions + $this->register([ + 'OBJE:BLOB' => new UnknownElement(I18N::translate('Binary data object')), + ]); + + // Gedcom-L extensions + $this->register([ + 'FAM:*:ADDR:_NAME' => new CustomElement('Name of addressee'), + 'FAM:*:PLAC:_GOV' => new GovIdentifier(I18N::translate('GOV identifier')), + 'FAM:*:PLAC:_LOC' => new XrefLocation(I18N::translate('Location')), + 'FAM:*:PLAC:_MAIDENHEAD' => new MaidenheadLocator('Maidenhead locator'), + 'FAM:*:PLAC:_POST' => new AddressPostalCode('Postal code'), + 'FAM:*:PLAC:_POST:DATE' => new DateValue(I18N::translate('Date')), + 'FAM:*:_ASSO' => new XrefIndividual(I18N::translate('Associate')), + 'FAM:*:_ASSO:NOTE' => new NoteStructure(I18N::translate('Note')), + 'FAM:*:_ASSO:RELA' => new RelationIsDescriptor(I18N::translate('Relationship')), + 'FAM:*:_ASSO:SOUR' => new XrefSource(I18N::translate('Source citation')), + 'FAM:_STAT' => new FamilyStatusText(I18N::translate('Family status')), + 'FAM:_STAT:DATE' => new DateValue(I18N::translate('Date')), + 'FAM:_STAT:NOTE' => new NoteStructure(I18N::translate('Note')), + 'FAM:_STAT:PLAC' => new PlaceName(I18N::translate('Place')), + 'FAM:_STAT:SOUR' => new XrefSource(I18N::translate('Source citation')), + 'FAM:_TODO' => new ResearchTask(I18N::translate('Research task')), + 'FAM:_TODO:DATA' => new SubmitterText(I18N::translate('The solution')), + 'FAM:_TODO:DATE' => new DateValue(I18N::translate('Creation date')), + 'FAM:_TODO:DESC' => new CustomElement(I18N::translate('Description')), + 'FAM:_TODO:NOTE' => new SubmitterText(I18N::translate('The problem')), + 'FAM:_TODO:REPO' => new XrefRepository('Repository'), + 'FAM:_TODO:STAT' => new ResearchTaskStatus(I18N::translate('Status')), + 'FAM:_TODO:TYPE' => new ResearchTaskType(I18N::translate('Type of research task')), + 'FAM:_TODO:_CAT' => new CustomElement(I18N::translate('Category')), + 'FAM:_TODO:_CDATE' => new DateValue(I18N::translate('Completion date')), + 'FAM:_TODO:_PRTY' => new ResearchTaskPriority(I18N::translate('Priority')), + 'FAM:_TODO:_RDATE' => new DateValue(I18N::translate('Reminder date')), + 'FAM:_UID' => new PafUid(I18N::translate('Unique identifier')), + 'HEAD:SOUR:CORP:ADDR:_NAME' => new CustomElement('Name of addressee'), + 'HEAD:_SCHEMA' => new EmptyElement(I18N::translate('Schema')), + 'HEAD:_SCHEMA:*' => new EmptyElement(I18N::translate('Base GEDCOM tag')), + 'HEAD:_SCHEMA:*:*' => new EmptyElement(I18N::translate('New GEDCOM tag')), + 'HEAD:_SCHEMA:*:*:*' => new EmptyElement(I18N::translate('New GEDCOM tag')), + 'HEAD:_SCHEMA:*:*:*:*' => new EmptyElement(I18N::translate('New GEDCOM tag')), + 'HEAD:_SCHEMA:*:*:*:*:*' => new EmptyElement(I18N::translate('New GEDCOM tag')), + 'HEAD:_SCHEMA:*:*:*:*:*:*' => new EmptyElement(I18N::translate('New GEDCOM tag')), + 'HEAD:_SCHEMA:*:*:*:*:*:*:_DEFN' => new EmptyElement(I18N::translate('Definition')), + 'HEAD:_SCHEMA:*:*:*:*:*:_DEFN' => new EmptyElement(I18N::translate('Definition')), + 'HEAD:_SCHEMA:*:*:*:*:_DEFN' => new EmptyElement(I18N::translate('Definition')), + 'HEAD:_SCHEMA:*:*:*:_DEFN' => new EmptyElement(I18N::translate('Definition')), + 'HEAD:_SCHEMA:*:*:_DEFN' => new EmptyElement(I18N::translate('Definition')), + 'INDI:*:ADDR:_NAME' => new CustomElement('Name of addressee'), + 'INDI:*:PLAC:_GOV' => new GovIdentifier(I18N::translate('GOV identifier')), + 'INDI:*:PLAC:_LOC' => new XrefLocation(I18N::translate('Location')), + 'INDI:*:PLAC:_MAIDENHEAD' => new MaidenheadLocator('Maidenhead locator'), + 'INDI:*:PLAC:_POST' => new AddressPostalCode('Postal code'), + 'INDI:*:PLAC:_POST:DATE' => new DateValue(I18N::translate('Date')), + 'INDI:*:_ASSO' => new XrefIndividual(I18N::translate('Associate')), + 'INDI:*:_ASSO:NOTE' => new NoteStructure(I18N::translate('Note')), + 'INDI:*:_ASSO:RELA' => new RelationIsDescriptor(I18N::translate('Relationship')), + 'INDI:*:_ASSO:SOUR' => new XrefSource(I18N::translate('Source citation')), + 'INDI:*:_WITN' => new CustomElement('Witness'), + 'INDI:BAPM:_GODP' => new CustomElement('Godparent'), + 'INDI:CHR:_GODP' => new CustomElement('Godparent'), + 'INDI:NAME:_RUFNAME' => new NamePieceGiven(I18N::translate('Rufname')), + 'INDI:OBJE:_PRIM' => new CustomElement(I18N::translate('Highlighted image')), + 'INDI:SEX' => new SexXValue(I18N::translate('Gender')), + 'INDI:_TODO' => new ResearchTask(I18N::translate('Research task')), + 'INDI:_TODO:DATA' => new SubmitterText(I18N::translate('The solution')), + 'INDI:_TODO:DATE' => new DateValue(I18N::translate('Creation date')), + 'INDI:_TODO:DESC' => new CustomElement(I18N::translate('Description')), + 'INDI:_TODO:NOTE' => new SubmitterText(I18N::translate('The problem')), + 'INDI:_TODO:REPO' => new XrefRepository('Repository'), + 'INDI:_TODO:STAT' => new ResearchTaskStatus(I18N::translate('Status')), + 'INDI:_TODO:TYPE' => new ResearchTaskType(I18N::translate('Type of research task')), + 'INDI:_TODO:_CAT' => new CustomElement(I18N::translate('Category')), + 'INDI:_TODO:_CDATE' => new DateValue(I18N::translate('Completion date')), + 'INDI:_TODO:_PRTY' => new ResearchTaskPriority(I18N::translate('Priority')), + 'INDI:_TODO:_RDATE' => new DateValue(I18N::translate('Reminder date')), + 'INDI:_UID' => new PafUid(I18N::translate('Unique identifier')), + 'NOTE:_UID' => new PafUid(I18N::translate('Unique identifier')), + 'OBJE:FILE:_PRIM' => new CustomElement(I18N::translate('Highlighted image')), + 'OBJE:_UID' => new PafUid(I18N::translate('Unique identifier')), + 'REPO:ADDR:_NAME' => new CustomElement('Name of addressee'), + 'REPO:_UID' => new PafUid(I18N::translate('Unique identifier')), + 'SOUR:_UID' => new PafUid(I18N::translate('Unique identifier')), + 'SUBM:ADDR:_NAME' => new CustomElement('Name of addressee'), + 'SUBM:_UID' => new PafUid(I18N::translate('Unique identifier')), + 'SUBN:_UID' => new PafUid(I18N::translate('Unique identifier')), + '_LOC' => new LocationRecord(I18N::translate('Location')), + '_LOC::NOTE' => new NoteStructure(I18N::translate('Note')), + '_LOC::OBJE' => new XrefMedia(I18N::translate('Media object')), + '_LOC::SOUR' => new XrefSource(I18N::translate('Source')), + '_LOC:CHAN' => new Change(I18N::translate('Last change')), + '_LOC:CHAN:DATE' => new ChangeDate(I18N::translate('Date of last change')), + '_LOC:CHAN:DATE:TIME' => new TimeValue(I18N::translate('Time')), + '_LOC:CHAN:NOTE' => new NoteStructure(I18N::translate('Note')), + '_LOC:EVEN' => new EventDescriptor(I18N::translate('Event')), + '_LOC:EVEN:TYPE' => new EventAttributeType(I18N::translate('Type of event')), + '_LOC:MAP' => new EmptyElement(I18N::translate('Coordinates')), + '_LOC:MAP:LATI' => new PlaceLatitude(I18N::translate('Latitude')), + '_LOC:MAP:LONG' => new PlaceLongtitude(I18N::translate('Longitude')), + '_LOC:NAME' => new PlaceName(I18N::translate('Place')), + '_LOC:NAME:ABBR' => new CustomElement(I18N::translate('Abbreviation')), + '_LOC:NAME:ABBR:TYPE' => new CustomElement(I18N::translate('Type of abbreviation')), + '_LOC:NAME:DATE' => new DateValue(I18N::translate('Date')), + '_LOC:NAME:LANG' => new LanguageId(I18N::translate('Language')), + '_LOC:NAME:SOUR' => new XrefSource(I18N::translate('Source')), + '_LOC:RELI' => new ReligiousAffiliation('Religion'), + '_LOC:TYPE' => new CustomElement(I18N::translate('Type of location')), + '_LOC:TYPE:DATE' => new DateValue(I18N::translate('Date')), + '_LOC:TYPE:SOUR' => new XrefSource(I18N::translate('Source')), + '_LOC:TYPE:_GOVTYPE' => new CustomElement('GOV identifier type'), + '_LOC:_AIDN' => new CustomElement('Administrative ID'), + '_LOC:_AIDN:DATE' => new DateValue(I18N::translate('Date')), + '_LOC:_AIDN:SOUR' => new XrefSource(I18N::translate('Source')), + '_LOC:_AIDN:TYPE' => new CustomElement(I18N::translate('Type of administrative ID')), + '_LOC:_DMGD' => new CustomElement('Demographic data'), + '_LOC:_DMGD:DATE' => new DateValue(I18N::translate('Date')), + '_LOC:_DMGD:SOUR' => new XrefSource(I18N::translate('Source')), + '_LOC:_DMGD:TYPE' => new CustomElement(I18N::translate('Type of demographic data')), + '_LOC:_GOV' => new GovIdentifier(I18N::translate('GOV identifier')), + '_LOC:_LOC' => new XrefLocation(I18N::translate('Location')), + '_LOC:_LOC:DATE' => new DateValue(I18N::translate('Date')), + '_LOC:_LOC:SOUR' => new XrefSource(I18N::translate('Source')), + '_LOC:_LOC:TYPE' => new HierarchicalRelationship(I18N::translate('Hierarchical relationship')), + '_LOC:_MAIDENHEAD' => new MaidenheadLocator('Maidenhead locator'), + '_LOC:_POST' => new AddressPostalCode(I18N::translate('Postal code')), + '_LOC:_POST:DATE' => new DateValue(I18N::translate('Date')), + '_LOC:_POST:SOUR' => new XrefSource(I18N::translate('Source')), + '_LOC:_UID' => new PafUid(I18N::translate('Unique identifier')), + ]); + + // Legacy extensions + $this->register([ + 'FAM:*:ADDR:_PRIV' => new CustomElement('Indicates that an address or event is marked as Private.'), + 'FAM:*:PLAC:_VERI' => new CustomElement('Indicates that a source citation or place name has a checkmark in the Verified column.'), + 'FAM:*:SOUR:_VERI' => new CustomElement('Indicates that a source citation or place name has a checkmark in the Verified column.'), + 'FAM:*:_PRIV' => new CustomElement('Indicates that an address or event is marked as Private.'), + 'FAM:CHIL:_FREL' => new CustomElement('The Relationship of a child to the Father (under a CHIL block under a FAM record).'), + 'FAM:CHIL:_MREL' => new CustomElement('The Relationship of a child to the Mother (under a CHIL block under a FAM record).'), + 'FAM:CHIL:_STAT' => new CustomElement('The Status of a marriage (Married, Unmarried, etc.). Also the Status of a child (Twin, Triplet, etc.). (The marriage status of Divorced is exported using a DIV tag.)'), + 'FAM:EVEN:_OVER' => new CustomElement('An event sentence override (under an EVEN block).'), + 'FAM:MARR:_STAT' => new CustomElement('The Status of a marriage (Married, Unmarried, etc.). Also the Status of a child (Twin, Triplet, etc.). (The marriage status of Divorced is exported using a DIV tag.)'), + 'FAM:SOUR:_VERI' => new CustomElement('Indicates that a source citation or place name has a checkmark in the Verified column.'), + 'FAM:_NONE' => new CustomElement('Indicates that a couple had no children (under a FAM record).'), + 'HEAD:_EVENT_DEFN' => new CustomElement('Indicates the start of an Event Definition record that describes the attributes of an event or fact.'), + 'HEAD:_EVENT_DEFN:_CONF_FLAG' => new CustomElement('Indicates that an event is Confidential or Private (under an _EVENT_DEFN record).'), + 'HEAD:_EVENT_DEFN:_DATE_TYPE' => new CustomElement('Indicates whether or not a Date field is shown for a specific event (under an _EVENT_DEFN record).'), + 'HEAD:_EVENT_DEFN:_DESC_FLAG' => new CustomElement('Indicates whether or not a Description field is shown for a specific event (under an _EVENT_DEFN record).'), + 'HEAD:_EVENT_DEFN:_PLACE_TYPE' => new CustomElement('Indicates whether or not a Place field is shown for a specific event (under an _EVENT_DEFN record).'), + 'HEAD:_EVENT_DEFN:_PP_EXCLUDE' => new CustomElement('Indicates that an event is to be Excluded from the Potential Problems reporting (under an _EVENT_DEFN record).'), + 'HEAD:_EVENT_DEFN:_SEN1' => new CustomElement('Event sentence definitions (under an _EVENT_DEFN record).'), + 'HEAD:_EVENT_DEFN:_SEN2' => new CustomElement('Event sentence definitions (under an _EVENT_DEFN record).'), + 'HEAD:_EVENT_DEFN:_SEN3' => new CustomElement('Event sentence definitions (under an _EVENT_DEFN record).'), + 'HEAD:_EVENT_DEFN:_SEN4' => new CustomElement('Event sentence definitions (under an _EVENT_DEFN record).'), + 'HEAD:_EVENT_DEFN:_SEN5' => new CustomElement('Event sentence definitions (under an _EVENT_DEFN record).'), + 'HEAD:_EVENT_DEFN:_SEN6' => new CustomElement('Event sentence definitions (under an _EVENT_DEFN record).'), + 'HEAD:_EVENT_DEFN:_SEN7' => new CustomElement('Event sentence definitions (under an _EVENT_DEFN record).'), + 'HEAD:_EVENT_DEFN:_SEN8' => new CustomElement('Event sentence definitions (under an _EVENT_DEFN record).'), + 'HEAD:_EVENT_DEFN:_SENDOF' => new CustomElement('Event sentence for PAF5 if only the Date field is filled in for a Male individual (under an _EVENT_DEFN record).'), + 'HEAD:_EVENT_DEFN:_SENDOM' => new CustomElement('Event sentence for PAF5 if only the Date field is filled in for a Male individual (under an _EVENT_DEFN record).'), + 'HEAD:_EVENT_DEFN:_SENDOU' => new CustomElement('Event sentence for PAF5 if only the Date field is filled in for a Male individual (under an _EVENT_DEFN record).'), + 'HEAD:_EVENT_DEFN:_SENDPF' => new CustomElement('Event sentence for PAF5 if only the Date and Place fields are filled in for a Male individual (under an _EVENT_DEFN record).'), + 'HEAD:_EVENT_DEFN:_SENDPM' => new CustomElement('Event sentence for PAF5 if only the Date and Place fields are filled in for a Male individual (under an _EVENT_DEFN record).'), + 'HEAD:_EVENT_DEFN:_SENDPU' => new CustomElement('Event sentence for PAF5 if only the Date and Place fields are filled in for a Male individual (under an _EVENT_DEFN record).'), + 'HEAD:_EVENT_DEFN:_SENF' => new CustomElement('Event sentence for PAF5 if all fields are filled in for a Male individual (under an _EVENT_DEFN record).'), + 'HEAD:_EVENT_DEFN:_SENM' => new CustomElement('Event sentence for PAF5 if all fields are filled in for a Male individual (under an _EVENT_DEFN record).'), + 'HEAD:_EVENT_DEFN:_SENPOF' => new CustomElement('Event sentence for PAF5 if only the Place field is filled in for a Male individual (under an _EVENT_DEFN record).'), + 'HEAD:_EVENT_DEFN:_SENPOM' => new CustomElement('Event sentence for PAF5 if only the Place field is filled in for a Male individual (under an _EVENT_DEFN record).'), + 'HEAD:_EVENT_DEFN:_SENPOU' => new CustomElement('Event sentence for PAF5 if only the Place field is filled in for a Male individual (under an _EVENT_DEFN record).'), + 'HEAD:_EVENT_DEFN:_SENU' => new CustomElement('Event sentence for PAF5 if all fields are filled in for a Male individual (under an _EVENT_DEFN record).'), + 'HEAD:_PLAC_DEFN' => new CustomElement('Indicates the start of a Place Definition record that describes the attribute of a place.'), + 'HEAD:_PLAC_DEFN:_PREP' => new CustomElement('A location Preposition (under a _PLAC_DEFN record).'), + 'INDI:*:ADDR:_LIST3 YES' => new CustomElement('Indicates that a person’s address is part of the Birthday grouping (under an ADDR block).'), + 'INDI:*:ADDR:_LIST4 YES' => new CustomElement('Indicates that a person’s address is part of the Research grouping (under an ADDR block).'), + 'INDI:*:ADDR:_LIST5 YES' => new CustomElement('Indicates that a person’s address is part of the Christmas grouping (under an ADDR block).'), + 'INDI:*:ADDR:_LIST6 YES' => new CustomElement('Indicates that a person’s address is part of the Holiday grouping (under an ADDR block).'), + 'INDI:*:ADDR:_NAME' => new CustomElement('The name of an individual as part of an address (under an ADDR block).'), + 'INDI:*:ADDR:_PRIV' => new CustomElement('Indicates that an address or event is marked as Private.'), + 'INDI:*:ADDR:_SORT' => new CustomElement('The spelling of a name to be used when sorting addresses for a report (under an ADDR block).'), + 'INDI:*:ADDR:_TAG' => new CustomElement('Indicates that an address, or place has been tagged. Also used for Tag 1 selection for an individual.'), + 'INDI:*:PLAC:_TAG' => new CustomElement('Indicates that an address, or place has been tagged. Also used for Tag 1 selection for an individual.'), + 'INDI:*:PLAC:_VERI' => new CustomElement('Indicates that a source citation or place name has a checkmark in the Verified column.'), + 'INDI:*:SOUR:_VERI' => new CustomElement('Indicates that a source citation or place name has a checkmark in the Verified column.'), + 'INDI:*:_PRIV' => new CustomElement('Indicates that an address or event is marked as Private.'), + 'INDI:ADDR:_EMAIL' => new CustomElement('An email address (under an ADDR block).'), + 'INDI:ADDR:_LIST1 YES' => new CustomElement('Indicates that a person’s address is part of the Newsletter grouping (under an ADDR block).'), + 'INDI:ADDR:_LIST2 YES' => new CustomElement('Indicates that a person’s address is part of the Family Association grouping (under an ADDR block).'), + 'INDI:EVEN:_OVER' => new CustomElement('An event sentence override (under an EVEN block).'), + 'INDI:SOUR:_VERI' => new CustomElement('Indicates that a source citation or place name has a checkmark in the Verified column.'), + 'INDI:_TAG' => new CustomElement('When under an INDI record, indicates that an individual has been given certain tag marks.'), + 'INDI:_TAG2' => new CustomElement('When under an INDI record, indicates that an individual has been given certain tag marks.'), + 'INDI:_TAG3' => new CustomElement('When under an INDI record, indicates that an individual has been given certain tag marks.'), + 'INDI:_TAG4' => new CustomElement('When under an INDI record, indicates that an individual has been given certain tag marks.'), + 'INDI:_TAG5' => new CustomElement('When under an INDI record, indicates that an individual has been given certain tag marks.'), + 'INDI:_TAG6' => new CustomElement('When under an INDI record, indicates that an individual has been given certain tag marks.'), + 'INDI:_TAG7' => new CustomElement('When under an INDI record, indicates that an individual has been given certain tag marks.'), + 'INDI:_TAG8' => new CustomElement('When under an INDI record, indicates that an individual has been given certain tag marks.'), + 'INDI:_TAG9' => new CustomElement('When under an INDI record, indicates that an individual has been given certain tag marks.'), + 'INDI:_TODO' => new CustomElement('Research task'), + 'INDI:_TODO:_CAT' => new CustomElement('The Category of a To-Do item (under a _TODO record).'), + 'INDI:_TODO:_CDATE' => new CustomElement('Closed Date of a To-Do item (under a _TODO record).'), + 'INDI:_TODO:_LOCL' => new CustomElement('The Locality of a To-Do item (under a _TODO record).'), + 'INDI:_TODO:_RDATE' => new CustomElement('Reminder date on to-do items. (Under a _TODO record.)'), + 'INDI:_UID' => new CustomElement('A Unique Identification Number given to each individual in a family file.'), + 'INDI:_URL' => new CustomElement('An Internet address (under an INDI record).'), + 'OBJE:_DATE' => new CustomElement('A date associated with a multimedia object, usually a picture or video (under an OBJE block).'), + 'OBJE:_PRIM' => new CustomElement('Means a multimedia object, usually a picture, is the Primary object (the one that is shown on a report) (under an OBJE block).'), + 'OBJE:_SCBK' => new CustomElement('Indicates that a Picture is tagged to be included in a scrapbook report (under an OBJE block).'), + 'OBJE:_SOUND' => new CustomElement('A sound file name that is attached to a picture (under an OBJE block).'), + 'OBJE:_TYPE' => new CustomElement('The type of a multimedia object: Photo, Sound, or Video (under an OBJE block).'), + 'SOUR:_ITALIC Y' => new CustomElement('Indicates that a source title should be printed on a report in italics (under a SOUR record).'), + 'SOUR:_PAREN' => new CustomElement('Indicates that the Publication Facts of a source should be printed within parentheses on a report (under a SOUR record).'), + 'SOUR:_QUOTED Y' => new CustomElement('Indicates that a source title should be printed within quotes on a report (under a SOUR record).'), + 'SOUR:_TAG NO' => new CustomElement('When used under a SOUR record, indicates to exclude the source citation detail on reports.'), + 'SOUR:_TAG2 NO' => new CustomElement('When used under a SOUR record, indicates to exclude the source citation on reports.'), + 'SOUR:_TAG3 YES' => new CustomElement('When used under a SOUR record, indicates to include the source citation detail text on reports.'), + 'SOUR:_TAG4 YES' => new CustomElement('When used under a SOUR record, indicates to include the source citation detail notes on reports.'), + '_PREF' => new CustomElement('Indicates a Preferred spouse, child or parents.'), // How is this used? + ]); + + // Personal Ancestral File extensions + $this->register([ + 'INDI:NAME:_ADPN' => new NamePersonal(I18N::translate('Adopted name')), + 'INDI:NAME:_AKA' => new NamePersonal(I18N::translate('Also known as')), + 'INDI:NAME:_AKAN' => new NamePersonal(I18N::translate('Also known as')), + 'URL' => new CustomElement(I18N::translate('URL')), + '_HEB' => new CustomElement(I18N::translate('Hebrew')), + '_NAME' => new CustomElement(I18N::translate('Mailing name')), + '_SCBK' => new CustomElement(I18N::translate('Scrapbook')), + '_SSHOW' => new CustomElement(I18N::translate('Slide show')), + '_TYPE' => new CustomElement(I18N::translate('Media type')), + '_URL' => new CustomElement(I18N::translate('URL')), + ]); + + // PhpGedView extensions + $this->register([ + 'FAM:CHAN:_PGVU' => new WebtreesUser(I18N::translate('Author of last change')), + 'FAM:COMM' => new CustomElement(I18N::translate('Comment')), + 'INDI:CHAN:_PGVU' => new WebtreesUser(I18N::translate('Author of last change')), + 'INDI:COMM' => new CustomElement(I18N::translate('Comment')), + 'INDI:NAME:_HEB' => new NamePersonal(I18N::translate('Name in Hebrew')), + 'INDI:_HOL' => new CustomEvent(I18N::translate('Holocaust')), + 'INDI:_PGV_OBJS' => new XrefMedia(I18N::translate('Re-order media')), + 'NOTE:CHAN:_PGVU' => new WebtreesUser(I18N::translate('Author of last change')), + 'OBJE:CHAN:_PGVU' => new WebtreesUser(I18N::translate('Author of last change')), + 'OBJE:_PRIM' => new CustomElement(I18N::translate('Highlighted image')), + 'OBJE:_THUM' => new CustomElement(I18N::translate('Thumbnail image')), + 'REPO:CHAN:_PGVU' => new WebtreesUser(I18N::translate('Author of last change')), + 'SOUR:CHAN:_PGVU' => new WebtreesUser(I18N::translate('Author of last change')), + 'SOUR:SERV' => new CustomElement(I18N::translate('Remote server')), + 'SOUR:URL' => new AddressWebPage(I18N::translate('URL')), + 'SOUR:URL:TYPE' => new CustomElement(I18N::translate('Type')), // e.g. "FamilySearch" + 'SOUR:URL:_BLOCK' => new CustomElement(I18N::translate('Block')), // "e.g. "false" + 'SOUR:_DBID' => new CustomElement(I18N::translate('Database name')), + 'SOUR:_DBID:_PASS' => new CustomElement(I18N::translate('Database password')), + 'SOUR:_DBID:_PASS:RESN' => new RestrictionNotice(I18N::translate('Restriction')), + 'SOUR:_DBID:_USER' => new CustomElement(I18N::translate('Database user account')), + ]); + + // Reunion extensions + $this->register([ + 'INDI:EMAL' => new AddressEmail(I18N::translate('Email address')), + 'INDI:CITN' => new CustomElement(I18N::translate('Citizenship')), + 'INDI:_LEGA' => new CustomElement(I18N::translate('Legatee')), + 'INDI:_MDCL' => new CustomElement(I18N::translate('Medical')), + 'INDI:_PURC' => new CustomElement('Land purchase'), + 'INDI:_SALE' => new CustomElement('Land sale'), + ]); + + // Roots Magic extensions + $this->register([ + 'INDI:_DNA' => new CustomElement(I18N::translate('DNA markers')), + 'SOUR:_BIBL' => new CustomElement(I18N::translate('Bibliography')), + 'SOUR:_SUBQ' => new CustomElement(I18N::translate('Abbreviation')), + ]); + + // webtrees extensions + $this->register([ + 'FAM:*:_ASSO' => new XrefIndividual(I18N::translate('Associate')), + 'FAM:*:_ASSO:RELA' => new RelationIsDescriptor(I18N::translate('Relationship')), + 'FAM:CHAN:_WT_USER' => new WebtreesUser(I18N::translate('Author of last change')), + 'FAM:_UID' => new PafUid(I18N::translate('Unique identifier')), + 'INDI:*:ASSO' => new XrefIndividual(I18N::translate('Associate')), + 'INDI:*:ASSO:RELA' => new RelationIsDescriptor(I18N::translate('Relationship')), + 'INDI:*:PLAC:_HEB' => new NoteStructure(I18N::translate('Place in Hebrew')), + 'INDI:*:_ASSO' => new XrefIndividual(I18N::translate('Associate')), + 'INDI:*:_ASSO:RELA' => new RelationIsDescriptor(I18N::translate('Relationship')), + 'INDI:CHAN:_WT_USER' => new WebtreesUser(I18N::translate('Author of last change')), + 'INDI:_UID' => new PafUid(I18N::translate('Unique identifier')), + 'INDI:_WT_OBJE_SORT' => new XrefMedia(I18N::translate('Re-order media')), + 'NOTE:CHAN:_WT_USER' => new WebtreesUser(I18N::translate('Author of last change')), + 'NOTE:RESN' => new RestrictionNotice(I18N::translate('Restriction')), + 'NOTE:_UID' => new PafUid(I18N::translate('Unique identifier')), + 'OBJE:CHAN:_WT_USER' => new WebtreesUser(I18N::translate('Author of last change')), + 'OBJE:RESN' => new RestrictionNotice(I18N::translate('Restriction')), + 'OBJE:_UID' => new PafUid(I18N::translate('Unique identifier')), + 'REPO:CHAN:_WT_USER' => new WebtreesUser(I18N::translate('Author of last change')), + 'REPO:RESN' => new RestrictionNotice(I18N::translate('Restriction')), + 'REPO:_UID' => new PafUid(I18N::translate('Unique identifier')), + 'SOUR:CHAN:_WT_USER' => new WebtreesUser(I18N::translate('Author of last change')), + 'SOUR:RESN' => new RestrictionNotice(I18N::translate('Restriction')), + 'SOUR:_UID' => new PafUid(I18N::translate('Unique identifier')), + 'SUBM:CHAN:_WT_USER' => new WebtreesUser(I18N::translate('Author of last change')), + 'SUBM:RESN' => new RestrictionNotice(I18N::translate('Restriction')), + 'SUBM:_UID' => new PafUid(I18N::translate('Unique identifier')), + 'SUBN:CHAN:_WT_USER' => new WebtreesUser(I18N::translate('Author of last change')), + 'SUBN:RESN' => new RestrictionNotice(I18N::translate('Restriction')), + 'SUBN:_UID' => new PafUid(I18N::translate('Unique identifier')), + ]); } return $this->elements; } + + /** + * Register more elements. + * + * @param array<string,ElementInterface> $elements + */ + public function register(array $elements): void + { + $this->elements = array_merge($this->elements(), $elements); + } + + /** + * @param string $tag + * + * @return ElementInterface|null + */ + private function findElementByWildcard(string $tag): ?ElementInterface + { + foreach ($this->elements() as $tags => $element) { + if (strpos($tags, '*') !== false) { + $regex = '/^' . strtr($tags, ['*' => '[^:]+']) . '$/'; + + if (preg_match($regex, $tag)) { + return $element; + } + } + } + + return null; + } } diff --git a/app/GedcomRecord.php b/app/GedcomRecord.php index 5bd27fa68d..5fcdc275fe 100644 --- a/app/GedcomRecord.php +++ b/app/GedcomRecord.php @@ -1367,7 +1367,7 @@ class GedcomRecord { $next_level = substr_count($tag, ':') + 1; $factory = Registry::elementFactory(); - $subtags = $factory->make($tag)->subtags($this->tree); + $subtags = $factory->make($tag)->subtags(); // The first part is level N (includes CONT records). The remainder are level N+1. $parts = preg_split('/\n(?=' . $next_level . ')/', $gedcom); diff --git a/app/Http/RequestHandlers/EditRecordPage.php b/app/Http/RequestHandlers/EditRecordPage.php index 86a285b207..d3f8ad0f53 100644 --- a/app/Http/RequestHandlers/EditRecordPage.php +++ b/app/Http/RequestHandlers/EditRecordPage.php @@ -55,7 +55,7 @@ class EditRecordPage implements RequestHandlerInterface $can_edit_raw = Auth::isAdmin() || $tree->getPreference('SHOW_GEDCOM_RECORD'); - $subtags = Registry::elementFactory()->make($record->tag())->subtags($tree); + $subtags = Registry::elementFactory()->make($record->tag())->subtags(); return $this->viewResponse('edit/edit-record', [ 'can_edit_raw' => $can_edit_raw, diff --git a/app/Module/ResearchTaskModule.php b/app/Module/ResearchTaskModule.php index 7d62fb7945..6a42a051a0 100644 --- a/app/Module/ResearchTaskModule.php +++ b/app/Module/ResearchTaskModule.php @@ -21,11 +21,15 @@ namespace Fisharebest\Webtrees\Module; use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\Carbon; -use Fisharebest\Webtrees\Registry; +use Fisharebest\Webtrees\Elements\IndividualRecord; +use Fisharebest\Webtrees\Elements\ResearchTask; +use Fisharebest\Webtrees\Elements\TransmissionDate; +use Fisharebest\Webtrees\Elements\WebtreesUser; use Fisharebest\Webtrees\Family; use Fisharebest\Webtrees\GedcomRecord; use Fisharebest\Webtrees\I18N; use Fisharebest\Webtrees\Individual; +use Fisharebest\Webtrees\Registry; use Fisharebest\Webtrees\Tree; use Illuminate\Database\Capsule\Manager as DB; use Illuminate\Database\Query\JoinClause; @@ -48,15 +52,16 @@ class ResearchTaskModule extends AbstractModule implements ModuleBlockInterface private const LIMIT_LOW = 10; private const LIMIT_HIGH = 20; - /** - * How should this module be identified in the control panel, etc.? - * - * @return string - */ - public function title(): string + public function boot(): void { - /* I18N: Name of a module. Tasks that need further research. */ - return I18N::translate('Research tasks'); + Registry::elementFactory()->register([ + 'FAM:_TODO' => new ResearchTask(I18N::translate('Research task')), + 'FAM:_TODO:DATE' => new TransmissionDate(I18N::translate('Date')), + 'FAM:_TODO:_WT_USER' => new WebtreesUser(I18N::translate('User')), + 'INDI:_TODO' => new ResearchTask(I18N::translate('Research task')), + 'INDI:_TODO:DATE' => new TransmissionDate(I18N::translate('Date')), + 'INDI:_TODO:_WT_USER' => new WebtreesUser(I18N::translate('User')), + ]); } /** @@ -137,6 +142,65 @@ class ResearchTaskModule extends AbstractModule implements ModuleBlockInterface } /** + * @param Tree $tree + * @param int $max_julian_day + * + * @return Collection<Individual> + */ + private function individualsWithTasks(Tree $tree, int $max_julian_day): Collection + { + return DB::table('individuals') + ->join('dates', static function (JoinClause $join): void { + $join + ->on('i_file', '=', 'd_file') + ->on('i_id', '=', 'd_gid'); + }) + ->where('i_file', '=', $tree->id()) + ->where('d_fact', '=', '_TODO') + ->where('d_julianday1', '<', $max_julian_day) + ->select(['individuals.*']) + ->distinct() + ->get() + ->map(Registry::individualFactory()->mapper($tree)) + ->filter(GedcomRecord::accessFilter()); + } + + /** + * @param Tree $tree + * @param int $max_julian_day + * + * @return Collection<Family> + */ + private function familiesWithTasks(Tree $tree, int $max_julian_day): Collection + { + return DB::table('families') + ->join('dates', static function (JoinClause $join): void { + $join + ->on('f_file', '=', 'd_file') + ->on('f_id', '=', 'd_gid'); + }) + ->where('f_file', '=', $tree->id()) + ->where('d_fact', '=', '_TODO') + ->where('d_julianday1', '<', $max_julian_day) + ->select(['families.*']) + ->distinct() + ->get() + ->map(Registry::familyFactory()->mapper($tree)) + ->filter(GedcomRecord::accessFilter()); + } + + /** + * How should this module be identified in the control panel, etc.? + * + * @return string + */ + public function title(): string + { + /* I18N: Name of a module. Tasks that need further research. */ + return I18N::translate('Research tasks'); + } + + /** * Should this block load asynchronously using AJAX? * * Simple blocks are faster in-line, more complex ones can be loaded later. @@ -172,7 +236,7 @@ class ResearchTaskModule extends AbstractModule implements ModuleBlockInterface * Update the configuration for a block. * * @param ServerRequestInterface $request - * @param int $block_id + * @param int $block_id * * @return void */ @@ -205,52 +269,4 @@ class ResearchTaskModule extends AbstractModule implements ModuleBlockInterface 'show_unassigned' => $show_unassigned, ]); } - - /** - * @param Tree $tree - * @param int $max_julian_day - * - * @return Collection<Family> - */ - private function familiesWithTasks(Tree $tree, int $max_julian_day): Collection - { - return DB::table('families') - ->join('dates', static function (JoinClause $join): void { - $join - ->on('f_file', '=', 'd_file') - ->on('f_id', '=', 'd_gid'); - }) - ->where('f_file', '=', $tree->id()) - ->where('d_fact', '=', '_TODO') - ->where('d_julianday1', '<', $max_julian_day) - ->select(['families.*']) - ->distinct() - ->get() - ->map(Registry::familyFactory()->mapper($tree)) - ->filter(GedcomRecord::accessFilter()); - } - - /** - * @param Tree $tree - * @param int $max_julian_day - * - * @return Collection<Individual> - */ - private function individualsWithTasks(Tree $tree, int $max_julian_day): Collection - { - return DB::table('individuals') - ->join('dates', static function (JoinClause $join): void { - $join - ->on('i_file', '=', 'd_file') - ->on('i_id', '=', 'd_gid'); - }) - ->where('i_file', '=', $tree->id()) - ->where('d_fact', '=', '_TODO') - ->where('d_julianday1', '<', $max_julian_day) - ->select(['individuals.*']) - ->distinct() - ->get() - ->map(Registry::individualFactory()->mapper($tree)) - ->filter(GedcomRecord::accessFilter()); - } } diff --git a/tests/app/Elements/AbstractElementTest.php b/tests/app/Elements/AbstractElementTest.php new file mode 100644 index 0000000000..092ec2f7ca --- /dev/null +++ b/tests/app/Elements/AbstractElementTest.php @@ -0,0 +1,94 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +use Fisharebest\Webtrees\Contracts\ElementInterface; +use Fisharebest\Webtrees\TestCase; +use Fisharebest\Webtrees\Tree; + +/** + * Common tests for ElementInterface + */ +abstract class AbstractElementTest extends TestCase +{ + /** @var ElementInterface */ + protected static $element; + + /** + * @return void + */ + public function testCanonical(): void + { + self::assertSame('Foo bAr baZ', self::$element->canonical("Foo bAr baZ")); + self::assertSame('Foo bAr baZ', self::$element->canonical("\t Foo\t bAr \tbaZ\t ")); + self::assertSame('Foo bAr baZ', self::$element->canonical("\nFoo \n\r bAr \r\n baZ\r")); + } + + /** + * @return void + */ + public function testEscapeAtSigns(): void + { + if (static::$element instanceof AbstractXrefElement) { + self::assertSame('@X123@', static::$element->escape('@X123@')); + } else { + self::assertSame('@@X123@@', static::$element->escape('@X123@')); + } + } + + /** + * @return void + */ + public function testXssInValue(): void + { + $tree = $this->createMock(Tree::class); + $evil = '<script>evil()</script>'; + $html = static::$element->value($evil, $tree); + $message = 'XSS vulnerability in value()'; + + self::assertStringNotContainsStringIgnoringCase($evil, $html, $message); + } + + /** + * @return void + */ + public function testXssInLabelValue(): void + { + $tree = $this->createMock(Tree::class); + $evil = '<script>evil()</script>'; + $html = static::$element->labelValue($evil, $tree); + $message = 'XSS vulnerability in lebelValue()'; + + self::assertStringNotContainsStringIgnoringCase($evil, $html, $message); + } + + /** + * @return void + */ + public function testXssInEdit(): void + { + $tree = $this->createMock(Tree::class); + $evil = '<script>evil()</script>'; + $html = static::$element->edit('id', 'name', $evil, $tree); + $message = 'XSS vulnerability in edit()'; + + self::assertStringNotContainsStringIgnoringCase($evil, $html, $message); + } +} diff --git a/tests/app/Elements/AbstractEventElementTest.php b/tests/app/Elements/AbstractEventElementTest.php new file mode 100644 index 0000000000..2322a408cb --- /dev/null +++ b/tests/app/Elements/AbstractEventElementTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class AbstractEventElement + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\AbstractEventElement + */ +class AbstractEventElementTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new AbstractEventElement('label'); + } +} diff --git a/tests/app/Elements/AbstractXrefElementTest.php b/tests/app/Elements/AbstractXrefElementTest.php new file mode 100644 index 0000000000..39f7a0a76f --- /dev/null +++ b/tests/app/Elements/AbstractXrefElementTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class AbstractXrefElement + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\AbstractXrefElement + */ +class AbstractXrefElementTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new AbstractXrefElement('label'); + } +} diff --git a/tests/app/Elements/AddressCityTest.php b/tests/app/Elements/AddressCityTest.php new file mode 100644 index 0000000000..a57d455b12 --- /dev/null +++ b/tests/app/Elements/AddressCityTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class AddressCity + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\AddressCity + */ +class AddressCityTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new AddressCity('label'); + } +} diff --git a/tests/app/Elements/AddressCountryTest.php b/tests/app/Elements/AddressCountryTest.php new file mode 100644 index 0000000000..a019c67ba8 --- /dev/null +++ b/tests/app/Elements/AddressCountryTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class AddressCountry + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\AddressCountry + */ +class AddressCountryTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new AddressCountry('label'); + } +} diff --git a/tests/app/Elements/AddressEmailTest.php b/tests/app/Elements/AddressEmailTest.php new file mode 100644 index 0000000000..c434b601a5 --- /dev/null +++ b/tests/app/Elements/AddressEmailTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class AddressEmail + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\AddressEmail + */ +class AddressEmailTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new AddressEmail('label'); + } +} diff --git a/tests/app/Elements/AddressFaxTest.php b/tests/app/Elements/AddressFaxTest.php new file mode 100644 index 0000000000..0f9a8f3e88 --- /dev/null +++ b/tests/app/Elements/AddressFaxTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class AddressFax + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\AddressFax + */ +class AddressFaxTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new AddressFax('label'); + } +} diff --git a/tests/app/Elements/AddressLine1Test.php b/tests/app/Elements/AddressLine1Test.php new file mode 100644 index 0000000000..a52c0a2c84 --- /dev/null +++ b/tests/app/Elements/AddressLine1Test.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class AddressLine1 + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\AddressLine1 + */ +class AddressLine1Test extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new AddressLine1('label'); + } +} diff --git a/tests/app/Elements/AddressLine2Test.php b/tests/app/Elements/AddressLine2Test.php new file mode 100644 index 0000000000..21a7e0d439 --- /dev/null +++ b/tests/app/Elements/AddressLine2Test.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class AddressLine2 + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\AddressLine2 + */ +class AddressLine2Test extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new AddressLine2('label'); + } +} diff --git a/tests/app/Elements/AddressLine3Test.php b/tests/app/Elements/AddressLine3Test.php new file mode 100644 index 0000000000..b860c20189 --- /dev/null +++ b/tests/app/Elements/AddressLine3Test.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class AddressLine3 + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\AddressLine3 + */ +class AddressLine3Test extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new AddressLine3('label'); + } +} diff --git a/tests/app/Elements/AddressLineTest.php b/tests/app/Elements/AddressLineTest.php new file mode 100644 index 0000000000..54f238d090 --- /dev/null +++ b/tests/app/Elements/AddressLineTest.php @@ -0,0 +1,49 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class AddressLine + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\AddressLine + */ +class AddressLineTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new AddressLine('label'); + } + + /** + * @return void + */ + public function testCanonical(): void + { + self::assertSame('Foo bAr baZ', self::$element->canonical("Foo bAr baZ")); + self::assertSame(' Foo bAr baZ ', self::$element->canonical("\t Foo\t bAr \tbaZ\t ")); + self::assertSame("\nFoo \n\n bAr \n baZ\n", self::$element->canonical("\nFoo \n\r bAr \r\n baZ\r")); + } +} diff --git a/tests/app/Elements/AddressPostalCodeTest.php b/tests/app/Elements/AddressPostalCodeTest.php new file mode 100644 index 0000000000..e0f1db54f6 --- /dev/null +++ b/tests/app/Elements/AddressPostalCodeTest.php @@ -0,0 +1,49 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class AddressPostalCode + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\AddressPostalCode + */ +class AddressPostalCodeTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new AddressPostalCode('label'); + } + + /** + * @return void + */ + public function testCanonical(): void + { + self::assertSame('FOO BAR BAZ', self::$element->canonical("Foo bAr baZ")); + self::assertSame('FOO BAR BAZ', self::$element->canonical("\t Foo\t bAr \tbaZ\t ")); + self::assertSame('FOO BAR BAZ', self::$element->canonical("\nFoo \n\r bAr \r\n baZ\r")); + } +} diff --git a/tests/app/Elements/AddressStateTest.php b/tests/app/Elements/AddressStateTest.php new file mode 100644 index 0000000000..1c41d2258f --- /dev/null +++ b/tests/app/Elements/AddressStateTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class AddressState + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\AddressState + */ +class AddressStateTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new AddressState('label'); + } +} diff --git a/tests/app/Elements/AddressWebPageTest.php b/tests/app/Elements/AddressWebPageTest.php new file mode 100644 index 0000000000..9a023bf29b --- /dev/null +++ b/tests/app/Elements/AddressWebPageTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class AddressWebPage + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\AddressWebPage + */ +class AddressWebPageTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new AddressWebPage('label'); + } +} diff --git a/tests/app/Elements/AdoptedByWhichParentTest.php b/tests/app/Elements/AdoptedByWhichParentTest.php new file mode 100644 index 0000000000..13230aae18 --- /dev/null +++ b/tests/app/Elements/AdoptedByWhichParentTest.php @@ -0,0 +1,49 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class AdoptedByWhichParent + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\AdoptedByWhichParent + */ +class AdoptedByWhichParentTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new AdoptedByWhichParent('label'); + } + + /** + * @return void + */ + public function testCanonical(): void + { + self::assertSame('FOO BAR BAZ', self::$element->canonical("Foo bAr baZ")); + self::assertSame('FOO BAR BAZ', self::$element->canonical("\t Foo\t bAr \tbaZ\t ")); + self::assertSame('FOO BAR BAZ', self::$element->canonical("\nFoo \n\r bAr \r\n baZ\r")); + } +} diff --git a/tests/app/Elements/AdoptionTest.php b/tests/app/Elements/AdoptionTest.php new file mode 100644 index 0000000000..936f5f028d --- /dev/null +++ b/tests/app/Elements/AdoptionTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class Adoption + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\Adoption + */ +class AdoptionTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new Adoption('label'); + } +} diff --git a/tests/app/Elements/AdultChristeningTest.php b/tests/app/Elements/AdultChristeningTest.php new file mode 100644 index 0000000000..73aa0fe50b --- /dev/null +++ b/tests/app/Elements/AdultChristeningTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class AdultChristening + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\AdultChristening + */ +class AdultChristeningTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new AdultChristening('label'); + } +} diff --git a/tests/app/Elements/AgeAtEventTest.php b/tests/app/Elements/AgeAtEventTest.php new file mode 100644 index 0000000000..9a7973d069 --- /dev/null +++ b/tests/app/Elements/AgeAtEventTest.php @@ -0,0 +1,52 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class AgeAtEvent + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\AgeAtEvent + */ +class AgeAtEventTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new AgeAtEvent('label'); + } + + + /** + * @return void + */ + public function testCanonical(): void + { + self::assertSame('CHILD', self::$element->canonical("cHiLd")); + self::assertSame('INFANT', self::$element->canonical("iNfAnT ")); + self::assertSame('STILLBORN', self::$element->canonical(" sTiLlBoRn")); + self::assertSame('fish', self::$element->canonical("fIsH")); + self::assertSame('1y 2m 3d', self::$element->canonical("1Y 2M 3D")); + } +} diff --git a/tests/app/Elements/AncestralFileNumberTest.php b/tests/app/Elements/AncestralFileNumberTest.php new file mode 100644 index 0000000000..e9535fa0e6 --- /dev/null +++ b/tests/app/Elements/AncestralFileNumberTest.php @@ -0,0 +1,49 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class AncestralFileNumber + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\AncestralFileNumber + */ +class AncestralFileNumberTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new AncestralFileNumber('label'); + } + + /** + * @return void + */ + public function testCanonical(): void + { + self::assertSame('FOO BAR BAZ', self::$element->canonical("Foo bAr baZ")); + self::assertSame('FOO BAR BAZ', self::$element->canonical("\t Foo\t bAr \tbaZ\t ")); + self::assertSame('FOO BAR BAZ', self::$element->canonical("\nFoo \n\r bAr \r\n baZ\r")); + } +} diff --git a/tests/app/Elements/AnnulmentTest.php b/tests/app/Elements/AnnulmentTest.php new file mode 100644 index 0000000000..3ad558564a --- /dev/null +++ b/tests/app/Elements/AnnulmentTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class Annulment + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\Annulment + */ +class AnnulmentTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new Annulment('label'); + } +} diff --git a/tests/app/Elements/ApprovedSystemIdTest.php b/tests/app/Elements/ApprovedSystemIdTest.php new file mode 100644 index 0000000000..5feb1c46ce --- /dev/null +++ b/tests/app/Elements/ApprovedSystemIdTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class ApprovedSystemId + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\ApprovedSystemId + */ +class ApprovedSystemIdTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new ApprovedSystemId('label'); + } +} diff --git a/tests/app/Elements/AttributeDescriptorTest.php b/tests/app/Elements/AttributeDescriptorTest.php new file mode 100644 index 0000000000..8874e37035 --- /dev/null +++ b/tests/app/Elements/AttributeDescriptorTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class AttributeDescriptor + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\AttributeDescriptor + */ +class AttributeDescriptorTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new AttributeDescriptor('label'); + } +} diff --git a/tests/app/Elements/AutomatedRecordIdTest.php b/tests/app/Elements/AutomatedRecordIdTest.php new file mode 100644 index 0000000000..701121047b --- /dev/null +++ b/tests/app/Elements/AutomatedRecordIdTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class AutomatedRecordId + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\AutomatedRecordId + */ +class AutomatedRecordIdTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new AutomatedRecordId('label'); + } +} diff --git a/tests/app/Elements/BaptismTest.php b/tests/app/Elements/BaptismTest.php new file mode 100644 index 0000000000..adf7e89082 --- /dev/null +++ b/tests/app/Elements/BaptismTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class Baptism + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\Baptism + */ +class BaptismTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new Baptism('label'); + } +} diff --git a/tests/app/Elements/BarMitzvahTest.php b/tests/app/Elements/BarMitzvahTest.php new file mode 100644 index 0000000000..0876d81401 --- /dev/null +++ b/tests/app/Elements/BarMitzvahTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class BarMitzvah + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\BarMitzvah + */ +class BarMitzvahTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new BarMitzvah('label'); + } +} diff --git a/tests/app/Elements/BasMitzvahTest.php b/tests/app/Elements/BasMitzvahTest.php new file mode 100644 index 0000000000..ccb3654a68 --- /dev/null +++ b/tests/app/Elements/BasMitzvahTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class BasMitzvah + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\BasMitzvah + */ +class BasMitzvahTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new BasMitzvah('label'); + } +} diff --git a/tests/app/Elements/BirthTest.php b/tests/app/Elements/BirthTest.php new file mode 100644 index 0000000000..a384eb106a --- /dev/null +++ b/tests/app/Elements/BirthTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class Birth + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\Birth + */ +class BirthTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new Birth('label'); + } +} diff --git a/tests/app/Elements/BlessingTest.php b/tests/app/Elements/BlessingTest.php new file mode 100644 index 0000000000..cf8fa82e69 --- /dev/null +++ b/tests/app/Elements/BlessingTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class Blessing + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\Blessing + */ +class BlessingTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new Blessing('label'); + } +} diff --git a/tests/app/Elements/BurialTest.php b/tests/app/Elements/BurialTest.php new file mode 100644 index 0000000000..ed44353a92 --- /dev/null +++ b/tests/app/Elements/BurialTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class Burial + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\Burial + */ +class BurialTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new Burial('label'); + } +} diff --git a/tests/app/Elements/CasteNameTest.php b/tests/app/Elements/CasteNameTest.php new file mode 100644 index 0000000000..3e4515deac --- /dev/null +++ b/tests/app/Elements/CasteNameTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class CasteName + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\CasteName + */ +class CasteNameTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new CasteName('label'); + } +} diff --git a/tests/app/Elements/CauseOfEventTest.php b/tests/app/Elements/CauseOfEventTest.php new file mode 100644 index 0000000000..e70b491194 --- /dev/null +++ b/tests/app/Elements/CauseOfEventTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class CauseOfEvent + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\CauseOfEvent + */ +class CauseOfEventTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new CauseOfEvent('label'); + } +} diff --git a/tests/app/Elements/CensusTest.php b/tests/app/Elements/CensusTest.php new file mode 100644 index 0000000000..4add6db1e4 --- /dev/null +++ b/tests/app/Elements/CensusTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class Census + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\Census + */ +class CensusTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new Census('label'); + } +} diff --git a/tests/app/Elements/CertaintyAssessmentTest.php b/tests/app/Elements/CertaintyAssessmentTest.php new file mode 100644 index 0000000000..fdde4d0c8c --- /dev/null +++ b/tests/app/Elements/CertaintyAssessmentTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class CertaintyAssessment + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\CertaintyAssessment + */ +class CertaintyAssessmentTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new CertaintyAssessment('label'); + } +} diff --git a/tests/app/Elements/ChangeDateTest.php b/tests/app/Elements/ChangeDateTest.php new file mode 100644 index 0000000000..743725743b --- /dev/null +++ b/tests/app/Elements/ChangeDateTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class ChangeDate + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\ChangeDate + */ +class ChangeDateTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new ChangeDate('label'); + } +} diff --git a/tests/app/Elements/ChangeTest.php b/tests/app/Elements/ChangeTest.php new file mode 100644 index 0000000000..f5e8e42456 --- /dev/null +++ b/tests/app/Elements/ChangeTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class Change + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\Change + */ +class ChangeTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new Change('label'); + } +} diff --git a/tests/app/Elements/CharacterSetTest.php b/tests/app/Elements/CharacterSetTest.php new file mode 100644 index 0000000000..bc9db45e05 --- /dev/null +++ b/tests/app/Elements/CharacterSetTest.php @@ -0,0 +1,49 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class CharacterSet + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\CharacterSet + */ +class CharacterSetTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new CharacterSet('label'); + } + + /** + * @return void + */ + public function testCanonical(): void + { + self::assertSame('FOO BAR BAZ', self::$element->canonical("Foo bAr baZ")); + self::assertSame('FOO BAR BAZ', self::$element->canonical("\t Foo\t bAr \tbaZ\t ")); + self::assertSame('FOO BAR BAZ', self::$element->canonical("\nFoo \n\r bAr \r\n baZ\r")); + } +} diff --git a/tests/app/Elements/ChildLinkageStatusTest.php b/tests/app/Elements/ChildLinkageStatusTest.php new file mode 100644 index 0000000000..d1bbf346b3 --- /dev/null +++ b/tests/app/Elements/ChildLinkageStatusTest.php @@ -0,0 +1,49 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class ChildLinkageStatus + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\ChildLinkageStatus + */ +class ChildLinkageStatusTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new ChildLinkageStatus('label'); + } + + /** + * @return void + */ + public function testCanonical(): void + { + self::assertSame('foo bar baz', self::$element->canonical("Foo bAr baZ")); + self::assertSame('foo bar baz', self::$element->canonical("\t Foo\t bAr \tbaZ\t ")); + self::assertSame('foo bar baz', self::$element->canonical("\nFoo \n\r bAr \r\n baZ\r")); + } +} diff --git a/tests/app/Elements/ChristeningTest.php b/tests/app/Elements/ChristeningTest.php new file mode 100644 index 0000000000..f797e212fb --- /dev/null +++ b/tests/app/Elements/ChristeningTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class Christening + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\Christening + */ +class ChristeningTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new Christening('label'); + } +} diff --git a/tests/app/Elements/ConfirmationTest.php b/tests/app/Elements/ConfirmationTest.php new file mode 100644 index 0000000000..0f2e5d7254 --- /dev/null +++ b/tests/app/Elements/ConfirmationTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class Confirmation + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\Confirmation + */ +class ConfirmationTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new Confirmation('label'); + } +} diff --git a/tests/app/Elements/ContentDescriptionTest.php b/tests/app/Elements/ContentDescriptionTest.php new file mode 100644 index 0000000000..7427d727e8 --- /dev/null +++ b/tests/app/Elements/ContentDescriptionTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class ContentDescription + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\ContentDescription + */ +class ContentDescriptionTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new ContentDescription('label'); + } +} diff --git a/tests/app/Elements/CopyrightFileTest.php b/tests/app/Elements/CopyrightFileTest.php new file mode 100644 index 0000000000..94db83f3ed --- /dev/null +++ b/tests/app/Elements/CopyrightFileTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class CopyrightFile + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\CopyrightFile + */ +class CopyrightFileTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new CopyrightFile('label'); + } +} diff --git a/tests/app/Elements/CopyrightSourceDataTest.php b/tests/app/Elements/CopyrightSourceDataTest.php new file mode 100644 index 0000000000..ef51289cc0 --- /dev/null +++ b/tests/app/Elements/CopyrightSourceDataTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class CopyrightSourceData + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\CopyrightSourceData + */ +class CopyrightSourceDataTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new CopyrightSourceData('label'); + } +} diff --git a/tests/app/Elements/CountOfChildrenTest.php b/tests/app/Elements/CountOfChildrenTest.php new file mode 100644 index 0000000000..50d8c370c2 --- /dev/null +++ b/tests/app/Elements/CountOfChildrenTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class CountOfChildren + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\CountOfChildren + */ +class CountOfChildrenTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new CountOfChildren('label'); + } +} diff --git a/tests/app/Elements/CountOfMarriagesTest.php b/tests/app/Elements/CountOfMarriagesTest.php new file mode 100644 index 0000000000..d1f4105222 --- /dev/null +++ b/tests/app/Elements/CountOfMarriagesTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class CountOfMarriages + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\CountOfMarriages + */ +class CountOfMarriagesTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new CountOfMarriages('label'); + } +} diff --git a/tests/app/Elements/CremationTest.php b/tests/app/Elements/CremationTest.php new file mode 100644 index 0000000000..bb53ab569b --- /dev/null +++ b/tests/app/Elements/CremationTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class Cremation + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\Cremation + */ +class CremationTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new Cremation('label'); + } +} diff --git a/tests/app/Elements/CustomElementTest.php b/tests/app/Elements/CustomElementTest.php new file mode 100644 index 0000000000..8fe6af9392 --- /dev/null +++ b/tests/app/Elements/CustomElementTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class CustomElement + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\CustomElement + */ +class CustomElementTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new CustomElement('label'); + } +} diff --git a/tests/app/Elements/CustomEventTest.php b/tests/app/Elements/CustomEventTest.php new file mode 100644 index 0000000000..d5f434689c --- /dev/null +++ b/tests/app/Elements/CustomEventTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class CustomEvent + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\CustomEvent + */ +class CustomEventTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new CustomEvent('label'); + } +} diff --git a/tests/app/Elements/CustomFactTest.php b/tests/app/Elements/CustomFactTest.php new file mode 100644 index 0000000000..be21cb37af --- /dev/null +++ b/tests/app/Elements/CustomFactTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class CustomFact + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\CustomFact + */ +class CustomFactTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new CustomFact('label'); + } +} diff --git a/tests/app/Elements/DateLdsOrdTest.php b/tests/app/Elements/DateLdsOrdTest.php new file mode 100644 index 0000000000..73a4f180c5 --- /dev/null +++ b/tests/app/Elements/DateLdsOrdTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class DateLdsOrd + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\DateLdsOrd + */ +class DateLdsOrdTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new DateLdsOrd('label'); + } +} diff --git a/tests/app/Elements/DateValueTest.php b/tests/app/Elements/DateValueTest.php index bf31ab99c1..ffe659a1eb 100644 --- a/tests/app/Elements/DateValueTest.php +++ b/tests/app/Elements/DateValueTest.php @@ -19,26 +19,32 @@ declare(strict_types=1); namespace Fisharebest\Webtrees\Elements; -use Fisharebest\Webtrees\TestCase; - /** * Test harness for the class DateValue * * @covers \Fisharebest\Webtrees\Elements\AbstractElement * @covers \Fisharebest\Webtrees\Elements\DateValue */ -class DateValueTest extends TestCase +class DateValueTest extends AbstractElementTest { /** - * @return void + * Standard tests for all elements. */ - public function testEscape(): void + public static function setupBeforeClass(): void { - $element = new DateValue(''); + parent::setUpBeforeClass(); + + static::$element = new DateValue('label'); + } + /** + * @return void + */ + public function testEscapeAtSigns(): void + { self::assertSame( - '@#DJULAIN@ 44 B.C. INT (says test@@example.com)', - $element->escape('@#DJULAIN@ 44 B.C. INT (says test@example.com)') + '@#DJULIAN@ 44 B.C. INT (says test@@example.com)', + static::$element->escape('@#DJULIAN@ 44 B.C. INT (says test@example.com)') ); } } diff --git a/tests/app/Elements/DeathTest.php b/tests/app/Elements/DeathTest.php new file mode 100644 index 0000000000..780a222b3d --- /dev/null +++ b/tests/app/Elements/DeathTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class Death + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\Death + */ +class DeathTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new Death('label'); + } +} diff --git a/tests/app/Elements/DemographicDataTypeTest.php b/tests/app/Elements/DemographicDataTypeTest.php new file mode 100644 index 0000000000..43c64a6a7f --- /dev/null +++ b/tests/app/Elements/DemographicDataTypeTest.php @@ -0,0 +1,49 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class DemographicDataType + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\DemographicDataType + */ +class DemographicDataTypeTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new DemographicDataType('label'); + } + + /** + * @return void + */ + public function testCanonical(): void + { + self::assertSame('FOO BAR BAZ', self::$element->canonical("Foo bAr baZ")); + self::assertSame('FOO BAR BAZ', self::$element->canonical("\t Foo\t bAr \tbaZ\t ")); + self::assertSame('FOO BAR BAZ', self::$element->canonical("\nFoo \n\r bAr \r\n baZ\r")); + } +} diff --git a/tests/app/Elements/DescriptiveTitleTest.php b/tests/app/Elements/DescriptiveTitleTest.php new file mode 100644 index 0000000000..7f91183dc7 --- /dev/null +++ b/tests/app/Elements/DescriptiveTitleTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class DescriptiveTitle + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\DescriptiveTitle + */ +class DescriptiveTitleTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new DescriptiveTitle('label'); + } +} diff --git a/tests/app/Elements/DivorceFiledTest.php b/tests/app/Elements/DivorceFiledTest.php new file mode 100644 index 0000000000..34ce69bf2a --- /dev/null +++ b/tests/app/Elements/DivorceFiledTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class DivorceFiled + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\DivorceFiled + */ +class DivorceFiledTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new DivorceFiled('label'); + } +} diff --git a/tests/app/Elements/DivorceTest.php b/tests/app/Elements/DivorceTest.php new file mode 100644 index 0000000000..270e5561f9 --- /dev/null +++ b/tests/app/Elements/DivorceTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class Divorce + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\Divorce + */ +class DivorceTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new Divorce('label'); + } +} diff --git a/tests/app/Elements/EmigrationTest.php b/tests/app/Elements/EmigrationTest.php new file mode 100644 index 0000000000..a9111f34c6 --- /dev/null +++ b/tests/app/Elements/EmigrationTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class Emigration + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\Emigration + */ +class EmigrationTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new Emigration('label'); + } +} diff --git a/tests/app/Elements/EmptyElementTest.php b/tests/app/Elements/EmptyElementTest.php new file mode 100644 index 0000000000..0b670d0207 --- /dev/null +++ b/tests/app/Elements/EmptyElementTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class EmptyElement + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\EmptyElement + */ +class EmptyElementTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new EmptyElement('label'); + } +} diff --git a/tests/app/Elements/EngagementTest.php b/tests/app/Elements/EngagementTest.php new file mode 100644 index 0000000000..a792110db0 --- /dev/null +++ b/tests/app/Elements/EngagementTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class Engagement + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\Engagement + */ +class EngagementTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new Engagement('label'); + } +} diff --git a/tests/app/Elements/EntryRecordingDateTest.php b/tests/app/Elements/EntryRecordingDateTest.php new file mode 100644 index 0000000000..b5d7bcd505 --- /dev/null +++ b/tests/app/Elements/EntryRecordingDateTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class EntryRecordingDate + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\EntryRecordingDate + */ +class EntryRecordingDateTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new EntryRecordingDate('label'); + } +} diff --git a/tests/app/Elements/EventAttributeTypeTest.php b/tests/app/Elements/EventAttributeTypeTest.php new file mode 100644 index 0000000000..e9b27fcf7b --- /dev/null +++ b/tests/app/Elements/EventAttributeTypeTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class EventAttributeType + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\EventAttributeType + */ +class EventAttributeTypeTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new EventAttributeType('label'); + } +} diff --git a/tests/app/Elements/EventDescriptorTest.php b/tests/app/Elements/EventDescriptorTest.php new file mode 100644 index 0000000000..f840fa78b7 --- /dev/null +++ b/tests/app/Elements/EventDescriptorTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class EventDescriptor + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\EventDescriptor + */ +class EventDescriptorTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new EventDescriptor('label'); + } +} diff --git a/tests/app/Elements/EventOrFactClassificationTest.php b/tests/app/Elements/EventOrFactClassificationTest.php new file mode 100644 index 0000000000..403c6280e3 --- /dev/null +++ b/tests/app/Elements/EventOrFactClassificationTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class EventOrFactClassification + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\EventOrFactClassification + */ +class EventOrFactClassificationTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new EventOrFactClassification('label'); + } +} diff --git a/tests/app/Elements/EventTypeCitedFromTest.php b/tests/app/Elements/EventTypeCitedFromTest.php new file mode 100644 index 0000000000..0fca8b4f63 --- /dev/null +++ b/tests/app/Elements/EventTypeCitedFromTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class EventTypeCitedFrom + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\EventTypeCitedFrom + */ +class EventTypeCitedFromTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new EventTypeCitedFrom('label'); + } +} diff --git a/tests/app/Elements/EventsRecordedTest.php b/tests/app/Elements/EventsRecordedTest.php new file mode 100644 index 0000000000..65a2f53640 --- /dev/null +++ b/tests/app/Elements/EventsRecordedTest.php @@ -0,0 +1,48 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class EventsRecorded + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\EventsRecorded + */ +class EventsRecordedTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new EventsRecorded('label'); + } + + /** + * @return void + */ + public function testCanonical(): void + { + self::assertSame('FOO,BAR,BAZ', self::$element->canonical("Foo , bAr, baZ")); + self::assertSame('FOO,BAR,BAZ', self::$element->canonical(", Foo, bAr ,baZ, ")); + } +} diff --git a/tests/app/Elements/FamilyRecordTest.php b/tests/app/Elements/FamilyRecordTest.php new file mode 100644 index 0000000000..8b09969a04 --- /dev/null +++ b/tests/app/Elements/FamilyRecordTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class FamilyRecord + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\FamilyRecord + */ +class FamilyRecordTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new FamilyRecord('label'); + } +} diff --git a/tests/app/Elements/FamilyStatusTextTest.php b/tests/app/Elements/FamilyStatusTextTest.php new file mode 100644 index 0000000000..76b34dd107 --- /dev/null +++ b/tests/app/Elements/FamilyStatusTextTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class FamilyStatusText + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\FamilyStatusText + */ +class FamilyStatusTextTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new FamilyStatusText('label'); + } +} diff --git a/tests/app/Elements/FileNameTest.php b/tests/app/Elements/FileNameTest.php new file mode 100644 index 0000000000..19905f59e2 --- /dev/null +++ b/tests/app/Elements/FileNameTest.php @@ -0,0 +1,49 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class FileName + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\FileName + */ +class FileNameTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new FileName('label'); + } + + /** + * @return void + */ + public function testCanonical(): void + { + self::assertSame('Foo bAr baZ', self::$element->canonical("Foo bAr baZ")); + self::assertSame(' Foo bAr baZ ', self::$element->canonical("\t Foo\t bAr \tbaZ\t ")); + self::assertSame('Foo bAr baZ', self::$element->canonical("\nFoo \n\r bAr \r\n baZ\r")); + } +} diff --git a/tests/app/Elements/FirstCommunionTest.php b/tests/app/Elements/FirstCommunionTest.php new file mode 100644 index 0000000000..7f47f6694a --- /dev/null +++ b/tests/app/Elements/FirstCommunionTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class FirstCommunion + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\FirstCommunion + */ +class FirstCommunionTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new FirstCommunion('label'); + } +} diff --git a/tests/app/Elements/FormTest.php b/tests/app/Elements/FormTest.php new file mode 100644 index 0000000000..b35bbc524e --- /dev/null +++ b/tests/app/Elements/FormTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class Form + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\Form + */ +class FormTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new Form('label'); + } +} diff --git a/tests/app/Elements/GedcomTest.php b/tests/app/Elements/GedcomTest.php new file mode 100644 index 0000000000..05066dd4c4 --- /dev/null +++ b/tests/app/Elements/GedcomTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class Gedcom + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\Gedcom + */ +class GedcomTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new Gedcom('label'); + } +} diff --git a/tests/app/Elements/GenerationsOfAncestorsTest.php b/tests/app/Elements/GenerationsOfAncestorsTest.php new file mode 100644 index 0000000000..006d3dfb76 --- /dev/null +++ b/tests/app/Elements/GenerationsOfAncestorsTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class GenerationsOfAncestors + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\GenerationsOfAncestors + */ +class GenerationsOfAncestorsTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new GenerationsOfAncestors('label'); + } +} diff --git a/tests/app/Elements/GenerationsOfDescendantsTest.php b/tests/app/Elements/GenerationsOfDescendantsTest.php new file mode 100644 index 0000000000..295e49d2f8 --- /dev/null +++ b/tests/app/Elements/GenerationsOfDescendantsTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class GenerationsOfDescendants + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\GenerationsOfDescendants + */ +class GenerationsOfDescendantsTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new GenerationsOfDescendants('label'); + } +} diff --git a/tests/app/Elements/GovIdTypeTest.php b/tests/app/Elements/GovIdTypeTest.php new file mode 100644 index 0000000000..a0a87d7b6d --- /dev/null +++ b/tests/app/Elements/GovIdTypeTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class GovIdType + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\GovIdType + */ +class GovIdTypeTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new GovIdType('label'); + } +} diff --git a/tests/app/Elements/GovIdentifierTest.php b/tests/app/Elements/GovIdentifierTest.php new file mode 100644 index 0000000000..123adaea87 --- /dev/null +++ b/tests/app/Elements/GovIdentifierTest.php @@ -0,0 +1,49 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class GovIdentifier + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\GovIdentifier + */ +class GovIdentifierTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new GovIdentifier('label'); + } + + /** + * @return void + */ + public function testCanonical(): void + { + self::assertSame('FOO BAR BAZ', self::$element->canonical("Foo bAr baZ")); + self::assertSame('FOO BAR BAZ', self::$element->canonical("\t Foo\t bAr \tbaZ\t ")); + self::assertSame('FOO BAR BAZ', self::$element->canonical("\nFoo \n\r bAr \r\n baZ\r")); + } +} diff --git a/tests/app/Elements/GraduationTest.php b/tests/app/Elements/GraduationTest.php new file mode 100644 index 0000000000..6f959b99d1 --- /dev/null +++ b/tests/app/Elements/GraduationTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class Graduation + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\Graduation + */ +class GraduationTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new Graduation('label'); + } +} diff --git a/tests/app/Elements/HeaderRecordTest.php b/tests/app/Elements/HeaderRecordTest.php new file mode 100644 index 0000000000..a181839743 --- /dev/null +++ b/tests/app/Elements/HeaderRecordTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class HeaderRecord + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\HeaderRecord + */ +class HeaderRecordTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new HeaderRecord('label'); + } +} diff --git a/tests/app/Elements/HierarchicalRelationshipTest.php b/tests/app/Elements/HierarchicalRelationshipTest.php new file mode 100644 index 0000000000..312533728e --- /dev/null +++ b/tests/app/Elements/HierarchicalRelationshipTest.php @@ -0,0 +1,49 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class HierarchicalRelationship + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\HierarchicalRelationship + */ +class HierarchicalRelationshipTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new HierarchicalRelationship('label'); + } + + /** + * @return void + */ + public function testCanonical(): void + { + self::assertSame('FOO BAR BAZ', self::$element->canonical("Foo bAr baZ")); + self::assertSame('FOO BAR BAZ', self::$element->canonical("\t Foo\t bAr \tbaZ\t ")); + self::assertSame('FOO BAR BAZ', self::$element->canonical("\nFoo \n\r bAr \r\n baZ\r")); + } +} diff --git a/tests/app/Elements/ImmigrationTest.php b/tests/app/Elements/ImmigrationTest.php new file mode 100644 index 0000000000..d50cacd37c --- /dev/null +++ b/tests/app/Elements/ImmigrationTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class Immigration + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\Immigration + */ +class ImmigrationTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new Immigration('label'); + } +} diff --git a/tests/app/Elements/IndividualRecordTest.php b/tests/app/Elements/IndividualRecordTest.php new file mode 100644 index 0000000000..481b2d12bc --- /dev/null +++ b/tests/app/Elements/IndividualRecordTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class IndividualRecord + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\IndividualRecord + */ +class IndividualRecordTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new IndividualRecord('label'); + } +} diff --git a/tests/app/Elements/LanguageIdTest.php b/tests/app/Elements/LanguageIdTest.php index 35b024cf44..32a3641b1f 100644 --- a/tests/app/Elements/LanguageIdTest.php +++ b/tests/app/Elements/LanguageIdTest.php @@ -27,18 +27,26 @@ use Fisharebest\Webtrees\TestCase; * @covers \Fisharebest\Webtrees\Elements\AbstractElement * @covers \Fisharebest\Webtrees\Elements\LanguageId */ -class LanguageIdTest extends TestCase +class LanguageIdTest extends AbstractElementTest { /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + static::$element = new LanguageId('label'); + } + + /** * @return void */ public function testCanonical(): void { - $element = new LanguageId(''); - - self::assertSame('English', $element->canonical("\t English\t ")); - self::assertSame('Klingon', $element->canonical('kLiNgOn')); - self::assertSame('Anglo-Saxon', $element->canonical('anglo-saxon')); - self::assertSame('Catalan_Spn', $element->canonical('CATALAN_SPN')); + self::assertSame('English', self::$element->canonical("\t English\t ")); + self::assertSame('Klingon', self::$element->canonical('kLiNgOn')); + self::assertSame('Anglo-Saxon', self::$element->canonical('anglo-saxon')); + self::assertSame('Catalan_Spn', self::$element->canonical('CATALAN_SPN')); } } diff --git a/tests/app/Elements/LdsBaptismDateStatusTest.php b/tests/app/Elements/LdsBaptismDateStatusTest.php new file mode 100644 index 0000000000..a26339d6bd --- /dev/null +++ b/tests/app/Elements/LdsBaptismDateStatusTest.php @@ -0,0 +1,49 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class LdsBaptismDateStatus + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\LdsBaptismDateStatus + */ +class LdsBaptismDateStatusTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new LdsBaptismDateStatus('label'); + } + + /** + * @return void + */ + public function testCanonical(): void + { + self::assertSame('FOO BAR BAZ', self::$element->canonical("Foo bAr baZ")); + self::assertSame('FOO BAR BAZ', self::$element->canonical("\t Foo\t bAr \tbaZ\t ")); + self::assertSame('FOO BAR BAZ', self::$element->canonical("\nFoo \n\r bAr \r\n baZ\r")); + } +} diff --git a/tests/app/Elements/LdsBaptismTest.php b/tests/app/Elements/LdsBaptismTest.php new file mode 100644 index 0000000000..4a6c101aeb --- /dev/null +++ b/tests/app/Elements/LdsBaptismTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class LdsBaptism + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\LdsBaptism + */ +class LdsBaptismTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new LdsBaptism('label'); + } +} diff --git a/tests/app/Elements/LdsChildSealingDateStatusTest.php b/tests/app/Elements/LdsChildSealingDateStatusTest.php new file mode 100644 index 0000000000..d0d599499f --- /dev/null +++ b/tests/app/Elements/LdsChildSealingDateStatusTest.php @@ -0,0 +1,49 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class LdsChildSealingDateStatus + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\LdsChildSealingDateStatus + */ +class LdsChildSealingDateStatusTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new LdsChildSealingDateStatus('label'); + } + + /** + * @return void + */ + public function testCanonical(): void + { + self::assertSame('FOO BAR BAZ', self::$element->canonical("Foo bAr baZ")); + self::assertSame('FOO BAR BAZ', self::$element->canonical("\t Foo\t bAr \tbaZ\t ")); + self::assertSame('FOO BAR BAZ', self::$element->canonical("\nFoo \n\r bAr \r\n baZ\r")); + } +} diff --git a/tests/app/Elements/LdsChildSealingTest.php b/tests/app/Elements/LdsChildSealingTest.php new file mode 100644 index 0000000000..4e78f68177 --- /dev/null +++ b/tests/app/Elements/LdsChildSealingTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class LdsChildSealing + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\LdsChildSealing + */ +class LdsChildSealingTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new LdsChildSealing('label'); + } +} diff --git a/tests/app/Elements/LdsConfirmationTest.php b/tests/app/Elements/LdsConfirmationTest.php new file mode 100644 index 0000000000..df14e58cd8 --- /dev/null +++ b/tests/app/Elements/LdsConfirmationTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class LdsConfirmation + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\LdsConfirmation + */ +class LdsConfirmationTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new LdsConfirmation('label'); + } +} diff --git a/tests/app/Elements/LdsEndowmentDateStatusTest.php b/tests/app/Elements/LdsEndowmentDateStatusTest.php new file mode 100644 index 0000000000..0f050c7340 --- /dev/null +++ b/tests/app/Elements/LdsEndowmentDateStatusTest.php @@ -0,0 +1,49 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class LdsEndowmentDateStatus + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\LdsEndowmentDateStatus + */ +class LdsEndowmentDateStatusTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new LdsEndowmentDateStatus('label'); + } + + /** + * @return void + */ + public function testCanonical(): void + { + self::assertSame('FOO BAR BAZ', self::$element->canonical("Foo bAr baZ")); + self::assertSame('FOO BAR BAZ', self::$element->canonical("\t Foo\t bAr \tbaZ\t ")); + self::assertSame('FOO BAR BAZ', self::$element->canonical("\nFoo \n\r bAr \r\n baZ\r")); + } +} diff --git a/tests/app/Elements/LdsEndowmentTest.php b/tests/app/Elements/LdsEndowmentTest.php new file mode 100644 index 0000000000..caf17f200a --- /dev/null +++ b/tests/app/Elements/LdsEndowmentTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class LdsEndowment + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\LdsEndowment + */ +class LdsEndowmentTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new LdsEndowment('label'); + } +} diff --git a/tests/app/Elements/LdsSpouseSealingDateStatusTest.php b/tests/app/Elements/LdsSpouseSealingDateStatusTest.php new file mode 100644 index 0000000000..8df7e710d5 --- /dev/null +++ b/tests/app/Elements/LdsSpouseSealingDateStatusTest.php @@ -0,0 +1,49 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class LdsSpouseSealingDateStatus + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\LdsSpouseSealingDateStatus + */ +class LdsSpouseSealingDateStatusTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new LdsSpouseSealingDateStatus('label'); + } + + /** + * @return void + */ + public function testCanonical(): void + { + self::assertSame('FOO BAR BAZ', self::$element->canonical("Foo bAr baZ")); + self::assertSame('FOO BAR BAZ', self::$element->canonical("\t Foo\t bAr \tbaZ\t ")); + self::assertSame('FOO BAR BAZ', self::$element->canonical("\nFoo \n\r bAr \r\n baZ\r")); + } +} diff --git a/tests/app/Elements/LdsSpouseSealingTest.php b/tests/app/Elements/LdsSpouseSealingTest.php new file mode 100644 index 0000000000..0c60174e80 --- /dev/null +++ b/tests/app/Elements/LdsSpouseSealingTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class LdsSpouseSealing + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\LdsSpouseSealing + */ +class LdsSpouseSealingTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new LdsSpouseSealing('label'); + } +} diff --git a/tests/app/Elements/LocationRecordTest.php b/tests/app/Elements/LocationRecordTest.php new file mode 100644 index 0000000000..9d7622372b --- /dev/null +++ b/tests/app/Elements/LocationRecordTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class LocationRecord + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\LocationRecord + */ +class LocationRecordTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new LocationRecord('label'); + } +} diff --git a/tests/app/Elements/MaidenheadLocatorTest.php b/tests/app/Elements/MaidenheadLocatorTest.php new file mode 100644 index 0000000000..b058c06d73 --- /dev/null +++ b/tests/app/Elements/MaidenheadLocatorTest.php @@ -0,0 +1,55 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class MaidenheadLocator + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\MaidenheadLocator + */ +class MaidenheadLocatorTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new MaidenheadLocator('label'); + } + + + /** + * @return void + */ + public function testCanonical(): void + { + self::assertSame('AB', self::$element->canonical("ab")); + self::assertSame('AB', self::$element->canonical("AB")); + self::assertSame('AB12', self::$element->canonical("ab12")); + self::assertSame('AB12', self::$element->canonical("AB12")); + self::assertSame('AB12cd', self::$element->canonical("ab12cd")); + self::assertSame('AB12cd', self::$element->canonical("AB12CD")); + self::assertSame('AB12cd34', self::$element->canonical("ab12cd34")); + self::assertSame('AB12cd34', self::$element->canonical("AB12CD34")); + } +} diff --git a/tests/app/Elements/MarriageBannsTest.php b/tests/app/Elements/MarriageBannsTest.php new file mode 100644 index 0000000000..0a69008a91 --- /dev/null +++ b/tests/app/Elements/MarriageBannsTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class MarriageBanns + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\MarriageBanns + */ +class MarriageBannsTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new MarriageBanns('label'); + } +} diff --git a/tests/app/Elements/MarriageContractTest.php b/tests/app/Elements/MarriageContractTest.php new file mode 100644 index 0000000000..b97fa76df9 --- /dev/null +++ b/tests/app/Elements/MarriageContractTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class MarriageContract + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\MarriageContract + */ +class MarriageContractTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new MarriageContract('label'); + } +} diff --git a/tests/app/Elements/MarriageLicenceTest.php b/tests/app/Elements/MarriageLicenceTest.php new file mode 100644 index 0000000000..189fa17f94 --- /dev/null +++ b/tests/app/Elements/MarriageLicenceTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class MarriageLicence + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\MarriageLicence + */ +class MarriageLicenceTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new MarriageLicence('label'); + } +} diff --git a/tests/app/Elements/MarriageSettlementTest.php b/tests/app/Elements/MarriageSettlementTest.php new file mode 100644 index 0000000000..35257361e3 --- /dev/null +++ b/tests/app/Elements/MarriageSettlementTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class MarriageSettlement + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\MarriageSettlement + */ +class MarriageSettlementTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new MarriageSettlement('label'); + } +} diff --git a/tests/app/Elements/MarriageTest.php b/tests/app/Elements/MarriageTest.php new file mode 100644 index 0000000000..ce37225478 --- /dev/null +++ b/tests/app/Elements/MarriageTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class Marriage + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\Marriage + */ +class MarriageTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new Marriage('label'); + } +} diff --git a/tests/app/Elements/MarriageTypeTest.php b/tests/app/Elements/MarriageTypeTest.php new file mode 100644 index 0000000000..294e8e017f --- /dev/null +++ b/tests/app/Elements/MarriageTypeTest.php @@ -0,0 +1,49 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class MarriageType + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\MarriageType + */ +class MarriageTypeTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new MarriageType('label'); + } + + /** + * @return void + */ + public function testCanonical(): void + { + self::assertSame('Foo bar baz', self::$element->canonical("Foo bAr baZ")); + self::assertSame('Foo bar baz', self::$element->canonical("\t Foo\t bAr \tbaZ\t ")); + self::assertSame('Foo bar baz', self::$element->canonical("\nFoo \n\r bAr \r\n baZ\r")); + } +} diff --git a/tests/app/Elements/MediaRecordTest.php b/tests/app/Elements/MediaRecordTest.php new file mode 100644 index 0000000000..4de468fb0c --- /dev/null +++ b/tests/app/Elements/MediaRecordTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class MediaRecord + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\MediaRecord + */ +class MediaRecordTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new MediaRecord('label'); + } +} diff --git a/tests/app/Elements/MultimediaFileReferenceTest.php b/tests/app/Elements/MultimediaFileReferenceTest.php new file mode 100644 index 0000000000..426acc8e92 --- /dev/null +++ b/tests/app/Elements/MultimediaFileReferenceTest.php @@ -0,0 +1,49 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class MultimediaFileReference + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\MultimediaFileReference + */ +class MultimediaFileReferenceTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new MultimediaFileReference('label'); + } + + /** + * @return void + */ + public function testCanonical(): void + { + self::assertSame('Foo bAr baZ', self::$element->canonical("Foo bAr baZ")); + self::assertSame(' Foo bAr baZ ', self::$element->canonical("\t Foo\t bAr \tbaZ\t ")); + self::assertSame('Foo bAr baZ', self::$element->canonical("\nFoo \n\r bAr \r\n baZ\r")); + } +} diff --git a/tests/app/Elements/MultimediaFormatTest.php b/tests/app/Elements/MultimediaFormatTest.php new file mode 100644 index 0000000000..37ac21078c --- /dev/null +++ b/tests/app/Elements/MultimediaFormatTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class MultimediaFormat + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\MultimediaFormat + */ +class MultimediaFormatTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new MultimediaFormat('label'); + } +} diff --git a/tests/app/Elements/NameOfBusinessTest.php b/tests/app/Elements/NameOfBusinessTest.php new file mode 100644 index 0000000000..4f897daf49 --- /dev/null +++ b/tests/app/Elements/NameOfBusinessTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class NameOfBusiness + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\NameOfBusiness + */ +class NameOfBusinessTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new NameOfBusiness('label'); + } +} diff --git a/tests/app/Elements/NameOfFamilyFileTest.php b/tests/app/Elements/NameOfFamilyFileTest.php new file mode 100644 index 0000000000..7c17277245 --- /dev/null +++ b/tests/app/Elements/NameOfFamilyFileTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class NameOfFamilyFile + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\NameOfFamilyFile + */ +class NameOfFamilyFileTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new NameOfFamilyFile('label'); + } +} diff --git a/tests/app/Elements/NameOfProductTest.php b/tests/app/Elements/NameOfProductTest.php new file mode 100644 index 0000000000..4b563bb7b7 --- /dev/null +++ b/tests/app/Elements/NameOfProductTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class NameOfProduct + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\NameOfProduct + */ +class NameOfProductTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new NameOfProduct('label'); + } +} diff --git a/tests/app/Elements/NameOfRepositoryTest.php b/tests/app/Elements/NameOfRepositoryTest.php new file mode 100644 index 0000000000..e668083c58 --- /dev/null +++ b/tests/app/Elements/NameOfRepositoryTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class NameOfRepository + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\NameOfRepository + */ +class NameOfRepositoryTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new NameOfRepository('label'); + } +} diff --git a/tests/app/Elements/NameOfSourceDataTest.php b/tests/app/Elements/NameOfSourceDataTest.php new file mode 100644 index 0000000000..9b4133b889 --- /dev/null +++ b/tests/app/Elements/NameOfSourceDataTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class NameOfSourceData + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\NameOfSourceData + */ +class NameOfSourceDataTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new NameOfSourceData('label'); + } +} diff --git a/tests/app/Elements/NamePersonalTest.php b/tests/app/Elements/NamePersonalTest.php new file mode 100644 index 0000000000..cdeae70d87 --- /dev/null +++ b/tests/app/Elements/NamePersonalTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class NamePersonal + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\NamePersonal + */ +class NamePersonalTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new NamePersonal('label'); + } +} diff --git a/tests/app/Elements/NamePhoneticVariationTest.php b/tests/app/Elements/NamePhoneticVariationTest.php new file mode 100644 index 0000000000..f88a94da24 --- /dev/null +++ b/tests/app/Elements/NamePhoneticVariationTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class NamePhoneticVariation + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\NamePhoneticVariation + */ +class NamePhoneticVariationTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new NamePhoneticVariation('label'); + } +} diff --git a/tests/app/Elements/NamePieceGivenTest.php b/tests/app/Elements/NamePieceGivenTest.php new file mode 100644 index 0000000000..a3c6f5ac3b --- /dev/null +++ b/tests/app/Elements/NamePieceGivenTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class NamePieceGiven + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\NamePieceGiven + */ +class NamePieceGivenTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new NamePieceGiven('label'); + } +} diff --git a/tests/app/Elements/NamePieceNicknameTest.php b/tests/app/Elements/NamePieceNicknameTest.php new file mode 100644 index 0000000000..6211c00b84 --- /dev/null +++ b/tests/app/Elements/NamePieceNicknameTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class NamePieceNickname + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\NamePieceNickname + */ +class NamePieceNicknameTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new NamePieceNickname('label'); + } +} diff --git a/tests/app/Elements/NamePiecePrefixTest.php b/tests/app/Elements/NamePiecePrefixTest.php new file mode 100644 index 0000000000..ec6fee6f53 --- /dev/null +++ b/tests/app/Elements/NamePiecePrefixTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class NamePiecePrefix + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\NamePiecePrefix + */ +class NamePiecePrefixTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new NamePiecePrefix('label'); + } +} diff --git a/tests/app/Elements/NamePieceSuffixTest.php b/tests/app/Elements/NamePieceSuffixTest.php new file mode 100644 index 0000000000..fd384dd859 --- /dev/null +++ b/tests/app/Elements/NamePieceSuffixTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class NamePieceSuffix + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\NamePieceSuffix + */ +class NamePieceSuffixTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new NamePieceSuffix('label'); + } +} diff --git a/tests/app/Elements/NamePieceSurnamePrefixTest.php b/tests/app/Elements/NamePieceSurnamePrefixTest.php new file mode 100644 index 0000000000..51d17926c0 --- /dev/null +++ b/tests/app/Elements/NamePieceSurnamePrefixTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class NamePieceSurnamePrefix + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\NamePieceSurnamePrefix + */ +class NamePieceSurnamePrefixTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new NamePieceSurnamePrefix('label'); + } +} diff --git a/tests/app/Elements/NamePieceSurnameTest.php b/tests/app/Elements/NamePieceSurnameTest.php new file mode 100644 index 0000000000..ac515534ad --- /dev/null +++ b/tests/app/Elements/NamePieceSurnameTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class NamePieceSurname + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\NamePieceSurname + */ +class NamePieceSurnameTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new NamePieceSurname('label'); + } +} diff --git a/tests/app/Elements/NameRomanizedVariationTest.php b/tests/app/Elements/NameRomanizedVariationTest.php new file mode 100644 index 0000000000..f8a713e964 --- /dev/null +++ b/tests/app/Elements/NameRomanizedVariationTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class NameRomanizedVariation + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\NameRomanizedVariation + */ +class NameRomanizedVariationTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new NameRomanizedVariation('label'); + } +} diff --git a/tests/app/Elements/NameTypeTest.php b/tests/app/Elements/NameTypeTest.php new file mode 100644 index 0000000000..42606d075d --- /dev/null +++ b/tests/app/Elements/NameTypeTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class NameType + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\NameType + */ +class NameTypeTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new NameType('label'); + } +} diff --git a/tests/app/Elements/NationOrTribalOriginTest.php b/tests/app/Elements/NationOrTribalOriginTest.php new file mode 100644 index 0000000000..3ab5d39a13 --- /dev/null +++ b/tests/app/Elements/NationOrTribalOriginTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class NationOrTribalOrigin + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\NationOrTribalOrigin + */ +class NationOrTribalOriginTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new NationOrTribalOrigin('label'); + } +} diff --git a/tests/app/Elements/NationalIdNumberTest.php b/tests/app/Elements/NationalIdNumberTest.php new file mode 100644 index 0000000000..013c47504e --- /dev/null +++ b/tests/app/Elements/NationalIdNumberTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class NationalIdNumber + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\NationalIdNumber + */ +class NationalIdNumberTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new NationalIdNumber('label'); + } +} diff --git a/tests/app/Elements/NaturalizationTest.php b/tests/app/Elements/NaturalizationTest.php new file mode 100644 index 0000000000..ac8d060512 --- /dev/null +++ b/tests/app/Elements/NaturalizationTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class Naturalization + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\Naturalization + */ +class NaturalizationTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new Naturalization('label'); + } +} diff --git a/tests/app/Elements/NobilityTypeTitleTest.php b/tests/app/Elements/NobilityTypeTitleTest.php new file mode 100644 index 0000000000..b977b5ca07 --- /dev/null +++ b/tests/app/Elements/NobilityTypeTitleTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class NobilityTypeTitle + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\NobilityTypeTitle + */ +class NobilityTypeTitleTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new NobilityTypeTitle('label'); + } +} diff --git a/tests/app/Elements/NoteRecordTest.php b/tests/app/Elements/NoteRecordTest.php new file mode 100644 index 0000000000..8028449b90 --- /dev/null +++ b/tests/app/Elements/NoteRecordTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class NoteRecord + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\NoteRecord + */ +class NoteRecordTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new NoteRecord('label'); + } +} diff --git a/tests/app/Elements/NoteStructureTest.php b/tests/app/Elements/NoteStructureTest.php new file mode 100644 index 0000000000..13ced2e2c1 --- /dev/null +++ b/tests/app/Elements/NoteStructureTest.php @@ -0,0 +1,49 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class NoteStructure + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\NoteStructure + */ +class NoteStructureTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new NoteStructure('label'); + } + + /** + * @return void + */ + public function testCanonical(): void + { + self::assertSame('Foo bAr baZ', self::$element->canonical("Foo bAr baZ")); + self::assertSame(' Foo bAr baZ ', self::$element->canonical("\t Foo\t bAr \tbaZ\t ")); + self::assertSame("\nFoo \n\n bAr \n baZ\n", self::$element->canonical("\nFoo \n\r bAr \r\n baZ\r")); + } +} diff --git a/tests/app/Elements/OccupationTest.php b/tests/app/Elements/OccupationTest.php new file mode 100644 index 0000000000..4f14cc2528 --- /dev/null +++ b/tests/app/Elements/OccupationTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class Occupation + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\Occupation + */ +class OccupationTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new Occupation('label'); + } +} diff --git a/tests/app/Elements/OrdinanceProcessFlagTest.php b/tests/app/Elements/OrdinanceProcessFlagTest.php new file mode 100644 index 0000000000..1f892906f8 --- /dev/null +++ b/tests/app/Elements/OrdinanceProcessFlagTest.php @@ -0,0 +1,50 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class OrdinanceProcessFlag + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\OrdinanceProcessFlag + */ +class OrdinanceProcessFlagTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new OrdinanceProcessFlag('label'); + } + + + /** + * @return void + */ + public function testCanonical(): void + { + self::assertSame('foo bar baz', self::$element->canonical("Foo bAr baZ")); + self::assertSame('foo bar baz', self::$element->canonical("\t Foo\t bAr \tbaZ\t ")); + self::assertSame('foo bar baz', self::$element->canonical("\nFoo \n\r bAr \r\n baZ\r")); + } +} diff --git a/tests/app/Elements/OrdinationTest.php b/tests/app/Elements/OrdinationTest.php new file mode 100644 index 0000000000..9f43cae2ac --- /dev/null +++ b/tests/app/Elements/OrdinationTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class Ordination + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\Ordination + */ +class OrdinationTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new Ordination('label'); + } +} diff --git a/tests/app/Elements/PafUidTest.php b/tests/app/Elements/PafUidTest.php new file mode 100644 index 0000000000..e1dfea944b --- /dev/null +++ b/tests/app/Elements/PafUidTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class PafUid + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\PafUid + */ +class PafUidTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new PafUid('label'); + } +} diff --git a/tests/app/Elements/PedigreeLinkageTypeTest.php b/tests/app/Elements/PedigreeLinkageTypeTest.php new file mode 100644 index 0000000000..71393421ac --- /dev/null +++ b/tests/app/Elements/PedigreeLinkageTypeTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class PedigreeLinkageType + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\PedigreeLinkageType + */ +class PedigreeLinkageTypeTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new PedigreeLinkageType('label'); + } +} diff --git a/tests/app/Elements/PermanentRecordFileNumberTest.php b/tests/app/Elements/PermanentRecordFileNumberTest.php new file mode 100644 index 0000000000..f012710678 --- /dev/null +++ b/tests/app/Elements/PermanentRecordFileNumberTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class PermanentRecordFileNumber + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\PermanentRecordFileNumber + */ +class PermanentRecordFileNumberTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new PermanentRecordFileNumber('label'); + } +} diff --git a/tests/app/Elements/PhoneNumberTest.php b/tests/app/Elements/PhoneNumberTest.php new file mode 100644 index 0000000000..3b38718966 --- /dev/null +++ b/tests/app/Elements/PhoneNumberTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class PhoneNumber + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\PhoneNumber + */ +class PhoneNumberTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new PhoneNumber('label'); + } +} diff --git a/tests/app/Elements/PhoneticTypeTest.php b/tests/app/Elements/PhoneticTypeTest.php new file mode 100644 index 0000000000..58d88102e3 --- /dev/null +++ b/tests/app/Elements/PhoneticTypeTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class PhoneticType + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\PhoneticType + */ +class PhoneticTypeTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new PhoneticType('label'); + } +} diff --git a/tests/app/Elements/PhysicalDescriptionTest.php b/tests/app/Elements/PhysicalDescriptionTest.php new file mode 100644 index 0000000000..bb6dc40cc6 --- /dev/null +++ b/tests/app/Elements/PhysicalDescriptionTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class PhysicalDescription + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\PhysicalDescription + */ +class PhysicalDescriptionTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new PhysicalDescription('label'); + } +} diff --git a/tests/app/Elements/PlaceHierarchyTest.php b/tests/app/Elements/PlaceHierarchyTest.php new file mode 100644 index 0000000000..177a2890c3 --- /dev/null +++ b/tests/app/Elements/PlaceHierarchyTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class PlaceHierarchy + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\PlaceHierarchy + */ +class PlaceHierarchyTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new PlaceHierarchy('label'); + } +} diff --git a/tests/app/Elements/PlaceLatitudeTest.php b/tests/app/Elements/PlaceLatitudeTest.php new file mode 100644 index 0000000000..f92f4f516e --- /dev/null +++ b/tests/app/Elements/PlaceLatitudeTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class PlaceLatitude + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\PlaceLatitude + */ +class PlaceLatitudeTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new PlaceLatitude('label'); + } +} diff --git a/tests/app/Elements/PlaceLivingOrdinanceTest.php b/tests/app/Elements/PlaceLivingOrdinanceTest.php new file mode 100644 index 0000000000..376af14096 --- /dev/null +++ b/tests/app/Elements/PlaceLivingOrdinanceTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class PlaceLivingOrdinance + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\PlaceLivingOrdinance + */ +class PlaceLivingOrdinanceTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new PlaceLivingOrdinance('label'); + } +} diff --git a/tests/app/Elements/PlaceLongtitudeTest.php b/tests/app/Elements/PlaceLongtitudeTest.php new file mode 100644 index 0000000000..6b51c8e3f8 --- /dev/null +++ b/tests/app/Elements/PlaceLongtitudeTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class PlaceLongtitude + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\PlaceLongtitude + */ +class PlaceLongtitudeTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new PlaceLongtitude('label'); + } +} diff --git a/tests/app/Elements/PlaceNameTest.php b/tests/app/Elements/PlaceNameTest.php new file mode 100644 index 0000000000..cdd43156eb --- /dev/null +++ b/tests/app/Elements/PlaceNameTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class PlaceName + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\PlaceName + */ +class PlaceNameTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new PlaceName('label'); + } +} diff --git a/tests/app/Elements/PlacePhoneticVariationTest.php b/tests/app/Elements/PlacePhoneticVariationTest.php new file mode 100644 index 0000000000..8f7cb8efa8 --- /dev/null +++ b/tests/app/Elements/PlacePhoneticVariationTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class PlacePhoneticVariation + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\PlacePhoneticVariation + */ +class PlacePhoneticVariationTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new PlacePhoneticVariation('label'); + } +} diff --git a/tests/app/Elements/PlaceRomanizedVariationTest.php b/tests/app/Elements/PlaceRomanizedVariationTest.php new file mode 100644 index 0000000000..12365be143 --- /dev/null +++ b/tests/app/Elements/PlaceRomanizedVariationTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class PlaceRomanizedVariation + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\PlaceRomanizedVariation + */ +class PlaceRomanizedVariationTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new PlaceRomanizedVariation('label'); + } +} diff --git a/tests/app/Elements/PossessionsTest.php b/tests/app/Elements/PossessionsTest.php new file mode 100644 index 0000000000..407f273419 --- /dev/null +++ b/tests/app/Elements/PossessionsTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class Possessions + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\Possessions + */ +class PossessionsTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new Possessions('label'); + } +} diff --git a/tests/app/Elements/ProbateTest.php b/tests/app/Elements/ProbateTest.php new file mode 100644 index 0000000000..3c029d574e --- /dev/null +++ b/tests/app/Elements/ProbateTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class Probate + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\Probate + */ +class ProbateTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new Probate('label'); + } +} diff --git a/tests/app/Elements/PublicationDateTest.php b/tests/app/Elements/PublicationDateTest.php new file mode 100644 index 0000000000..53e8d936ae --- /dev/null +++ b/tests/app/Elements/PublicationDateTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class PublicationDate + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\PublicationDate + */ +class PublicationDateTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new PublicationDate('label'); + } +} diff --git a/tests/app/Elements/ReceivingSystemNameTest.php b/tests/app/Elements/ReceivingSystemNameTest.php new file mode 100644 index 0000000000..08d4e5d117 --- /dev/null +++ b/tests/app/Elements/ReceivingSystemNameTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class ReceivingSystemName + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\ReceivingSystemName + */ +class ReceivingSystemNameTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new ReceivingSystemName('label'); + } +} diff --git a/tests/app/Elements/RelationIsDescriptorTest.php b/tests/app/Elements/RelationIsDescriptorTest.php new file mode 100644 index 0000000000..a6a3a2c0e9 --- /dev/null +++ b/tests/app/Elements/RelationIsDescriptorTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class RelationIsDescriptor + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\RelationIsDescriptor + */ +class RelationIsDescriptorTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new RelationIsDescriptor('label'); + } +} diff --git a/tests/app/Elements/ReligiousAffiliationTest.php b/tests/app/Elements/ReligiousAffiliationTest.php new file mode 100644 index 0000000000..5a3658206b --- /dev/null +++ b/tests/app/Elements/ReligiousAffiliationTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class ReligiousAffiliation + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\ReligiousAffiliation + */ +class ReligiousAffiliationTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new ReligiousAffiliation('label'); + } +} diff --git a/tests/app/Elements/RepositoryRecordTest.php b/tests/app/Elements/RepositoryRecordTest.php new file mode 100644 index 0000000000..64dd64c9b6 --- /dev/null +++ b/tests/app/Elements/RepositoryRecordTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class RepositoryRecord + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\RepositoryRecord + */ +class RepositoryRecordTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new RepositoryRecord('label'); + } +} diff --git a/tests/app/Elements/ResearchTaskPriorityTest.php b/tests/app/Elements/ResearchTaskPriorityTest.php new file mode 100644 index 0000000000..d7da9bd751 --- /dev/null +++ b/tests/app/Elements/ResearchTaskPriorityTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class ResearchTaskPriority + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\ResearchTaskPriority + */ +class ResearchTaskPriorityTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new ResearchTaskPriority('label'); + } +} diff --git a/tests/app/Elements/ResearchTaskStatusTest.php b/tests/app/Elements/ResearchTaskStatusTest.php new file mode 100644 index 0000000000..c19555b204 --- /dev/null +++ b/tests/app/Elements/ResearchTaskStatusTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class ResearchTaskStatus + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\ResearchTaskStatus + */ +class ResearchTaskStatusTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new ResearchTaskStatus('label'); + } +} diff --git a/tests/app/Elements/ResearchTaskTest.php b/tests/app/Elements/ResearchTaskTest.php new file mode 100644 index 0000000000..11bbaa720b --- /dev/null +++ b/tests/app/Elements/ResearchTaskTest.php @@ -0,0 +1,49 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class ResearchTask + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\ResearchTask + */ +class ResearchTaskTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new ResearchTask('label'); + } + + /** + * @return void + */ + public function testCanonical(): void + { + self::assertSame('Foo bAr baZ', self::$element->canonical("Foo bAr baZ")); + self::assertSame(' Foo bAr baZ ', self::$element->canonical("\t Foo\t bAr \tbaZ\t ")); + self::assertSame("\nFoo \n\n bAr \n baZ\n", self::$element->canonical("\nFoo \n\r bAr \r\n baZ\r")); + } +} diff --git a/tests/app/Elements/ResearchTaskTypeTest.php b/tests/app/Elements/ResearchTaskTypeTest.php new file mode 100644 index 0000000000..fac3ce12fc --- /dev/null +++ b/tests/app/Elements/ResearchTaskTypeTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class ResearchTaskType + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\ResearchTaskType + */ +class ResearchTaskTypeTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new ResearchTaskType('label'); + } +} diff --git a/tests/app/Elements/ResidenceTest.php b/tests/app/Elements/ResidenceTest.php new file mode 100644 index 0000000000..225db722bd --- /dev/null +++ b/tests/app/Elements/ResidenceTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class Residence + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\Residence + */ +class ResidenceTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new Residence('label'); + } +} diff --git a/tests/app/Elements/ResponsibleAgencyTest.php b/tests/app/Elements/ResponsibleAgencyTest.php new file mode 100644 index 0000000000..f4d9560598 --- /dev/null +++ b/tests/app/Elements/ResponsibleAgencyTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class ResponsibleAgency + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\ResponsibleAgency + */ +class ResponsibleAgencyTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new ResponsibleAgency('label'); + } +} diff --git a/tests/app/Elements/RestrictionNoticeTest.php b/tests/app/Elements/RestrictionNoticeTest.php new file mode 100644 index 0000000000..4992fcad00 --- /dev/null +++ b/tests/app/Elements/RestrictionNoticeTest.php @@ -0,0 +1,49 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class RestrictionNotice + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\RestrictionNotice + */ +class RestrictionNoticeTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new RestrictionNotice('label'); + } + + /** + * @return void + */ + public function testCanonical(): void + { + self::assertSame('foo bar baz', self::$element->canonical("Foo bAr baZ")); + self::assertSame('foo bar baz', self::$element->canonical("\t Foo\t bAr \tbaZ\t ")); + self::assertSame('foo bar baz', self::$element->canonical("\nFoo \n\r bAr \r\n baZ\r")); + } +} diff --git a/tests/app/Elements/RetirementTest.php b/tests/app/Elements/RetirementTest.php new file mode 100644 index 0000000000..f354709266 --- /dev/null +++ b/tests/app/Elements/RetirementTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class Retirement + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\Retirement + */ +class RetirementTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new Retirement('label'); + } +} diff --git a/tests/app/Elements/RoleInEventTest.php b/tests/app/Elements/RoleInEventTest.php new file mode 100644 index 0000000000..d6c977676f --- /dev/null +++ b/tests/app/Elements/RoleInEventTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class RoleInEvent + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\RoleInEvent + */ +class RoleInEventTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new RoleInEvent('label'); + } +} diff --git a/tests/app/Elements/RomanizedTypeTest.php b/tests/app/Elements/RomanizedTypeTest.php new file mode 100644 index 0000000000..15aeb54fe1 --- /dev/null +++ b/tests/app/Elements/RomanizedTypeTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class RomanizedType + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\RomanizedType + */ +class RomanizedTypeTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new RomanizedType('label'); + } +} diff --git a/tests/app/Elements/ScholasticAchievementTest.php b/tests/app/Elements/ScholasticAchievementTest.php new file mode 100644 index 0000000000..5876a191ff --- /dev/null +++ b/tests/app/Elements/ScholasticAchievementTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class ScholasticAchievement + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\ScholasticAchievement + */ +class ScholasticAchievementTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new ScholasticAchievement('label'); + } +} diff --git a/tests/app/Elements/SexValueTest.php b/tests/app/Elements/SexValueTest.php new file mode 100644 index 0000000000..c066489a63 --- /dev/null +++ b/tests/app/Elements/SexValueTest.php @@ -0,0 +1,49 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class SexValue + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\SexValue + */ +class SexValueTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new SexValue('label'); + } + + /** + * @return void + */ + public function testCanonical(): void + { + self::assertSame('FOO BAR BAZ', self::$element->canonical("Foo bAr baZ")); + self::assertSame('FOO BAR BAZ', self::$element->canonical("\t Foo\t bAr \tbaZ\t ")); + self::assertSame('FOO BAR BAZ', self::$element->canonical("\nFoo \n\r bAr \r\n baZ\r")); + } +} diff --git a/tests/app/Elements/SexXValueTest.php b/tests/app/Elements/SexXValueTest.php new file mode 100644 index 0000000000..680ad1f79f --- /dev/null +++ b/tests/app/Elements/SexXValueTest.php @@ -0,0 +1,49 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class SexXValue + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\SexXValue + */ +class SexXValueTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new SexXValue('label'); + } + + /** + * @return void + */ + public function testCanonical(): void + { + self::assertSame('FOO BAR BAZ', self::$element->canonical("Foo bAr baZ")); + self::assertSame('FOO BAR BAZ', self::$element->canonical("\t Foo\t bAr \tbaZ\t ")); + self::assertSame('FOO BAR BAZ', self::$element->canonical("\nFoo \n\r bAr \r\n baZ\r")); + } +} diff --git a/tests/app/Elements/SocialSecurityNumberTest.php b/tests/app/Elements/SocialSecurityNumberTest.php new file mode 100644 index 0000000000..8de210e6ee --- /dev/null +++ b/tests/app/Elements/SocialSecurityNumberTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class SocialSecurityNumber + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\SocialSecurityNumber + */ +class SocialSecurityNumberTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new SocialSecurityNumber('label'); + } +} diff --git a/tests/app/Elements/SourceCallNumberTest.php b/tests/app/Elements/SourceCallNumberTest.php new file mode 100644 index 0000000000..62bd14d26c --- /dev/null +++ b/tests/app/Elements/SourceCallNumberTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class SourceCallNumber + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\SourceCallNumber + */ +class SourceCallNumberTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new SourceCallNumber('label'); + } +} diff --git a/tests/app/Elements/SourceDataTest.php b/tests/app/Elements/SourceDataTest.php new file mode 100644 index 0000000000..72be5af641 --- /dev/null +++ b/tests/app/Elements/SourceDataTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class SourceData + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\SourceData + */ +class SourceDataTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new SourceData('label'); + } +} diff --git a/tests/app/Elements/SourceDescriptiveTitleTest.php b/tests/app/Elements/SourceDescriptiveTitleTest.php new file mode 100644 index 0000000000..b5841b915b --- /dev/null +++ b/tests/app/Elements/SourceDescriptiveTitleTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class SourceDescriptiveTitle + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\SourceDescriptiveTitle + */ +class SourceDescriptiveTitleTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new SourceDescriptiveTitle('label'); + } +} diff --git a/tests/app/Elements/SourceFiledByEntryTest.php b/tests/app/Elements/SourceFiledByEntryTest.php new file mode 100644 index 0000000000..b9d48cc5b9 --- /dev/null +++ b/tests/app/Elements/SourceFiledByEntryTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class SourceFiledByEntry + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\SourceFiledByEntry + */ +class SourceFiledByEntryTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new SourceFiledByEntry('label'); + } +} diff --git a/tests/app/Elements/SourceJurisdictionPlaceTest.php b/tests/app/Elements/SourceJurisdictionPlaceTest.php new file mode 100644 index 0000000000..d1cffb26c3 --- /dev/null +++ b/tests/app/Elements/SourceJurisdictionPlaceTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class SourceJurisdictionPlace + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\SourceJurisdictionPlace + */ +class SourceJurisdictionPlaceTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new SourceJurisdictionPlace('label'); + } +} diff --git a/tests/app/Elements/SourceMediaTypeTest.php b/tests/app/Elements/SourceMediaTypeTest.php new file mode 100644 index 0000000000..4a2a6e8217 --- /dev/null +++ b/tests/app/Elements/SourceMediaTypeTest.php @@ -0,0 +1,49 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class SourceMediaType + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\SourceMediaType + */ +class SourceMediaTypeTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new SourceMediaType('label'); + } + + /** + * @return void + */ + public function testCanonical(): void + { + self::assertSame('foo bar baz', self::$element->canonical("Foo bAr baZ")); + self::assertSame('foo bar baz', self::$element->canonical("\t Foo\t bAr \tbaZ\t ")); + self::assertSame('foo bar baz', self::$element->canonical("\nFoo \n\r bAr \r\n baZ\r")); + } +} diff --git a/tests/app/Elements/SourceOriginatorTest.php b/tests/app/Elements/SourceOriginatorTest.php new file mode 100644 index 0000000000..1ddac2ca65 --- /dev/null +++ b/tests/app/Elements/SourceOriginatorTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class SourceOriginator + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\SourceOriginator + */ +class SourceOriginatorTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new SourceOriginator('label'); + } +} diff --git a/tests/app/Elements/SourcePublicationFactsTest.php b/tests/app/Elements/SourcePublicationFactsTest.php new file mode 100644 index 0000000000..27665e06a4 --- /dev/null +++ b/tests/app/Elements/SourcePublicationFactsTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class SourcePublicationFacts + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\SourcePublicationFacts + */ +class SourcePublicationFactsTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new SourcePublicationFacts('label'); + } +} diff --git a/tests/app/Elements/SourceRecordTest.php b/tests/app/Elements/SourceRecordTest.php new file mode 100644 index 0000000000..3c9f7b2f80 --- /dev/null +++ b/tests/app/Elements/SourceRecordTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class SourceRecord + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\SourceRecord + */ +class SourceRecordTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new SourceRecord('label'); + } +} diff --git a/tests/app/Elements/SubmissionRecordTest.php b/tests/app/Elements/SubmissionRecordTest.php new file mode 100644 index 0000000000..0dd4b2ecf3 --- /dev/null +++ b/tests/app/Elements/SubmissionRecordTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class SubmissionRecord + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\SubmissionRecord + */ +class SubmissionRecordTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new SubmissionRecord('label'); + } +} diff --git a/tests/app/Elements/SubmitterNameTest.php b/tests/app/Elements/SubmitterNameTest.php new file mode 100644 index 0000000000..2ea3e4484d --- /dev/null +++ b/tests/app/Elements/SubmitterNameTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class SubmitterName + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\SubmitterName + */ +class SubmitterNameTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new SubmitterName('label'); + } +} diff --git a/tests/app/Elements/SubmitterRecordTest.php b/tests/app/Elements/SubmitterRecordTest.php new file mode 100644 index 0000000000..bc79ff3740 --- /dev/null +++ b/tests/app/Elements/SubmitterRecordTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class SubmitterRecord + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\SubmitterRecord + */ +class SubmitterRecordTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new SubmitterRecord('label'); + } +} diff --git a/tests/app/Elements/SubmitterRegisteredRfnTest.php b/tests/app/Elements/SubmitterRegisteredRfnTest.php new file mode 100644 index 0000000000..54670c4939 --- /dev/null +++ b/tests/app/Elements/SubmitterRegisteredRfnTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class SubmitterRegisteredRfn + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\SubmitterRegisteredRfn + */ +class SubmitterRegisteredRfnTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new SubmitterRegisteredRfn('label'); + } +} diff --git a/tests/app/Elements/SubmitterTextTest.php b/tests/app/Elements/SubmitterTextTest.php new file mode 100644 index 0000000000..9202ae8412 --- /dev/null +++ b/tests/app/Elements/SubmitterTextTest.php @@ -0,0 +1,49 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class SubmitterText + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\SubmitterText + */ +class SubmitterTextTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new SubmitterText('label'); + } + + /** + * @return void + */ + public function testCanonical(): void + { + self::assertSame('Foo bAr baZ', self::$element->canonical("Foo bAr baZ")); + self::assertSame(' Foo bAr baZ ', self::$element->canonical("\t Foo\t bAr \tbaZ\t ")); + self::assertSame("\nFoo \n\n bAr \n baZ\n", self::$element->canonical("\nFoo \n\r bAr \r\n baZ\r")); + } +} diff --git a/tests/app/Elements/TempleCodeTest.php b/tests/app/Elements/TempleCodeTest.php new file mode 100644 index 0000000000..f2d6ee620e --- /dev/null +++ b/tests/app/Elements/TempleCodeTest.php @@ -0,0 +1,49 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class TempleCode + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\TempleCode + */ +class TempleCodeTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new TempleCode('label'); + } + + /** + * @return void + */ + public function testCanonical(): void + { + self::assertSame('FOO BAR BAZ', self::$element->canonical("Foo bAr baZ")); + self::assertSame('FOO BAR BAZ', self::$element->canonical("\t Foo\t bAr \tbaZ\t ")); + self::assertSame('FOO BAR BAZ', self::$element->canonical("\nFoo \n\r bAr \r\n baZ\r")); + } +} diff --git a/tests/app/Elements/TextFromSourceTest.php b/tests/app/Elements/TextFromSourceTest.php new file mode 100644 index 0000000000..dbfe7fab05 --- /dev/null +++ b/tests/app/Elements/TextFromSourceTest.php @@ -0,0 +1,49 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class TextFromSource + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\TextFromSource + */ +class TextFromSourceTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new TextFromSource('label'); + } + + /** + * @return void + */ + public function testCanonical(): void + { + self::assertSame('Foo bAr baZ', self::$element->canonical("Foo bAr baZ")); + self::assertSame(' Foo bAr baZ ', self::$element->canonical("\t Foo\t bAr \tbaZ\t ")); + self::assertSame("\nFoo \n\n bAr \n baZ\n", self::$element->canonical("\nFoo \n\r bAr \r\n baZ\r")); + } +} diff --git a/tests/app/Elements/TimeValueTest.php b/tests/app/Elements/TimeValueTest.php new file mode 100644 index 0000000000..e713705aff --- /dev/null +++ b/tests/app/Elements/TimeValueTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class TimeValue + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\TimeValue + */ +class TimeValueTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new TimeValue('label'); + } +} diff --git a/tests/app/Elements/TransmissionDateTest.php b/tests/app/Elements/TransmissionDateTest.php new file mode 100644 index 0000000000..489971f14a --- /dev/null +++ b/tests/app/Elements/TransmissionDateTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class TransmissionDate + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\TransmissionDate + */ +class TransmissionDateTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new TransmissionDate('label'); + } +} diff --git a/tests/app/Elements/UnknownElementTest.php b/tests/app/Elements/UnknownElementTest.php new file mode 100644 index 0000000000..37538b0c8a --- /dev/null +++ b/tests/app/Elements/UnknownElementTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class UnknownElement + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\UnknownElement + */ +class UnknownElementTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new UnknownElement('label'); + } +} diff --git a/tests/app/Elements/UserReferenceNumberTest.php b/tests/app/Elements/UserReferenceNumberTest.php new file mode 100644 index 0000000000..fd2fa7db1b --- /dev/null +++ b/tests/app/Elements/UserReferenceNumberTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class UserReferenceNumber + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\UserReferenceNumber + */ +class UserReferenceNumberTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new UserReferenceNumber('label'); + } +} diff --git a/tests/app/Elements/UserReferenceTypeTest.php b/tests/app/Elements/UserReferenceTypeTest.php new file mode 100644 index 0000000000..ed141e1998 --- /dev/null +++ b/tests/app/Elements/UserReferenceTypeTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class UserReferenceType + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\UserReferenceType + */ +class UserReferenceTypeTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new UserReferenceType('label'); + } +} diff --git a/tests/app/Elements/VersionNumberTest.php b/tests/app/Elements/VersionNumberTest.php new file mode 100644 index 0000000000..a12889d904 --- /dev/null +++ b/tests/app/Elements/VersionNumberTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class VersionNumber + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\VersionNumber + */ +class VersionNumberTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new VersionNumber('label'); + } +} diff --git a/tests/app/Elements/WebtreesUserTest.php b/tests/app/Elements/WebtreesUserTest.php new file mode 100644 index 0000000000..52c52baccb --- /dev/null +++ b/tests/app/Elements/WebtreesUserTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class WebtreesUser + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\WebtreesUser + */ +class WebtreesUserTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new WebtreesUser('label'); + } +} diff --git a/tests/app/Elements/WhereWithinSourceTest.php b/tests/app/Elements/WhereWithinSourceTest.php new file mode 100644 index 0000000000..5337ffadb6 --- /dev/null +++ b/tests/app/Elements/WhereWithinSourceTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class WhereWithinSource + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\WhereWithinSource + */ +class WhereWithinSourceTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new WhereWithinSource('label'); + } +} diff --git a/tests/app/Elements/WillTest.php b/tests/app/Elements/WillTest.php new file mode 100644 index 0000000000..3e85bab9dc --- /dev/null +++ b/tests/app/Elements/WillTest.php @@ -0,0 +1,39 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2021 webtrees development team + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +declare(strict_types=1); + +namespace Fisharebest\Webtrees\Elements; + +/** + * Test harness for the class Will + * + * @covers \Fisharebest\Webtrees\Elements\AbstractElement + * @covers \Fisharebest\Webtrees\Elements\Will + */ +class WillTest extends AbstractElementTest +{ + /** + * Standard tests for all elements. + */ + public static function setupBeforeClass(): void + { + parent::setUpBeforeClass(); + + self::$element = new Will('label'); + } +} |
