diff options
64 files changed, 3011 insertions, 600 deletions
diff --git a/app/Census/AbstractCensusColumnCondition.php b/app/Census/AbstractCensusColumnCondition.php new file mode 100644 index 0000000000..0fa9028272 --- /dev/null +++ b/app/Census/AbstractCensusColumnCondition.php @@ -0,0 +1,145 @@ +<?php +/** + * webtrees: online genealogy + * Copyright (C) 2016 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 <http://www.gnu.org/licenses/>. + */ +namespace Fisharebest\Webtrees\Census; + +use Fisharebest\Webtrees\Date; +use Fisharebest\Webtrees\Individual; + +/** + * Marital status. + */ +abstract class AbstractCensusColumnCondition extends AbstractCensusColumn implements CensusColumnInterface { + /* Text to display for married individuals */ + protected $husband = ''; + protected $wife = ''; + + /* Text to display for unmarried individuals */ + protected $bachelor = ''; + protected $spinster = ''; + + /* Text to display for children */ + protected $boy = ''; + protected $girl = ''; + + /* Text to display for divorced individuals */ + protected $divorce = ''; + protected $divorcee = ''; + + /* Text to display for widowed individuals (not yet implemented) */ + protected $widower = ''; + protected $widow = ''; + + /* At what age is this individual recorded as an adult */ + protected $age_adult = 15; + + /** + * Generate the likely value of this census column, based on available information. + * + * @param Individual $individual + * @param Individual|null $head + * + * @return string + */ + public function generate(Individual $individual, Individual $head = null) { + $family = $this->spouseFamily($individual); + $sex = $individual->getSex(); + + if ($family === null || count($family->getFacts('_NMR')) > 0) { + if ($this->isChild($individual)) { + return $this->conditionChild($sex); + } else { + return $this->conditionSingle($sex); + } + } elseif (count($family->getFacts('DIV')) > 0) { + return $this->conditionDivorced($sex); + } else { + return $this->conditionMarried($sex); + } + } + + /** + * How is this condition written in a census column. + * + * @param $sex + * + * @return string + */ + private function conditionChild($sex) { + if ($sex === 'F') { + return $this->girl; + } else { + return $this->boy; + } + } + + /** + * How is this condition written in a census column. + * + * @param $sex + * + * @return string + */ + private function conditionDivorced($sex) { + if ($sex === 'F') { + return $this->divorcee; + } else { + return $this->divorce; + } + } + + /** + * How is this condition written in a census column. + * + * @param $sex + * + * @return string + */ + private function conditionMarried($sex) { + if ($sex === 'F') { + return $this->wife; + } else { + return $this->husband; + } + } + + /** + * How is this condition written in a census column. + * + * @param $sex + * + * @return string + */ + private function conditionSingle($sex) { + if ($sex === 'F') { + return $this->spinster; + } else { + return $this->bachelor; + } + } + + /** + * Is the individual a child. + * + * @param Individual $individual + * + * @return bool + */ + private function isChild(Individual $individual) { + $age = (int) Date::getAge($individual->getEstimatedBirthDate(), $this->date(), 0); + + return $age < $this->age_adult; + } +} diff --git a/app/Census/CensusColumnConditionDanish.php b/app/Census/CensusColumnConditionDanish.php index 65da0b69dc..beb2daa5b2 100644 --- a/app/Census/CensusColumnConditionDanish.php +++ b/app/Census/CensusColumnConditionDanish.php @@ -20,14 +20,18 @@ namespace Fisharebest\Webtrees\Census; */ class CensusColumnConditionDanish extends CensusColumnConditionEnglish { /* Text to display for married individuals */ - protected $married = 'Gift'; + protected $husband = 'Gift'; + protected $wife = 'Gift'; /* Text to display for unmarried individuals */ - protected $unmarried = 'Ugift'; + protected $bachelor = 'Ugift'; + protected $spinster = 'Ugift'; /* Text to display for divorced individuals */ - protected $divorced = 'Skilt'; + protected $divorce = 'Skilt'; + protected $divorcee = 'Skilt'; /* Text to display for widowed individuals (not yet implemented) */ - protected $wid = 'Wid'; + protected $widower = ''; + protected $widow = ''; } diff --git a/app/Census/CensusColumnConditionEnglish.php b/app/Census/CensusColumnConditionEnglish.php index 01f5750d6b..1e6111f4df 100644 --- a/app/Census/CensusColumnConditionEnglish.php +++ b/app/Census/CensusColumnConditionEnglish.php @@ -15,41 +15,26 @@ */ namespace Fisharebest\Webtrees\Census; +use Fisharebest\Webtrees\Date; use Fisharebest\Webtrees\Individual; /** * Marital status. */ -class CensusColumnConditionEnglish extends AbstractCensusColumn implements CensusColumnInterface { +class CensusColumnConditionEnglish extends AbstractCensusColumnCondition { /* Text to display for married individuals */ - protected $married = 'Mar'; + protected $husband = 'Mar'; + protected $wife = 'Mar'; /* Text to display for unmarried individuals */ - protected $unmarried = 'Unm'; + protected $bachelor = 'Unm'; + protected $spinster = 'Unm'; /* Text to display for divorced individuals */ - protected $divorced = 'Div'; + protected $divorce = 'Div'; + protected $divorcee = 'Div'; /* Text to display for widowed individuals (not yet implemented) */ - protected $wid = 'Wid'; - - /** - * Generate the likely value of this census column, based on available information. - * - * @param Individual $individual - * @param Individual|null $head - * - * @return string - */ - public function generate(Individual $individual, Individual $head = null) { - $family = $this->spouseFamily($individual); - - if ($family === null || count($family->getFacts('_NMR')) > 0) { - return $this->unmarried; - } elseif (count($family->getFacts('DIV')) > 0) { - return $this->divorced; - } else { - return $this->married; - } - } + protected $widower = 'Wid'; + protected $widow = 'Wid'; } diff --git a/app/Census/CensusColumnConditionFrenchFemme.php b/app/Census/CensusColumnConditionFrenchFemme.php new file mode 100644 index 0000000000..7fff20e755 --- /dev/null +++ b/app/Census/CensusColumnConditionFrenchFemme.php @@ -0,0 +1,41 @@ +<?php +/** + * webtrees: online genealogy + * Copyright (C) 2016 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 <http://www.gnu.org/licenses/>. + */ +namespace Fisharebest\Webtrees\Census; + +/** + * Marital status. + */ +class CensusColumnConditionFrenchFemme extends AbstractCensusColumnCondition { + /* Text to display for married individuals */ + protected $husband = ''; + protected $wife = 'X'; + + /* Text to display for unmarried individuals */ + protected $bachelor = ''; + protected $spinster = 'X'; + + /* Text to display for children */ + protected $boy = ''; + protected $girl = ''; + + /* Text to display for divorced individuals */ + protected $divorce = ''; + protected $divorcee = 'X'; + + /* Text to display for widowed individuals (not yet implemented) */ + protected $widower = ''; + protected $widow = ''; +} diff --git a/app/Census/CensusColumnConditionFrenchFille.php b/app/Census/CensusColumnConditionFrenchFille.php new file mode 100644 index 0000000000..9a13f5dbbf --- /dev/null +++ b/app/Census/CensusColumnConditionFrenchFille.php @@ -0,0 +1,41 @@ +<?php +/** + * webtrees: online genealogy + * Copyright (C) 2016 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 <http://www.gnu.org/licenses/>. + */ +namespace Fisharebest\Webtrees\Census; + +/** + * Marital status. + */ +class CensusColumnConditionFrenchFille extends AbstractCensusColumnCondition { + /* Text to display for married individuals */ + protected $husband = ''; + protected $wife = ''; + + /* Text to display for unmarried individuals */ + protected $bachelor = ''; + protected $spinster = ''; + + /* Text to display for children */ + protected $boy = ''; + protected $girl = 'X'; + + /* Text to display for divorced individuals */ + protected $divorce = ''; + protected $divorcee = ''; + + /* Text to display for widowed individuals (not yet implemented) */ + protected $widower = ''; + protected $widow = ''; +} diff --git a/app/Census/CensusColumnConditionFrenchGarcon.php b/app/Census/CensusColumnConditionFrenchGarcon.php new file mode 100644 index 0000000000..3e09f770ea --- /dev/null +++ b/app/Census/CensusColumnConditionFrenchGarcon.php @@ -0,0 +1,41 @@ +<?php +/** + * webtrees: online genealogy + * Copyright (C) 2016 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 <http://www.gnu.org/licenses/>. + */ +namespace Fisharebest\Webtrees\Census; + +/** + * Marital status. + */ +class CensusColumnConditionFrenchGarcon extends AbstractCensusColumnCondition { + /* Text to display for married individuals */ + protected $husband = ''; + protected $wife = ''; + + /* Text to display for unmarried individuals */ + protected $bachelor = ''; + protected $spinster = ''; + + /* Text to display for children */ + protected $boy = 'X'; + protected $girl = ''; + + /* Text to display for divorced individuals */ + protected $divorce = ''; + protected $divorcee = ''; + + /* Text to display for widowed individuals (not yet implemented) */ + protected $widower = ''; + protected $widow = ''; +} diff --git a/app/Census/CensusColumnConditionFrenchHomme.php b/app/Census/CensusColumnConditionFrenchHomme.php new file mode 100644 index 0000000000..b3ac2b1eb6 --- /dev/null +++ b/app/Census/CensusColumnConditionFrenchHomme.php @@ -0,0 +1,41 @@ +<?php +/** + * webtrees: online genealogy + * Copyright (C) 2016 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 <http://www.gnu.org/licenses/>. + */ +namespace Fisharebest\Webtrees\Census; + +/** + * Marital status. + */ +class CensusColumnConditionFrenchHomme extends AbstractCensusColumnCondition { + /* Text to display for married individuals */ + protected $husband = 'X'; + protected $wife = ''; + + /* Text to display for unmarried individuals */ + protected $bachelor = 'X'; + protected $spinster = ''; + + /* Text to display for children */ + protected $boy = ''; + protected $girl = ''; + + /* Text to display for divorced individuals */ + protected $divorce = 'X'; + protected $divorcee = ''; + + /* Text to display for widowed individuals (not yet implemented) */ + protected $widower = ''; + protected $widow = ''; +} diff --git a/app/Census/CensusColumnConditionFrench.php b/app/Census/CensusColumnConditionFrenchVeuf.php index 2c1437856a..a7785d4129 100644 --- a/app/Census/CensusColumnConditionFrench.php +++ b/app/Census/CensusColumnConditionFrenchVeuf.php @@ -18,16 +18,24 @@ namespace Fisharebest\Webtrees\Census; /** * Marital status. */ -class CensusColumnConditionFrench extends CensusColumnConditionEnglish { +class CensusColumnConditionFrenchVeuf extends AbstractCensusColumnCondition { /* Text to display for married individuals */ - protected $married = 'Marié'; + protected $husband = ''; + protected $wife = ''; /* Text to display for unmarried individuals */ - protected $unmarried = 'Célibataire'; + protected $bachelor = ''; + protected $spinster = ''; + + /* Text to display for children */ + protected $boy = ''; + protected $girl = ''; /* Text to display for divorced individuals */ - protected $divorced = 'Divorcé'; + protected $divorce = ''; + protected $divorcee = ''; /* Text to display for widowed individuals (not yet implemented) */ - protected $wid = 'Wid'; + protected $widower = 'X'; + protected $widow = ''; } diff --git a/app/Census/CensusColumnConditionFrenchVeuve.php b/app/Census/CensusColumnConditionFrenchVeuve.php new file mode 100644 index 0000000000..614a3a3d09 --- /dev/null +++ b/app/Census/CensusColumnConditionFrenchVeuve.php @@ -0,0 +1,41 @@ +<?php +/** + * webtrees: online genealogy + * Copyright (C) 2016 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 <http://www.gnu.org/licenses/>. + */ +namespace Fisharebest\Webtrees\Census; + +/** + * Marital status. + */ +class CensusColumnConditionFrenchVeuve extends AbstractCensusColumnCondition { + /* Text to display for married individuals */ + protected $husband = ''; + protected $wife = ''; + + /* Text to display for unmarried individuals */ + protected $bachelor = ''; + protected $spinster = ''; + + /* Text to display for children */ + protected $boy = ''; + protected $girl = ''; + + /* Text to display for divorced individuals */ + protected $divorce = ''; + protected $divorcee = ''; + + /* Text to display for widowed individuals (not yet implemented) */ + protected $widower = ''; + protected $widow = 'X'; +} diff --git a/app/Census/CensusColumnConditionUs.php b/app/Census/CensusColumnConditionUs.php index 76d1b5744c..3bfb7dacc2 100644 --- a/app/Census/CensusColumnConditionUs.php +++ b/app/Census/CensusColumnConditionUs.php @@ -20,14 +20,22 @@ namespace Fisharebest\Webtrees\Census; */ class CensusColumnConditionUs extends CensusColumnConditionEnglish { /* Text to display for married individuals */ - protected $married = 'M'; + protected $husband = 'M'; + protected $wife = 'M'; /* Text to display for unmarried individuals */ - protected $unmarried = 'S'; + protected $bachelor = 'S'; + protected $spinster = 'S'; + + /* Text to display for children */ + protected $boy = 'S'; + protected $girl = 'S'; /* Text to display for divorced individuals */ - protected $divorced = 'D'; + protected $divorce = 'D'; + protected $divorcee = 'D'; /* Text to display for widowed individuals (not yet implemented) */ - protected $wid = 'W'; + protected $widower = 'W'; + protected $widow = 'W'; } diff --git a/app/Census/CensusOfFrance1831.php b/app/Census/CensusOfFrance1831.php index 643461e42f..47152219e9 100644 --- a/app/Census/CensusOfFrance1831.php +++ b/app/Census/CensusOfFrance1831.php @@ -35,11 +35,16 @@ class CensusOfFrance1831 extends CensusOfFrance implements CensusInterface { */ public function columns() { return array( - new CensusColumnSurname($this, 'Nom', 'Nom de famille'), - new CensusColumnGivenNames($this, 'Prénom', 'Prénom'), - new CensusColumnOccupation($this, 'Profession', 'Profession'), - new CensusColumnBirthYear($this, 'Année', 'Année de naissance'), - new CensusColumnConditionFrench($this, 'Situation pers.', 'Situation personnelle (marié, veuf…)'), + new CensusColumnSurname($this, 'Noms', 'Noms de famille'), + new CensusColumnGivenNames($this, 'Prénoms', ''), + new CensusColumnOccupation($this, 'Titres', 'Titres, qualifications, état ou profession et fonctions'), + new CensusColumnConditionFrenchGarcon($this, 'Garçons', ''), + new CensusColumnConditionFrenchHomme($this, 'Hommes', 'Hommes mariés'), + new CensusColumnConditionFrenchVeuf($this, 'Veufs', ''), + new CensusColumnConditionFrenchFille($this, 'Filles', ''), + new CensusColumnConditionFrenchFemme($this, 'Femmes', 'Femmes mariées'), + new CensusColumnConditionFrenchVeuve($this, 'Veuves', ''), + new CensusColumnAge($this, 'Âge', ''), ); } } diff --git a/app/Census/CensusOfFrance1836.php b/app/Census/CensusOfFrance1836.php index eac6393178..7d997666ee 100644 --- a/app/Census/CensusOfFrance1836.php +++ b/app/Census/CensusOfFrance1836.php @@ -35,11 +35,16 @@ class CensusOfFrance1836 extends CensusOfFrance implements CensusInterface { */ public function columns() { return array( - new CensusColumnSurname($this, 'Nom', 'Nom de famille'), - new CensusColumnGivenNames($this, 'Prénom', 'Prénom'), - new CensusColumnOccupation($this, 'Profession', 'Profession'), - new CensusColumnAge($this, 'Âge', 'Âge'), - new CensusColumnConditionFrench($this, 'Situation pers.', 'Situation personnelle (marié, veuf…)'), + new CensusColumnSurname($this, 'Noms', 'Noms de famille'), + new CensusColumnGivenNames($this, 'Prénoms', ''), + new CensusColumnOccupation($this, 'Titres', 'Titres, qualifications, état ou profession et fonctions'), + new CensusColumnConditionFrenchGarcon($this, 'Garçons', ''), + new CensusColumnConditionFrenchHomme($this, 'Hommes', 'Hommes mariés'), + new CensusColumnConditionFrenchVeuf($this, 'Veufs', ''), + new CensusColumnConditionFrenchFille($this, 'Filles', ''), + new CensusColumnConditionFrenchFemme($this, 'Femmes', 'Femmes mariées'), + new CensusColumnConditionFrenchVeuve($this, 'Veuves', ''), + new CensusColumnAge($this, 'Âge', ''), ); } } diff --git a/app/Census/CensusOfFrance1841.php b/app/Census/CensusOfFrance1841.php index 358fbc118a..7006c202b8 100644 --- a/app/Census/CensusOfFrance1841.php +++ b/app/Census/CensusOfFrance1841.php @@ -35,10 +35,15 @@ class CensusOfFrance1841 extends CensusOfFrance implements CensusInterface { */ public function columns() { return array( - new CensusColumnSurname($this, 'Nom', 'Nom de famille'), - new CensusColumnGivenNames($this, 'Prénom', 'Prénom'), - new CensusColumnOccupation($this, 'Profession', 'Profession'), - new CensusColumnConditionFrench($this, 'Situtation pers.', 'Situation personnelle (marié, veuf…)'), + new CensusColumnSurname($this, 'Noms', 'Noms de famille'), + new CensusColumnGivenNames($this, 'Prénoms', ''), + new CensusColumnOccupation($this, 'Titres', 'Titres, qualifications, état ou profession et fonctions'), + new CensusColumnConditionFrenchGarcon($this, 'Garçons', ''), + new CensusColumnConditionFrenchHomme($this, 'Hommes', 'Hommes mariés'), + new CensusColumnConditionFrenchVeuf($this, 'Veufs', ''), + new CensusColumnConditionFrenchFille($this, 'Filles', ''), + new CensusColumnConditionFrenchFemme($this, 'Femmes', 'Femmes mariées'), + new CensusColumnConditionFrenchVeuve($this, 'Veuves', ''), ); } } diff --git a/app/Census/CensusOfFrance1846.php b/app/Census/CensusOfFrance1846.php index 0f9a0af30a..e44a0b4030 100644 --- a/app/Census/CensusOfFrance1846.php +++ b/app/Census/CensusOfFrance1846.php @@ -35,11 +35,16 @@ class CensusOfFrance1846 extends CensusOfFrance implements CensusInterface { */ public function columns() { return array( - new CensusColumnSurname($this, 'Nom', 'Nom de famille'), - new CensusColumnGivenNames($this, 'Prénom', 'Prénom'), - new CensusColumnOccupation($this, 'Profession', 'Profession'), - new CensusColumnAge($this, 'Âge', 'Âge'), - new CensusColumnConditionFrench($this, 'Situtation pers.', 'Situation personnelle (marié, veuf…)'), + new CensusColumnSurname($this, 'Noms', 'Noms de famille'), + new CensusColumnGivenNames($this, 'Prénoms', ''), + new CensusColumnOccupation($this, 'Titres', 'Titres, qualifications, état ou profession et fonctions'), + new CensusColumnConditionFrenchGarcon($this, 'Garçons', ''), + new CensusColumnConditionFrenchHomme($this, 'Hommes', 'Hommes mariés'), + new CensusColumnConditionFrenchVeuf($this, 'Veufs', ''), + new CensusColumnConditionFrenchFille($this, 'Filles', ''), + new CensusColumnConditionFrenchFemme($this, 'Femmes', 'Femmes mariées'), + new CensusColumnConditionFrenchVeuve($this, 'Veuves', ''), + new CensusColumnAge($this, 'Âge', ''), ); } } diff --git a/app/Census/CensusOfFrance1851.php b/app/Census/CensusOfFrance1851.php index 656c3d978c..7e722f99cc 100644 --- a/app/Census/CensusOfFrance1851.php +++ b/app/Census/CensusOfFrance1851.php @@ -35,14 +35,19 @@ class CensusOfFrance1851 extends CensusOfFrance implements CensusInterface { */ public function columns() { return array( - new CensusColumnSurname($this, 'Nom', 'Nom de famille'), - new CensusColumnGivenNames($this, 'Prénom', 'Prénom'), - new CensusColumnOccupation($this, 'Profession', 'Profession'), + new CensusColumnSurname($this, 'Noms', 'Noms de famille'), + new CensusColumnGivenNames($this, 'Prénoms', ''), + new CensusColumnOccupation($this, 'Professions', ''), + new CensusColumnConditionFrenchGarcon($this, 'Garçons', ''), + new CensusColumnConditionFrenchHomme($this, 'Hommes', 'Hommes mariés'), + new CensusColumnConditionFrenchVeuf($this, 'Veufs', ''), + new CensusColumnConditionFrenchFille($this, 'Filles', ''), + new CensusColumnConditionFrenchFemme($this, 'Femmes', 'Femmes mariées'), + new CensusColumnConditionFrenchVeuve($this, 'Veuves', ''), new CensusColumnAge($this, 'Âge', 'Âge'), - new CensusColumnConditionFrench($this, 'Situtation pers.', 'Situation personnelle (marié, veuf…)'), - new CensusColumnNationality($this, 'Nationalité', 'Nationalité'), - new CensusColumnNull($this, 'Religion', 'Religion'), - new CensusColumnNull($this, 'Maladies', 'Infirmités et maladies'), + new CensusColumnNull($this, 'Fr', 'Français d’origine'), + new CensusColumnNull($this, 'Nat', 'Naturalisés français'), + new CensusColumnNull($this, 'Etr', 'Étrangers (indiquer leur pays d’origine)'), ); } } diff --git a/app/Census/CensusOfFrance1856.php b/app/Census/CensusOfFrance1856.php index 5e9c5de404..ab9c92e186 100644 --- a/app/Census/CensusOfFrance1856.php +++ b/app/Census/CensusOfFrance1856.php @@ -35,11 +35,16 @@ class CensusOfFrance1856 extends CensusOfFrance implements CensusInterface { */ public function columns() { return array( - new CensusColumnSurname($this, 'Nom', 'Nom de famille'), - new CensusColumnGivenNames($this, 'Prénom', 'Prénom'), - new CensusColumnOccupation($this, 'Profession', 'Profession'), - new CensusColumnAge($this, 'Âge', 'Âge'), - new CensusColumnConditionFrench($this, 'Situtation pers.', 'Situation personnelle (marié, veuf…)'), + new CensusColumnSurname($this, 'Noms', 'Noms de famille'), + new CensusColumnGivenNames($this, 'Prénoms', ''), + new CensusColumnOccupation($this, 'Titres', 'Titres, qualifications, état ou profession et fonctions'), + new CensusColumnConditionFrenchGarcon($this, 'Garçons', ''), + new CensusColumnConditionFrenchHomme($this, 'Hommes', 'Hommes mariés'), + new CensusColumnConditionFrenchVeuf($this, 'Veufs', ''), + new CensusColumnConditionFrenchFille($this, 'Filles', ''), + new CensusColumnConditionFrenchFemme($this, 'Femmes', 'Femmes mariées'), + new CensusColumnConditionFrenchVeuve($this, 'Veuves', ''), + new CensusColumnAge($this, 'Âge', ''), ); } } diff --git a/app/Census/CensusOfFrance1861.php b/app/Census/CensusOfFrance1861.php index 6e585ef05c..e278cda8d5 100644 --- a/app/Census/CensusOfFrance1861.php +++ b/app/Census/CensusOfFrance1861.php @@ -35,11 +35,16 @@ class CensusOfFrance1861 extends CensusOfFrance implements CensusInterface { */ public function columns() { return array( - new CensusColumnSurname($this, 'Nom', 'Nom de famille'), - new CensusColumnGivenNames($this, 'Prénom', 'Prénom'), - new CensusColumnOccupation($this, 'Profession', 'Profession'), - new CensusColumnAge($this, 'Âge', 'Âge'), - new CensusColumnConditionFrench($this, 'Situtation pers.', 'Situation personnelle (marié, veuf…)'), + new CensusColumnSurname($this, 'Noms', 'Noms de famille'), + new CensusColumnGivenNames($this, 'Prénoms', ''), + new CensusColumnOccupation($this, 'Titres', 'Titres, qualifications, état ou profession et fonctions'), + new CensusColumnConditionFrenchGarcon($this, 'Garçons', ''), + new CensusColumnConditionFrenchHomme($this, 'Hommes', 'Hommes mariés'), + new CensusColumnConditionFrenchVeuf($this, 'Veufs', ''), + new CensusColumnConditionFrenchFille($this, 'Filles', ''), + new CensusColumnConditionFrenchFemme($this, 'Femmes', 'Femmes mariées'), + new CensusColumnConditionFrenchVeuve($this, 'Veuves', ''), + new CensusColumnAge($this, 'Âge', ''), ); } } diff --git a/app/Census/CensusOfFrance1866.php b/app/Census/CensusOfFrance1866.php index e6451442ef..39a8856774 100644 --- a/app/Census/CensusOfFrance1866.php +++ b/app/Census/CensusOfFrance1866.php @@ -35,11 +35,16 @@ class CensusOfFrance1866 extends CensusOfFrance implements CensusInterface { */ public function columns() { return array( - new CensusColumnSurname($this, 'Nom', 'Nom de famille'), - new CensusColumnGivenNames($this, 'Prénom', 'Prénom'), - new CensusColumnOccupation($this, 'Profession', 'Profession'), - new CensusColumnAge($this, 'Âge', 'Âge'), - new CensusColumnConditionFrench($this, 'Situtation pers.', 'Situation personnelle (marié, veuf…)'), + new CensusColumnSurname($this, 'Noms', 'Noms de famille'), + new CensusColumnGivenNames($this, 'Prénoms', ''), + new CensusColumnOccupation($this, 'Titres', 'Titres, qualifications, état ou profession et fonctions'), + new CensusColumnConditionFrenchGarcon($this, 'Garçons', ''), + new CensusColumnConditionFrenchHomme($this, 'Hommes', 'Hommes mariés'), + new CensusColumnConditionFrenchVeuf($this, 'Veufs', ''), + new CensusColumnConditionFrenchFille($this, 'Filles', ''), + new CensusColumnConditionFrenchFemme($this, 'Femmes', 'Femmes mariées'), + new CensusColumnConditionFrenchVeuve($this, 'Veuves', ''), + new CensusColumnAge($this, 'Âge', ''), ); } } diff --git a/app/Census/CensusOfFrance1872.php b/app/Census/CensusOfFrance1872.php index dadbd5ac43..0672a72fc5 100644 --- a/app/Census/CensusOfFrance1872.php +++ b/app/Census/CensusOfFrance1872.php @@ -35,13 +35,17 @@ class CensusOfFrance1872 extends CensusOfFrance implements CensusInterface { */ public function columns() { return array( - new CensusColumnSurname($this, 'Nom', 'Nom de famille'), - new CensusColumnGivenNames($this, 'Prénom', 'Prénom'), - new CensusColumnOccupation($this, 'Profession', 'Profession'), - new CensusColumnAge($this, 'Âge', 'Âge'), - new CensusColumnConditionFrench($this, 'Situtation pers.', 'Situation personnelle (marié, veuf…)'), - new CensusColumnNationality($this, 'Nationalité', 'Nationalité'), - new CensusColumnBirthPlace($this, 'Lieu', 'Lieu de naissance'), + new CensusColumnSurname($this, 'Noms', 'Noms de famille'), + new CensusColumnGivenNames($this, 'Prénoms', ''), + new CensusColumnOccupation($this, 'Titres', 'Titres, qualifications, état ou profession et fonctions'), + new CensusColumnConditionFrenchGarcon($this, 'Garçons', ''), + new CensusColumnConditionFrenchHomme($this, 'Hommes', 'Hommes mariés'), + new CensusColumnConditionFrenchVeuf($this, 'Veufs', ''), + new CensusColumnConditionFrenchFille($this, 'Filles', ''), + new CensusColumnConditionFrenchFemme($this, 'Femmes', 'Femmes mariées'), + new CensusColumnConditionFrenchVeuve($this, 'Veuves', ''), + new CensusColumnAge($this, 'Âge', ''), + new CensusColumnBirthPlace($this, 'Nationalité', 'Nationalité - Lieu de naissance'), ); } } diff --git a/app/Census/CensusOfFrance1876.php b/app/Census/CensusOfFrance1876.php index 6b36edebdc..ba1495b2d6 100644 --- a/app/Census/CensusOfFrance1876.php +++ b/app/Census/CensusOfFrance1876.php @@ -35,13 +35,17 @@ class CensusOfFrance1876 extends CensusOfFrance implements CensusInterface { */ public function columns() { return array( - new CensusColumnSurname($this, 'Nom', 'Nom de famille'), - new CensusColumnGivenNames($this, 'Prénom', 'Prénom'), - new CensusColumnOccupation($this, 'Profession', 'Profession'), - new CensusColumnAge($this, 'Âge', 'Âge'), - new CensusColumnConditionFrench($this, 'Situtation pers.', 'Situation personnelle (marié, veuf…)'), - new CensusColumnNationality($this, 'Nationalité', 'Nationalité'), - new CensusColumnBirthPlace($this, 'Lieu', 'Lieu de naissance'), + new CensusColumnSurname($this, 'Noms', 'Noms de famille'), + new CensusColumnGivenNames($this, 'Prénoms', ''), + new CensusColumnOccupation($this, 'Titres', 'Titres, qualifications, état ou profession et fonctions'), + new CensusColumnConditionFrenchGarcon($this, 'Garçons', ''), + new CensusColumnConditionFrenchHomme($this, 'Hommes', 'Hommes mariés'), + new CensusColumnConditionFrenchVeuf($this, 'Veufs', ''), + new CensusColumnConditionFrenchFille($this, 'Filles', ''), + new CensusColumnConditionFrenchFemme($this, 'Femmes', 'Femmes mariées'), + new CensusColumnConditionFrenchVeuve($this, 'Veuves', ''), + new CensusColumnAge($this, 'Âge', ''), + new CensusColumnBirthPlace($this, 'Nationalité', 'Nationalité - Lieu de naissance'), ); } } diff --git a/app/Census/CensusOfFrance1881.php b/app/Census/CensusOfFrance1881.php index 44af8409c8..2915177d11 100644 --- a/app/Census/CensusOfFrance1881.php +++ b/app/Census/CensusOfFrance1881.php @@ -35,10 +35,10 @@ class CensusOfFrance1881 extends CensusOfFrance implements CensusInterface { */ public function columns() { return array( - new CensusColumnSurname($this, 'Nom', 'Nom de famille'), - new CensusColumnGivenNames($this, 'Prénom', 'Prénom'), - new CensusColumnOccupation($this, 'Profession', 'Profession'), - new CensusColumnAge($this, 'Âge', 'Âge'), + new CensusColumnSurname($this, 'Noms', 'Noms de famille'), + new CensusColumnGivenNames($this, 'Prénoms', ''), + new CensusColumnAge($this, 'Âge', ''), + new CensusColumnOccupation($this, 'Profession', ''), new CensusColumnRelationToHead($this, 'Position', 'Position dans le ménage'), ); } diff --git a/app/Census/CensusOfFrance1886.php b/app/Census/CensusOfFrance1886.php index a975da445a..ea9fdec4ef 100644 --- a/app/Census/CensusOfFrance1886.php +++ b/app/Census/CensusOfFrance1886.php @@ -35,12 +35,12 @@ class CensusOfFrance1886 extends CensusOfFrance implements CensusInterface { */ public function columns() { return array( - new CensusColumnSurname($this, 'Nom', 'Nom de famille'), - new CensusColumnGivenNames($this, 'Prénom', 'Prénom'), - new CensusColumnOccupation($this, 'Profession', 'Profession'), - new CensusColumnAge($this, 'Âge', 'Âge'), + new CensusColumnSurname($this, 'Noms', 'Noms de famille'), + new CensusColumnGivenNames($this, 'Prénoms', ''), + new CensusColumnAge($this, 'Âge', ''), + new CensusColumnNationality($this, 'Nationalité', ''), + new CensusColumnOccupation($this, 'Profession', ''), new CensusColumnRelationToHead($this, 'Position', 'Position dans le ménage'), - new CensusColumnNationality($this, 'Nationalité', 'Nationalité'), ); } } diff --git a/app/Census/CensusOfFrance1891.php b/app/Census/CensusOfFrance1891.php index 51c0aeea04..eb9c55ce68 100644 --- a/app/Census/CensusOfFrance1891.php +++ b/app/Census/CensusOfFrance1891.php @@ -35,11 +35,12 @@ class CensusOfFrance1891 extends CensusOfFrance implements CensusInterface { */ public function columns() { return array( - new CensusColumnSurname($this, 'Nom', 'Nom de famille'), - new CensusColumnGivenNames($this, 'Prénom', 'Prénom'), - new CensusColumnOccupation($this, 'Profession', 'Profession'), + new CensusColumnSurname($this, 'Noms', 'Noms de famille'), + new CensusColumnGivenNames($this, 'Prénoms', ''), + new CensusColumnAge($this, 'Âge', ''), + new CensusColumnNationality($this, 'Nationalité', ''), + new CensusColumnOccupation($this, 'Profession', ''), new CensusColumnRelationToHead($this, 'Position', 'Position dans le ménage'), - new CensusColumnNationality($this, 'Nationalité', 'Nationalité'), ); } } diff --git a/app/Census/CensusOfFrance1896.php b/app/Census/CensusOfFrance1896.php index 88b1f58747..0f4d97c0ab 100644 --- a/app/Census/CensusOfFrance1896.php +++ b/app/Census/CensusOfFrance1896.php @@ -35,12 +35,12 @@ class CensusOfFrance1896 extends CensusOfFrance implements CensusInterface { */ public function columns() { return array( - new CensusColumnSurname($this, 'Nom', 'Nom de famille'), - new CensusColumnGivenNames($this, 'Prénom', 'Prénom'), - new CensusColumnOccupation($this, 'Profession', 'Profession'), - new CensusColumnAge($this, 'Âge', 'Âge'), + new CensusColumnSurname($this, 'Noms', 'Noms de famille'), + new CensusColumnGivenNames($this, 'Prénoms', ''), + new CensusColumnAge($this, 'Âge', ''), + new CensusColumnNationality($this, 'Nationalité', ''), + new CensusColumnOccupation($this, 'Profession', ''), new CensusColumnRelationToHead($this, 'Position', 'Position dans le ménage'), - new CensusColumnNationality($this, 'Nationalité', 'Nationalité'), ); } } diff --git a/app/Census/CensusOfFrance1901.php b/app/Census/CensusOfFrance1901.php index 09d9b6f7b8..989f7be5a4 100644 --- a/app/Census/CensusOfFrance1901.php +++ b/app/Census/CensusOfFrance1901.php @@ -35,14 +35,14 @@ class CensusOfFrance1901 extends CensusOfFrance implements CensusInterface { */ public function columns() { return array( - new CensusColumnSurname($this, 'Nom', 'Nom de famille'), - new CensusColumnGivenNames($this, 'Prénom', 'Prénom'), - new CensusColumnOccupation($this, 'Profession', 'Profession'), - new CensusColumnAge($this, 'Âge', 'Âge'), - new CensusColumnRelationToHead($this, 'Position', 'Position dans le ménage'), - new CensusColumnNationality($this, 'Nationalité', 'Nationalité'), + new CensusColumnSurname($this, 'Noms', 'Noms de famille'), + new CensusColumnGivenNames($this, 'Prénoms', ''), + new CensusColumnAge($this, 'Âge', ''), + new CensusColumnNationality($this, 'Nationalité', ''), + new CensusColumnRelationToHead($this, 'Situation', 'Situation par rapport au chef de ménage'), + new CensusColumnOccupation($this, 'Profession', ''), new CensusColumnBirthPlace($this, 'Lieu', 'Lieu de naissance'), - new CensusColumnNull($this, 'Position sociale', 'Position sociale (patron, ouvrier ou employé)'), + new CensusColumnNull($this, 'Empl', ''), ); } } diff --git a/app/Census/CensusOfFrance1906.php b/app/Census/CensusOfFrance1906.php index 7610b678df..374c999ce9 100644 --- a/app/Census/CensusOfFrance1906.php +++ b/app/Census/CensusOfFrance1906.php @@ -35,14 +35,14 @@ class CensusOfFrance1906 extends CensusOfFrance implements CensusInterface { */ public function columns() { return array( - new CensusColumnSurname($this, 'Nom', 'Nom de famille'), - new CensusColumnGivenNames($this, 'Prénom', 'Prénom'), - new CensusColumnOccupation($this, 'Profession', 'Profession'), - new CensusColumnBirthYear($this, 'Année', 'Année de naissance'), - new CensusColumnRelationToHead($this, 'Position', 'Position dans le ménage'), - new CensusColumnNationality($this, 'Nationalité', 'Nationalité'), + new CensusColumnSurname($this, 'Noms', 'Noms de famille'), + new CensusColumnGivenNames($this, 'Prénoms', ''), + new CensusColumnBirthYear($this, 'Année', 'Année de naissance'), new CensusColumnBirthPlace($this, 'Lieu', 'Lieu de naissance'), - new CensusColumnNull($this, 'Position sociale', 'Position sociale (patron, ouvrier ou employé)'), + new CensusColumnNationality($this, 'Nationalité', ''), + new CensusColumnRelationToHead($this, 'Situation', 'Situation par rapport au chef de ménage'), + new CensusColumnOccupation($this, 'Profession', ''), + new CensusColumnNull($this, 'Empl', ''), ); } } diff --git a/app/Census/CensusOfFrance1911.php b/app/Census/CensusOfFrance1911.php index 08a710d4ba..5108964ae4 100644 --- a/app/Census/CensusOfFrance1911.php +++ b/app/Census/CensusOfFrance1911.php @@ -35,14 +35,14 @@ class CensusOfFrance1911 extends CensusOfFrance implements CensusInterface { */ public function columns() { return array( - new CensusColumnSurname($this, 'Nom', 'Nom de famille'), - new CensusColumnGivenNames($this, 'Prénom', 'Prénom'), - new CensusColumnOccupation($this, 'Profession', 'Profession'), - new CensusColumnBirthYear($this, 'Année', 'Année de naissance'), - new CensusColumnRelationToHead($this, 'Position', 'Position dans le ménage'), - new CensusColumnNationality($this, 'Nationalité', 'Nationalité'), + new CensusColumnSurname($this, 'Noms', 'Noms de famille'), + new CensusColumnGivenNames($this, 'Prénoms', ''), + new CensusColumnBirthYear($this, 'Année', 'Année de naissance'), new CensusColumnBirthPlace($this, 'Lieu', 'Lieu de naissance'), - new CensusColumnNull($this, 'Position sociale', 'Position sociale (patron, ouvrier ou employé)'), + new CensusColumnNationality($this, 'Nationalité', ''), + new CensusColumnRelationToHead($this, 'Situation', 'Situation par rapport au chef de ménage'), + new CensusColumnOccupation($this, 'Profession', ''), + new CensusColumnNull($this, 'Empl', ''), ); } } diff --git a/app/Census/CensusOfFrance1921.php b/app/Census/CensusOfFrance1921.php index 9b21dfc592..d9c6d294f5 100644 --- a/app/Census/CensusOfFrance1921.php +++ b/app/Census/CensusOfFrance1921.php @@ -35,12 +35,14 @@ class CensusOfFrance1921 extends CensusOfFrance implements CensusInterface { */ public function columns() { return array( - new CensusColumnSurname($this, 'Nom', 'Nom de famille'), - new CensusColumnGivenNames($this, 'Prénom', 'Prénom'), - new CensusColumnOccupation($this, 'Profession', 'Profession'), - new CensusColumnBirthYear($this, 'Année', 'Année de naissance'), - new CensusColumnRelationToHead($this, 'Position', 'Position dans le ménage'), - new CensusColumnNationality($this, 'Nationalité', 'Nationalité'), + new CensusColumnSurname($this, 'Noms', 'Noms de famille'), + new CensusColumnGivenNames($this, 'Prénoms', ''), + new CensusColumnBirthYear($this, 'Année', 'Année de naissance'), + new CensusColumnBirthPlace($this, 'Lieu', 'Lieu de naissance'), + new CensusColumnNationality($this, 'Nationalité', ''), + new CensusColumnRelationToHead($this, 'Situation', 'Situation par rapport au chef de ménage'), + new CensusColumnOccupation($this, 'Profession', ''), + new CensusColumnNull($this, 'Empl', ''), ); } } diff --git a/app/Census/CensusOfFrance1926.php b/app/Census/CensusOfFrance1926.php index 7e4e8c2b83..886dbad092 100644 --- a/app/Census/CensusOfFrance1926.php +++ b/app/Census/CensusOfFrance1926.php @@ -35,12 +35,12 @@ class CensusOfFrance1926 extends CensusOfFrance implements CensusInterface { */ public function columns() { return array( - new CensusColumnSurname($this, 'Nom', 'Nom de famille'), - new CensusColumnGivenNames($this, 'Prénom', 'Prénom'), - new CensusColumnOccupation($this, 'Profession', 'Profession'), - new CensusColumnBirthYear($this, 'Année', 'Année de naissance'), + new CensusColumnSurname($this, 'Noms', 'Noms de famille'), + new CensusColumnGivenNames($this, 'Prénoms', ''), + new CensusColumnOccupation($this, 'Profession', ''), + new CensusColumnBirthYear($this, 'Année', 'Année de naissance'), new CensusColumnRelationToHead($this, 'Position', 'Position dans le ménage'), - new CensusColumnNationality($this, 'Nationalité', 'Nationalité'), + new CensusColumnNationality($this, 'Nationalité', ''), ); } } diff --git a/app/Census/CensusOfFrance1931.php b/app/Census/CensusOfFrance1931.php index 23a948802d..2334eaab89 100644 --- a/app/Census/CensusOfFrance1931.php +++ b/app/Census/CensusOfFrance1931.php @@ -35,12 +35,12 @@ class CensusOfFrance1931 extends CensusOfFrance implements CensusInterface { */ public function columns() { return array( - new CensusColumnSurname($this, 'Nom', 'Nom de famille'), - new CensusColumnGivenNames($this, 'Prénom', 'Prénom'), - new CensusColumnOccupation($this, 'Profession', 'Profession'), - new CensusColumnBirthYear($this, 'Année', 'Année de naissance'), + new CensusColumnSurname($this, 'Noms', 'Noms de famille'), + new CensusColumnGivenNames($this, 'Prénoms', ''), + new CensusColumnOccupation($this, 'Profession', ''), + new CensusColumnBirthYear($this, 'Année', 'Année de naissance'), new CensusColumnRelationToHead($this, 'Position', 'Position dans le ménage'), - new CensusColumnNationality($this, 'Nationalité', 'Nationalité'), + new CensusColumnNationality($this, 'Nationalité', ''), ); } } diff --git a/app/Census/CensusOfFrance1936.php b/app/Census/CensusOfFrance1936.php index e8ca64f31f..6f5a330f30 100644 --- a/app/Census/CensusOfFrance1936.php +++ b/app/Census/CensusOfFrance1936.php @@ -35,12 +35,12 @@ class CensusOfFrance1936 extends CensusOfFrance implements CensusInterface { */ public function columns() { return array( - new CensusColumnSurname($this, 'Nom', 'Nom de famille'), - new CensusColumnGivenNames($this, 'Prénom', 'Prénom'), - new CensusColumnOccupation($this, 'Profession', 'Profession'), - new CensusColumnBirthYear($this, 'Année', 'Année de naissance'), + new CensusColumnSurname($this, 'Noms', 'Noms de famille'), + new CensusColumnGivenNames($this, 'Prénoms', ''), + new CensusColumnOccupation($this, 'Profession', ''), + new CensusColumnBirthYear($this, 'Année', 'Année de naissance'), new CensusColumnRelationToHead($this, 'Position', 'Position dans le ménage'), - new CensusColumnNationality($this, 'Nationalité', 'Nationalité'), + new CensusColumnNationality($this, 'Nationalité', ''), ); } } diff --git a/app/Census/CensusOfFrance1946.php b/app/Census/CensusOfFrance1946.php index daf0759d6d..905616c178 100644 --- a/app/Census/CensusOfFrance1946.php +++ b/app/Census/CensusOfFrance1946.php @@ -35,12 +35,12 @@ class CensusOfFrance1946 extends CensusOfFrance implements CensusInterface { */ public function columns() { return array( - new CensusColumnSurname($this, 'Nom', 'Nom de famille'), - new CensusColumnGivenNames($this, 'Prénom', 'Prénom'), - new CensusColumnOccupation($this, 'Profession', 'Profession'), + new CensusColumnSurname($this, 'Noms', 'Noms de famille'), + new CensusColumnGivenNames($this, 'Prénoms', ''), + new CensusColumnOccupation($this, 'Profession', ''), new CensusColumnBirthYear($this, 'Année', 'Année de naissance'), new CensusColumnRelationToHead($this, 'Position', 'Position dans le ménage'), - new CensusColumnNationality($this, 'Nationalité', 'Nationalité'), + new CensusColumnNationality($this, 'Nationalité', ''), ); } } diff --git a/tests/app/Census/CensusColumnConditionDanishTest.php b/tests/app/Census/CensusColumnConditionDanishTest.php index 0f3fc356a1..746ebe10a5 100644 --- a/tests/app/Census/CensusColumnConditionDanishTest.php +++ b/tests/app/Census/CensusColumnConditionDanishTest.php @@ -35,13 +35,34 @@ class CensusColumnConditionDanishTest extends \PHPUnit_Framework_TestCase { /** * @covers Fisharebest\Webtrees\Census\CensusColumnConditionDanish - * @covers Fisharebest\Webtrees\Census\AbstractCensusColumn + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition */ - public function testNoSpouseFamilies() { + public function testNoSpouseFamiliesMale() { $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('M'); $individual->shouldReceive('getSpouseFamilies')->andReturn(array()); + $individual->shouldReceive('getEstimatedBirthDate')->andReturn(new Date('1800')); $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); + + $column = new CensusColumnConditionDanish($census, '', ''); + + $this->assertSame('Ugift', $column->generate($individual)); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnConditionDanish + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition + */ + public function testNoSpouseFamiliesFemale() { + $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('F'); + $individual->shouldReceive('getSpouseFamilies')->andReturn(array()); + $individual->shouldReceive('getEstimatedBirthDate')->andReturn(new Date('1800')); + + $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); $column = new CensusColumnConditionDanish($census, '', ''); @@ -50,14 +71,36 @@ class CensusColumnConditionDanishTest extends \PHPUnit_Framework_TestCase { /** * @covers Fisharebest\Webtrees\Census\CensusColumnConditionDanish - * @covers Fisharebest\Webtrees\Census\AbstractCensusColumn + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition + */ + public function testNoFamilyNoFactsMale() { + $family = Mockery::mock('Fisharebest\Webtrees\Family'); + $family->shouldReceive('getMarriageDate')->andReturn(new Date('')); + $family->shouldReceive('getFacts')->andReturn(array()); + + $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('M'); + $individual->shouldReceive('getSpouseFamilies')->andReturn(array($family)); + + $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + + $column = new CensusColumnConditionDanish($census, '', ''); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); + + $this->assertSame('Gift', $column->generate($individual)); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnConditionDanish + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition */ - public function testNoFamilyNoFacts() { + public function testNoFamilyNoFactsFemale() { $family = Mockery::mock('Fisharebest\Webtrees\Family'); $family->shouldReceive('getMarriageDate')->andReturn(new Date('')); $family->shouldReceive('getFacts')->andReturn(array()); $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('F'); $individual->shouldReceive('getSpouseFamilies')->andReturn(array($family)); $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); @@ -70,9 +113,9 @@ class CensusColumnConditionDanishTest extends \PHPUnit_Framework_TestCase { /** * @covers Fisharebest\Webtrees\Census\CensusColumnConditionDanish - * @covers Fisharebest\Webtrees\Census\AbstractCensusColumn + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition */ - public function testNoFamilyUnmarried() { + public function testNoFamilyUnmarriedMale() { $fact = Mockery::mock('Fisharebest\Webtrees\Fact'); $family = Mockery::mock('Fisharebest\Webtrees\Family'); @@ -80,21 +123,119 @@ class CensusColumnConditionDanishTest extends \PHPUnit_Framework_TestCase { $family->shouldReceive('getFacts')->with('_NMR')->andReturn(array($fact)); $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('M'); $individual->shouldReceive('getSpouseFamilies')->andReturn(array($family)); + $individual->shouldReceive('getEstimatedBirthDate')->andReturn(new Date('1800')); $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); $column = new CensusColumnConditionDanish($census, '', ''); + + $this->assertSame('Ugift', $column->generate($individual)); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnConditionDanish + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition + */ + public function testNoFamilyUnmarriedFemale() { + $fact = Mockery::mock('Fisharebest\Webtrees\Fact'); + + $family = Mockery::mock('Fisharebest\Webtrees\Family'); + $family->shouldReceive('getMarriageDate')->andReturn(new Date('')); + $family->shouldReceive('getFacts')->with('_NMR')->andReturn(array($fact)); + + $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('F'); + $individual->shouldReceive('getSpouseFamilies')->andReturn(array($family)); + $individual->shouldReceive('getEstimatedBirthDate')->andReturn(new Date('1800')); + + $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); + $column = new CensusColumnConditionDanish($census, '', ''); + $this->assertSame('Ugift', $column->generate($individual)); } /** * @covers Fisharebest\Webtrees\Census\CensusColumnConditionDanish - * @covers Fisharebest\Webtrees\Census\AbstractCensusColumn + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition + */ + public function testChildMale() { + $fact = Mockery::mock('Fisharebest\Webtrees\Fact'); + + $family = Mockery::mock('Fisharebest\Webtrees\Family'); + $family->shouldReceive('getMarriageDate')->andReturn(new Date('')); + $family->shouldReceive('getFacts')->with('_NMR')->andReturn(array($fact)); + + $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('M'); + $individual->shouldReceive('getSpouseFamilies')->andReturn(array($family)); + $individual->shouldReceive('getEstimatedBirthDate')->andReturn(new Date('1820')); + + $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); + + $column = new CensusColumnConditionDanish($census, '', ''); + + $this->assertSame('', $column->generate($individual)); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnConditionDanish + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition + */ + public function testChildFemale() { + $fact = Mockery::mock('Fisharebest\Webtrees\Fact'); + + $family = Mockery::mock('Fisharebest\Webtrees\Family'); + $family->shouldReceive('getMarriageDate')->andReturn(new Date('')); + $family->shouldReceive('getFacts')->with('_NMR')->andReturn(array($fact)); + + $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('F'); + $individual->shouldReceive('getSpouseFamilies')->andReturn(array($family)); + $individual->shouldReceive('getEstimatedBirthDate')->andReturn(new Date('1820')); + + $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); + + $column = new CensusColumnConditionDanish($census, '', ''); + + $this->assertSame('', $column->generate($individual)); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnConditionDanish + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition + */ + public function testDivorcedMale() { + $fact = Mockery::mock('Fisharebest\Webtrees\Fact'); + + $family = Mockery::mock('Fisharebest\Webtrees\Family'); + $family->shouldReceive('getMarriageDate')->andReturn(new Date('')); + $family->shouldReceive('getFacts')->with('_NMR')->andReturn(array()); + $family->shouldReceive('getFacts')->with('DIV')->andReturn(array($fact)); + + $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('M'); + $individual->shouldReceive('getSpouseFamilies')->andReturn(array($family)); + + $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + + $column = new CensusColumnConditionDanish($census, '', ''); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); + + $this->assertSame('Skilt', $column->generate($individual)); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnConditionDanish + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition */ - public function testNoFamilyDivorced() { + public function testDivorcedFemale() { $fact = Mockery::mock('Fisharebest\Webtrees\Fact'); $family = Mockery::mock('Fisharebest\Webtrees\Family'); @@ -103,6 +244,7 @@ class CensusColumnConditionDanishTest extends \PHPUnit_Framework_TestCase { $family->shouldReceive('getFacts')->with('DIV')->andReturn(array($fact)); $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('F'); $individual->shouldReceive('getSpouseFamilies')->andReturn(array($family)); $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); diff --git a/tests/app/Census/CensusColumnConditionEnglishTest.php b/tests/app/Census/CensusColumnConditionEnglishTest.php index 19593778ef..e86770ea3c 100644 --- a/tests/app/Census/CensusColumnConditionEnglishTest.php +++ b/tests/app/Census/CensusColumnConditionEnglishTest.php @@ -35,13 +35,34 @@ class CensusColumnConditionEnglishTest extends \PHPUnit_Framework_TestCase { /** * @covers Fisharebest\Webtrees\Census\CensusColumnConditionEnglish - * @covers Fisharebest\Webtrees\Census\AbstractCensusColumn + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition */ - public function testNoSpouseFamilies() { + public function testNoSpouseFamiliesMale() { $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('M'); $individual->shouldReceive('getSpouseFamilies')->andReturn(array()); + $individual->shouldReceive('getEstimatedBirthDate')->andReturn(new Date('1800')); $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); + + $column = new CensusColumnConditionEnglish($census, '', ''); + + $this->assertSame('Unm', $column->generate($individual)); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnConditionEnglish + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition + */ + public function testNoSpouseFamiliesFemale() { + $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('F'); + $individual->shouldReceive('getSpouseFamilies')->andReturn(array()); + $individual->shouldReceive('getEstimatedBirthDate')->andReturn(new Date('1800')); + + $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); $column = new CensusColumnConditionEnglish($census, '', ''); @@ -50,14 +71,36 @@ class CensusColumnConditionEnglishTest extends \PHPUnit_Framework_TestCase { /** * @covers Fisharebest\Webtrees\Census\CensusColumnConditionEnglish - * @covers Fisharebest\Webtrees\Census\AbstractCensusColumn + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition + */ + public function testNoFamilyNoFactsMale() { + $family = Mockery::mock('Fisharebest\Webtrees\Family'); + $family->shouldReceive('getMarriageDate')->andReturn(new Date('')); + $family->shouldReceive('getFacts')->andReturn(array()); + + $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('M'); + $individual->shouldReceive('getSpouseFamilies')->andReturn(array($family)); + + $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + + $column = new CensusColumnConditionEnglish($census, '', ''); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); + + $this->assertSame('Mar', $column->generate($individual)); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnConditionEnglish + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition */ - public function testNoFamilyNoFacts() { + public function testNoFamilyNoFactsFemale() { $family = Mockery::mock('Fisharebest\Webtrees\Family'); $family->shouldReceive('getMarriageDate')->andReturn(new Date('')); $family->shouldReceive('getFacts')->andReturn(array()); $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('F'); $individual->shouldReceive('getSpouseFamilies')->andReturn(array($family)); $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); @@ -70,9 +113,9 @@ class CensusColumnConditionEnglishTest extends \PHPUnit_Framework_TestCase { /** * @covers Fisharebest\Webtrees\Census\CensusColumnConditionEnglish - * @covers Fisharebest\Webtrees\Census\AbstractCensusColumn + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition */ - public function testNoFamilyUnmarried() { + public function testNoFamilyUnmarriedMale() { $fact = Mockery::mock('Fisharebest\Webtrees\Fact'); $family = Mockery::mock('Fisharebest\Webtrees\Family'); @@ -80,21 +123,119 @@ class CensusColumnConditionEnglishTest extends \PHPUnit_Framework_TestCase { $family->shouldReceive('getFacts')->with('_NMR')->andReturn(array($fact)); $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('M'); $individual->shouldReceive('getSpouseFamilies')->andReturn(array($family)); + $individual->shouldReceive('getEstimatedBirthDate')->andReturn(new Date('1800')); $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); $column = new CensusColumnConditionEnglish($census, '', ''); + + $this->assertSame('Unm', $column->generate($individual)); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnConditionEnglish + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition + */ + public function testNoFamilyUnmarriedFemale() { + $fact = Mockery::mock('Fisharebest\Webtrees\Fact'); + + $family = Mockery::mock('Fisharebest\Webtrees\Family'); + $family->shouldReceive('getMarriageDate')->andReturn(new Date('')); + $family->shouldReceive('getFacts')->with('_NMR')->andReturn(array($fact)); + + $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('F'); + $individual->shouldReceive('getSpouseFamilies')->andReturn(array($family)); + $individual->shouldReceive('getEstimatedBirthDate')->andReturn(new Date('1800')); + + $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); + $column = new CensusColumnConditionEnglish($census, '', ''); + $this->assertSame('Unm', $column->generate($individual)); } /** * @covers Fisharebest\Webtrees\Census\CensusColumnConditionEnglish - * @covers Fisharebest\Webtrees\Census\AbstractCensusColumn + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition + */ + public function testChildMale() { + $fact = Mockery::mock('Fisharebest\Webtrees\Fact'); + + $family = Mockery::mock('Fisharebest\Webtrees\Family'); + $family->shouldReceive('getMarriageDate')->andReturn(new Date('')); + $family->shouldReceive('getFacts')->with('_NMR')->andReturn(array($fact)); + + $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('M'); + $individual->shouldReceive('getSpouseFamilies')->andReturn(array($family)); + $individual->shouldReceive('getEstimatedBirthDate')->andReturn(new Date('1820')); + + $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); + + $column = new CensusColumnConditionEnglish($census, '', ''); + + $this->assertSame('', $column->generate($individual)); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnConditionEnglish + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition + */ + public function testChildFemale() { + $fact = Mockery::mock('Fisharebest\Webtrees\Fact'); + + $family = Mockery::mock('Fisharebest\Webtrees\Family'); + $family->shouldReceive('getMarriageDate')->andReturn(new Date('')); + $family->shouldReceive('getFacts')->with('_NMR')->andReturn(array($fact)); + + $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('F'); + $individual->shouldReceive('getSpouseFamilies')->andReturn(array($family)); + $individual->shouldReceive('getEstimatedBirthDate')->andReturn(new Date('1820')); + + $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); + + $column = new CensusColumnConditionEnglish($census, '', ''); + + $this->assertSame('', $column->generate($individual)); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnConditionEnglish + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition + */ + public function testDivorcedMale() { + $fact = Mockery::mock('Fisharebest\Webtrees\Fact'); + + $family = Mockery::mock('Fisharebest\Webtrees\Family'); + $family->shouldReceive('getMarriageDate')->andReturn(new Date('')); + $family->shouldReceive('getFacts')->with('_NMR')->andReturn(array()); + $family->shouldReceive('getFacts')->with('DIV')->andReturn(array($fact)); + + $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('M'); + $individual->shouldReceive('getSpouseFamilies')->andReturn(array($family)); + + $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + + $column = new CensusColumnConditionEnglish($census, '', ''); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); + + $this->assertSame('Div', $column->generate($individual)); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnConditionEnglish + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition */ - public function testNoFamilyDivorced() { + public function testDivorcedFemale() { $fact = Mockery::mock('Fisharebest\Webtrees\Fact'); $family = Mockery::mock('Fisharebest\Webtrees\Family'); @@ -103,6 +244,7 @@ class CensusColumnConditionEnglishTest extends \PHPUnit_Framework_TestCase { $family->shouldReceive('getFacts')->with('DIV')->andReturn(array($fact)); $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('F'); $individual->shouldReceive('getSpouseFamilies')->andReturn(array($family)); $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); diff --git a/tests/app/Census/CensusColumnConditionFrenchFemmeTest.php b/tests/app/Census/CensusColumnConditionFrenchFemmeTest.php new file mode 100644 index 0000000000..b2642378ac --- /dev/null +++ b/tests/app/Census/CensusColumnConditionFrenchFemmeTest.php @@ -0,0 +1,257 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2016 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 <http://www.gnu.org/licenses/>. + */ +namespace Fisharebest\Webtrees\Census; + +use Fisharebest\Webtrees\Date; +use Fisharebest\Webtrees\Fact; +use Fisharebest\Webtrees\Family; +use Fisharebest\Webtrees\Individual; +use Mockery; + +/** + * Test harness for the class CensusColumnConditionFrenchFemme + */ +class CensusColumnConditionFrenchFemmeTest extends \PHPUnit_Framework_TestCase { + /** + * Delete mock objects + */ + public function tearDown() { + Mockery::close(); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnConditionFrenchFemme + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition + */ + public function testNoSpouseFamiliesMale() { + $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('M'); + $individual->shouldReceive('getSpouseFamilies')->andReturn(array()); + $individual->shouldReceive('getEstimatedBirthDate')->andReturn(new Date('1800')); + + $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); + + $column = new CensusColumnConditionFrenchFemme($census, '', ''); + + $this->assertSame('', $column->generate($individual)); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnConditionFrenchFemme + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition + */ + public function testNoSpouseFamiliesFemale() { + $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('F'); + $individual->shouldReceive('getSpouseFamilies')->andReturn(array()); + $individual->shouldReceive('getEstimatedBirthDate')->andReturn(new Date('1800')); + + $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); + + $column = new CensusColumnConditionFrenchFemme($census, '', ''); + + $this->assertSame('X', $column->generate($individual)); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnConditionFrenchFemme + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition + */ + public function testNoFamilyNoFactsMale() { + $family = Mockery::mock('Fisharebest\Webtrees\Family'); + $family->shouldReceive('getMarriageDate')->andReturn(new Date('')); + $family->shouldReceive('getFacts')->andReturn(array()); + + $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('M'); + $individual->shouldReceive('getSpouseFamilies')->andReturn(array($family)); + + $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + + $column = new CensusColumnConditionFrenchFemme($census, '', ''); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); + + $this->assertSame('', $column->generate($individual)); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnConditionFrenchFemme + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition + */ + public function testNoFamilyNoFactsFemale() { + $family = Mockery::mock('Fisharebest\Webtrees\Family'); + $family->shouldReceive('getMarriageDate')->andReturn(new Date('')); + $family->shouldReceive('getFacts')->andReturn(array()); + + $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('F'); + $individual->shouldReceive('getSpouseFamilies')->andReturn(array($family)); + + $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + + $column = new CensusColumnConditionFrenchFemme($census, '', ''); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); + + $this->assertSame('X', $column->generate($individual)); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnConditionFrenchFemme + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition + */ + public function testNoFamilyUnmarriedMale() { + $fact = Mockery::mock('Fisharebest\Webtrees\Fact'); + + $family = Mockery::mock('Fisharebest\Webtrees\Family'); + $family->shouldReceive('getMarriageDate')->andReturn(new Date('')); + $family->shouldReceive('getFacts')->with('_NMR')->andReturn(array($fact)); + + $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('M'); + $individual->shouldReceive('getSpouseFamilies')->andReturn(array($family)); + $individual->shouldReceive('getEstimatedBirthDate')->andReturn(new Date('1800')); + + $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); + + $column = new CensusColumnConditionFrenchFemme($census, '', ''); + + $this->assertSame('', $column->generate($individual)); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnConditionFrenchFemme + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition + */ + public function testNoFamilyUnmarriedFemale() { + $fact = Mockery::mock('Fisharebest\Webtrees\Fact'); + + $family = Mockery::mock('Fisharebest\Webtrees\Family'); + $family->shouldReceive('getMarriageDate')->andReturn(new Date('')); + $family->shouldReceive('getFacts')->with('_NMR')->andReturn(array($fact)); + + $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('F'); + $individual->shouldReceive('getSpouseFamilies')->andReturn(array($family)); + $individual->shouldReceive('getEstimatedBirthDate')->andReturn(new Date('1800')); + + $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); + + $column = new CensusColumnConditionFrenchFemme($census, '', ''); + + $this->assertSame('X', $column->generate($individual)); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnConditionFrenchFemme + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition + */ + public function testChildMale() { + $fact = Mockery::mock('Fisharebest\Webtrees\Fact'); + + $family = Mockery::mock('Fisharebest\Webtrees\Family'); + $family->shouldReceive('getMarriageDate')->andReturn(new Date('')); + $family->shouldReceive('getFacts')->with('_NMR')->andReturn(array($fact)); + + $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('M'); + $individual->shouldReceive('getSpouseFamilies')->andReturn(array($family)); + $individual->shouldReceive('getEstimatedBirthDate')->andReturn(new Date('1820')); + + $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); + + $column = new CensusColumnConditionFrenchFemme($census, '', ''); + + $this->assertSame('', $column->generate($individual)); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnConditionFrenchFemme + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition + */ + public function testChildFemale() { + $fact = Mockery::mock('Fisharebest\Webtrees\Fact'); + + $family = Mockery::mock('Fisharebest\Webtrees\Family'); + $family->shouldReceive('getMarriageDate')->andReturn(new Date('')); + $family->shouldReceive('getFacts')->with('_NMR')->andReturn(array($fact)); + + $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('F'); + $individual->shouldReceive('getSpouseFamilies')->andReturn(array($family)); + $individual->shouldReceive('getEstimatedBirthDate')->andReturn(new Date('1820')); + + $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); + + $column = new CensusColumnConditionFrenchFemme($census, '', ''); + + $this->assertSame('', $column->generate($individual)); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnConditionFrenchFemme + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition + */ + public function testDivorcedMale() { + $fact = Mockery::mock('Fisharebest\Webtrees\Fact'); + + $family = Mockery::mock('Fisharebest\Webtrees\Family'); + $family->shouldReceive('getMarriageDate')->andReturn(new Date('')); + $family->shouldReceive('getFacts')->with('_NMR')->andReturn(array()); + $family->shouldReceive('getFacts')->with('DIV')->andReturn(array($fact)); + + $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('M'); + $individual->shouldReceive('getSpouseFamilies')->andReturn(array($family)); + + $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + + $column = new CensusColumnConditionFrenchFemme($census, '', ''); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); + + $this->assertSame('', $column->generate($individual)); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnConditionFrenchFemme + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition + */ + public function testDivorcedFemale() { + $fact = Mockery::mock('Fisharebest\Webtrees\Fact'); + + $family = Mockery::mock('Fisharebest\Webtrees\Family'); + $family->shouldReceive('getMarriageDate')->andReturn(new Date('')); + $family->shouldReceive('getFacts')->with('_NMR')->andReturn(array()); + $family->shouldReceive('getFacts')->with('DIV')->andReturn(array($fact)); + + $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('F'); + $individual->shouldReceive('getSpouseFamilies')->andReturn(array($family)); + + $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + + $column = new CensusColumnConditionFrenchFemme($census, '', ''); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); + + $this->assertSame('X', $column->generate($individual)); + } +} diff --git a/tests/app/Census/CensusColumnConditionFrenchFilleTest.php b/tests/app/Census/CensusColumnConditionFrenchFilleTest.php new file mode 100644 index 0000000000..5c80f316b6 --- /dev/null +++ b/tests/app/Census/CensusColumnConditionFrenchFilleTest.php @@ -0,0 +1,257 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2016 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 <http://www.gnu.org/licenses/>. + */ +namespace Fisharebest\Webtrees\Census; + +use Fisharebest\Webtrees\Date; +use Fisharebest\Webtrees\Fact; +use Fisharebest\Webtrees\Family; +use Fisharebest\Webtrees\Individual; +use Mockery; + +/** + * Test harness for the class CensusColumnConditionFrenchFille + */ +class CensusColumnConditionFrenchFilleTest extends \PHPUnit_Framework_TestCase { + /** + * Delete mock objects + */ + public function tearDown() { + Mockery::close(); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnConditionFrenchFille + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition + */ + public function testNoSpouseFamiliesMale() { + $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('M'); + $individual->shouldReceive('getSpouseFamilies')->andReturn(array()); + $individual->shouldReceive('getEstimatedBirthDate')->andReturn(new Date('1800')); + + $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); + + $column = new CensusColumnConditionFrenchFille($census, '', ''); + + $this->assertSame('', $column->generate($individual)); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnConditionFrenchFille + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition + */ + public function testNoSpouseFamiliesFemale() { + $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('F'); + $individual->shouldReceive('getSpouseFamilies')->andReturn(array()); + $individual->shouldReceive('getEstimatedBirthDate')->andReturn(new Date('1800')); + + $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); + + $column = new CensusColumnConditionFrenchFille($census, '', ''); + + $this->assertSame('', $column->generate($individual)); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnConditionFrenchFille + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition + */ + public function testNoFamilyNoFactsMale() { + $family = Mockery::mock('Fisharebest\Webtrees\Family'); + $family->shouldReceive('getMarriageDate')->andReturn(new Date('')); + $family->shouldReceive('getFacts')->andReturn(array()); + + $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('M'); + $individual->shouldReceive('getSpouseFamilies')->andReturn(array($family)); + + $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + + $column = new CensusColumnConditionFrenchFille($census, '', ''); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); + + $this->assertSame('', $column->generate($individual)); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnConditionFrenchFille + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition + */ + public function testNoFamilyNoFactsFemale() { + $family = Mockery::mock('Fisharebest\Webtrees\Family'); + $family->shouldReceive('getMarriageDate')->andReturn(new Date('')); + $family->shouldReceive('getFacts')->andReturn(array()); + + $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('F'); + $individual->shouldReceive('getSpouseFamilies')->andReturn(array($family)); + + $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + + $column = new CensusColumnConditionFrenchFille($census, '', ''); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); + + $this->assertSame('', $column->generate($individual)); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnConditionFrenchFille + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition + */ + public function testNoFamilyUnmarriedMale() { + $fact = Mockery::mock('Fisharebest\Webtrees\Fact'); + + $family = Mockery::mock('Fisharebest\Webtrees\Family'); + $family->shouldReceive('getMarriageDate')->andReturn(new Date('')); + $family->shouldReceive('getFacts')->with('_NMR')->andReturn(array($fact)); + + $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('M'); + $individual->shouldReceive('getSpouseFamilies')->andReturn(array($family)); + $individual->shouldReceive('getEstimatedBirthDate')->andReturn(new Date('1800')); + + $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); + + $column = new CensusColumnConditionFrenchFille($census, '', ''); + + $this->assertSame('', $column->generate($individual)); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnConditionFrenchFille + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition + */ + public function testNoFamilyUnmarriedFemale() { + $fact = Mockery::mock('Fisharebest\Webtrees\Fact'); + + $family = Mockery::mock('Fisharebest\Webtrees\Family'); + $family->shouldReceive('getMarriageDate')->andReturn(new Date('')); + $family->shouldReceive('getFacts')->with('_NMR')->andReturn(array($fact)); + + $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('F'); + $individual->shouldReceive('getSpouseFamilies')->andReturn(array($family)); + $individual->shouldReceive('getEstimatedBirthDate')->andReturn(new Date('1800')); + + $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); + + $column = new CensusColumnConditionFrenchFille($census, '', ''); + + $this->assertSame('', $column->generate($individual)); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnConditionFrenchFille + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition + */ + public function testChildMale() { + $fact = Mockery::mock('Fisharebest\Webtrees\Fact'); + + $family = Mockery::mock('Fisharebest\Webtrees\Family'); + $family->shouldReceive('getMarriageDate')->andReturn(new Date('')); + $family->shouldReceive('getFacts')->with('_NMR')->andReturn(array($fact)); + + $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('M'); + $individual->shouldReceive('getSpouseFamilies')->andReturn(array($family)); + $individual->shouldReceive('getEstimatedBirthDate')->andReturn(new Date('1820')); + + $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); + + $column = new CensusColumnConditionFrenchFille($census, '', ''); + + $this->assertSame('', $column->generate($individual)); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnConditionFrenchFille + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition + */ + public function testChildFemale() { + $fact = Mockery::mock('Fisharebest\Webtrees\Fact'); + + $family = Mockery::mock('Fisharebest\Webtrees\Family'); + $family->shouldReceive('getMarriageDate')->andReturn(new Date('')); + $family->shouldReceive('getFacts')->with('_NMR')->andReturn(array($fact)); + + $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('F'); + $individual->shouldReceive('getSpouseFamilies')->andReturn(array($family)); + $individual->shouldReceive('getEstimatedBirthDate')->andReturn(new Date('1820')); + + $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); + + $column = new CensusColumnConditionFrenchFille($census, '', ''); + + $this->assertSame('X', $column->generate($individual)); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnConditionFrenchFille + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition + */ + public function testDivorcedMale() { + $fact = Mockery::mock('Fisharebest\Webtrees\Fact'); + + $family = Mockery::mock('Fisharebest\Webtrees\Family'); + $family->shouldReceive('getMarriageDate')->andReturn(new Date('')); + $family->shouldReceive('getFacts')->with('_NMR')->andReturn(array()); + $family->shouldReceive('getFacts')->with('DIV')->andReturn(array($fact)); + + $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('M'); + $individual->shouldReceive('getSpouseFamilies')->andReturn(array($family)); + + $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + + $column = new CensusColumnConditionFrenchFille($census, '', ''); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); + + $this->assertSame('', $column->generate($individual)); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnConditionFrenchFille + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition + */ + public function testDivorcedFemale() { + $fact = Mockery::mock('Fisharebest\Webtrees\Fact'); + + $family = Mockery::mock('Fisharebest\Webtrees\Family'); + $family->shouldReceive('getMarriageDate')->andReturn(new Date('')); + $family->shouldReceive('getFacts')->with('_NMR')->andReturn(array()); + $family->shouldReceive('getFacts')->with('DIV')->andReturn(array($fact)); + + $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('F'); + $individual->shouldReceive('getSpouseFamilies')->andReturn(array($family)); + + $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + + $column = new CensusColumnConditionFrenchFille($census, '', ''); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); + + $this->assertSame('', $column->generate($individual)); + } +} diff --git a/tests/app/Census/CensusColumnConditionFrenchGarconTest.php b/tests/app/Census/CensusColumnConditionFrenchGarconTest.php new file mode 100644 index 0000000000..18f8130486 --- /dev/null +++ b/tests/app/Census/CensusColumnConditionFrenchGarconTest.php @@ -0,0 +1,257 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2016 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 <http://www.gnu.org/licenses/>. + */ +namespace Fisharebest\Webtrees\Census; + +use Fisharebest\Webtrees\Date; +use Fisharebest\Webtrees\Fact; +use Fisharebest\Webtrees\Family; +use Fisharebest\Webtrees\Individual; +use Mockery; + +/** + * Test harness for the class CensusColumnConditionFrenchGarcon + */ +class CensusColumnConditionFrenchGarconTest extends \PHPUnit_Framework_TestCase { + /** + * Delete mock objects + */ + public function tearDown() { + Mockery::close(); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnConditionFrenchGarcon + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition + */ + public function testNoSpouseFamiliesMale() { + $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('M'); + $individual->shouldReceive('getSpouseFamilies')->andReturn(array()); + $individual->shouldReceive('getEstimatedBirthDate')->andReturn(new Date('1800')); + + $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); + + $column = new CensusColumnConditionFrenchGarcon($census, '', ''); + + $this->assertSame('', $column->generate($individual)); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnConditionFrenchGarcon + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition + */ + public function testNoSpouseFamiliesFemale() { + $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('F'); + $individual->shouldReceive('getSpouseFamilies')->andReturn(array()); + $individual->shouldReceive('getEstimatedBirthDate')->andReturn(new Date('1800')); + + $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); + + $column = new CensusColumnConditionFrenchGarcon($census, '', ''); + + $this->assertSame('', $column->generate($individual)); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnConditionFrenchGarcon + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition + */ + public function testNoFamilyNoFactsMale() { + $family = Mockery::mock('Fisharebest\Webtrees\Family'); + $family->shouldReceive('getMarriageDate')->andReturn(new Date('')); + $family->shouldReceive('getFacts')->andReturn(array()); + + $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('M'); + $individual->shouldReceive('getSpouseFamilies')->andReturn(array($family)); + + $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + + $column = new CensusColumnConditionFrenchGarcon($census, '', ''); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); + + $this->assertSame('', $column->generate($individual)); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnConditionFrenchGarcon + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition + */ + public function testNoFamilyNoFactsFemale() { + $family = Mockery::mock('Fisharebest\Webtrees\Family'); + $family->shouldReceive('getMarriageDate')->andReturn(new Date('')); + $family->shouldReceive('getFacts')->andReturn(array()); + + $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('F'); + $individual->shouldReceive('getSpouseFamilies')->andReturn(array($family)); + + $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + + $column = new CensusColumnConditionFrenchGarcon($census, '', ''); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); + + $this->assertSame('', $column->generate($individual)); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnConditionFrenchGarcon + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition + */ + public function testNoFamilyUnmarriedMale() { + $fact = Mockery::mock('Fisharebest\Webtrees\Fact'); + + $family = Mockery::mock('Fisharebest\Webtrees\Family'); + $family->shouldReceive('getMarriageDate')->andReturn(new Date('')); + $family->shouldReceive('getFacts')->with('_NMR')->andReturn(array($fact)); + + $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('M'); + $individual->shouldReceive('getSpouseFamilies')->andReturn(array($family)); + $individual->shouldReceive('getEstimatedBirthDate')->andReturn(new Date('1800')); + + $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); + + $column = new CensusColumnConditionFrenchGarcon($census, '', ''); + + $this->assertSame('', $column->generate($individual)); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnConditionFrenchGarcon + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition + */ + public function testNoFamilyUnmarriedFemale() { + $fact = Mockery::mock('Fisharebest\Webtrees\Fact'); + + $family = Mockery::mock('Fisharebest\Webtrees\Family'); + $family->shouldReceive('getMarriageDate')->andReturn(new Date('')); + $family->shouldReceive('getFacts')->with('_NMR')->andReturn(array($fact)); + + $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('F'); + $individual->shouldReceive('getSpouseFamilies')->andReturn(array($family)); + $individual->shouldReceive('getEstimatedBirthDate')->andReturn(new Date('1800')); + + $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); + + $column = new CensusColumnConditionFrenchGarcon($census, '', ''); + + $this->assertSame('', $column->generate($individual)); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnConditionFrenchGarcon + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition + */ + public function testChildMale() { + $fact = Mockery::mock('Fisharebest\Webtrees\Fact'); + + $family = Mockery::mock('Fisharebest\Webtrees\Family'); + $family->shouldReceive('getMarriageDate')->andReturn(new Date('')); + $family->shouldReceive('getFacts')->with('_NMR')->andReturn(array($fact)); + + $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('M'); + $individual->shouldReceive('getSpouseFamilies')->andReturn(array($family)); + $individual->shouldReceive('getEstimatedBirthDate')->andReturn(new Date('1820')); + + $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); + + $column = new CensusColumnConditionFrenchGarcon($census, '', ''); + + $this->assertSame('X', $column->generate($individual)); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnConditionFrenchGarcon + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition + */ + public function testChildFemale() { + $fact = Mockery::mock('Fisharebest\Webtrees\Fact'); + + $family = Mockery::mock('Fisharebest\Webtrees\Family'); + $family->shouldReceive('getMarriageDate')->andReturn(new Date('')); + $family->shouldReceive('getFacts')->with('_NMR')->andReturn(array($fact)); + + $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('F'); + $individual->shouldReceive('getSpouseFamilies')->andReturn(array($family)); + $individual->shouldReceive('getEstimatedBirthDate')->andReturn(new Date('1820')); + + $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); + + $column = new CensusColumnConditionFrenchGarcon($census, '', ''); + + $this->assertSame('', $column->generate($individual)); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnConditionFrenchGarcon + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition + */ + public function testDivorcedMale() { + $fact = Mockery::mock('Fisharebest\Webtrees\Fact'); + + $family = Mockery::mock('Fisharebest\Webtrees\Family'); + $family->shouldReceive('getMarriageDate')->andReturn(new Date('')); + $family->shouldReceive('getFacts')->with('_NMR')->andReturn(array()); + $family->shouldReceive('getFacts')->with('DIV')->andReturn(array($fact)); + + $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('M'); + $individual->shouldReceive('getSpouseFamilies')->andReturn(array($family)); + + $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + + $column = new CensusColumnConditionFrenchGarcon($census, '', ''); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); + + $this->assertSame('', $column->generate($individual)); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnConditionFrenchGarcon + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition + */ + public function testDivorcedFemale() { + $fact = Mockery::mock('Fisharebest\Webtrees\Fact'); + + $family = Mockery::mock('Fisharebest\Webtrees\Family'); + $family->shouldReceive('getMarriageDate')->andReturn(new Date('')); + $family->shouldReceive('getFacts')->with('_NMR')->andReturn(array()); + $family->shouldReceive('getFacts')->with('DIV')->andReturn(array($fact)); + + $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('F'); + $individual->shouldReceive('getSpouseFamilies')->andReturn(array($family)); + + $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + + $column = new CensusColumnConditionFrenchGarcon($census, '', ''); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); + + $this->assertSame('', $column->generate($individual)); + } +} diff --git a/tests/app/Census/CensusColumnConditionFrenchHommeTest.php b/tests/app/Census/CensusColumnConditionFrenchHommeTest.php new file mode 100644 index 0000000000..b1d86c68d8 --- /dev/null +++ b/tests/app/Census/CensusColumnConditionFrenchHommeTest.php @@ -0,0 +1,257 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2016 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 <http://www.gnu.org/licenses/>. + */ +namespace Fisharebest\Webtrees\Census; + +use Fisharebest\Webtrees\Date; +use Fisharebest\Webtrees\Fact; +use Fisharebest\Webtrees\Family; +use Fisharebest\Webtrees\Individual; +use Mockery; + +/** + * Test harness for the class CensusColumnConditionFrenchHomme + */ +class CensusColumnConditionFrenchHommeTest extends \PHPUnit_Framework_TestCase { + /** + * Delete mock objects + */ + public function tearDown() { + Mockery::close(); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnConditionFrenchHomme + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition + */ + public function testNoSpouseFamiliesMale() { + $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('M'); + $individual->shouldReceive('getSpouseFamilies')->andReturn(array()); + $individual->shouldReceive('getEstimatedBirthDate')->andReturn(new Date('1800')); + + $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); + + $column = new CensusColumnConditionFrenchHomme($census, '', ''); + + $this->assertSame('X', $column->generate($individual)); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnConditionFrenchHomme + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition + */ + public function testNoSpouseFamiliesFemale() { + $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('F'); + $individual->shouldReceive('getSpouseFamilies')->andReturn(array()); + $individual->shouldReceive('getEstimatedBirthDate')->andReturn(new Date('1800')); + + $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); + + $column = new CensusColumnConditionFrenchHomme($census, '', ''); + + $this->assertSame('', $column->generate($individual)); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnConditionFrenchHomme + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition + */ + public function testNoFamilyNoFactsMale() { + $family = Mockery::mock('Fisharebest\Webtrees\Family'); + $family->shouldReceive('getMarriageDate')->andReturn(new Date('')); + $family->shouldReceive('getFacts')->andReturn(array()); + + $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('M'); + $individual->shouldReceive('getSpouseFamilies')->andReturn(array($family)); + + $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + + $column = new CensusColumnConditionFrenchHomme($census, '', ''); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); + + $this->assertSame('X', $column->generate($individual)); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnConditionFrenchHomme + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition + */ + public function testNoFamilyNoFactsFemale() { + $family = Mockery::mock('Fisharebest\Webtrees\Family'); + $family->shouldReceive('getMarriageDate')->andReturn(new Date('')); + $family->shouldReceive('getFacts')->andReturn(array()); + + $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('F'); + $individual->shouldReceive('getSpouseFamilies')->andReturn(array($family)); + + $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + + $column = new CensusColumnConditionFrenchHomme($census, '', ''); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); + + $this->assertSame('', $column->generate($individual)); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnConditionFrenchHomme + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition + */ + public function testNoFamilyUnmarriedMale() { + $fact = Mockery::mock('Fisharebest\Webtrees\Fact'); + + $family = Mockery::mock('Fisharebest\Webtrees\Family'); + $family->shouldReceive('getMarriageDate')->andReturn(new Date('')); + $family->shouldReceive('getFacts')->with('_NMR')->andReturn(array($fact)); + + $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('M'); + $individual->shouldReceive('getSpouseFamilies')->andReturn(array($family)); + $individual->shouldReceive('getEstimatedBirthDate')->andReturn(new Date('1800')); + + $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); + + $column = new CensusColumnConditionFrenchHomme($census, '', ''); + + $this->assertSame('X', $column->generate($individual)); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnConditionFrenchHomme + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition + */ + public function testNoFamilyUnmarriedFemale() { + $fact = Mockery::mock('Fisharebest\Webtrees\Fact'); + + $family = Mockery::mock('Fisharebest\Webtrees\Family'); + $family->shouldReceive('getMarriageDate')->andReturn(new Date('')); + $family->shouldReceive('getFacts')->with('_NMR')->andReturn(array($fact)); + + $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('F'); + $individual->shouldReceive('getSpouseFamilies')->andReturn(array($family)); + $individual->shouldReceive('getEstimatedBirthDate')->andReturn(new Date('1800')); + + $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); + + $column = new CensusColumnConditionFrenchHomme($census, '', ''); + + $this->assertSame('', $column->generate($individual)); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnConditionFrenchHomme + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition + */ + public function testChildMale() { + $fact = Mockery::mock('Fisharebest\Webtrees\Fact'); + + $family = Mockery::mock('Fisharebest\Webtrees\Family'); + $family->shouldReceive('getMarriageDate')->andReturn(new Date('')); + $family->shouldReceive('getFacts')->with('_NMR')->andReturn(array($fact)); + + $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('M'); + $individual->shouldReceive('getSpouseFamilies')->andReturn(array($family)); + $individual->shouldReceive('getEstimatedBirthDate')->andReturn(new Date('1820')); + + $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); + + $column = new CensusColumnConditionFrenchHomme($census, '', ''); + + $this->assertSame('', $column->generate($individual)); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnConditionFrenchHomme + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition + */ + public function testChildFemale() { + $fact = Mockery::mock('Fisharebest\Webtrees\Fact'); + + $family = Mockery::mock('Fisharebest\Webtrees\Family'); + $family->shouldReceive('getMarriageDate')->andReturn(new Date('')); + $family->shouldReceive('getFacts')->with('_NMR')->andReturn(array($fact)); + + $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('F'); + $individual->shouldReceive('getSpouseFamilies')->andReturn(array($family)); + $individual->shouldReceive('getEstimatedBirthDate')->andReturn(new Date('1820')); + + $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); + + $column = new CensusColumnConditionFrenchHomme($census, '', ''); + + $this->assertSame('', $column->generate($individual)); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnConditionFrenchHomme + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition + */ + public function testDivorcedMale() { + $fact = Mockery::mock('Fisharebest\Webtrees\Fact'); + + $family = Mockery::mock('Fisharebest\Webtrees\Family'); + $family->shouldReceive('getMarriageDate')->andReturn(new Date('')); + $family->shouldReceive('getFacts')->with('_NMR')->andReturn(array()); + $family->shouldReceive('getFacts')->with('DIV')->andReturn(array($fact)); + + $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('M'); + $individual->shouldReceive('getSpouseFamilies')->andReturn(array($family)); + + $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + + $column = new CensusColumnConditionFrenchHomme($census, '', ''); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); + + $this->assertSame('X', $column->generate($individual)); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnConditionFrenchHomme + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition + */ + public function testDivorcedFemale() { + $fact = Mockery::mock('Fisharebest\Webtrees\Fact'); + + $family = Mockery::mock('Fisharebest\Webtrees\Family'); + $family->shouldReceive('getMarriageDate')->andReturn(new Date('')); + $family->shouldReceive('getFacts')->with('_NMR')->andReturn(array()); + $family->shouldReceive('getFacts')->with('DIV')->andReturn(array($fact)); + + $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('F'); + $individual->shouldReceive('getSpouseFamilies')->andReturn(array($family)); + + $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + + $column = new CensusColumnConditionFrenchHomme($census, '', ''); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); + + $this->assertSame('', $column->generate($individual)); + } +} diff --git a/tests/app/Census/CensusColumnConditionFrenchTest.php b/tests/app/Census/CensusColumnConditionFrenchTest.php deleted file mode 100644 index 4fe4c6daed..0000000000 --- a/tests/app/Census/CensusColumnConditionFrenchTest.php +++ /dev/null @@ -1,115 +0,0 @@ -<?php - -/** - * webtrees: online genealogy - * Copyright (C) 2016 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 <http://www.gnu.org/licenses/>. - */ -namespace Fisharebest\Webtrees\Census; - -use Fisharebest\Webtrees\Date; -use Fisharebest\Webtrees\Fact; -use Fisharebest\Webtrees\Family; -use Fisharebest\Webtrees\Individual; -use Mockery; - -/** - * Test harness for the class CensusColumnConditionFrench - */ -class CensusColumnConditionFrenchTest extends \PHPUnit_Framework_TestCase { - /** - * Delete mock objects - */ - public function tearDown() { - Mockery::close(); - } - - /** - * @covers Fisharebest\Webtrees\Census\CensusColumnConditionFrench - * @covers Fisharebest\Webtrees\Census\AbstractCensusColumn - */ - public function testNoSpouseFamilies() { - $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); - $individual->shouldReceive('getSpouseFamilies')->andReturn(array()); - - $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); - - $column = new CensusColumnConditionFrench($census, '', ''); - - $this->assertSame('Célibataire', $column->generate($individual)); - } - - /** - * @covers Fisharebest\Webtrees\Census\CensusColumnConditionFrench - * @covers Fisharebest\Webtrees\Census\AbstractCensusColumn - */ - public function testNoFamilyNoFacts() { - $family = Mockery::mock('Fisharebest\Webtrees\Family'); - $family->shouldReceive('getMarriageDate')->andReturn(new Date('')); - $family->shouldReceive('getFacts')->andReturn(array()); - - $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); - $individual->shouldReceive('getSpouseFamilies')->andReturn(array($family)); - - $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); - - $column = new CensusColumnConditionFrench($census, '', ''); - $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); - - $this->assertSame('Marié', $column->generate($individual)); - } - - /** - * @covers Fisharebest\Webtrees\Census\CensusColumnConditionFrench - * @covers Fisharebest\Webtrees\Census\AbstractCensusColumn - */ - public function testNoFamilyUnmarried() { - $fact = Mockery::mock('Fisharebest\Webtrees\Fact'); - - $family = Mockery::mock('Fisharebest\Webtrees\Family'); - $family->shouldReceive('getMarriageDate')->andReturn(new Date('')); - $family->shouldReceive('getFacts')->with('_NMR')->andReturn(array($fact)); - - $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); - $individual->shouldReceive('getSpouseFamilies')->andReturn(array($family)); - - $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); - - $column = new CensusColumnConditionFrench($census, '', ''); - $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); - - $this->assertSame('Célibataire', $column->generate($individual)); - } - - /** - * @covers Fisharebest\Webtrees\Census\CensusColumnConditionFrench - * @covers Fisharebest\Webtrees\Census\AbstractCensusColumn - */ - public function testNoFamilyDivorced() { - $fact = Mockery::mock('Fisharebest\Webtrees\Fact'); - - $family = Mockery::mock('Fisharebest\Webtrees\Family'); - $family->shouldReceive('getMarriageDate')->andReturn(new Date('')); - $family->shouldReceive('getFacts')->with('_NMR')->andReturn(array()); - $family->shouldReceive('getFacts')->with('DIV')->andReturn(array($fact)); - - $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); - $individual->shouldReceive('getSpouseFamilies')->andReturn(array($family)); - - $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); - - $column = new CensusColumnConditionFrench($census, '', ''); - $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); - - $this->assertSame('Divorcé', $column->generate($individual)); - } -} diff --git a/tests/app/Census/CensusColumnConditionFrenchVeufTest.php b/tests/app/Census/CensusColumnConditionFrenchVeufTest.php new file mode 100644 index 0000000000..b35dcdf040 --- /dev/null +++ b/tests/app/Census/CensusColumnConditionFrenchVeufTest.php @@ -0,0 +1,257 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2016 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 <http://www.gnu.org/licenses/>. + */ +namespace Fisharebest\Webtrees\Census; + +use Fisharebest\Webtrees\Date; +use Fisharebest\Webtrees\Fact; +use Fisharebest\Webtrees\Family; +use Fisharebest\Webtrees\Individual; +use Mockery; + +/** + * Test harness for the class CensusColumnConditionFrenchVeuf + */ +class CensusColumnConditionFrenchVeufTest extends \PHPUnit_Framework_TestCase { + /** + * Delete mock objects + */ + public function tearDown() { + Mockery::close(); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnConditionFrenchVeuf + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition + */ + public function testNoSpouseFamiliesMale() { + $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('M'); + $individual->shouldReceive('getSpouseFamilies')->andReturn(array()); + $individual->shouldReceive('getEstimatedBirthDate')->andReturn(new Date('1800')); + + $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); + + $column = new CensusColumnConditionFrenchVeuf($census, '', ''); + + $this->assertSame('', $column->generate($individual)); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnConditionFrenchVeuf + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition + */ + public function testNoSpouseFamiliesFemale() { + $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('F'); + $individual->shouldReceive('getSpouseFamilies')->andReturn(array()); + $individual->shouldReceive('getEstimatedBirthDate')->andReturn(new Date('1800')); + + $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); + + $column = new CensusColumnConditionFrenchVeuf($census, '', ''); + + $this->assertSame('', $column->generate($individual)); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnConditionFrenchVeuf + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition + */ + public function testNoFamilyNoFactsMale() { + $family = Mockery::mock('Fisharebest\Webtrees\Family'); + $family->shouldReceive('getMarriageDate')->andReturn(new Date('')); + $family->shouldReceive('getFacts')->andReturn(array()); + + $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('M'); + $individual->shouldReceive('getSpouseFamilies')->andReturn(array($family)); + + $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + + $column = new CensusColumnConditionFrenchVeuf($census, '', ''); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); + + $this->assertSame('', $column->generate($individual)); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnConditionFrenchVeuf + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition + */ + public function testNoFamilyNoFactsFemale() { + $family = Mockery::mock('Fisharebest\Webtrees\Family'); + $family->shouldReceive('getMarriageDate')->andReturn(new Date('')); + $family->shouldReceive('getFacts')->andReturn(array()); + + $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('F'); + $individual->shouldReceive('getSpouseFamilies')->andReturn(array($family)); + + $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + + $column = new CensusColumnConditionFrenchVeuf($census, '', ''); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); + + $this->assertSame('', $column->generate($individual)); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnConditionFrenchVeuf + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition + */ + public function testNoFamilyUnmarriedMale() { + $fact = Mockery::mock('Fisharebest\Webtrees\Fact'); + + $family = Mockery::mock('Fisharebest\Webtrees\Family'); + $family->shouldReceive('getMarriageDate')->andReturn(new Date('')); + $family->shouldReceive('getFacts')->with('_NMR')->andReturn(array($fact)); + + $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('M'); + $individual->shouldReceive('getSpouseFamilies')->andReturn(array($family)); + $individual->shouldReceive('getEstimatedBirthDate')->andReturn(new Date('1800')); + + $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); + + $column = new CensusColumnConditionFrenchVeuf($census, '', ''); + + $this->assertSame('', $column->generate($individual)); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnConditionFrenchVeuf + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition + */ + public function testNoFamilyUnmarriedFemale() { + $fact = Mockery::mock('Fisharebest\Webtrees\Fact'); + + $family = Mockery::mock('Fisharebest\Webtrees\Family'); + $family->shouldReceive('getMarriageDate')->andReturn(new Date('')); + $family->shouldReceive('getFacts')->with('_NMR')->andReturn(array($fact)); + + $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('F'); + $individual->shouldReceive('getSpouseFamilies')->andReturn(array($family)); + $individual->shouldReceive('getEstimatedBirthDate')->andReturn(new Date('1800')); + + $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); + + $column = new CensusColumnConditionFrenchVeuf($census, '', ''); + + $this->assertSame('', $column->generate($individual)); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnConditionFrenchVeuf + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition + */ + public function testChildMale() { + $fact = Mockery::mock('Fisharebest\Webtrees\Fact'); + + $family = Mockery::mock('Fisharebest\Webtrees\Family'); + $family->shouldReceive('getMarriageDate')->andReturn(new Date('')); + $family->shouldReceive('getFacts')->with('_NMR')->andReturn(array($fact)); + + $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('M'); + $individual->shouldReceive('getSpouseFamilies')->andReturn(array($family)); + $individual->shouldReceive('getEstimatedBirthDate')->andReturn(new Date('1820')); + + $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); + + $column = new CensusColumnConditionFrenchVeuf($census, '', ''); + + $this->assertSame('', $column->generate($individual)); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnConditionFrenchVeuf + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition + */ + public function testChildFemale() { + $fact = Mockery::mock('Fisharebest\Webtrees\Fact'); + + $family = Mockery::mock('Fisharebest\Webtrees\Family'); + $family->shouldReceive('getMarriageDate')->andReturn(new Date('')); + $family->shouldReceive('getFacts')->with('_NMR')->andReturn(array($fact)); + + $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('F'); + $individual->shouldReceive('getSpouseFamilies')->andReturn(array($family)); + $individual->shouldReceive('getEstimatedBirthDate')->andReturn(new Date('1820')); + + $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); + + $column = new CensusColumnConditionFrenchVeuf($census, '', ''); + + $this->assertSame('', $column->generate($individual)); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnConditionFrenchVeuf + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition + */ + public function testDivorcedMale() { + $fact = Mockery::mock('Fisharebest\Webtrees\Fact'); + + $family = Mockery::mock('Fisharebest\Webtrees\Family'); + $family->shouldReceive('getMarriageDate')->andReturn(new Date('')); + $family->shouldReceive('getFacts')->with('_NMR')->andReturn(array()); + $family->shouldReceive('getFacts')->with('DIV')->andReturn(array($fact)); + + $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('M'); + $individual->shouldReceive('getSpouseFamilies')->andReturn(array($family)); + + $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + + $column = new CensusColumnConditionFrenchVeuf($census, '', ''); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); + + $this->assertSame('', $column->generate($individual)); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnConditionFrenchVeuf + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition + */ + public function testDivorcedFemale() { + $fact = Mockery::mock('Fisharebest\Webtrees\Fact'); + + $family = Mockery::mock('Fisharebest\Webtrees\Family'); + $family->shouldReceive('getMarriageDate')->andReturn(new Date('')); + $family->shouldReceive('getFacts')->with('_NMR')->andReturn(array()); + $family->shouldReceive('getFacts')->with('DIV')->andReturn(array($fact)); + + $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('F'); + $individual->shouldReceive('getSpouseFamilies')->andReturn(array($family)); + + $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + + $column = new CensusColumnConditionFrenchVeuf($census, '', ''); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); + + $this->assertSame('', $column->generate($individual)); + } +} diff --git a/tests/app/Census/CensusColumnConditionFrenchVeuveTest.php b/tests/app/Census/CensusColumnConditionFrenchVeuveTest.php new file mode 100644 index 0000000000..bbf6cf2b35 --- /dev/null +++ b/tests/app/Census/CensusColumnConditionFrenchVeuveTest.php @@ -0,0 +1,257 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2016 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 <http://www.gnu.org/licenses/>. + */ +namespace Fisharebest\Webtrees\Census; + +use Fisharebest\Webtrees\Date; +use Fisharebest\Webtrees\Fact; +use Fisharebest\Webtrees\Family; +use Fisharebest\Webtrees\Individual; +use Mockery; + +/** + * Test harness for the class CensusColumnConditionFrenchVeuve + */ +class CensusColumnConditionFrenchVeuveTest extends \PHPUnit_Framework_TestCase { + /** + * Delete mock objects + */ + public function tearDown() { + Mockery::close(); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnConditionFrenchVeuve + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition + */ + public function testNoSpouseFamiliesMale() { + $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('M'); + $individual->shouldReceive('getSpouseFamilies')->andReturn(array()); + $individual->shouldReceive('getEstimatedBirthDate')->andReturn(new Date('1800')); + + $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); + + $column = new CensusColumnConditionFrenchVeuve($census, '', ''); + + $this->assertSame('', $column->generate($individual)); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnConditionFrenchVeuve + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition + */ + public function testNoSpouseFamiliesFemale() { + $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('F'); + $individual->shouldReceive('getSpouseFamilies')->andReturn(array()); + $individual->shouldReceive('getEstimatedBirthDate')->andReturn(new Date('1800')); + + $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); + + $column = new CensusColumnConditionFrenchVeuve($census, '', ''); + + $this->assertSame('', $column->generate($individual)); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnConditionFrenchVeuve + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition + */ + public function testNoFamilyNoFactsMale() { + $family = Mockery::mock('Fisharebest\Webtrees\Family'); + $family->shouldReceive('getMarriageDate')->andReturn(new Date('')); + $family->shouldReceive('getFacts')->andReturn(array()); + + $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('M'); + $individual->shouldReceive('getSpouseFamilies')->andReturn(array($family)); + + $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + + $column = new CensusColumnConditionFrenchVeuve($census, '', ''); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); + + $this->assertSame('', $column->generate($individual)); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnConditionFrenchVeuve + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition + */ + public function testNoFamilyNoFactsFemale() { + $family = Mockery::mock('Fisharebest\Webtrees\Family'); + $family->shouldReceive('getMarriageDate')->andReturn(new Date('')); + $family->shouldReceive('getFacts')->andReturn(array()); + + $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('F'); + $individual->shouldReceive('getSpouseFamilies')->andReturn(array($family)); + + $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + + $column = new CensusColumnConditionFrenchVeuve($census, '', ''); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); + + $this->assertSame('', $column->generate($individual)); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnConditionFrenchVeuve + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition + */ + public function testNoFamilyUnmarriedMale() { + $fact = Mockery::mock('Fisharebest\Webtrees\Fact'); + + $family = Mockery::mock('Fisharebest\Webtrees\Family'); + $family->shouldReceive('getMarriageDate')->andReturn(new Date('')); + $family->shouldReceive('getFacts')->with('_NMR')->andReturn(array($fact)); + + $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('M'); + $individual->shouldReceive('getSpouseFamilies')->andReturn(array($family)); + $individual->shouldReceive('getEstimatedBirthDate')->andReturn(new Date('1800')); + + $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); + + $column = new CensusColumnConditionFrenchVeuve($census, '', ''); + + $this->assertSame('', $column->generate($individual)); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnConditionFrenchVeuve + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition + */ + public function testNoFamilyUnmarriedFemale() { + $fact = Mockery::mock('Fisharebest\Webtrees\Fact'); + + $family = Mockery::mock('Fisharebest\Webtrees\Family'); + $family->shouldReceive('getMarriageDate')->andReturn(new Date('')); + $family->shouldReceive('getFacts')->with('_NMR')->andReturn(array($fact)); + + $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('F'); + $individual->shouldReceive('getSpouseFamilies')->andReturn(array($family)); + $individual->shouldReceive('getEstimatedBirthDate')->andReturn(new Date('1800')); + + $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); + + $column = new CensusColumnConditionFrenchVeuve($census, '', ''); + + $this->assertSame('', $column->generate($individual)); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnConditionFrenchVeuve + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition + */ + public function testChildMale() { + $fact = Mockery::mock('Fisharebest\Webtrees\Fact'); + + $family = Mockery::mock('Fisharebest\Webtrees\Family'); + $family->shouldReceive('getMarriageDate')->andReturn(new Date('')); + $family->shouldReceive('getFacts')->with('_NMR')->andReturn(array($fact)); + + $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('M'); + $individual->shouldReceive('getSpouseFamilies')->andReturn(array($family)); + $individual->shouldReceive('getEstimatedBirthDate')->andReturn(new Date('1820')); + + $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); + + $column = new CensusColumnConditionFrenchVeuve($census, '', ''); + + $this->assertSame('', $column->generate($individual)); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnConditionFrenchVeuve + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition + */ + public function testChildFemale() { + $fact = Mockery::mock('Fisharebest\Webtrees\Fact'); + + $family = Mockery::mock('Fisharebest\Webtrees\Family'); + $family->shouldReceive('getMarriageDate')->andReturn(new Date('')); + $family->shouldReceive('getFacts')->with('_NMR')->andReturn(array($fact)); + + $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('F'); + $individual->shouldReceive('getSpouseFamilies')->andReturn(array($family)); + $individual->shouldReceive('getEstimatedBirthDate')->andReturn(new Date('1820')); + + $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); + + $column = new CensusColumnConditionFrenchVeuve($census, '', ''); + + $this->assertSame('', $column->generate($individual)); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnConditionFrenchVeuve + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition + */ + public function testDivorcedMale() { + $fact = Mockery::mock('Fisharebest\Webtrees\Fact'); + + $family = Mockery::mock('Fisharebest\Webtrees\Family'); + $family->shouldReceive('getMarriageDate')->andReturn(new Date('')); + $family->shouldReceive('getFacts')->with('_NMR')->andReturn(array()); + $family->shouldReceive('getFacts')->with('DIV')->andReturn(array($fact)); + + $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('M'); + $individual->shouldReceive('getSpouseFamilies')->andReturn(array($family)); + + $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + + $column = new CensusColumnConditionFrenchVeuve($census, '', ''); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); + + $this->assertSame('', $column->generate($individual)); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnConditionFrenchVeuve + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition + */ + public function testDivorcedFemale() { + $fact = Mockery::mock('Fisharebest\Webtrees\Fact'); + + $family = Mockery::mock('Fisharebest\Webtrees\Family'); + $family->shouldReceive('getMarriageDate')->andReturn(new Date('')); + $family->shouldReceive('getFacts')->with('_NMR')->andReturn(array()); + $family->shouldReceive('getFacts')->with('DIV')->andReturn(array($fact)); + + $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('F'); + $individual->shouldReceive('getSpouseFamilies')->andReturn(array($family)); + + $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + + $column = new CensusColumnConditionFrenchVeuve($census, '', ''); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); + + $this->assertSame('', $column->generate($individual)); + } +} diff --git a/tests/app/Census/CensusColumnConditionUsTest.php b/tests/app/Census/CensusColumnConditionUsTest.php index 4f880fa650..d7fdaaf836 100644 --- a/tests/app/Census/CensusColumnConditionUsTest.php +++ b/tests/app/Census/CensusColumnConditionUsTest.php @@ -35,13 +35,34 @@ class CensusColumnConditionUsTest extends \PHPUnit_Framework_TestCase { /** * @covers Fisharebest\Webtrees\Census\CensusColumnConditionUs - * @covers Fisharebest\Webtrees\Census\AbstractCensusColumn + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition */ - public function testNoSpouseFamilies() { + public function testNoSpouseFamiliesMale() { $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('M'); $individual->shouldReceive('getSpouseFamilies')->andReturn(array()); + $individual->shouldReceive('getEstimatedBirthDate')->andReturn(new Date('1800')); $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); + + $column = new CensusColumnConditionUs($census, '', ''); + + $this->assertSame('S', $column->generate($individual)); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnConditionUs + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition + */ + public function testNoSpouseFamiliesFemale() { + $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('F'); + $individual->shouldReceive('getSpouseFamilies')->andReturn(array()); + $individual->shouldReceive('getEstimatedBirthDate')->andReturn(new Date('1800')); + + $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); $column = new CensusColumnConditionUs($census, '', ''); @@ -50,14 +71,15 @@ class CensusColumnConditionUsTest extends \PHPUnit_Framework_TestCase { /** * @covers Fisharebest\Webtrees\Census\CensusColumnConditionUs - * @covers Fisharebest\Webtrees\Census\AbstractCensusColumn + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition */ - public function testNoFamilyNoFacts() { + public function testNoFamilyNoFactsMale() { $family = Mockery::mock('Fisharebest\Webtrees\Family'); $family->shouldReceive('getMarriageDate')->andReturn(new Date('')); $family->shouldReceive('getFacts')->andReturn(array()); $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('M'); $individual->shouldReceive('getSpouseFamilies')->andReturn(array($family)); $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); @@ -70,9 +92,78 @@ class CensusColumnConditionUsTest extends \PHPUnit_Framework_TestCase { /** * @covers Fisharebest\Webtrees\Census\CensusColumnConditionUs - * @covers Fisharebest\Webtrees\Census\AbstractCensusColumn + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition + */ + public function testNoFamilyNoFactsFemale() { + $family = Mockery::mock('Fisharebest\Webtrees\Family'); + $family->shouldReceive('getMarriageDate')->andReturn(new Date('')); + $family->shouldReceive('getFacts')->andReturn(array()); + + $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('F'); + $individual->shouldReceive('getSpouseFamilies')->andReturn(array($family)); + + $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + + $column = new CensusColumnConditionUs($census, '', ''); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); + + $this->assertSame('M', $column->generate($individual)); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnConditionUs + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition + */ + public function testNoFamilyUnmarriedMale() { + $fact = Mockery::mock('Fisharebest\Webtrees\Fact'); + + $family = Mockery::mock('Fisharebest\Webtrees\Family'); + $family->shouldReceive('getMarriageDate')->andReturn(new Date('')); + $family->shouldReceive('getFacts')->with('_NMR')->andReturn(array($fact)); + + $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('M'); + $individual->shouldReceive('getSpouseFamilies')->andReturn(array($family)); + $individual->shouldReceive('getEstimatedBirthDate')->andReturn(new Date('1800')); + + $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); + + $column = new CensusColumnConditionUs($census, '', ''); + + $this->assertSame('S', $column->generate($individual)); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnConditionUs + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition + */ + public function testNoFamilyUnmarriedFemale() { + $fact = Mockery::mock('Fisharebest\Webtrees\Fact'); + + $family = Mockery::mock('Fisharebest\Webtrees\Family'); + $family->shouldReceive('getMarriageDate')->andReturn(new Date('')); + $family->shouldReceive('getFacts')->with('_NMR')->andReturn(array($fact)); + + $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('F'); + $individual->shouldReceive('getSpouseFamilies')->andReturn(array($family)); + $individual->shouldReceive('getEstimatedBirthDate')->andReturn(new Date('1800')); + + $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); + + $column = new CensusColumnConditionUs($census, '', ''); + + $this->assertSame('S', $column->generate($individual)); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnConditionUs + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition */ - public function testNoFamilyUnmarried() { + public function testChildMale() { $fact = Mockery::mock('Fisharebest\Webtrees\Fact'); $family = Mockery::mock('Fisharebest\Webtrees\Family'); @@ -80,21 +171,71 @@ class CensusColumnConditionUsTest extends \PHPUnit_Framework_TestCase { $family->shouldReceive('getFacts')->with('_NMR')->andReturn(array($fact)); $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('M'); $individual->shouldReceive('getSpouseFamilies')->andReturn(array($family)); + $individual->shouldReceive('getEstimatedBirthDate')->andReturn(new Date('1820')); $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); $column = new CensusColumnConditionUs($census, '', ''); + + $this->assertSame('S', $column->generate($individual)); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnConditionUs + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition + */ + public function testChildFemale() { + $fact = Mockery::mock('Fisharebest\Webtrees\Fact'); + + $family = Mockery::mock('Fisharebest\Webtrees\Family'); + $family->shouldReceive('getMarriageDate')->andReturn(new Date('')); + $family->shouldReceive('getFacts')->with('_NMR')->andReturn(array($fact)); + + $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('F'); + $individual->shouldReceive('getSpouseFamilies')->andReturn(array($family)); + $individual->shouldReceive('getEstimatedBirthDate')->andReturn(new Date('1820')); + + $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); + $column = new CensusColumnConditionUs($census, '', ''); + $this->assertSame('S', $column->generate($individual)); } /** * @covers Fisharebest\Webtrees\Census\CensusColumnConditionUs - * @covers Fisharebest\Webtrees\Census\AbstractCensusColumn + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition + */ + public function testDivorcedMale() { + $fact = Mockery::mock('Fisharebest\Webtrees\Fact'); + + $family = Mockery::mock('Fisharebest\Webtrees\Family'); + $family->shouldReceive('getMarriageDate')->andReturn(new Date('')); + $family->shouldReceive('getFacts')->with('_NMR')->andReturn(array()); + $family->shouldReceive('getFacts')->with('DIV')->andReturn(array($fact)); + + $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('M'); + $individual->shouldReceive('getSpouseFamilies')->andReturn(array($family)); + + $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); + + $column = new CensusColumnConditionUs($census, '', ''); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1830'); + + $this->assertSame('D', $column->generate($individual)); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnConditionUs + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumnCondition */ - public function testNoFamilyDivorced() { + public function testDivorcedFemale() { $fact = Mockery::mock('Fisharebest\Webtrees\Fact'); $family = Mockery::mock('Fisharebest\Webtrees\Family'); @@ -103,6 +244,7 @@ class CensusColumnConditionUsTest extends \PHPUnit_Framework_TestCase { $family->shouldReceive('getFacts')->with('DIV')->andReturn(array($fact)); $individual = Mockery::mock('Fisharebest\Webtrees\Individual'); + $individual->shouldReceive('getSex')->andReturn('F'); $individual->shouldReceive('getSpouseFamilies')->andReturn(array($family)); $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface'); diff --git a/tests/app/Census/CensusOfFrance1831Test.php b/tests/app/Census/CensusOfFrance1831Test.php index 92fad28a6c..69c683ce17 100644 --- a/tests/app/Census/CensusOfFrance1831Test.php +++ b/tests/app/Census/CensusOfFrance1831Test.php @@ -42,23 +42,38 @@ class CensusOfFrance1831Test extends \PHPUnit_Framework_TestCase { $census = new CensusOfFrance1831; $columns = $census->columns(); - $this->assertCount(5, $columns); + $this->assertCount(10, $columns); $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnSurname', $columns[0]); $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnGivenNames', $columns[1]); $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnOccupation', $columns[2]); - $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnBirthYear', $columns[3]); - $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnConditionFrench', $columns[4]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnConditionFrenchGarcon', $columns[3]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnConditionFrenchHomme', $columns[4]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnConditionFrenchVeuf', $columns[5]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnConditionFrenchFille', $columns[6]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnConditionFrenchFemme', $columns[7]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnConditionFrenchVeuve', $columns[8]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnAge', $columns[9]); - $this->assertSame('Nom', $columns[0]->abbreviation()); - $this->assertSame('Prénom', $columns[1]->abbreviation()); - $this->assertSame('Profession', $columns[2]->abbreviation()); - $this->assertSame('Année', $columns[3]->abbreviation()); - $this->assertSame('Situation pers.', $columns[4]->abbreviation()); + $this->assertSame('Noms', $columns[0]->abbreviation()); + $this->assertSame('Prénoms', $columns[1]->abbreviation()); + $this->assertSame('Titres', $columns[2]->abbreviation()); + $this->assertSame('Garçons', $columns[3]->abbreviation()); + $this->assertSame('Hommes', $columns[4]->abbreviation()); + $this->assertSame('Veufs', $columns[5]->abbreviation()); + $this->assertSame('Filles', $columns[6]->abbreviation()); + $this->assertSame('Femmes', $columns[7]->abbreviation()); + $this->assertSame('Veuves', $columns[8]->abbreviation()); + $this->assertSame('Âge', $columns[9]->abbreviation()); - $this->assertSame('Nom de famille', $columns[0]->title()); - $this->assertSame('Prénom', $columns[1]->title()); - $this->assertSame('Profession', $columns[2]->title()); - $this->assertSame('Année de naissance', $columns[3]->title()); - $this->assertSame('Situation personnelle (marié, veuf…)', $columns[4]->title()); + $this->assertSame('Noms de famille', $columns[0]->title()); + $this->assertSame('', $columns[1]->title()); + $this->assertSame('Titres, qualifications, état ou profession et fonctions', $columns[2]->title()); + $this->assertSame('', $columns[3]->title()); + $this->assertSame('Hommes mariés', $columns[4]->title()); + $this->assertSame('', $columns[5]->title()); + $this->assertSame('', $columns[6]->title()); + $this->assertSame('Femmes mariées', $columns[7]->title()); + $this->assertSame('', $columns[8]->title()); + $this->assertSame('', $columns[9]->title()); } } diff --git a/tests/app/Census/CensusOfFrance1836Test.php b/tests/app/Census/CensusOfFrance1836Test.php index dca098e3cd..2d2d5ecfe6 100644 --- a/tests/app/Census/CensusOfFrance1836Test.php +++ b/tests/app/Census/CensusOfFrance1836Test.php @@ -42,23 +42,38 @@ class CensusOfFrance1836Test extends \PHPUnit_Framework_TestCase { $census = new CensusOfFrance1836; $columns = $census->columns(); - $this->assertCount(5, $columns); + $this->assertCount(10, $columns); $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnSurname', $columns[0]); $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnGivenNames', $columns[1]); $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnOccupation', $columns[2]); - $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnAge', $columns[3]); - $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnConditionFrench', $columns[4]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnConditionFrenchGarcon', $columns[3]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnConditionFrenchHomme', $columns[4]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnConditionFrenchVeuf', $columns[5]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnConditionFrenchFille', $columns[6]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnConditionFrenchFemme', $columns[7]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnConditionFrenchVeuve', $columns[8]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnAge', $columns[9]); - $this->assertSame('Nom', $columns[0]->abbreviation()); - $this->assertSame('Prénom', $columns[1]->abbreviation()); - $this->assertSame('Profession', $columns[2]->abbreviation()); - $this->assertSame('Âge', $columns[3]->abbreviation()); - $this->assertSame('Situation pers.', $columns[4]->abbreviation()); + $this->assertSame('Noms', $columns[0]->abbreviation()); + $this->assertSame('Prénoms', $columns[1]->abbreviation()); + $this->assertSame('Titres', $columns[2]->abbreviation()); + $this->assertSame('Garçons', $columns[3]->abbreviation()); + $this->assertSame('Hommes', $columns[4]->abbreviation()); + $this->assertSame('Veufs', $columns[5]->abbreviation()); + $this->assertSame('Filles', $columns[6]->abbreviation()); + $this->assertSame('Femmes', $columns[7]->abbreviation()); + $this->assertSame('Veuves', $columns[8]->abbreviation()); + $this->assertSame('Âge', $columns[9]->abbreviation()); - $this->assertSame('Nom de famille', $columns[0]->title()); - $this->assertSame('Prénom', $columns[1]->title()); - $this->assertSame('Profession', $columns[2]->title()); - $this->assertSame('Âge', $columns[3]->title()); - $this->assertSame('Situation personnelle (marié, veuf…)', $columns[4]->title()); + $this->assertSame('Noms de famille', $columns[0]->title()); + $this->assertSame('', $columns[1]->title()); + $this->assertSame('Titres, qualifications, état ou profession et fonctions', $columns[2]->title()); + $this->assertSame('', $columns[3]->title()); + $this->assertSame('Hommes mariés', $columns[4]->title()); + $this->assertSame('', $columns[5]->title()); + $this->assertSame('', $columns[6]->title()); + $this->assertSame('Femmes mariées', $columns[7]->title()); + $this->assertSame('', $columns[8]->title()); + $this->assertSame('', $columns[9]->title()); } } diff --git a/tests/app/Census/CensusOfFrance1841Test.php b/tests/app/Census/CensusOfFrance1841Test.php index 4ab68fd241..a03bc1737e 100644 --- a/tests/app/Census/CensusOfFrance1841Test.php +++ b/tests/app/Census/CensusOfFrance1841Test.php @@ -42,20 +42,35 @@ class CensusOfFrance1841Test extends \PHPUnit_Framework_TestCase { $census = new CensusOfFrance1841; $columns = $census->columns(); - $this->assertCount(4, $columns); + $this->assertCount(9, $columns); $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnSurname', $columns[0]); $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnGivenNames', $columns[1]); $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnOccupation', $columns[2]); - $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnConditionFrench', $columns[3]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnConditionFrenchGarcon', $columns[3]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnConditionFrenchHomme', $columns[4]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnConditionFrenchVeuf', $columns[5]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnConditionFrenchFille', $columns[6]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnConditionFrenchFemme', $columns[7]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnConditionFrenchVeuve', $columns[8]); - $this->assertSame('Nom', $columns[0]->abbreviation()); - $this->assertSame('Prénom', $columns[1]->abbreviation()); - $this->assertSame('Profession', $columns[2]->abbreviation()); - $this->assertSame('Situtation pers.', $columns[3]->abbreviation()); + $this->assertSame('Noms', $columns[0]->abbreviation()); + $this->assertSame('Prénoms', $columns[1]->abbreviation()); + $this->assertSame('Titres', $columns[2]->abbreviation()); + $this->assertSame('Garçons', $columns[3]->abbreviation()); + $this->assertSame('Hommes', $columns[4]->abbreviation()); + $this->assertSame('Veufs', $columns[5]->abbreviation()); + $this->assertSame('Filles', $columns[6]->abbreviation()); + $this->assertSame('Femmes', $columns[7]->abbreviation()); + $this->assertSame('Veuves', $columns[8]->abbreviation()); - $this->assertSame('Nom de famille', $columns[0]->title()); - $this->assertSame('Prénom', $columns[1]->title()); - $this->assertSame('Profession', $columns[2]->title()); - $this->assertSame('Situation personnelle (marié, veuf…)', $columns[3]->title()); + $this->assertSame('Noms de famille', $columns[0]->title()); + $this->assertSame('', $columns[1]->title()); + $this->assertSame('Titres, qualifications, état ou profession et fonctions', $columns[2]->title()); + $this->assertSame('', $columns[3]->title()); + $this->assertSame('Hommes mariés', $columns[4]->title()); + $this->assertSame('', $columns[5]->title()); + $this->assertSame('', $columns[6]->title()); + $this->assertSame('Femmes mariées', $columns[7]->title()); + $this->assertSame('', $columns[8]->title()); } } diff --git a/tests/app/Census/CensusOfFrance1846Test.php b/tests/app/Census/CensusOfFrance1846Test.php index 2fd9a955f4..f1e7896df7 100644 --- a/tests/app/Census/CensusOfFrance1846Test.php +++ b/tests/app/Census/CensusOfFrance1846Test.php @@ -42,23 +42,38 @@ class CensusOfFrance1846Test extends \PHPUnit_Framework_TestCase { $census = new CensusOfFrance1846; $columns = $census->columns(); - $this->assertCount(5, $columns); + $this->assertCount(10, $columns); $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnSurname', $columns[0]); $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnGivenNames', $columns[1]); $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnOccupation', $columns[2]); - $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnAge', $columns[3]); - $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnConditionFrench', $columns[4]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnConditionFrenchGarcon', $columns[3]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnConditionFrenchHomme', $columns[4]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnConditionFrenchVeuf', $columns[5]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnConditionFrenchFille', $columns[6]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnConditionFrenchFemme', $columns[7]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnConditionFrenchVeuve', $columns[8]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnAge', $columns[9]); - $this->assertSame('Nom', $columns[0]->abbreviation()); - $this->assertSame('Prénom', $columns[1]->abbreviation()); - $this->assertSame('Profession', $columns[2]->abbreviation()); - $this->assertSame('Âge', $columns[3]->abbreviation()); - $this->assertSame('Situtation pers.', $columns[4]->abbreviation()); + $this->assertSame('Noms', $columns[0]->abbreviation()); + $this->assertSame('Prénoms', $columns[1]->abbreviation()); + $this->assertSame('Titres', $columns[2]->abbreviation()); + $this->assertSame('Garçons', $columns[3]->abbreviation()); + $this->assertSame('Hommes', $columns[4]->abbreviation()); + $this->assertSame('Veufs', $columns[5]->abbreviation()); + $this->assertSame('Filles', $columns[6]->abbreviation()); + $this->assertSame('Femmes', $columns[7]->abbreviation()); + $this->assertSame('Veuves', $columns[8]->abbreviation()); + $this->assertSame('Âge', $columns[9]->abbreviation()); - $this->assertSame('Nom de famille', $columns[0]->title()); - $this->assertSame('Prénom', $columns[1]->title()); - $this->assertSame('Profession', $columns[2]->title()); - $this->assertSame('Âge', $columns[3]->title()); - $this->assertSame('Situation personnelle (marié, veuf…)', $columns[4]->title()); + $this->assertSame('Noms de famille', $columns[0]->title()); + $this->assertSame('', $columns[1]->title()); + $this->assertSame('Titres, qualifications, état ou profession et fonctions', $columns[2]->title()); + $this->assertSame('', $columns[3]->title()); + $this->assertSame('Hommes mariés', $columns[4]->title()); + $this->assertSame('', $columns[5]->title()); + $this->assertSame('', $columns[6]->title()); + $this->assertSame('Femmes mariées', $columns[7]->title()); + $this->assertSame('', $columns[8]->title()); + $this->assertSame('', $columns[9]->title()); } } diff --git a/tests/app/Census/CensusOfFrance1851Test.php b/tests/app/Census/CensusOfFrance1851Test.php index a5d0cb810c..806a08d05e 100644 --- a/tests/app/Census/CensusOfFrance1851Test.php +++ b/tests/app/Census/CensusOfFrance1851Test.php @@ -42,32 +42,46 @@ class CensusOfFrance1851Test extends \PHPUnit_Framework_TestCase { $census = new CensusOfFrance1851; $columns = $census->columns(); - $this->assertCount(8, $columns); + $this->assertCount(13, $columns); $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnSurname', $columns[0]); $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnGivenNames', $columns[1]); $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnOccupation', $columns[2]); - $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnAge', $columns[3]); - $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnConditionFrench', $columns[4]); - $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNationality', $columns[5]); - $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[6]); - $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[7]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnConditionFrenchGarcon', $columns[3]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnConditionFrenchHomme', $columns[4]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnConditionFrenchVeuf', $columns[5]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnConditionFrenchFille', $columns[6]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnConditionFrenchFemme', $columns[7]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnConditionFrenchVeuve', $columns[8]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnAge', $columns[9]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[10]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[11]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[12]); - $this->assertSame('Nom', $columns[0]->abbreviation()); - $this->assertSame('Prénom', $columns[1]->abbreviation()); - $this->assertSame('Profession', $columns[2]->abbreviation()); - $this->assertSame('Âge', $columns[3]->abbreviation()); - $this->assertSame('Situtation pers.', $columns[4]->abbreviation()); - $this->assertSame('Nationalité', $columns[5]->abbreviation()); - $this->assertSame('Religion', $columns[6]->abbreviation()); - $this->assertSame('Maladies', $columns[7]->abbreviation()); + $this->assertSame('Noms', $columns[0]->abbreviation()); + $this->assertSame('Prénoms', $columns[1]->abbreviation()); + $this->assertSame('Professions', $columns[2]->abbreviation()); + $this->assertSame('Garçons', $columns[3]->abbreviation()); + $this->assertSame('Hommes', $columns[4]->abbreviation()); + $this->assertSame('Veufs', $columns[5]->abbreviation()); + $this->assertSame('Filles', $columns[6]->abbreviation()); + $this->assertSame('Femmes', $columns[7]->abbreviation()); + $this->assertSame('Veuves', $columns[8]->abbreviation()); + $this->assertSame('Âge', $columns[9]->abbreviation()); + $this->assertSame('Fr', $columns[10]->abbreviation()); + $this->assertSame('Nat', $columns[11]->abbreviation()); + $this->assertSame('Etr', $columns[12]->abbreviation()); - $this->assertSame('Nom de famille', $columns[0]->title()); - $this->assertSame('Prénom', $columns[1]->title()); - $this->assertSame('Profession', $columns[2]->title()); - $this->assertSame('Âge', $columns[3]->title()); - $this->assertSame('Situation personnelle (marié, veuf…)', $columns[4]->title()); - $this->assertSame('Nationalité', $columns[5]->title()); - $this->assertSame('Religion', $columns[6]->title()); - $this->assertSame('Infirmités et maladies', $columns[7]->title()); + $this->assertSame('Noms de famille', $columns[0]->title()); + $this->assertSame('', $columns[1]->title()); + $this->assertSame('', $columns[2]->title()); + $this->assertSame('', $columns[3]->title()); + $this->assertSame('Hommes mariés', $columns[4]->title()); + $this->assertSame('', $columns[5]->title()); + $this->assertSame('', $columns[6]->title()); + $this->assertSame('Femmes mariées', $columns[7]->title()); + $this->assertSame('', $columns[8]->title()); + $this->assertSame('Français d’origine', $columns[10]->title()); + $this->assertSame('Naturalisés français', $columns[11]->title()); + $this->assertSame('Étrangers (indiquer leur pays d’origine)', $columns[12]->title()); } } diff --git a/tests/app/Census/CensusOfFrance1856Test.php b/tests/app/Census/CensusOfFrance1856Test.php index afb74dd23d..9fa142e523 100644 --- a/tests/app/Census/CensusOfFrance1856Test.php +++ b/tests/app/Census/CensusOfFrance1856Test.php @@ -42,23 +42,38 @@ class CensusOfFrance1856Test extends \PHPUnit_Framework_TestCase { $census = new CensusOfFrance1856; $columns = $census->columns(); - $this->assertCount(5, $columns); + $this->assertCount(10, $columns); $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnSurname', $columns[0]); $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnGivenNames', $columns[1]); $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnOccupation', $columns[2]); - $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnAge', $columns[3]); - $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnConditionFrench', $columns[4]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnConditionFrenchGarcon', $columns[3]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnConditionFrenchHomme', $columns[4]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnConditionFrenchVeuf', $columns[5]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnConditionFrenchFille', $columns[6]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnConditionFrenchFemme', $columns[7]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnConditionFrenchVeuve', $columns[8]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnAge', $columns[9]); - $this->assertSame('Nom', $columns[0]->abbreviation()); - $this->assertSame('Prénom', $columns[1]->abbreviation()); - $this->assertSame('Profession', $columns[2]->abbreviation()); - $this->assertSame('Âge', $columns[3]->abbreviation()); - $this->assertSame('Situtation pers.', $columns[4]->abbreviation()); + $this->assertSame('Noms', $columns[0]->abbreviation()); + $this->assertSame('Prénoms', $columns[1]->abbreviation()); + $this->assertSame('Titres', $columns[2]->abbreviation()); + $this->assertSame('Garçons', $columns[3]->abbreviation()); + $this->assertSame('Hommes', $columns[4]->abbreviation()); + $this->assertSame('Veufs', $columns[5]->abbreviation()); + $this->assertSame('Filles', $columns[6]->abbreviation()); + $this->assertSame('Femmes', $columns[7]->abbreviation()); + $this->assertSame('Veuves', $columns[8]->abbreviation()); + $this->assertSame('Âge', $columns[9]->abbreviation()); - $this->assertSame('Nom de famille', $columns[0]->title()); - $this->assertSame('Prénom', $columns[1]->title()); - $this->assertSame('Profession', $columns[2]->title()); - $this->assertSame('Âge', $columns[3]->title()); - $this->assertSame('Situation personnelle (marié, veuf…)', $columns[4]->title()); + $this->assertSame('Noms de famille', $columns[0]->title()); + $this->assertSame('', $columns[1]->title()); + $this->assertSame('Titres, qualifications, état ou profession et fonctions', $columns[2]->title()); + $this->assertSame('', $columns[3]->title()); + $this->assertSame('Hommes mariés', $columns[4]->title()); + $this->assertSame('', $columns[5]->title()); + $this->assertSame('', $columns[6]->title()); + $this->assertSame('Femmes mariées', $columns[7]->title()); + $this->assertSame('', $columns[8]->title()); + $this->assertSame('', $columns[9]->title()); } } diff --git a/tests/app/Census/CensusOfFrance1861Test.php b/tests/app/Census/CensusOfFrance1861Test.php index db35c2dfa1..5e87580690 100644 --- a/tests/app/Census/CensusOfFrance1861Test.php +++ b/tests/app/Census/CensusOfFrance1861Test.php @@ -42,23 +42,38 @@ class CensusOfFrance1861Test extends \PHPUnit_Framework_TestCase { $census = new CensusOfFrance1861; $columns = $census->columns(); - $this->assertCount(5, $columns); + $this->assertCount(10, $columns); $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnSurname', $columns[0]); $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnGivenNames', $columns[1]); $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnOccupation', $columns[2]); - $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnAge', $columns[3]); - $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnConditionFrench', $columns[4]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnConditionFrenchGarcon', $columns[3]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnConditionFrenchHomme', $columns[4]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnConditionFrenchVeuf', $columns[5]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnConditionFrenchFille', $columns[6]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnConditionFrenchFemme', $columns[7]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnConditionFrenchVeuve', $columns[8]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnAge', $columns[9]); - $this->assertSame('Nom', $columns[0]->abbreviation()); - $this->assertSame('Prénom', $columns[1]->abbreviation()); - $this->assertSame('Profession', $columns[2]->abbreviation()); - $this->assertSame('Âge', $columns[3]->abbreviation()); - $this->assertSame('Situtation pers.', $columns[4]->abbreviation()); + $this->assertSame('Noms', $columns[0]->abbreviation()); + $this->assertSame('Prénoms', $columns[1]->abbreviation()); + $this->assertSame('Titres', $columns[2]->abbreviation()); + $this->assertSame('Garçons', $columns[3]->abbreviation()); + $this->assertSame('Hommes', $columns[4]->abbreviation()); + $this->assertSame('Veufs', $columns[5]->abbreviation()); + $this->assertSame('Filles', $columns[6]->abbreviation()); + $this->assertSame('Femmes', $columns[7]->abbreviation()); + $this->assertSame('Veuves', $columns[8]->abbreviation()); + $this->assertSame('Âge', $columns[9]->abbreviation()); - $this->assertSame('Nom de famille', $columns[0]->title()); - $this->assertSame('Prénom', $columns[1]->title()); - $this->assertSame('Profession', $columns[2]->title()); - $this->assertSame('Âge', $columns[3]->title()); - $this->assertSame('Situation personnelle (marié, veuf…)', $columns[4]->title()); + $this->assertSame('Noms de famille', $columns[0]->title()); + $this->assertSame('', $columns[1]->title()); + $this->assertSame('Titres, qualifications, état ou profession et fonctions', $columns[2]->title()); + $this->assertSame('', $columns[3]->title()); + $this->assertSame('Hommes mariés', $columns[4]->title()); + $this->assertSame('', $columns[5]->title()); + $this->assertSame('', $columns[6]->title()); + $this->assertSame('Femmes mariées', $columns[7]->title()); + $this->assertSame('', $columns[8]->title()); + $this->assertSame('', $columns[9]->title()); } } diff --git a/tests/app/Census/CensusOfFrance1866Test.php b/tests/app/Census/CensusOfFrance1866Test.php index e736fb8dde..528d867cfb 100644 --- a/tests/app/Census/CensusOfFrance1866Test.php +++ b/tests/app/Census/CensusOfFrance1866Test.php @@ -42,23 +42,38 @@ class CensusOfFrance1866Test extends \PHPUnit_Framework_TestCase { $census = new CensusOfFrance1866; $columns = $census->columns(); - $this->assertCount(5, $columns); + $this->assertCount(10, $columns); $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnSurname', $columns[0]); $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnGivenNames', $columns[1]); $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnOccupation', $columns[2]); - $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnAge', $columns[3]); - $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnConditionFrench', $columns[4]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnConditionFrenchGarcon', $columns[3]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnConditionFrenchHomme', $columns[4]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnConditionFrenchVeuf', $columns[5]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnConditionFrenchFille', $columns[6]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnConditionFrenchFemme', $columns[7]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnConditionFrenchVeuve', $columns[8]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnAge', $columns[9]); - $this->assertSame('Nom', $columns[0]->abbreviation()); - $this->assertSame('Prénom', $columns[1]->abbreviation()); - $this->assertSame('Profession', $columns[2]->abbreviation()); - $this->assertSame('Âge', $columns[3]->abbreviation()); - $this->assertSame('Situtation pers.', $columns[4]->abbreviation()); + $this->assertSame('Noms', $columns[0]->abbreviation()); + $this->assertSame('Prénoms', $columns[1]->abbreviation()); + $this->assertSame('Titres', $columns[2]->abbreviation()); + $this->assertSame('Garçons', $columns[3]->abbreviation()); + $this->assertSame('Hommes', $columns[4]->abbreviation()); + $this->assertSame('Veufs', $columns[5]->abbreviation()); + $this->assertSame('Filles', $columns[6]->abbreviation()); + $this->assertSame('Femmes', $columns[7]->abbreviation()); + $this->assertSame('Veuves', $columns[8]->abbreviation()); + $this->assertSame('Âge', $columns[9]->abbreviation()); - $this->assertSame('Nom de famille', $columns[0]->title()); - $this->assertSame('Prénom', $columns[1]->title()); - $this->assertSame('Profession', $columns[2]->title()); - $this->assertSame('Âge', $columns[3]->title()); - $this->assertSame('Situation personnelle (marié, veuf…)', $columns[4]->title()); + $this->assertSame('Noms de famille', $columns[0]->title()); + $this->assertSame('', $columns[1]->title()); + $this->assertSame('Titres, qualifications, état ou profession et fonctions', $columns[2]->title()); + $this->assertSame('', $columns[3]->title()); + $this->assertSame('Hommes mariés', $columns[4]->title()); + $this->assertSame('', $columns[5]->title()); + $this->assertSame('', $columns[6]->title()); + $this->assertSame('Femmes mariées', $columns[7]->title()); + $this->assertSame('', $columns[8]->title()); + $this->assertSame('', $columns[9]->title()); } } diff --git a/tests/app/Census/CensusOfFrance1872Test.php b/tests/app/Census/CensusOfFrance1872Test.php index eef77cfa42..d8c9e8295d 100644 --- a/tests/app/Census/CensusOfFrance1872Test.php +++ b/tests/app/Census/CensusOfFrance1872Test.php @@ -42,29 +42,41 @@ class CensusOfFrance1872Test extends \PHPUnit_Framework_TestCase { $census = new CensusOfFrance1872; $columns = $census->columns(); - $this->assertCount(7, $columns); + $this->assertCount(11, $columns); $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnSurname', $columns[0]); $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnGivenNames', $columns[1]); $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnOccupation', $columns[2]); - $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnAge', $columns[3]); - $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnConditionFrench', $columns[4]); - $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNationality', $columns[5]); - $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnBirthPlace', $columns[6]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnConditionFrenchGarcon', $columns[3]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnConditionFrenchHomme', $columns[4]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnConditionFrenchVeuf', $columns[5]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnConditionFrenchFille', $columns[6]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnConditionFrenchFemme', $columns[7]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnConditionFrenchVeuve', $columns[8]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnAge', $columns[9]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnBirthPlace', $columns[10]); - $this->assertSame('Nom', $columns[0]->abbreviation()); - $this->assertSame('Prénom', $columns[1]->abbreviation()); - $this->assertSame('Profession', $columns[2]->abbreviation()); - $this->assertSame('Âge', $columns[3]->abbreviation()); - $this->assertSame('Situtation pers.', $columns[4]->abbreviation()); - $this->assertSame('Nationalité', $columns[5]->abbreviation()); - $this->assertSame('Lieu', $columns[6]->abbreviation()); + $this->assertSame('Noms', $columns[0]->abbreviation()); + $this->assertSame('Prénoms', $columns[1]->abbreviation()); + $this->assertSame('Titres', $columns[2]->abbreviation()); + $this->assertSame('Garçons', $columns[3]->abbreviation()); + $this->assertSame('Hommes', $columns[4]->abbreviation()); + $this->assertSame('Veufs', $columns[5]->abbreviation()); + $this->assertSame('Filles', $columns[6]->abbreviation()); + $this->assertSame('Femmes', $columns[7]->abbreviation()); + $this->assertSame('Veuves', $columns[8]->abbreviation()); + $this->assertSame('Âge', $columns[9]->abbreviation()); + $this->assertSame('Nationalité', $columns[10]->abbreviation()); - $this->assertSame('Nom de famille', $columns[0]->title()); - $this->assertSame('Prénom', $columns[1]->title()); - $this->assertSame('Profession', $columns[2]->title()); - $this->assertSame('Âge', $columns[3]->title()); - $this->assertSame('Situation personnelle (marié, veuf…)', $columns[4]->title()); - $this->assertSame('Nationalité', $columns[5]->title()); - $this->assertSame('Lieu de naissance', $columns[6]->title()); + $this->assertSame('Noms de famille', $columns[0]->title()); + $this->assertSame('', $columns[1]->title()); + $this->assertSame('Titres, qualifications, état ou profession et fonctions', $columns[2]->title()); + $this->assertSame('', $columns[3]->title()); + $this->assertSame('Hommes mariés', $columns[4]->title()); + $this->assertSame('', $columns[5]->title()); + $this->assertSame('', $columns[6]->title()); + $this->assertSame('Femmes mariées', $columns[7]->title()); + $this->assertSame('', $columns[8]->title()); + $this->assertSame('', $columns[9]->title()); + $this->assertSame('Nationalité - Lieu de naissance', $columns[10]->title()); } } diff --git a/tests/app/Census/CensusOfFrance1876Test.php b/tests/app/Census/CensusOfFrance1876Test.php index 2d7c59fe05..4adf29fe83 100644 --- a/tests/app/Census/CensusOfFrance1876Test.php +++ b/tests/app/Census/CensusOfFrance1876Test.php @@ -42,29 +42,41 @@ class CensusOfFrance1876Test extends \PHPUnit_Framework_TestCase { $census = new CensusOfFrance1876; $columns = $census->columns(); - $this->assertCount(7, $columns); + $this->assertCount(11, $columns); $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnSurname', $columns[0]); $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnGivenNames', $columns[1]); $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnOccupation', $columns[2]); - $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnAge', $columns[3]); - $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnConditionFrench', $columns[4]); - $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNationality', $columns[5]); - $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnBirthPlace', $columns[6]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnConditionFrenchGarcon', $columns[3]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnConditionFrenchHomme', $columns[4]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnConditionFrenchVeuf', $columns[5]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnConditionFrenchFille', $columns[6]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnConditionFrenchFemme', $columns[7]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnConditionFrenchVeuve', $columns[8]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnAge', $columns[9]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnBirthPlace', $columns[10]); - $this->assertSame('Nom', $columns[0]->abbreviation()); - $this->assertSame('Prénom', $columns[1]->abbreviation()); - $this->assertSame('Profession', $columns[2]->abbreviation()); - $this->assertSame('Âge', $columns[3]->abbreviation()); - $this->assertSame('Situtation pers.', $columns[4]->abbreviation()); - $this->assertSame('Nationalité', $columns[5]->abbreviation()); - $this->assertSame('Lieu', $columns[6]->abbreviation()); + $this->assertSame('Noms', $columns[0]->abbreviation()); + $this->assertSame('Prénoms', $columns[1]->abbreviation()); + $this->assertSame('Titres', $columns[2]->abbreviation()); + $this->assertSame('Garçons', $columns[3]->abbreviation()); + $this->assertSame('Hommes', $columns[4]->abbreviation()); + $this->assertSame('Veufs', $columns[5]->abbreviation()); + $this->assertSame('Filles', $columns[6]->abbreviation()); + $this->assertSame('Femmes', $columns[7]->abbreviation()); + $this->assertSame('Veuves', $columns[8]->abbreviation()); + $this->assertSame('Âge', $columns[9]->abbreviation()); + $this->assertSame('Nationalité', $columns[10]->abbreviation()); - $this->assertSame('Nom de famille', $columns[0]->title()); - $this->assertSame('Prénom', $columns[1]->title()); - $this->assertSame('Profession', $columns[2]->title()); - $this->assertSame('Âge', $columns[3]->title()); - $this->assertSame('Situation personnelle (marié, veuf…)', $columns[4]->title()); - $this->assertSame('Nationalité', $columns[5]->title()); - $this->assertSame('Lieu de naissance', $columns[6]->title()); + $this->assertSame('Noms de famille', $columns[0]->title()); + $this->assertSame('', $columns[1]->title()); + $this->assertSame('Titres, qualifications, état ou profession et fonctions', $columns[2]->title()); + $this->assertSame('', $columns[3]->title()); + $this->assertSame('Hommes mariés', $columns[4]->title()); + $this->assertSame('', $columns[5]->title()); + $this->assertSame('', $columns[6]->title()); + $this->assertSame('Femmes mariées', $columns[7]->title()); + $this->assertSame('', $columns[8]->title()); + $this->assertSame('', $columns[9]->title()); + $this->assertSame('Nationalité - Lieu de naissance', $columns[10]->title()); } } diff --git a/tests/app/Census/CensusOfFrance1881Test.php b/tests/app/Census/CensusOfFrance1881Test.php index 1531ccee3b..0c0204377f 100644 --- a/tests/app/Census/CensusOfFrance1881Test.php +++ b/tests/app/Census/CensusOfFrance1881Test.php @@ -45,20 +45,20 @@ class CensusOfFrance1881Test extends \PHPUnit_Framework_TestCase { $this->assertCount(5, $columns); $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnSurname', $columns[0]); $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnGivenNames', $columns[1]); - $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnOccupation', $columns[2]); - $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnAge', $columns[3]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnAge', $columns[2]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnOccupation', $columns[3]); $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnRelationToHead', $columns[4]); - $this->assertSame('Nom', $columns[0]->abbreviation()); - $this->assertSame('Prénom', $columns[1]->abbreviation()); - $this->assertSame('Profession', $columns[2]->abbreviation()); - $this->assertSame('Âge', $columns[3]->abbreviation()); + $this->assertSame('Noms', $columns[0]->abbreviation()); + $this->assertSame('Prénoms', $columns[1]->abbreviation()); + $this->assertSame('Âge', $columns[2]->abbreviation()); + $this->assertSame('Profession', $columns[3]->abbreviation()); $this->assertSame('Position', $columns[4]->abbreviation()); - $this->assertSame('Nom de famille', $columns[0]->title()); - $this->assertSame('Prénom', $columns[1]->title()); - $this->assertSame('Profession', $columns[2]->title()); - $this->assertSame('Âge', $columns[3]->title()); + $this->assertSame('Noms de famille', $columns[0]->title()); + $this->assertSame('', $columns[1]->title()); + $this->assertSame('', $columns[2]->title()); + $this->assertSame('', $columns[3]->title()); $this->assertSame('Position dans le ménage', $columns[4]->title()); } } diff --git a/tests/app/Census/CensusOfFrance1886Test.php b/tests/app/Census/CensusOfFrance1886Test.php index efb990fe1b..21f741728f 100644 --- a/tests/app/Census/CensusOfFrance1886Test.php +++ b/tests/app/Census/CensusOfFrance1886Test.php @@ -45,23 +45,23 @@ class CensusOfFrance1886Test extends \PHPUnit_Framework_TestCase { $this->assertCount(6, $columns); $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnSurname', $columns[0]); $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnGivenNames', $columns[1]); - $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnOccupation', $columns[2]); - $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnAge', $columns[3]); - $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnRelationToHead', $columns[4]); - $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNationality', $columns[5]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnAge', $columns[2]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNationality', $columns[3]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnOccupation', $columns[4]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnRelationToHead', $columns[5]); - $this->assertSame('Nom', $columns[0]->abbreviation()); - $this->assertSame('Prénom', $columns[1]->abbreviation()); - $this->assertSame('Profession', $columns[2]->abbreviation()); - $this->assertSame('Âge', $columns[3]->abbreviation()); - $this->assertSame('Position', $columns[4]->abbreviation()); - $this->assertSame('Nationalité', $columns[5]->abbreviation()); + $this->assertSame('Noms', $columns[0]->abbreviation()); + $this->assertSame('Prénoms', $columns[1]->abbreviation()); + $this->assertSame('Âge', $columns[2]->abbreviation()); + $this->assertSame('Nationalité', $columns[3]->abbreviation()); + $this->assertSame('Profession', $columns[4]->abbreviation()); + $this->assertSame('Position', $columns[5]->abbreviation()); - $this->assertSame('Nom de famille', $columns[0]->title()); - $this->assertSame('Prénom', $columns[1]->title()); - $this->assertSame('Profession', $columns[2]->title()); - $this->assertSame('Âge', $columns[3]->title()); - $this->assertSame('Position dans le ménage', $columns[4]->title()); - $this->assertSame('Nationalité', $columns[5]->title()); + $this->assertSame('Noms de famille', $columns[0]->title()); + $this->assertSame('', $columns[1]->title()); + $this->assertSame('', $columns[2]->title()); + $this->assertSame('', $columns[3]->title()); + $this->assertSame('', $columns[4]->title()); + $this->assertSame('Position dans le ménage', $columns[5]->title()); } } diff --git a/tests/app/Census/CensusOfFrance1891Test.php b/tests/app/Census/CensusOfFrance1891Test.php index d578648606..5be238cc7b 100644 --- a/tests/app/Census/CensusOfFrance1891Test.php +++ b/tests/app/Census/CensusOfFrance1891Test.php @@ -42,23 +42,26 @@ class CensusOfFrance1891Test extends \PHPUnit_Framework_TestCase { $census = new CensusOfFrance1891; $columns = $census->columns(); - $this->assertCount(5, $columns); + $this->assertCount(6, $columns); $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnSurname', $columns[0]); $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnGivenNames', $columns[1]); - $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnOccupation', $columns[2]); - $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnRelationToHead', $columns[3]); - $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNationality', $columns[4]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnAge', $columns[2]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNationality', $columns[3]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnOccupation', $columns[4]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnRelationToHead', $columns[5]); - $this->assertSame('Nom', $columns[0]->abbreviation()); - $this->assertSame('Prénom', $columns[1]->abbreviation()); - $this->assertSame('Profession', $columns[2]->abbreviation()); - $this->assertSame('Position', $columns[3]->abbreviation()); - $this->assertSame('Nationalité', $columns[4]->abbreviation()); + $this->assertSame('Noms', $columns[0]->abbreviation()); + $this->assertSame('Prénoms', $columns[1]->abbreviation()); + $this->assertSame('Âge', $columns[2]->abbreviation()); + $this->assertSame('Nationalité', $columns[3]->abbreviation()); + $this->assertSame('Profession', $columns[4]->abbreviation()); + $this->assertSame('Position', $columns[5]->abbreviation()); - $this->assertSame('Nom de famille', $columns[0]->title()); - $this->assertSame('Prénom', $columns[1]->title()); - $this->assertSame('Profession', $columns[2]->title()); - $this->assertSame('Position dans le ménage', $columns[3]->title()); - $this->assertSame('Nationalité', $columns[4]->title()); + $this->assertSame('Noms de famille', $columns[0]->title()); + $this->assertSame('', $columns[1]->title()); + $this->assertSame('', $columns[2]->title()); + $this->assertSame('', $columns[3]->title()); + $this->assertSame('', $columns[4]->title()); + $this->assertSame('Position dans le ménage', $columns[5]->title()); } } diff --git a/tests/app/Census/CensusOfFrance1896Test.php b/tests/app/Census/CensusOfFrance1896Test.php index c1ccb4685f..0565393eb0 100644 --- a/tests/app/Census/CensusOfFrance1896Test.php +++ b/tests/app/Census/CensusOfFrance1896Test.php @@ -45,23 +45,23 @@ class CensusOfFrance1896Test extends \PHPUnit_Framework_TestCase { $this->assertCount(6, $columns); $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnSurname', $columns[0]); $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnGivenNames', $columns[1]); - $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnOccupation', $columns[2]); - $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnAge', $columns[3]); - $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnRelationToHead', $columns[4]); - $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNationality', $columns[5]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnAge', $columns[2]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNationality', $columns[3]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnOccupation', $columns[4]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnRelationToHead', $columns[5]); - $this->assertSame('Nom', $columns[0]->abbreviation()); - $this->assertSame('Prénom', $columns[1]->abbreviation()); - $this->assertSame('Profession', $columns[2]->abbreviation()); - $this->assertSame('Âge', $columns[3]->abbreviation()); - $this->assertSame('Position', $columns[4]->abbreviation()); - $this->assertSame('Nationalité', $columns[5]->abbreviation()); + $this->assertSame('Noms', $columns[0]->abbreviation()); + $this->assertSame('Prénoms', $columns[1]->abbreviation()); + $this->assertSame('Âge', $columns[2]->abbreviation()); + $this->assertSame('Nationalité', $columns[3]->abbreviation()); + $this->assertSame('Profession', $columns[4]->abbreviation()); + $this->assertSame('Position', $columns[5]->abbreviation()); - $this->assertSame('Nom de famille', $columns[0]->title()); - $this->assertSame('Prénom', $columns[1]->title()); - $this->assertSame('Profession', $columns[2]->title()); - $this->assertSame('Âge', $columns[3]->title()); - $this->assertSame('Position dans le ménage', $columns[4]->title()); - $this->assertSame('Nationalité', $columns[5]->title()); + $this->assertSame('Noms de famille', $columns[0]->title()); + $this->assertSame('', $columns[1]->title()); + $this->assertSame('', $columns[2]->title()); + $this->assertSame('', $columns[3]->title()); + $this->assertSame('', $columns[4]->title()); + $this->assertSame('Position dans le ménage', $columns[5]->title()); } } diff --git a/tests/app/Census/CensusOfFrance1901Test.php b/tests/app/Census/CensusOfFrance1901Test.php index 6fbc4f63e1..a933f6ece3 100644 --- a/tests/app/Census/CensusOfFrance1901Test.php +++ b/tests/app/Census/CensusOfFrance1901Test.php @@ -45,29 +45,29 @@ class CensusOfFrance1901Test extends \PHPUnit_Framework_TestCase { $this->assertCount(8, $columns); $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnSurname', $columns[0]); $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnGivenNames', $columns[1]); - $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnOccupation', $columns[2]); - $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnAge', $columns[3]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnAge', $columns[2]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNationality', $columns[3]); $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnRelationToHead', $columns[4]); - $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNationality', $columns[5]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnOccupation', $columns[5]); $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnBirthPlace', $columns[6]); $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[7]); - $this->assertSame('Nom', $columns[0]->abbreviation()); - $this->assertSame('Prénom', $columns[1]->abbreviation()); - $this->assertSame('Profession', $columns[2]->abbreviation()); - $this->assertSame('Âge', $columns[3]->abbreviation()); - $this->assertSame('Position', $columns[4]->abbreviation()); - $this->assertSame('Nationalité', $columns[5]->abbreviation()); + $this->assertSame('Noms', $columns[0]->abbreviation()); + $this->assertSame('Prénoms', $columns[1]->abbreviation()); + $this->assertSame('Âge', $columns[2]->abbreviation()); + $this->assertSame('Nationalité', $columns[3]->abbreviation()); + $this->assertSame('Situation', $columns[4]->abbreviation()); + $this->assertSame('Profession', $columns[5]->abbreviation()); $this->assertSame('Lieu', $columns[6]->abbreviation()); - $this->assertSame('Position sociale', $columns[7]->abbreviation()); + $this->assertSame('Empl', $columns[7]->abbreviation()); - $this->assertSame('Nom de famille', $columns[0]->title()); - $this->assertSame('Prénom', $columns[1]->title()); - $this->assertSame('Profession', $columns[2]->title()); - $this->assertSame('Âge', $columns[3]->title()); - $this->assertSame('Position dans le ménage', $columns[4]->title()); - $this->assertSame('Nationalité', $columns[5]->title()); + $this->assertSame('Noms de famille', $columns[0]->title()); + $this->assertSame('', $columns[1]->title()); + $this->assertSame('', $columns[2]->title()); + $this->assertSame('', $columns[3]->title()); + $this->assertSame('Situation par rapport au chef de ménage', $columns[4]->title()); + $this->assertSame('', $columns[5]->title()); $this->assertSame('Lieu de naissance', $columns[6]->title()); - $this->assertSame('Position sociale (patron, ouvrier ou employé)', $columns[7]->title()); + $this->assertSame('', $columns[7]->title()); } } diff --git a/tests/app/Census/CensusOfFrance1906Test.php b/tests/app/Census/CensusOfFrance1906Test.php index 4deffebbd8..66a7ef4d2f 100644 --- a/tests/app/Census/CensusOfFrance1906Test.php +++ b/tests/app/Census/CensusOfFrance1906Test.php @@ -45,29 +45,29 @@ class CensusOfFrance1906Test extends \PHPUnit_Framework_TestCase { $this->assertCount(8, $columns); $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnSurname', $columns[0]); $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnGivenNames', $columns[1]); - $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnOccupation', $columns[2]); - $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnBirthYear', $columns[3]); - $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnRelationToHead', $columns[4]); - $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNationality', $columns[5]); - $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnBirthPlace', $columns[6]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnBirthYear', $columns[2]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnBirthPlace', $columns[3]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNationality', $columns[4]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnRelationToHead', $columns[5]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnOccupation', $columns[6]); $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[7]); - $this->assertSame('Nom', $columns[0]->abbreviation()); - $this->assertSame('Prénom', $columns[1]->abbreviation()); - $this->assertSame('Profession', $columns[2]->abbreviation()); - $this->assertSame('Année', $columns[3]->abbreviation()); - $this->assertSame('Position', $columns[4]->abbreviation()); - $this->assertSame('Nationalité', $columns[5]->abbreviation()); - $this->assertSame('Lieu', $columns[6]->abbreviation()); - $this->assertSame('Position sociale', $columns[7]->abbreviation()); + $this->assertSame('Noms', $columns[0]->abbreviation()); + $this->assertSame('Prénoms', $columns[1]->abbreviation()); + $this->assertSame('Année', $columns[2]->abbreviation()); + $this->assertSame('Lieu', $columns[3]->abbreviation()); + $this->assertSame('Nationalité', $columns[4]->abbreviation()); + $this->assertSame('Situation', $columns[5]->abbreviation()); + $this->assertSame('Profession', $columns[6]->abbreviation()); + $this->assertSame('Empl', $columns[7]->abbreviation()); - $this->assertSame('Nom de famille', $columns[0]->title()); - $this->assertSame('Prénom', $columns[1]->title()); - $this->assertSame('Profession', $columns[2]->title()); - $this->assertSame('Année de naissance', $columns[3]->title()); - $this->assertSame('Position dans le ménage', $columns[4]->title()); - $this->assertSame('Nationalité', $columns[5]->title()); - $this->assertSame('Lieu de naissance', $columns[6]->title()); - $this->assertSame('Position sociale (patron, ouvrier ou employé)', $columns[7]->title()); + $this->assertSame('Noms de famille', $columns[0]->title()); + $this->assertSame('', $columns[1]->title()); + $this->assertSame('Année de naissance', $columns[2]->title()); + $this->assertSame('Lieu de naissance', $columns[3]->title()); + $this->assertSame('', $columns[4]->title()); + $this->assertSame('Situation par rapport au chef de ménage', $columns[5]->title()); + $this->assertSame('', $columns[6]->title()); + $this->assertSame('', $columns[7]->title()); } } diff --git a/tests/app/Census/CensusOfFrance1911Test.php b/tests/app/Census/CensusOfFrance1911Test.php index 3ba9ff6be8..3ab9aee19c 100644 --- a/tests/app/Census/CensusOfFrance1911Test.php +++ b/tests/app/Census/CensusOfFrance1911Test.php @@ -45,29 +45,29 @@ class CensusOfFrance1911Test extends \PHPUnit_Framework_TestCase { $this->assertCount(8, $columns); $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnSurname', $columns[0]); $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnGivenNames', $columns[1]); - $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnOccupation', $columns[2]); - $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnBirthYear', $columns[3]); - $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnRelationToHead', $columns[4]); - $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNationality', $columns[5]); - $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnBirthPlace', $columns[6]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnBirthYear', $columns[2]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnBirthPlace', $columns[3]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNationality', $columns[4]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnRelationToHead', $columns[5]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnOccupation', $columns[6]); $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[7]); - $this->assertSame('Nom', $columns[0]->abbreviation()); - $this->assertSame('Prénom', $columns[1]->abbreviation()); - $this->assertSame('Profession', $columns[2]->abbreviation()); - $this->assertSame('Année', $columns[3]->abbreviation()); - $this->assertSame('Position', $columns[4]->abbreviation()); - $this->assertSame('Nationalité', $columns[5]->abbreviation()); - $this->assertSame('Lieu', $columns[6]->abbreviation()); - $this->assertSame('Position sociale', $columns[7]->abbreviation()); + $this->assertSame('Noms', $columns[0]->abbreviation()); + $this->assertSame('Prénoms', $columns[1]->abbreviation()); + $this->assertSame('Année', $columns[2]->abbreviation()); + $this->assertSame('Lieu', $columns[3]->abbreviation()); + $this->assertSame('Nationalité', $columns[4]->abbreviation()); + $this->assertSame('Situation', $columns[5]->abbreviation()); + $this->assertSame('Profession', $columns[6]->abbreviation()); + $this->assertSame('Empl', $columns[7]->abbreviation()); - $this->assertSame('Nom de famille', $columns[0]->title()); - $this->assertSame('Prénom', $columns[1]->title()); - $this->assertSame('Profession', $columns[2]->title()); - $this->assertSame('Année de naissance', $columns[3]->title()); - $this->assertSame('Position dans le ménage', $columns[4]->title()); - $this->assertSame('Nationalité', $columns[5]->title()); - $this->assertSame('Lieu de naissance', $columns[6]->title()); - $this->assertSame('Position sociale (patron, ouvrier ou employé)', $columns[7]->title()); + $this->assertSame('Noms de famille', $columns[0]->title()); + $this->assertSame('', $columns[1]->title()); + $this->assertSame('Année de naissance', $columns[2]->title()); + $this->assertSame('Lieu de naissance', $columns[3]->title()); + $this->assertSame('', $columns[4]->title()); + $this->assertSame('Situation par rapport au chef de ménage', $columns[5]->title()); + $this->assertSame('', $columns[6]->title()); + $this->assertSame('', $columns[7]->title()); } } diff --git a/tests/app/Census/CensusOfFrance1921Test.php b/tests/app/Census/CensusOfFrance1921Test.php index 26d7fcb6ff..cceb57851e 100644 --- a/tests/app/Census/CensusOfFrance1921Test.php +++ b/tests/app/Census/CensusOfFrance1921Test.php @@ -42,26 +42,32 @@ class CensusOfFrance1921Test extends \PHPUnit_Framework_TestCase { $census = new CensusOfFrance1921; $columns = $census->columns(); - $this->assertCount(6, $columns); + $this->assertCount(8, $columns); $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnSurname', $columns[0]); $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnGivenNames', $columns[1]); - $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnOccupation', $columns[2]); - $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnBirthYear', $columns[3]); - $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnRelationToHead', $columns[4]); - $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNationality', $columns[5]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnBirthYear', $columns[2]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnBirthPlace', $columns[3]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNationality', $columns[4]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnRelationToHead', $columns[5]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnOccupation', $columns[6]); + $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNull', $columns[7]); - $this->assertSame('Nom', $columns[0]->abbreviation()); - $this->assertSame('Prénom', $columns[1]->abbreviation()); - $this->assertSame('Profession', $columns[2]->abbreviation()); - $this->assertSame('Année', $columns[3]->abbreviation()); - $this->assertSame('Position', $columns[4]->abbreviation()); - $this->assertSame('Nationalité', $columns[5]->abbreviation()); + $this->assertSame('Noms', $columns[0]->abbreviation()); + $this->assertSame('Prénoms', $columns[1]->abbreviation()); + $this->assertSame('Année', $columns[2]->abbreviation()); + $this->assertSame('Lieu', $columns[3]->abbreviation()); + $this->assertSame('Nationalité', $columns[4]->abbreviation()); + $this->assertSame('Situation', $columns[5]->abbreviation()); + $this->assertSame('Profession', $columns[6]->abbreviation()); + $this->assertSame('Empl', $columns[7]->abbreviation()); - $this->assertSame('Nom de famille', $columns[0]->title()); - $this->assertSame('Prénom', $columns[1]->title()); - $this->assertSame('Profession', $columns[2]->title()); - $this->assertSame('Année de naissance', $columns[3]->title()); - $this->assertSame('Position dans le ménage', $columns[4]->title()); - $this->assertSame('Nationalité', $columns[5]->title()); + $this->assertSame('Noms de famille', $columns[0]->title()); + $this->assertSame('', $columns[1]->title()); + $this->assertSame('Année de naissance', $columns[2]->title()); + $this->assertSame('Lieu de naissance', $columns[3]->title()); + $this->assertSame('', $columns[4]->title()); + $this->assertSame('Situation par rapport au chef de ménage', $columns[5]->title()); + $this->assertSame('', $columns[6]->title()); + $this->assertSame('', $columns[7]->title()); } } diff --git a/tests/app/Census/CensusOfFrance1926Test.php b/tests/app/Census/CensusOfFrance1926Test.php index 4347edc719..650911cf28 100644 --- a/tests/app/Census/CensusOfFrance1926Test.php +++ b/tests/app/Census/CensusOfFrance1926Test.php @@ -50,18 +50,18 @@ class CensusOfFrance1926Test extends \PHPUnit_Framework_TestCase { $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnRelationToHead', $columns[4]); $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNationality', $columns[5]); - $this->assertSame('Nom', $columns[0]->abbreviation()); - $this->assertSame('Prénom', $columns[1]->abbreviation()); + $this->assertSame('Noms', $columns[0]->abbreviation()); + $this->assertSame('Prénoms', $columns[1]->abbreviation()); $this->assertSame('Profession', $columns[2]->abbreviation()); $this->assertSame('Année', $columns[3]->abbreviation()); $this->assertSame('Position', $columns[4]->abbreviation()); $this->assertSame('Nationalité', $columns[5]->abbreviation()); - $this->assertSame('Nom de famille', $columns[0]->title()); - $this->assertSame('Prénom', $columns[1]->title()); - $this->assertSame('Profession', $columns[2]->title()); + $this->assertSame('Noms de famille', $columns[0]->title()); + $this->assertSame('', $columns[1]->title()); + $this->assertSame('', $columns[2]->title()); $this->assertSame('Année de naissance', $columns[3]->title()); $this->assertSame('Position dans le ménage', $columns[4]->title()); - $this->assertSame('Nationalité', $columns[5]->title()); + $this->assertSame('', $columns[5]->title()); } } diff --git a/tests/app/Census/CensusOfFrance1931Test.php b/tests/app/Census/CensusOfFrance1931Test.php index 08756a4585..8787c73e84 100644 --- a/tests/app/Census/CensusOfFrance1931Test.php +++ b/tests/app/Census/CensusOfFrance1931Test.php @@ -50,18 +50,18 @@ class CensusOfFrance1931Test extends \PHPUnit_Framework_TestCase { $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnRelationToHead', $columns[4]); $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNationality', $columns[5]); - $this->assertSame('Nom', $columns[0]->abbreviation()); - $this->assertSame('Prénom', $columns[1]->abbreviation()); + $this->assertSame('Noms', $columns[0]->abbreviation()); + $this->assertSame('Prénoms', $columns[1]->abbreviation()); $this->assertSame('Profession', $columns[2]->abbreviation()); $this->assertSame('Année', $columns[3]->abbreviation()); $this->assertSame('Position', $columns[4]->abbreviation()); $this->assertSame('Nationalité', $columns[5]->abbreviation()); - $this->assertSame('Nom de famille', $columns[0]->title()); - $this->assertSame('Prénom', $columns[1]->title()); - $this->assertSame('Profession', $columns[2]->title()); + $this->assertSame('Noms de famille', $columns[0]->title()); + $this->assertSame('', $columns[1]->title()); + $this->assertSame('', $columns[2]->title()); $this->assertSame('Année de naissance', $columns[3]->title()); $this->assertSame('Position dans le ménage', $columns[4]->title()); - $this->assertSame('Nationalité', $columns[5]->title()); + $this->assertSame('', $columns[5]->title()); } } diff --git a/tests/app/Census/CensusOfFrance1936Test.php b/tests/app/Census/CensusOfFrance1936Test.php index 9d8024eb28..b706e2d12d 100644 --- a/tests/app/Census/CensusOfFrance1936Test.php +++ b/tests/app/Census/CensusOfFrance1936Test.php @@ -50,18 +50,18 @@ class CensusOfFrance1936Test extends \PHPUnit_Framework_TestCase { $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnRelationToHead', $columns[4]); $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNationality', $columns[5]); - $this->assertSame('Nom', $columns[0]->abbreviation()); - $this->assertSame('Prénom', $columns[1]->abbreviation()); + $this->assertSame('Noms', $columns[0]->abbreviation()); + $this->assertSame('Prénoms', $columns[1]->abbreviation()); $this->assertSame('Profession', $columns[2]->abbreviation()); $this->assertSame('Année', $columns[3]->abbreviation()); $this->assertSame('Position', $columns[4]->abbreviation()); $this->assertSame('Nationalité', $columns[5]->abbreviation()); - $this->assertSame('Nom de famille', $columns[0]->title()); - $this->assertSame('Prénom', $columns[1]->title()); - $this->assertSame('Profession', $columns[2]->title()); + $this->assertSame('Noms de famille', $columns[0]->title()); + $this->assertSame('', $columns[1]->title()); + $this->assertSame('', $columns[2]->title()); $this->assertSame('Année de naissance', $columns[3]->title()); $this->assertSame('Position dans le ménage', $columns[4]->title()); - $this->assertSame('Nationalité', $columns[5]->title()); + $this->assertSame('', $columns[5]->title()); } } diff --git a/tests/app/Census/CensusOfFrance1946Test.php b/tests/app/Census/CensusOfFrance1946Test.php index cbe1e4f30f..3e43846526 100644 --- a/tests/app/Census/CensusOfFrance1946Test.php +++ b/tests/app/Census/CensusOfFrance1946Test.php @@ -50,18 +50,18 @@ class CensusOfFrance1946Test extends \PHPUnit_Framework_TestCase { $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnRelationToHead', $columns[4]); $this->assertInstanceOf('Fisharebest\Webtrees\Census\CensusColumnNationality', $columns[5]); - $this->assertSame('Nom', $columns[0]->abbreviation()); - $this->assertSame('Prénom', $columns[1]->abbreviation()); + $this->assertSame('Noms', $columns[0]->abbreviation()); + $this->assertSame('Prénoms', $columns[1]->abbreviation()); $this->assertSame('Profession', $columns[2]->abbreviation()); $this->assertSame('Année', $columns[3]->abbreviation()); $this->assertSame('Position', $columns[4]->abbreviation()); $this->assertSame('Nationalité', $columns[5]->abbreviation()); - $this->assertSame('Nom de famille', $columns[0]->title()); - $this->assertSame('Prénom', $columns[1]->title()); - $this->assertSame('Profession', $columns[2]->title()); + $this->assertSame('Noms de famille', $columns[0]->title()); + $this->assertSame('', $columns[1]->title()); + $this->assertSame('', $columns[2]->title()); $this->assertSame('Année de naissance', $columns[3]->title()); $this->assertSame('Position dans le ménage', $columns[4]->title()); - $this->assertSame('Nationalité', $columns[5]->title()); + $this->assertSame('', $columns[5]->title()); } } |
