public function test_purgeArchivesWithPeriodRange_PurgesAllRangeArchives() { $deletedRowCount = $this->archivePurger->purgeArchivesWithPeriodRange($this->february); self::$fixture->assertCustomRangesPurged($this->february); self::$fixture->assertCustomRangesNotPurged($this->january); $this->assertEquals(3 * RawArchiveDataWithTempAndInvalidated::ROWS_PER_ARCHIVE, $deletedRowCount); }
public function purgeInvalidatedArchives() { $archivesToPurge = new ArchivesToPurgeDistributedList(); foreach ($archivesToPurge->getAllAsDates() as $date) { $this->archivePurger->purgeInvalidatedArchivesFrom($date); $archivesToPurge->removeDate($date); } }
public function setUp() { parent::setUp(); $this->january = Date::factory('2015-01-01'); $this->february = Date::factory('2015-02-01'); $archivePurger = new ArchivePurger(); $archivePurger->setTodayDate(Date::factory('2015-02-27')); $archivePurger->setYesterdayDate(Date::factory('2015-02-26')); $archivePurger->setNow(Date::factory('2015-02-27 08:00:00')->getTimestamp()); $this->tasks = new Tasks($archivePurger, new NullLogger()); }
public function setUp() { parent::setUp(); PurgeOldArchiveData::$todayOverride = Date::factory('2015-02-27'); $archivePurger = new ArchivePurger(); $archivePurger->setTodayDate(Date::factory('2015-02-27')); $archivePurger->setYesterdayDate(Date::factory('2015-02-26')); $archivePurger->setNow(Date::factory('2015-02-27 08:00:00')->getTimestamp()); $this->application = new Console(); $this->application->setAutoExit(false); $this->application->add(new PurgeOldArchiveData($archivePurger)); $this->applicationTester = new ApplicationTester($this->application); // assert the test data was setup correctly self::$fixture->assertInvalidatedArchivesNotPurged(self::$fixture->january); self::$fixture->assertInvalidatedArchivesNotPurged(self::$fixture->february); }