diff --git a/app/code/Magento/AwsS3/Test/Mftf/Helper/S3FileAssertions.php b/app/code/Magento/AwsS3/Test/Mftf/Helper/S3FileAssertions.php index e896901211cb1..cec553afe9463 100644 --- a/app/code/Magento/AwsS3/Test/Mftf/Helper/S3FileAssertions.php +++ b/app/code/Magento/AwsS3/Test/Mftf/Helper/S3FileAssertions.php @@ -149,6 +149,21 @@ public function assertFileExists($filePath, $message = ''): void $this->assertTrue($this->driver->isExists($filePath), $message); } + /** + * Asserts that a file with the given glob pattern exists in the given path on the remote storage system + * + * @param string $path + * @param string $pattern + * @param string $message + * + * @throws \Magento\Framework\Exception\FileSystemException + */ + public function assertGlobbedFileExists($path, $pattern, $message = ""): void + { + $files = $this->driver->search($pattern, $path); + $this->assertNotEmpty($files, $message); + } + /** * Assert a file does not exist on the remote storage system * @@ -206,6 +221,24 @@ public function assertFileContainsString($filePath, $text, $message = ""): void $this->assertStringContainsString($text, $this->driver->fileGetContents($filePath), $message); } + /** + * Asserts that a file with the given glob pattern at the given path on the remote storage system contains a given string + * + * @param string $path + * @param string $pattern + * @param string $text + * @param int $fileIndex + * @param string $message + * @return void + * + * @throws \Magento\Framework\Exception\FileSystemException + */ + public function assertGlobbedFileContainsString($path, $pattern, $text, $fileIndex = 0, $message = ""): void + { + $files = $this->driver->search($pattern, $path); + $this->assertStringContainsString($text, $this->driver->fileGetContents($files[$fileIndex] ?? ''), $message); + } + /** * Assert a file on the remote storage system does not contain a given string * diff --git a/app/code/Magento/Catalog/Test/Mftf/Helper/LocalFileAssertions.php b/app/code/Magento/Catalog/Test/Mftf/Helper/LocalFileAssertions.php index ed0e244c280dc..dbf777c1fe5c5 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Helper/LocalFileAssertions.php +++ b/app/code/Magento/Catalog/Test/Mftf/Helper/LocalFileAssertions.php @@ -134,6 +134,22 @@ public function assertFileExists($filePath, $message = ''): void $this->assertTrue($this->driver->isExists($realPath), $message); } + /** + * Asserts that a file with the given glob pattern exists in the given path + * + * @param string $path + * @param string $pattern + * @param string $message + * + * @throws \Magento\Framework\Exception\FileSystemException + */ + public function assertGlobbedFileExists($path, $pattern, $message = ""): void + { + $realPath = $this->expandPath($path); + $files = $this->driver->search($pattern, $realPath); + $this->assertNotEmpty($files, $message); + } + /** * Assert a file does not exist * @@ -195,6 +211,25 @@ public function assertFileContainsString($filePath, $text, $message = ""): void $this->assertStringContainsString($text, $this->driver->fileGetContents($realPath), $message); } + /** + * Asserts that a file with the given glob pattern at the given path contains a given string + * + * @param string $path + * @param string $pattern + * @param string $text + * @param int $fileIndex + * @param string $message + * @return void + * + * @throws \Magento\Framework\Exception\FileSystemException + */ + public function assertGlobbedFileContainsString($path, $pattern, $text, $fileIndex = 0, $message = ""): void + { + $realPath = $this->expandPath($path); + $files = $this->driver->search($pattern, $realPath); + $this->assertStringContainsString($text, $this->driver->fileGetContents($files[$fileIndex] ?? ''), $message); + } + /** * Assert a file does not contain a given string * diff --git a/app/code/Magento/MediaStorage/Helper/File/Storage/Database.php b/app/code/Magento/MediaStorage/Helper/File/Storage/Database.php index 05e2e836abada..e0f5509830a0c 100644 --- a/app/code/Magento/MediaStorage/Helper/File/Storage/Database.php +++ b/app/code/Magento/MediaStorage/Helper/File/Storage/Database.php @@ -14,6 +14,9 @@ * * @api * @since 100.0.2 + * + * @deprecated Database Media Storage is deprecated + * */ class Database extends \Magento\Framework\App\Helper\AbstractHelper { diff --git a/app/code/Magento/MediaStorage/Model/Config/Backend/Storage/Media/Database.php b/app/code/Magento/MediaStorage/Model/Config/Backend/Storage/Media/Database.php index 1a55be299a75b..81e6c5e028be1 100644 --- a/app/code/Magento/MediaStorage/Model/Config/Backend/Storage/Media/Database.php +++ b/app/code/Magento/MediaStorage/Model/Config/Backend/Storage/Media/Database.php @@ -4,7 +4,9 @@ * See COPYING.txt for license details. */ namespace Magento\MediaStorage\Model\Config\Backend\Storage\Media; - +/** +* @deprecated Database Media Storage is deprecated +**/ class Database extends \Magento\Framework\App\Config\Value { /** diff --git a/app/code/Magento/MediaStorage/Model/Config/Source/Storage/Media/Database.php b/app/code/Magento/MediaStorage/Model/Config/Source/Storage/Media/Database.php index 83134c2ac00ef..97f161e4c49d8 100644 --- a/app/code/Magento/MediaStorage/Model/Config/Source/Storage/Media/Database.php +++ b/app/code/Magento/MediaStorage/Model/Config/Source/Storage/Media/Database.php @@ -12,6 +12,9 @@ use Magento\Framework\App\DeploymentConfig; use Magento\Framework\Config\ConfigOptionsListConstants; +/** + * @deprecated Database Media Storage is deprecated + **/ class Database implements \Magento\Framework\Option\ArrayInterface { /** diff --git a/app/code/Magento/MediaStorage/Model/Config/Source/Storage/Media/Storage.php b/app/code/Magento/MediaStorage/Model/Config/Source/Storage/Media/Storage.php index fb171831407e2..c881b59c5c593 100644 --- a/app/code/Magento/MediaStorage/Model/Config/Source/Storage/Media/Storage.php +++ b/app/code/Magento/MediaStorage/Model/Config/Source/Storage/Media/Storage.php @@ -23,7 +23,7 @@ public function toOptionArray() 'value' => \Magento\MediaStorage\Model\File\Storage::STORAGE_MEDIA_FILE_SYSTEM, 'label' => __('File System'), ], - ['value' => \Magento\MediaStorage\Model\File\Storage::STORAGE_MEDIA_DATABASE, 'label' => __('Database')] + ['value' => \Magento\MediaStorage\Model\File\Storage::STORAGE_MEDIA_DATABASE, 'label' => __('Database (Deprecated)')] ]; } } diff --git a/app/code/Magento/MediaStorage/Model/File/Storage/Database.php b/app/code/Magento/MediaStorage/Model/File/Storage/Database.php index 2bdc69f45ccb8..571dad7f0ae9a 100644 --- a/app/code/Magento/MediaStorage/Model/File/Storage/Database.php +++ b/app/code/Magento/MediaStorage/Model/File/Storage/Database.php @@ -10,6 +10,8 @@ * * @api * @since 100.0.2 + * + * @deprecated Database Media Storage is deprecated */ class Database extends \Magento\MediaStorage\Model\File\Storage\Database\AbstractDatabase { diff --git a/app/code/Magento/MediaStorage/Model/File/Storage/Database/AbstractDatabase.php b/app/code/Magento/MediaStorage/Model/File/Storage/Database/AbstractDatabase.php index c9812b86e8b91..3528ca5743ff7 100644 --- a/app/code/Magento/MediaStorage/Model/File/Storage/Database/AbstractDatabase.php +++ b/app/code/Magento/MediaStorage/Model/File/Storage/Database/AbstractDatabase.php @@ -7,7 +7,10 @@ /** * Class AbstractDatabase - */ + * + * @deprecated Database Media Storage is deprecated + * + **/ abstract class AbstractDatabase extends \Magento\Framework\Model\AbstractModel { /** diff --git a/app/code/Magento/MediaStorage/Model/File/Storage/Directory/Database.php b/app/code/Magento/MediaStorage/Model/File/Storage/Directory/Database.php index 2617e88e7538a..03d5eee617b1b 100644 --- a/app/code/Magento/MediaStorage/Model/File/Storage/Directory/Database.php +++ b/app/code/Magento/MediaStorage/Model/File/Storage/Directory/Database.php @@ -11,6 +11,8 @@ * * @api * @since 100.0.2 + * + * @deprecated Database Media Storage is deprecated */ class Database extends \Magento\MediaStorage\Model\File\Storage\Database\AbstractDatabase { diff --git a/app/code/Magento/MediaStorage/Model/ResourceModel/File/Storage/AbstractStorage.php b/app/code/Magento/MediaStorage/Model/ResourceModel/File/Storage/AbstractStorage.php index 227b428328b79..0533c0229ea3d 100644 --- a/app/code/Magento/MediaStorage/Model/ResourceModel/File/Storage/AbstractStorage.php +++ b/app/code/Magento/MediaStorage/Model/ResourceModel/File/Storage/AbstractStorage.php @@ -7,6 +7,8 @@ /** * Class AbstractStorage + * + * @deprecated Database Media Storage is deprecated */ abstract class AbstractStorage extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb { diff --git a/app/code/Magento/MediaStorage/Model/ResourceModel/File/Storage/Database.php b/app/code/Magento/MediaStorage/Model/ResourceModel/File/Storage/Database.php index ae896395b8eb5..863b368883fbe 100644 --- a/app/code/Magento/MediaStorage/Model/ResourceModel/File/Storage/Database.php +++ b/app/code/Magento/MediaStorage/Model/ResourceModel/File/Storage/Database.php @@ -10,6 +10,8 @@ * * @api * @since 100.0.2 + * + * @deprecated Database Media Storage is deprecated */ class Database extends \Magento\MediaStorage\Model\ResourceModel\File\Storage\AbstractStorage { diff --git a/app/code/Magento/MediaStorage/Model/ResourceModel/File/Storage/Directory/Database.php b/app/code/Magento/MediaStorage/Model/ResourceModel/File/Storage/Directory/Database.php index e5f54cac4af6a..342761646e396 100644 --- a/app/code/Magento/MediaStorage/Model/ResourceModel/File/Storage/Directory/Database.php +++ b/app/code/Magento/MediaStorage/Model/ResourceModel/File/Storage/Directory/Database.php @@ -7,6 +7,8 @@ /** * Class Database + * + * @deprecated Database Media Storage is deprecated */ class Database extends \Magento\MediaStorage\Model\ResourceModel\File\Storage\AbstractStorage {