Skip to content

Commit

Permalink
Fixed Integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
konarshankar07 committed Sep 4, 2020
1 parent 1209868 commit 60c0163
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,22 +98,24 @@ public function testGetFilesCollection(): void
$fileName = 'magento_image.jpg';
$imagePath = realpath(__DIR__ . '/../../../../Catalog/_files/' . $fileName);
$mediaDirectory = $this->filesystem->getDirectoryWrite(DirectoryList::MEDIA);
$modifiableFilePath = $mediaDirectory->getAbsolutePath($fileName);
$modifiableFilePath = $mediaDirectory->getAbsolutePath('MagentoCmsModelWysiwygImagesStorageTest/' . $fileName);
$this->driver->copy(
$imagePath,
$modifiableFilePath
);
$collection = $this->storage->getFilesCollection(self::$_baseDir, 'media');
$this->storage->resizeFile($modifiableFilePath);
$collection = $this->storage->getFilesCollection(self::$_baseDir, 'image');
$this->assertInstanceOf(\Magento\Cms\Model\Wysiwyg\Images\Storage\Collection::class, $collection);
foreach ($collection as $item) {
$this->assertInstanceOf(\Magento\Framework\DataObject::class, $item);
$this->assertStringEndsWith('/' . $fileName, $item->getUrl());
$this->assertStringMatchesFormat(
'http://%s/static/%s/adminhtml/%s/%s/Magento_Cms/images/magento_image.jpg',
$this->assertMatchesRegularExpression(
'/.thumbsMagentoCmsModelWysiwygImagesStorageTest/',
'http://%s/pub/%s/.thumbsMagentoCmsModelWysiwygImagesStorageTest/magento_image.jpg',
$item->getThumbUrl()
);
$this->assertEquals(
'jpg',
'image/jpeg',
$item->getMimeType()
);
return;
Expand Down

0 comments on commit 60c0163

Please sign in to comment.