summaryrefslogtreecommitdiff
path: root/tests/app/Census/CensusColumnMonthIfMarriedWithinYearTest.php
diff options
context:
space:
mode:
authorGreg Roach <fisharebest@gmail.com>2016-12-05 14:29:00 +0000
committerGreg Roach <fisharebest@gmail.com>2016-12-05 14:29:00 +0000
commit4fc9500e42872f656cd6981846f3188c5c21b5fe (patch)
tree69bb53dee682c10b34bc6ed33328213990412b34 /tests/app/Census/CensusColumnMonthIfMarriedWithinYearTest.php
parent52f14e58a20a2e5d8dfec5d8803d242dbf3e350e (diff)
downloadwebtrees-4fc9500e42872f656cd6981846f3188c5c21b5fe.tar.gz
webtrees-4fc9500e42872f656cd6981846f3188c5c21b5fe.tar.bz2
webtrees-4fc9500e42872f656cd6981846f3188c5c21b5fe.zip
Fix #1122 Census column marriage/birth months for future dates
Diffstat (limited to 'tests/app/Census/CensusColumnMonthIfMarriedWithinYearTest.php')
-rw-r--r--tests/app/Census/CensusColumnMonthIfMarriedWithinYearTest.php24
1 files changed, 23 insertions, 1 deletions
diff --git a/tests/app/Census/CensusColumnMonthIfMarriedWithinYearTest.php b/tests/app/Census/CensusColumnMonthIfMarriedWithinYearTest.php
index 08d546a752..aca477d979 100644
--- a/tests/app/Census/CensusColumnMonthIfMarriedWithinYearTest.php
+++ b/tests/app/Census/CensusColumnMonthIfMarriedWithinYearTest.php
@@ -56,7 +56,7 @@ class CensusColumnMonthIfMarriedWithinYearTest extends \PHPUnit_Framework_TestCa
* @covers Fisharebest\Webtrees\Census\CensusColumnMonthIfMarriedWithinYear
* @covers Fisharebest\Webtrees\Census\AbstractCensusColumn
*/
- public function testNotMarriedWithinYear() {
+ public function testMarriedOverYearBeforeTheCensus() {
$fact = Mockery::mock('Fisharebest\Webtrees\Fact');
$fact->shouldReceive('getDate')->andReturn(new Date('01 JAN 1859'));
@@ -78,6 +78,28 @@ class CensusColumnMonthIfMarriedWithinYearTest extends \PHPUnit_Framework_TestCa
* @covers Fisharebest\Webtrees\Census\CensusColumnMonthIfMarriedWithinYear
* @covers Fisharebest\Webtrees\Census\AbstractCensusColumn
*/
+ public function testMarriedAfterTheCensus() {
+ $fact = Mockery::mock('Fisharebest\Webtrees\Fact');
+ $fact->shouldReceive('getDate')->andReturn(new Date('02 JUN 1860'));
+
+ $family = Mockery::mock('Fisharebest\Webtrees\Family');
+ $family->shouldReceive('getFacts')->with('MARR')->andReturn(array($fact));
+
+ $individual = Mockery::mock('Fisharebest\Webtrees\Individual');
+ $individual->shouldReceive('getSpouseFamilies')->andReturn(array($family));
+
+ $census = Mockery::mock('Fisharebest\Webtrees\Census\CensusInterface');
+ $census->shouldReceive('censusDate')->andReturn('01 JUN 1860');
+
+ $column = new CensusColumnMonthIfMarriedWithinYear($census, '', '');
+
+ $this->assertSame('', $column->generate($individual));
+ }
+
+ /**
+ * @covers Fisharebest\Webtrees\Census\CensusColumnMonthIfMarriedWithinYear
+ * @covers Fisharebest\Webtrees\Census\AbstractCensusColumn
+ */
public function testNoMarriage() {
$family = Mockery::mock('Fisharebest\Webtrees\Family');
$family->shouldReceive('getFacts')->with('MARR')->andReturn(array());