/**
  * @param Range $range
  * @param int $total
  * @return RangeFile
  */
 protected function createFileFromRangeAndTotal(Range $range, $total)
 {
     return PHPRangeFile::fromRangeAndTotal($this->basePath, $range, $total);
 }
 private function givenFileUnserializesTo(PHPRangeFile $file, array $characters)
 {
     $values = [];
     foreach ($characters as $i => $character) {
         $serialized = sprintf('serialized:%d', $i);
         $values[$i] = $serialized;
         $this->serializer->unserialize($serialized)->willReturn($character);
     }
     $file->read()->willReturn($values);
 }