diff options
author | Thomas Steur <thomas.steur@gmail.com> | 2015-03-19 00:26:57 +0300 |
---|---|---|
committer | Thomas Steur <thomas.steur@gmail.com> | 2015-03-19 05:25:54 +0300 |
commit | 56eb0f3075454dc2238679030e7168e0c1ddad05 (patch) | |
tree | c59cdbd0061ee35b23f378769db5fefb1718834e /tests/PHPUnit | |
parent | bf56078002db6c9d1bd5653443486b9148af76b0 (diff) |
Monthly archiving should use the smaller amount of weeks and days inside the month
Diffstat (limited to 'tests/PHPUnit')
-rw-r--r-- | tests/PHPUnit/System/ArchiveInvalidationTest.php | 43 | ||||
-rw-r--r-- | tests/PHPUnit/System/PrivacyManagerTest.php | 20 | ||||
-rw-r--r-- | tests/PHPUnit/Unit/Period/MonthTest.php | 383 | ||||
-rw-r--r-- | tests/PHPUnit/Unit/Period/RangeTest.php | 404 |
4 files changed, 476 insertions, 374 deletions
diff --git a/tests/PHPUnit/System/ArchiveInvalidationTest.php b/tests/PHPUnit/System/ArchiveInvalidationTest.php index bd97f78413..b64aa82479 100644 --- a/tests/PHPUnit/System/ArchiveInvalidationTest.php +++ b/tests/PHPUnit/System/ArchiveInvalidationTest.php @@ -9,6 +9,7 @@ namespace Piwik\Tests\System; use Piwik\API\Request; use Piwik\Config; +use Piwik\Date; use Piwik\Tests\Fixtures\VisitsTwoWebsitesWithAdditionalVisits; use Piwik\Tests\Framework\TestCase\SystemTestCase; @@ -24,6 +25,9 @@ use Piwik\Tests\Framework\TestCase\SystemTestCase; */ class ArchiveInvalidationTest extends SystemTestCase { + /** + * @var VisitsTwoWebsitesWithAdditionalVisits + */ public static $fixture = null; // initialized below class definition protected $suffix = '_NewDataShouldNotAppear'; @@ -46,6 +50,15 @@ class ArchiveInvalidationTest extends SystemTestCase // Build tests for the 2 websites return array( + + array($apiToCall, array('idSite' => self::$fixture->idSite2, + 'testSuffix' => 'Website' . self::$fixture->idSite2 . "_NewDataShouldNotAppear_BecauseWeekWasNotInvalidated", + 'date' => self::$fixture->dateTimeFirstDateWebsite2, + 'periods' => 'week', + 'segment' => 'pageUrl=@category/', + 'setDateLastN' => 4, // 4months ahead + 'otherRequestParameters' => array('expanded' => 1)) + ), array($apiToCall, array('idSite' => self::$fixture->idSite1, 'testSuffix' => 'Website' . self::$fixture->idSite1 . $this->suffix, 'date' => self::$fixture->dateTimeFirstDateWebsite1, @@ -61,16 +74,7 @@ class ArchiveInvalidationTest extends SystemTestCase 'segment' => 'pageUrl=@category/', 'setDateLastN' => 4, // 4months ahead 'otherRequestParameters' => array('expanded' => 1)) - ), - - array($apiToCall, array('idSite' => self::$fixture->idSite2, - 'testSuffix' => 'Website' . self::$fixture->idSite2 . "_NewDataShouldNotAppear_BecauseWeekWasNotInvalidated", - 'date' => self::$fixture->dateTimeFirstDateWebsite2, - 'periods' => 'week', - 'segment' => 'pageUrl=@category/', - 'setDateLastN' => 4, // 4months ahead - 'otherRequestParameters' => array('expanded' => 1)) - ), + ) ); } @@ -94,6 +98,11 @@ class ArchiveInvalidationTest extends SystemTestCase */ public function testAnotherApi($api, $params) { + if ($params['periods'] === 'month') { + // we do now need to invalidate weeks as well since months are based on weeks + $this->invalidateTestArchive(self::$fixture->idSite2, 'week', self::$fixture->dateTimeFirstDateWebsite2); + } + $this->setBrowserArchivingTriggering(1); $this->runApiTests($api, $params); @@ -122,17 +131,21 @@ class ArchiveInvalidationTest extends SystemTestCase protected function invalidateTestArchives() { $dateToInvalidate1 = new \DateTime(self::$fixture->dateTimeFirstDateWebsite1); - $dateToInvalidate2 = new \DateTime(self::$fixture->dateTimeFirstDateWebsite2); $r = new Request("module=API&method=CoreAdminHome.invalidateArchivedReports&idSites=" . self::$fixture->idSite1 . "&dates=" . $dateToInvalidate1->format('Y-m-d')); $this->assertApiResponseHasNoError($r->process()); // Days & Months reports only are invalidated and we test our weekly report will still show old data. - $r = new Request("module=API&method=CoreAdminHome.invalidateArchivedReports&period=day&idSites=" . self::$fixture->idSite2 . "&dates=" . $dateToInvalidate2->format('Y-m-d')); - $this->assertApiResponseHasNoError($r->process()); - $r = new Request("module=API&method=CoreAdminHome.invalidateArchivedReports&period=month&idSites=" . self::$fixture->idSite2 . "&dates=" . $dateToInvalidate2->format('Y-m-d')); - $this->assertApiResponseHasNoError($r->process()); + $this->invalidateTestArchive(self::$fixture->idSite2, 'day', self::$fixture->dateTimeFirstDateWebsite2); + $this->invalidateTestArchive(self::$fixture->idSite2, 'month', self::$fixture->dateTimeFirstDateWebsite2); + } + private function invalidateTestArchive($idSite, $period, $dateTime) + { + $dates = new \DateTime($dateTime); + $dates = $dates->format('Y-m-d'); + $r = new Request("module=API&method=CoreAdminHome.invalidateArchivedReports&period=$period&idSites=$idSite&dates=$dates"); + $this->assertApiResponseHasNoError($r->process()); } } diff --git a/tests/PHPUnit/System/PrivacyManagerTest.php b/tests/PHPUnit/System/PrivacyManagerTest.php index 0d99d0816d..e674e9bc96 100644 --- a/tests/PHPUnit/System/PrivacyManagerTest.php +++ b/tests/PHPUnit/System/PrivacyManagerTest.php @@ -27,6 +27,7 @@ use Piwik\Tracker\Cache; use Piwik\Tracker\GoalManager; use Piwik\Tests\Framework\TestCase\SystemTestCase; use Piwik\Tests\Framework\Fixture; +use Piwik\Translate; require_once PIWIK_INCLUDE_PATH . '/plugins/PrivacyManager/PrivacyManager.php'; @@ -47,7 +48,7 @@ class PrivacyManagerTest extends SystemTestCase const JAN_METRIC_ARCHIVE_COUNT = 11; // 5 days + 4 weeks + 1 month + 1 year const FEB_METRIC_ARCHIVE_COUNT = 11; // 6 days + 4 weeks + 1 month - const JAN_DONE_FLAGS_COUNT = 43; + const JAN_DONE_FLAGS_COUNT = 44; // fake metric/report name used to make sure unwanted metrics are purged const GARBAGE_FIELD = 'abcdefg'; @@ -81,6 +82,8 @@ class PrivacyManagerTest extends SystemTestCase { parent::setUp(); + Translate::loadAllTranslations(); + LogDataPurger::$selectSegmentSize = 2; ReportsPurger::$selectSegmentSize = 2; @@ -374,7 +377,7 @@ class PrivacyManagerTest extends SystemTestCase // perform checks $this->checkLogDataPurged(); - $this->_checkReportsAndMetricsPurged($janBlobsRemaining = 5, $janNumericRemaining = 69); // 5 blobs for 5 days + $this->_checkReportsAndMetricsPurged($janBlobsRemaining = 5, $janNumericRemaining = 70); // 5 blobs for 5 days } /** @@ -408,7 +411,7 @@ class PrivacyManagerTest extends SystemTestCase // perform checks $this->checkLogDataPurged(); - $this->_checkReportsAndMetricsPurged($janBlobsRemaining = 4, $janNumericRemaining = 63); // 4 blobs for 4 weeks + $this->_checkReportsAndMetricsPurged($janBlobsRemaining = 4, $janNumericRemaining = 64); // 4 blobs for 4 weeks } /** @@ -442,7 +445,7 @@ class PrivacyManagerTest extends SystemTestCase // perform checks $this->checkLogDataPurged(); - $this->_checkReportsAndMetricsPurged($janBlobsRemaining = 1, $janNumericRemaining = 48); + $this->_checkReportsAndMetricsPurged($janBlobsRemaining = 1, $janNumericRemaining = 49); } /** @@ -476,7 +479,7 @@ class PrivacyManagerTest extends SystemTestCase // perform checks $this->checkLogDataPurged(); - $this->_checkReportsAndMetricsPurged($janBlobsRemaining = 1, $janNumericRemaining = 48); + $this->_checkReportsAndMetricsPurged($janBlobsRemaining = 1, $janNumericRemaining = 49); } /** @@ -539,7 +542,7 @@ class PrivacyManagerTest extends SystemTestCase // perform checks $this->checkLogDataPurged(); - $this->_checkReportsAndMetricsPurged($janBlobsRemaining = 2, $janNumericRemaining = 47); // 2 range blobs + $this->_checkReportsAndMetricsPurged($janBlobsRemaining = 2, $janNumericRemaining = 48); // 2 range blobs } /** @@ -574,7 +577,7 @@ class PrivacyManagerTest extends SystemTestCase // perform checks $this->checkLogDataPurged(); - $this->_checkReportsAndMetricsPurged($janBlobsRemaining = 6, $janNumericRemaining = 71); // 1 segmented blob + 5 day blobs + $this->_checkReportsAndMetricsPurged($janBlobsRemaining = 6, $janNumericRemaining = 72); // 1 segmented blob + 5 day blobs } // --- utility functions follow --- @@ -866,7 +869,8 @@ class PrivacyManagerTest extends SystemTestCase // + 1 garbage metric // log_link_visit_action+ 2 entries per range period (4 total) + 2 'done...' entries per range period (4 total) // + 2 entries per segment (2 total) + 2 'done...' entries per segment (2 total) - return self::JAN_METRIC_ARCHIVE_COUNT * 5 + self::TOTAL_JAN_ARCHIVE_COUNT + 1 + 8 + 4; + // +1 done flag for one further week used to create the archive of a month + return self::JAN_METRIC_ARCHIVE_COUNT * 5 + self::TOTAL_JAN_ARCHIVE_COUNT + 1 + 8 + 4 + 1; } protected function _getExpectedNumericArchiveCountFeb() diff --git a/tests/PHPUnit/Unit/Period/MonthTest.php b/tests/PHPUnit/Unit/Period/MonthTest.php index 6ef1c824e3..6791cea6e6 100644 --- a/tests/PHPUnit/Unit/Period/MonthTest.php +++ b/tests/PHPUnit/Unit/Period/MonthTest.php @@ -11,11 +11,15 @@ namespace Piwik\Tests\Unit\Period; use Piwik\Date; use Piwik\Period\Month; +/** + * @group Core + * @group MonthTest + * @group Period + */ class MonthTest extends BasePeriodTest { /** * testing december - * @group Core */ public function testMonthDec() { @@ -24,82 +28,97 @@ class MonthTest extends BasePeriodTest "2006-12-01", "2006-12-02", "2006-12-03", - "2006-12-04", - "2006-12-05", - "2006-12-06", - "2006-12-07", - "2006-12-08", - "2006-12-09", - "2006-12-10", - "2006-12-11", - "2006-12-12", - "2006-12-13", - "2006-12-14", - "2006-12-15", - "2006-12-16", - "2006-12-17", - "2006-12-18", - "2006-12-19", - "2006-12-20", - "2006-12-21", - "2006-12-22", - "2006-12-23", - "2006-12-24", - "2006-12-25", - "2006-12-26", - "2006-12-27", - "2006-12-28", - "2006-12-29", - "2006-12-30", - "2006-12-31",); + array( + "2006-12-04", + "2006-12-05", + "2006-12-06", + "2006-12-07", + "2006-12-08", + "2006-12-09", + "2006-12-10" + ), + array( + "2006-12-11", + "2006-12-12", + "2006-12-13", + "2006-12-14", + "2006-12-15", + "2006-12-16", + "2006-12-17" + ), + array( + "2006-12-18", + "2006-12-19", + "2006-12-20", + "2006-12-21", + "2006-12-22", + "2006-12-23", + "2006-12-24", + ), + array( + "2006-12-25", + "2006-12-26", + "2006-12-27", + "2006-12-28", + "2006-12-29", + "2006-12-30", + "2006-12-31" + ) + ); + $this->assertEquals($correct, $month->toString()); - $this->assertEquals(31, $month->getNumberOfSubperiods()); + $this->assertEquals(7, $month->getNumberOfSubperiods()); } /** * testing month feb leap year - * @group Core */ public function testMonthFebLeap() { - $month = new Month(Date::factory("2024-02-11")); + $month = new Month(Date::factory("2024-02-11"), Date::factory("2025-01-01")); $correct = array( "2024-02-01", "2024-02-02", "2024-02-03", "2024-02-04", - "2024-02-05", - "2024-02-06", - "2024-02-07", - "2024-02-08", - "2024-02-09", - "2024-02-10", - "2024-02-11", - "2024-02-12", - "2024-02-13", - "2024-02-14", - "2024-02-15", - "2024-02-16", - "2024-02-17", - "2024-02-18", - "2024-02-19", - "2024-02-20", - "2024-02-21", - "2024-02-22", - "2024-02-23", - "2024-02-24", - "2024-02-25", + array( + "2024-02-05", + "2024-02-06", + "2024-02-07", + "2024-02-08", + "2024-02-09", + "2024-02-10", + "2024-02-11" + ), + array( + "2024-02-12", + "2024-02-13", + "2024-02-14", + "2024-02-15", + "2024-02-16", + "2024-02-17", + "2024-02-18" + ), + array( + "2024-02-19", + "2024-02-20", + "2024-02-21", + "2024-02-22", + "2024-02-23", + "2024-02-24", + "2024-02-25" + ), "2024-02-26", "2024-02-27", "2024-02-28", - "2024-02-29",); + "2024-02-29"); + $this->assertEquals($correct, $month->toString()); - $this->assertEquals(29, $month->getNumberOfSubperiods()); + $this->assertEquals(11, $month->getNumberOfSubperiods()); } /** * testing month feb non-leap year - * @group Core */ public function testMonthFebNonLeap() { @@ -110,79 +129,91 @@ class MonthTest extends BasePeriodTest "2023-02-03", "2023-02-04", "2023-02-05", - "2023-02-06", - "2023-02-07", - "2023-02-08", - "2023-02-09", - "2023-02-10", - "2023-02-11", - "2023-02-12", - "2023-02-13", - "2023-02-14", - "2023-02-15", - "2023-02-16", - "2023-02-17", - "2023-02-18", - "2023-02-19", - "2023-02-20", - "2023-02-21", - "2023-02-22", - "2023-02-23", - "2023-02-24", - "2023-02-25", - "2023-02-26", + array( + "2023-02-06", + "2023-02-07", + "2023-02-08", + "2023-02-09", + "2023-02-10", + "2023-02-11", + "2023-02-12" + ), + array( + "2023-02-13", + "2023-02-14", + "2023-02-15", + "2023-02-16", + "2023-02-17", + "2023-02-18", + "2023-02-19" + ), + array( + "2023-02-20", + "2023-02-21", + "2023-02-22", + "2023-02-23", + "2023-02-24", + "2023-02-25", + "2023-02-26" + ), "2023-02-27", - "2023-02-28",); + "2023-02-28"); $this->assertEquals($correct, $month->toString()); - $this->assertEquals(28, $month->getNumberOfSubperiods()); + $this->assertEquals(10, $month->getNumberOfSubperiods()); } /** * testing jan - * @group Core */ public function testMonthJan() { $month = new Month(Date::factory("2007-01-01")); $correct = array( - "2007-01-01", - "2007-01-02", - "2007-01-03", - "2007-01-04", - "2007-01-05", - "2007-01-06", - "2007-01-07", - "2007-01-08", - "2007-01-09", - "2007-01-10", - "2007-01-11", - "2007-01-12", - "2007-01-13", - "2007-01-14", - "2007-01-15", - "2007-01-16", - "2007-01-17", - "2007-01-18", - "2007-01-19", - "2007-01-20", - "2007-01-21", - "2007-01-22", - "2007-01-23", - "2007-01-24", - "2007-01-25", - "2007-01-26", - "2007-01-27", - "2007-01-28", + array( + "2007-01-01", + "2007-01-02", + "2007-01-03", + "2007-01-04", + "2007-01-05", + "2007-01-06", + "2007-01-07" + ), + array( + "2007-01-08", + "2007-01-09", + "2007-01-10", + "2007-01-11", + "2007-01-12", + "2007-01-13", + "2007-01-14" + ), + array( + "2007-01-15", + "2007-01-16", + "2007-01-17", + "2007-01-18", + "2007-01-19", + "2007-01-20", + "2007-01-21" + ), + array( + "2007-01-22", + "2007-01-23", + "2007-01-24", + "2007-01-25", + "2007-01-26", + "2007-01-27", + "2007-01-28" + ), "2007-01-29", "2007-01-30", - "2007-01-31",); + "2007-01-31"); $this->assertEquals($correct, $month->toString()); - $this->assertEquals(31, $month->getNumberOfSubperiods()); + $this->assertEquals(7, $month->getNumberOfSubperiods()); } /** * testing month containing a time change (DST) - * @group Core */ public function testMonthDSTChangeMarch() { @@ -192,82 +223,90 @@ class MonthTest extends BasePeriodTest "2007-03-02", "2007-03-03", "2007-03-04", - "2007-03-05", - "2007-03-06", - "2007-03-07", - "2007-03-08", - "2007-03-09", - "2007-03-10", - "2007-03-11", - "2007-03-12", - "2007-03-13", - "2007-03-14", - "2007-03-15", - "2007-03-16", - "2007-03-17", - "2007-03-18", - "2007-03-19", - "2007-03-20", - "2007-03-21", - "2007-03-22", - "2007-03-23", - "2007-03-24", - "2007-03-25", + array( + "2007-03-05", + "2007-03-06", + "2007-03-07", + "2007-03-08", + "2007-03-09", + "2007-03-10", + "2007-03-11" + ), + array( + "2007-03-12", + "2007-03-13", + "2007-03-14", + "2007-03-15", + "2007-03-16", + "2007-03-17", + "2007-03-18" + ), + array( + "2007-03-19", + "2007-03-20", + "2007-03-21", + "2007-03-22", + "2007-03-23", + "2007-03-24", + "2007-03-25" + ), "2007-03-26", "2007-03-27", "2007-03-28", "2007-03-29", "2007-03-30", - "2007-03-31",); + "2007-03-31"); $this->assertEquals($correct, $month->toString()); - $this->assertEquals(31, $month->getNumberOfSubperiods()); + $this->assertEquals(13, $month->getNumberOfSubperiods()); } - /** - * @group Core - */ public function testMonthDSTChangeOct() { $month = new Month(Date::factory("2017-10-31")); $correct = array( "2017-10-01", - "2017-10-02", - "2017-10-03", - "2017-10-04", - "2017-10-05", - "2017-10-06", - "2017-10-07", - "2017-10-08", - "2017-10-09", - "2017-10-10", - "2017-10-11", - "2017-10-12", - "2017-10-13", - "2017-10-14", - "2017-10-15", - "2017-10-16", - "2017-10-17", - "2017-10-18", - "2017-10-19", - "2017-10-20", - "2017-10-21", - "2017-10-22", - "2017-10-23", - "2017-10-24", - "2017-10-25", - "2017-10-26", - "2017-10-27", - "2017-10-28", - "2017-10-29", + array( + "2017-10-02", + "2017-10-03", + "2017-10-04", + "2017-10-05", + "2017-10-06", + "2017-10-07", + "2017-10-08" + ), + array( + "2017-10-09", + "2017-10-10", + "2017-10-11", + "2017-10-12", + "2017-10-13", + "2017-10-14", + "2017-10-15" + ), + array( + "2017-10-16", + "2017-10-17", + "2017-10-18", + "2017-10-19", + "2017-10-20", + "2017-10-21", + "2017-10-22" + ), + array( + "2017-10-23", + "2017-10-24", + "2017-10-25", + "2017-10-26", + "2017-10-27", + "2017-10-28", + "2017-10-29" + ), "2017-10-30", "2017-10-31",); $this->assertEquals($correct, $month->toString()); - $this->assertEquals(31, $month->getNumberOfSubperiods()); + $this->assertEquals(7, $month->getNumberOfSubperiods()); } - /** - * @group Core - */ public function testGetLocalizedShortString() { $month = new Month(Date::factory('2024-10-09')); @@ -275,9 +314,6 @@ class MonthTest extends BasePeriodTest $this->assertEquals($shouldBe, $month->getLocalizedShortString()); } - /** - * @group Core - */ public function testGetLocalizedLongString() { $month = new Month(Date::factory('2024-10-09')); @@ -285,9 +321,6 @@ class MonthTest extends BasePeriodTest $this->assertEquals($shouldBe, $month->getLocalizedLongString()); } - /** - * @group Core - */ public function testGetPrettyString() { $month = new Month(Date::factory('2024-10-09')); diff --git a/tests/PHPUnit/Unit/Period/RangeTest.php b/tests/PHPUnit/Unit/Period/RangeTest.php index adc84c5651..24dce9e08c 100644 --- a/tests/PHPUnit/Unit/Period/RangeTest.php +++ b/tests/PHPUnit/Unit/Period/RangeTest.php @@ -248,64 +248,80 @@ class RangeTest extends BasePeriodTest '2006-12-01', '2006-12-02', '2006-12-03', - '2006-12-04', - '2006-12-05', - '2006-12-06', - '2006-12-07', - '2006-12-08', - '2006-12-09', - '2006-12-10', - '2006-12-11', - '2006-12-12', - '2006-12-13', - '2006-12-14', - '2006-12-15', - '2006-12-16', - '2006-12-17', - '2006-12-18', - '2006-12-19', - '2006-12-20', - '2006-12-21', - '2006-12-22', - '2006-12-23', - '2006-12-24', - '2006-12-25', - '2006-12-26', - '2006-12-27', - '2006-12-28', - '2006-12-29', - '2006-12-30', - '2006-12-31', + array( + '2006-12-04', + '2006-12-05', + '2006-12-06', + '2006-12-07', + '2006-12-08', + '2006-12-09', + '2006-12-10' + ), + array( + '2006-12-11', + '2006-12-12', + '2006-12-13', + '2006-12-14', + '2006-12-15', + '2006-12-16', + '2006-12-17' + ), + array( + '2006-12-18', + '2006-12-19', + '2006-12-20', + '2006-12-21', + '2006-12-22', + '2006-12-23', + '2006-12-24' + ), + array( + '2006-12-25', + '2006-12-26', + '2006-12-27', + '2006-12-28', + '2006-12-29', + '2006-12-30', + '2006-12-31' + ), ), array( - '2007-01-01', - '2007-01-02', - '2007-01-03', - '2007-01-04', - '2007-01-05', - '2007-01-06', - '2007-01-07', - '2007-01-08', - '2007-01-09', - '2007-01-10', - '2007-01-11', - '2007-01-12', - '2007-01-13', - '2007-01-14', - '2007-01-15', - '2007-01-16', - '2007-01-17', - '2007-01-18', - '2007-01-19', - '2007-01-20', - '2007-01-21', - '2007-01-22', - '2007-01-23', - '2007-01-24', - '2007-01-25', - '2007-01-26', - '2007-01-27', - '2007-01-28', + array( + '2007-01-01', + '2007-01-02', + '2007-01-03', + '2007-01-04', + '2007-01-05', + '2007-01-06', + '2007-01-07' + ), + array( + '2007-01-08', + '2007-01-09', + '2007-01-10', + '2007-01-11', + '2007-01-12', + '2007-01-13', + '2007-01-14' + ), + array( + '2007-01-15', + '2007-01-16', + '2007-01-17', + '2007-01-18', + '2007-01-19', + '2007-01-20', + '2007-01-21', + ), + array( + '2007-01-22', + '2007-01-23', + '2007-01-24', + '2007-01-25', + '2007-01-26', + '2007-01-27', + '2007-01-28' + ), '2007-01-29', '2007-01-30', '2007-01-31', @@ -838,34 +854,42 @@ class RangeTest extends BasePeriodTest array( "2011-10-01", "2011-10-02", - "2011-10-03", - "2011-10-04", - "2011-10-05", - "2011-10-06", - "2011-10-07", - "2011-10-08", - "2011-10-09", - "2011-10-10", - "2011-10-11", - "2011-10-12", - "2011-10-13", - "2011-10-14", - "2011-10-15", - "2011-10-16", - "2011-10-17", - "2011-10-18", - "2011-10-19", - "2011-10-20", - "2011-10-21", - "2011-10-22", - "2011-10-23", - "2011-10-24", - "2011-10-25", - "2011-10-26", - "2011-10-27", - "2011-10-28", - "2011-10-29", - "2011-10-30", + array( + "2011-10-03", + "2011-10-04", + "2011-10-05", + "2011-10-06", + "2011-10-07", + "2011-10-08", + "2011-10-09" + ), + array( + "2011-10-10", + "2011-10-11", + "2011-10-12", + "2011-10-13", + "2011-10-14", + "2011-10-15", + "2011-10-16" + ), + array( + "2011-10-17", + "2011-10-18", + "2011-10-19", + "2011-10-20", + "2011-10-21", + "2011-10-22", + "2011-10-23" + ), + array( + "2011-10-24", + "2011-10-25", + "2011-10-26", + "2011-10-27", + "2011-10-28", + "2011-10-29", + "2011-10-30" + ), "2011-10-31", ), "2011-11-01", @@ -893,34 +917,42 @@ class RangeTest extends BasePeriodTest $correct = array( array( - "2011-08-01", - "2011-08-02", - "2011-08-03", - "2011-08-04", - "2011-08-05", - "2011-08-06", - "2011-08-07", - "2011-08-08", - "2011-08-09", - "2011-08-10", - "2011-08-11", - "2011-08-12", - "2011-08-13", - "2011-08-14", - "2011-08-15", - "2011-08-16", - "2011-08-17", - "2011-08-18", - "2011-08-19", - "2011-08-20", - "2011-08-21", - "2011-08-22", - "2011-08-23", - "2011-08-24", - "2011-08-25", - "2011-08-26", - "2011-08-27", - "2011-08-28", + array( + "2011-08-01", + "2011-08-02", + "2011-08-03", + "2011-08-04", + "2011-08-05", + "2011-08-06", + "2011-08-07" + ), + array( + "2011-08-08", + "2011-08-09", + "2011-08-10", + "2011-08-11", + "2011-08-12", + "2011-08-13", + "2011-08-14" + ), + array( + "2011-08-15", + "2011-08-16", + "2011-08-17", + "2011-08-18", + "2011-08-19", + "2011-08-20", + "2011-08-21" + ), + array( + "2011-08-22", + "2011-08-23", + "2011-08-24", + "2011-08-25", + "2011-08-26", + "2011-08-27", + "2011-08-28" + ), "2011-08-29", "2011-08-30", "2011-08-31", @@ -930,27 +962,33 @@ class RangeTest extends BasePeriodTest "2011-09-02", "2011-09-03", "2011-09-04", - "2011-09-05", - "2011-09-06", - "2011-09-07", - "2011-09-08", - "2011-09-09", - "2011-09-10", - "2011-09-11", - "2011-09-12", - "2011-09-13", - "2011-09-14", - "2011-09-15", - "2011-09-16", - "2011-09-17", - "2011-09-18", - "2011-09-19", - "2011-09-20", - "2011-09-21", - "2011-09-22", - "2011-09-23", - "2011-09-24", - "2011-09-25", + array( + "2011-09-05", + "2011-09-06", + "2011-09-07", + "2011-09-08", + "2011-09-09", + "2011-09-10", + "2011-09-11" + ), + array( + "2011-09-12", + "2011-09-13", + "2011-09-14", + "2011-09-15", + "2011-09-16", + "2011-09-17", + "2011-09-18" + ), + array( + "2011-09-19", + "2011-09-20", + "2011-09-21", + "2011-09-22", + "2011-09-23", + "2011-09-24", + "2011-09-25" + ), "2011-09-26", "2011-09-27", "2011-09-28", @@ -996,27 +1034,33 @@ class RangeTest extends BasePeriodTest "2011-09-02", "2011-09-03", "2011-09-04", - "2011-09-05", - "2011-09-06", - "2011-09-07", - "2011-09-08", - "2011-09-09", - "2011-09-10", - "2011-09-11", - "2011-09-12", - "2011-09-13", - "2011-09-14", - "2011-09-15", - "2011-09-16", - "2011-09-17", - "2011-09-18", - "2011-09-19", - "2011-09-20", - "2011-09-21", - "2011-09-22", - "2011-09-23", - "2011-09-24", - "2011-09-25", + array( + "2011-09-05", + "2011-09-06", + "2011-09-07", + "2011-09-08", + "2011-09-09", + "2011-09-10", + "2011-09-11" + ), + array( + "2011-09-12", + "2011-09-13", + "2011-09-14", + "2011-09-15", + "2011-09-16", + "2011-09-17", + "2011-09-18" + ), + array( + "2011-09-19", + "2011-09-20", + "2011-09-21", + "2011-09-22", + "2011-09-23", + "2011-09-24", + "2011-09-25" + ), "2011-09-26", "2011-09-27", "2011-09-28", @@ -1043,34 +1087,42 @@ class RangeTest extends BasePeriodTest '2011-07-31', ), array( + array( "2011-08-01", "2011-08-02", "2011-08-03", "2011-08-04", "2011-08-05", "2011-08-06", - "2011-08-07", - "2011-08-08", - "2011-08-09", - "2011-08-10", - "2011-08-11", - "2011-08-12", - "2011-08-13", - "2011-08-14", - "2011-08-15", - "2011-08-16", - "2011-08-17", - "2011-08-18", - "2011-08-19", - "2011-08-20", - "2011-08-21", - "2011-08-22", - "2011-08-23", - "2011-08-24", - "2011-08-25", - "2011-08-26", - "2011-08-27", - "2011-08-28", + "2011-08-07" + ), + array( + "2011-08-08", + "2011-08-09", + "2011-08-10", + "2011-08-11", + "2011-08-12", + "2011-08-13", + "2011-08-14" + ), + array( + "2011-08-15", + "2011-08-16", + "2011-08-17", + "2011-08-18", + "2011-08-19", + "2011-08-20", + "2011-08-21" + ), + array( + "2011-08-22", + "2011-08-23", + "2011-08-24", + "2011-08-25", + "2011-08-26", + "2011-08-27", + "2011-08-28" + ), "2011-08-29", "2011-08-30", "2011-08-31", |