diff options
| author | Greg Roach <fisharebest@gmail.com> | 2015-12-30 18:25:55 +0000 |
|---|---|---|
| committer | Greg Roach <fisharebest@gmail.com> | 2015-12-30 22:13:28 +0000 |
| commit | 4c219c47822475f66a15a7a74d8bcf644e030cfe (patch) | |
| tree | 457365fd94a525d1381e608ab40c2378fe10dfbd /tests/app/Census/CensusColumnBirthDaySlashMonthYearTest.php | |
| parent | ab12429990b847d176a5fcc6bbccb7686a461d71 (diff) | |
| download | webtrees-4c219c47822475f66a15a7a74d8bcf644e030cfe.tar.gz webtrees-4c219c47822475f66a15a7a74d8bcf644e030cfe.tar.bz2 webtrees-4c219c47822475f66a15a7a74d8bcf644e030cfe.zip | |
Danish census
Diffstat (limited to 'tests/app/Census/CensusColumnBirthDaySlashMonthYearTest.php')
| -rw-r--r-- | tests/app/Census/CensusColumnBirthDaySlashMonthYearTest.php | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/tests/app/Census/CensusColumnBirthDaySlashMonthYearTest.php b/tests/app/Census/CensusColumnBirthDaySlashMonthYearTest.php new file mode 100644 index 0000000000..04492c341e --- /dev/null +++ b/tests/app/Census/CensusColumnBirthDaySlashMonthYearTest.php @@ -0,0 +1,57 @@ +<?php + +/** + * webtrees: online genealogy + * Copyright (C) 2015 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; +use Mockery; + +/** + * Test harness for the class CensusColumnBirthDaySlashMonthYearTest + */ +class CensusColumnBirthDaySlashMonthYearTest extends \PHPUnit_Framework_TestCase { + /** + * Delete mock objects + */ + public function tearDown() { + Mockery::close(); + } + + /** + * @covers Fisharebest\Webtrees\Census\CensusColumnBirthDaySlashMonthYearTest + * @covers Fisharebest\Webtrees\Census\AbstractCensusColumn + */ + public function testGenerateColumn() { + $cal_date = Mockery::mock(Date\CalendarDate::class); + $cal_date->shouldReceive('format')->andReturn('30/6 1832'); + + $date = Mockery::mock(Date::class); + $date->shouldReceive('minimumJulianDay')->andReturn($cal_date); + $date->shouldReceive('maximumJulianDay')->andReturn($cal_date); + $date->shouldReceive('minimumDate')->andReturn($cal_date); + + $individual = Mockery::mock(Individual::class); + $individual->shouldReceive('getBirthDate')->andReturn($date); + + $census = Mockery::mock(CensusInterface::class); + $census->shouldReceive('censusDate')->andReturn('30 JUN 1832'); + + $column = new CensusColumnBirthDaySlashMonthYear($census, '', ''); + + $this->assertSame('30/6 1832', $column->generate($individual)); + } +} |
