diff options
author | Thomas Steur <thomas.steur@gmail.com> | 2013-10-31 02:48:26 +0400 |
---|---|---|
committer | Thomas Steur <thomas.steur@gmail.com> | 2013-10-31 02:48:26 +0400 |
commit | e0df029b4edc1c444beaef20b37261aa978a9c26 (patch) | |
tree | 2cc848c34ec7feaf7cd8bef0a0aa36c21722f18f /tests/PHPUnit/Core/Period/RangeTest.php | |
parent | 43fd0f06a7f2e4149db805b990c55e119e88ba83 (diff) |
refs #3074 added two test cases to prove range returns wrong dates under circumstances
Diffstat (limited to 'tests/PHPUnit/Core/Period/RangeTest.php')
-rw-r--r-- | tests/PHPUnit/Core/Period/RangeTest.php | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/PHPUnit/Core/Period/RangeTest.php b/tests/PHPUnit/Core/Period/RangeTest.php index 3bd290fa45..92f17ee214 100644 --- a/tests/PHPUnit/Core/Period/RangeTest.php +++ b/tests/PHPUnit/Core/Period/RangeTest.php @@ -487,6 +487,42 @@ class Period_RangeTest extends PHPUnit_Framework_TestCase /** * @group Core */ + public function testRangeEndDateIsInFuture() + { + $range = new Range('range', '2013-10-29,2013-10-31', 'UTC', Date::factory('2013-10-30')); + + $correct = array( + '2013-10-29', + '2013-10-30', + '2013-10-31' + ); + + $this->assertEquals(count($correct), $range->getNumberOfSubperiods()); + $this->assertEquals($correct, $range->toString()); + } + + /** + * @group Core + */ + public function testRangePreviousmonthEndDateIsInFutureAndEndOfTheWeek() + { + $range = new Range('range', '2013-10-29,2013-11-03', 'UTC', Date::factory('2013-10-30')); + + $correct = array( + '2013-10-29', + '2013-10-30', + '2013-10-31', + '2013-11-01', + '2013-11-02', + '2013-11-03', + ); + + $this->assertEquals(count($correct), $range->getNumberOfSubperiods()); + $this->assertEquals($correct, $range->toString()); + } + /** + * @group Core + */ public function testCustomRangeWeekInsideEndingYesterday() { $todays = array( |