Example #1
0
 /**
  * @param \ArrayObject $fileInfo
  *
  * @return array
  */
 protected function extractFiles(\ArrayObject $fileInfo)
 {
     $result = [];
     /** @var \Generated\Shared\Transfer\AttachmentTransfer $file */
     foreach ($fileInfo as $file) {
         $result[] = ['type' => $this->inclusionHandler->guessType($file->getFileName()), 'name' => $file->getDisplayName() ? $file->getDisplayName() : $this->inclusionHandler->getFilename($file->getFileName()), 'content' => $this->inclusionHandler->encodeBase64($file->getFileName())];
     }
     return $result;
 }
Example #2
0
 /**
  * @return void
  */
 public function testGetFilename()
 {
     $textFilePath = __DIR__ . '/testfile.txt';
     $this->assertEquals('testfile.txt', $this->inclusionHandler->getFilename($textFilePath));
 }