示例#1
0
 /**
  * @dataProvider getRecordNameWithoutChunkAppendixDataProvider
  */
 public function test_getRecordNameWithoutChunkAppendix_shouldSplitChunksIntoBitsOf100($realName, $recordName)
 {
     $this->assertSame($realName, $this->chunk->getRecordNameWithoutChunkAppendix($recordName));
 }
示例#2
0
 protected function moveChunkRowToRows(&$rows, $row, Chunk $chunk, $loadAllSubtables, $idSubtable)
 {
     // $blobs = array([subtableID] = [blob of subtableId])
     $blobs = unserialize($row['value']);
     if (!is_array($blobs)) {
         return;
     }
     // $rawName = eg 'PluginName_ArchiveName'
     $rawName = $chunk->getRecordNameWithoutChunkAppendix($row['name']);
     if ($loadAllSubtables) {
         foreach ($blobs as $subtableId => $blob) {
             $row['value'] = $blob;
             $row['name'] = ArchiveSelector::appendIdSubtable($rawName, $subtableId);
             $rows[] = $row;
         }
     } elseif (array_key_exists($idSubtable, $blobs)) {
         $row['value'] = $blobs[$idSubtable];
         $row['name'] = ArchiveSelector::appendIdSubtable($rawName, $idSubtable);
         $rows[] = $row;
     }
 }