public function testWithToDate()
 {
     $dbAdapter = $this->createDbAdapter(array('archive_numeric_2013_11', 'archive_numeric_2014_09', 'archive_numeric_2014_10', 'archive_numeric_2014_11', 'archive_numeric_2014_12', 'archive_numeric_2015_11'));
     $db = $this->createDbHelper($dbAdapter, '');
     $lister = new ArchiveLister($db);
     $expected = array('2013_11', '2014_09', '2014_10', '2014_11');
     $this->assertEquals($expected, $lister->getArchiveList(null, new \DateTime('2014-11-01')));
 }
 public function migrate($siteId, \DateTime $from = null, \DateTime $to = null)
 {
     $archives = $this->archiveLister->getArchiveList($from, $to);
     foreach ($archives as $archiveDate) {
         Log::debug('Migrating archive ' . $archiveDate);
         $this->migrateArchive($archiveDate, 'archive_numeric_' . $archiveDate, $siteId);
         try {
             $this->migrateArchive($archiveDate, 'archive_blob_' . $archiveDate, $siteId);
         } catch (\Exception $e) {
             // blob tables can be missing
         }
     }
 }