public function test_construct_CorrectlyConvertsOldListValues()
 {
     $oldItems = array('2015_01' => array(1, 2, 3), '2013_02' => array(3), 3 => '2015_03', '2014_01' => array(), 4 => '2015_06');
     Option::set(ArchivesToPurgeDistributedList::OPTION_INVALIDATED_DATES_SITES_TO_PURGE, serialize($oldItems));
     $list = new ArchivesToPurgeDistributedList();
     $items = $list->getAll();
     $expected = array('2015_03', '2015_06', '2015_01', '2013_02', '2014_01');
     $this->assertEquals($expected, array_values($items));
 }
 public function test_purgeInvalidatedArchives_PurgesCorrectInvalidatedArchives_AndOnlyPurgesDataForDatesAndSites_InInvalidatedReportsDistributedList()
 {
     $this->setUpInvalidatedReportsDistributedList($dates = array($this->february));
     $this->tasks->purgeInvalidatedArchives();
     self::$fixture->assertInvalidatedArchivesPurged($this->february);
     self::$fixture->assertInvalidatedArchivesNotPurged($this->january);
     // assert invalidated reports distributed list has changed
     $archivesToPurgeDistributedList = new ArchivesToPurgeDistributedList();
     $yearMonths = $archivesToPurgeDistributedList->getAll();
     $this->assertEmpty($yearMonths);
 }
Exemplo n.º 3
0
 private function getArchivesToPurgeListContents()
 {
     $list = new ArchivesToPurgeDistributedList();
     $values = $list->getAll();
     return array_values($values);
 }