Skip to content

Commit

Permalink
Merge branch '2.4-develop' into refactoring-AdminUpdateSimpleProductW…
Browse files Browse the repository at this point in the history
…ithRegularPriceInStockNotVisibleIndividuallyTest
  • Loading branch information
kate-kyzyma committed Mar 16, 2021
2 parents 920867a + 592c792 commit 1e4fcb1
Show file tree
Hide file tree
Showing 12 changed files with 92 additions and 3 deletions.
33 changes: 33 additions & 0 deletions app/code/Magento/AwsS3/Test/Mftf/Helper/S3FileAssertions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down Expand Up @@ -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
*
Expand Down
35 changes: 35 additions & 0 deletions app/code/Magento/Catalog/Test/Mftf/Helper/LocalFileAssertions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down Expand Up @@ -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
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
*
* @api
* @since 100.0.2
*
* @deprecated Database Media Storage is deprecated
*
*/
class Database extends \Magento\Framework\App\Helper\AbstractHelper
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)')]
];
}
}
2 changes: 2 additions & 0 deletions app/code/Magento/MediaStorage/Model/File/Storage/Database.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@

/**
* Class AbstractDatabase
*/
*
* @deprecated Database Media Storage is deprecated
*
**/
abstract class AbstractDatabase extends \Magento\Framework\Model\AbstractModel
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

/**
* Class AbstractStorage
*
* @deprecated Database Media Storage is deprecated
*/
abstract class AbstractStorage extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

/**
* Class Database
*
* @deprecated Database Media Storage is deprecated
*/
class Database extends \Magento\MediaStorage\Model\ResourceModel\File\Storage\AbstractStorage
{
Expand Down

0 comments on commit 1e4fcb1

Please sign in to comment.