diff --git a/MediaGalleryMetadata/Test/Integration/Model/AddMetadataTest.php b/MediaGalleryMetadata/Test/Integration/Model/AddMetadataTest.php deleted file mode 100644 index 2c677398df0a..000000000000 --- a/MediaGalleryMetadata/Test/Integration/Model/AddMetadataTest.php +++ /dev/null @@ -1,150 +0,0 @@ -addMetadata = Bootstrap::getObjectManager()->get(AddMetadataInterface::class); - $this->varDirectory = Bootstrap::getObjectManager()->get(Filesystem::class) - ->getDirectoryWrite(DirectoryList::VAR_DIR); - $this->driver = Bootstrap::getObjectManager()->get(DriverInterface::class); - $this->metadataFactory = Bootstrap::getObjectManager()->get(MetadataInterfaceFactory::class); - $this->extractMetadata = Bootstrap::getObjectManager()->get(ExtractMetadataInterface::class); - } - - /** - * Test for ExtractMetadata::execute - * - * @dataProvider filesProvider - * @param string $fileName - * @param string $title - * @param string $description - * @param array $keywords - * @throws LocalizedException - */ - public function testExecute( - string $fileName, - string $title, - string $description, - array $keywords - ): void { - $path = realpath(__DIR__ . '/../../_files/' . $fileName); - $modifiableFilePath = $this->varDirectory->getAbsolutePath($fileName); - $this->driver->copy( - $path, - $modifiableFilePath - ); - $metadata = $this->metadataFactory->create([ - 'title' => $title, - 'description' => $description, - 'keywords' => $keywords - ]); - - $this->addMetadata->execute($modifiableFilePath, $metadata); - - $updatedMetadata = $this->extractMetadata->execute($modifiableFilePath); - - $this->assertEquals($title, $updatedMetadata->getTitle()); - $this->assertEquals($description, $updatedMetadata->getDescription()); - $this->assertEquals($keywords, $updatedMetadata->getKeywords()); - - $this->driver->deleteFile($modifiableFilePath); - } - - /** - * Data provider for testExecute - * - * @return array[] - */ - public function filesProvider(): array - { - return [ - [ - 'macos-photos.jpeg', - 'Updated Title', - 'Updated Description', - [ - 'magento2', - 'mediagallery' - ] - ], - [ - 'iptc_only.jpeg', - 'Updated Title', - 'Updated Description', - [ - 'magento2', - 'mediagallery' - ] - ], - [ - 'macos-preview.png', - 'Title of the magento image 2', - 'Description of the magento image 2', - [ - 'magento2', - 'community' - ] - ], - [ - 'empty_xmp_image.jpeg', - 'Title of the magento image', - 'Description of the magento image 2', - [ - 'magento2', - 'community' - ] - ] - - ]; - } -} diff --git a/MediaGalleryMetadata/Test/Integration/Model/ExtractMetadataTest.php b/MediaGalleryMetadata/Test/Integration/Model/ExtractMetadataTest.php deleted file mode 100644 index a813684c7d3b..000000000000 --- a/MediaGalleryMetadata/Test/Integration/Model/ExtractMetadataTest.php +++ /dev/null @@ -1,103 +0,0 @@ -extractMetadata = Bootstrap::getObjectManager()->get(ExtractMetadataInterface::class); - } - - /** - * Test for ExtractMetadata::execute - * - * @dataProvider filesProvider - * @param string $fileName - * @param string $title - * @param string $description - * @param array $keywords - * @throws LocalizedException - */ - public function testExecute( - string $fileName, - string $title, - string $description, - array $keywords - ): void { - $path = realpath(__DIR__ . '/../../_files/' . $fileName); - $metadata = $this->extractMetadata->execute($path); - - $this->assertEquals($title, $metadata->getTitle()); - $this->assertEquals($description, $metadata->getDescription()); - $this->assertEquals($keywords, $metadata->getKeywords()); - } - - /** - * Data provider for testExecute - * - * @return array[] - */ - public function filesProvider(): array - { - return [ - [ - 'macos-photos.jpeg', - 'Title of the magento image', - 'Description of the magento image', - [ - 'magento', - 'mediagallerymetadata' - ] - ], - [ - 'macos-preview.png', - 'Title of the magento image', - 'Description of the magento image', - [ - 'magento', - 'mediagallerymetadata' - ] - ], - [ - 'iptc_only.jpeg', - 'Title of the magento image', - 'Description of the magento image', - [ - 'magento', - 'mediagallerymetadata' - ] - ], - [ - 'exiftool.gif', - 'Title of the magento image', - 'Description of the magento image', - [ - 'magento', - 'mediagallerymetadata' - ] - ] - ]; - } -} diff --git a/MediaGalleryMetadata/Test/_files/empty_xmp_image.jpeg b/MediaGalleryMetadata/Test/_files/empty_xmp_image.jpeg deleted file mode 100644 index cee7bff38a6c..000000000000 Binary files a/MediaGalleryMetadata/Test/_files/empty_xmp_image.jpeg and /dev/null differ diff --git a/MediaGalleryMetadata/Test/_files/exiftool.gif b/MediaGalleryMetadata/Test/_files/exiftool.gif deleted file mode 100644 index 70574d70b609..000000000000 Binary files a/MediaGalleryMetadata/Test/_files/exiftool.gif and /dev/null differ diff --git a/MediaGalleryMetadata/Test/_files/iptc_only.jpeg b/MediaGalleryMetadata/Test/_files/iptc_only.jpeg deleted file mode 100644 index 5d7dba35fede..000000000000 Binary files a/MediaGalleryMetadata/Test/_files/iptc_only.jpeg and /dev/null differ diff --git a/MediaGalleryMetadata/Test/_files/macos-photos.jpeg b/MediaGalleryMetadata/Test/_files/macos-photos.jpeg deleted file mode 100644 index 10c6ca9438ca..000000000000 Binary files a/MediaGalleryMetadata/Test/_files/macos-photos.jpeg and /dev/null differ diff --git a/MediaGalleryMetadata/Test/_files/macos-preview.png b/MediaGalleryMetadata/Test/_files/macos-preview.png deleted file mode 100644 index 966520f0d011..000000000000 Binary files a/MediaGalleryMetadata/Test/_files/macos-preview.png and /dev/null differ