|
6 | 6 | */
|
7 | 7 | namespace Magento\Cms\Model\Wysiwyg\Images;
|
8 | 8 |
|
| 9 | +use Magento\Cms\Model\Wysiwyg\Images\Storage\Collection; |
9 | 10 | use Magento\Framework\App\Filesystem\DirectoryList;
|
| 11 | +use Magento\Framework\DataObject; |
10 | 12 | use Magento\Framework\Filesystem;
|
11 | 13 | use Magento\Framework\Filesystem\Driver\File;
|
12 | 14 | use Magento\Framework\Filesystem\DriverInterface;
|
@@ -105,18 +107,19 @@ public function testGetFilesCollection(): void
|
105 | 107 | );
|
106 | 108 | $this->storage->resizeFile($modifiableFilePath);
|
107 | 109 | $collection = $this->storage->getFilesCollection(self::$_baseDir, 'image');
|
108 |
| - $this->assertInstanceOf(\Magento\Cms\Model\Wysiwyg\Images\Storage\Collection::class, $collection); |
| 110 | + $this->assertInstanceOf(Collection::class, $collection); |
109 | 111 | foreach ($collection as $item) {
|
110 |
| - $this->assertInstanceOf(\Magento\Framework\DataObject::class, $item); |
| 112 | + $this->assertInstanceOf(DataObject::class, $item); |
111 | 113 | $this->assertStringEndsWith('/' . $fileName, $item->getUrl());
|
112 |
| - $this->assertMatchesRegularExpression( |
113 |
| - '/.thumbsMagentoCmsModelWysiwygImagesStorageTest/', |
114 |
| - 'http://%s/pub/%s/.thumbsMagentoCmsModelWysiwygImagesStorageTest/magento_image.jpg', |
115 |
| - $item->getThumbUrl() |
| 114 | + $this->assertEquals( |
| 115 | + '/pub/media/.thumbsMagentoCmsModelWysiwygImagesStorageTest/magento_image.jpg', |
| 116 | + parse_url($item->getThumbUrl(), PHP_URL_PATH), |
| 117 | + "Check if Thumbnail URL is equal to the generated URL" |
116 | 118 | );
|
117 | 119 | $this->assertEquals(
|
118 | 120 | 'image/jpeg',
|
119 |
| - $item->getMimeType() |
| 121 | + $item->getMimeType(), |
| 122 | + "Check if Mime Type is equal to the image in the file system" |
120 | 123 | );
|
121 | 124 | return;
|
122 | 125 | }
|
|
0 commit comments