Skip to content

Commit 1e4fcb1

Browse files
committed
Merge branch '2.4-develop' into refactoring-AdminUpdateSimpleProductWithRegularPriceInStockNotVisibleIndividuallyTest
2 parents 920867a + 592c792 commit 1e4fcb1

File tree

12 files changed

+92
-3
lines changed

12 files changed

+92
-3
lines changed

app/code/Magento/AwsS3/Test/Mftf/Helper/S3FileAssertions.php

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,21 @@ public function assertFileExists($filePath, $message = ''): void
149149
$this->assertTrue($this->driver->isExists($filePath), $message);
150150
}
151151

152+
/**
153+
* Asserts that a file with the given glob pattern exists in the given path on the remote storage system
154+
*
155+
* @param string $path
156+
* @param string $pattern
157+
* @param string $message
158+
*
159+
* @throws \Magento\Framework\Exception\FileSystemException
160+
*/
161+
public function assertGlobbedFileExists($path, $pattern, $message = ""): void
162+
{
163+
$files = $this->driver->search($pattern, $path);
164+
$this->assertNotEmpty($files, $message);
165+
}
166+
152167
/**
153168
* Assert a file does not exist on the remote storage system
154169
*
@@ -206,6 +221,24 @@ public function assertFileContainsString($filePath, $text, $message = ""): void
206221
$this->assertStringContainsString($text, $this->driver->fileGetContents($filePath), $message);
207222
}
208223

224+
/**
225+
* Asserts that a file with the given glob pattern at the given path on the remote storage system contains a given string
226+
*
227+
* @param string $path
228+
* @param string $pattern
229+
* @param string $text
230+
* @param int $fileIndex
231+
* @param string $message
232+
* @return void
233+
*
234+
* @throws \Magento\Framework\Exception\FileSystemException
235+
*/
236+
public function assertGlobbedFileContainsString($path, $pattern, $text, $fileIndex = 0, $message = ""): void
237+
{
238+
$files = $this->driver->search($pattern, $path);
239+
$this->assertStringContainsString($text, $this->driver->fileGetContents($files[$fileIndex] ?? ''), $message);
240+
}
241+
209242
/**
210243
* Assert a file on the remote storage system does not contain a given string
211244
*

app/code/Magento/Catalog/Test/Mftf/Helper/LocalFileAssertions.php

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,22 @@ public function assertFileExists($filePath, $message = ''): void
134134
$this->assertTrue($this->driver->isExists($realPath), $message);
135135
}
136136

137+
/**
138+
* Asserts that a file with the given glob pattern exists in the given path
139+
*
140+
* @param string $path
141+
* @param string $pattern
142+
* @param string $message
143+
*
144+
* @throws \Magento\Framework\Exception\FileSystemException
145+
*/
146+
public function assertGlobbedFileExists($path, $pattern, $message = ""): void
147+
{
148+
$realPath = $this->expandPath($path);
149+
$files = $this->driver->search($pattern, $realPath);
150+
$this->assertNotEmpty($files, $message);
151+
}
152+
137153
/**
138154
* Assert a file does not exist
139155
*
@@ -195,6 +211,25 @@ public function assertFileContainsString($filePath, $text, $message = ""): void
195211
$this->assertStringContainsString($text, $this->driver->fileGetContents($realPath), $message);
196212
}
197213

214+
/**
215+
* Asserts that a file with the given glob pattern at the given path contains a given string
216+
*
217+
* @param string $path
218+
* @param string $pattern
219+
* @param string $text
220+
* @param int $fileIndex
221+
* @param string $message
222+
* @return void
223+
*
224+
* @throws \Magento\Framework\Exception\FileSystemException
225+
*/
226+
public function assertGlobbedFileContainsString($path, $pattern, $text, $fileIndex = 0, $message = ""): void
227+
{
228+
$realPath = $this->expandPath($path);
229+
$files = $this->driver->search($pattern, $realPath);
230+
$this->assertStringContainsString($text, $this->driver->fileGetContents($files[$fileIndex] ?? ''), $message);
231+
}
232+
198233
/**
199234
* Assert a file does not contain a given string
200235
*

app/code/Magento/MediaStorage/Helper/File/Storage/Database.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
*
1515
* @api
1616
* @since 100.0.2
17+
*
18+
* @deprecated Database Media Storage is deprecated
19+
*
1720
*/
1821
class Database extends \Magento\Framework\App\Helper\AbstractHelper
1922
{

app/code/Magento/MediaStorage/Model/Config/Backend/Storage/Media/Database.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
* See COPYING.txt for license details.
55
*/
66
namespace Magento\MediaStorage\Model\Config\Backend\Storage\Media;
7-
7+
/**
8+
* @deprecated Database Media Storage is deprecated
9+
**/
810
class Database extends \Magento\Framework\App\Config\Value
911
{
1012
/**

app/code/Magento/MediaStorage/Model/Config/Source/Storage/Media/Database.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
use Magento\Framework\App\DeploymentConfig;
1313
use Magento\Framework\Config\ConfigOptionsListConstants;
1414

15+
/**
16+
* @deprecated Database Media Storage is deprecated
17+
**/
1518
class Database implements \Magento\Framework\Option\ArrayInterface
1619
{
1720
/**

app/code/Magento/MediaStorage/Model/Config/Source/Storage/Media/Storage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function toOptionArray()
2323
'value' => \Magento\MediaStorage\Model\File\Storage::STORAGE_MEDIA_FILE_SYSTEM,
2424
'label' => __('File System'),
2525
],
26-
['value' => \Magento\MediaStorage\Model\File\Storage::STORAGE_MEDIA_DATABASE, 'label' => __('Database')]
26+
['value' => \Magento\MediaStorage\Model\File\Storage::STORAGE_MEDIA_DATABASE, 'label' => __('Database (Deprecated)')]
2727
];
2828
}
2929
}

app/code/Magento/MediaStorage/Model/File/Storage/Database.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
*
1111
* @api
1212
* @since 100.0.2
13+
*
14+
* @deprecated Database Media Storage is deprecated
1315
*/
1416
class Database extends \Magento\MediaStorage\Model\File\Storage\Database\AbstractDatabase
1517
{

app/code/Magento/MediaStorage/Model/File/Storage/Database/AbstractDatabase.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@
77

88
/**
99
* Class AbstractDatabase
10-
*/
10+
*
11+
* @deprecated Database Media Storage is deprecated
12+
*
13+
**/
1114
abstract class AbstractDatabase extends \Magento\Framework\Model\AbstractModel
1215
{
1316
/**

app/code/Magento/MediaStorage/Model/File/Storage/Directory/Database.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
*
1212
* @api
1313
* @since 100.0.2
14+
*
15+
* @deprecated Database Media Storage is deprecated
1416
*/
1517
class Database extends \Magento\MediaStorage\Model\File\Storage\Database\AbstractDatabase
1618
{

app/code/Magento/MediaStorage/Model/ResourceModel/File/Storage/AbstractStorage.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
/**
99
* Class AbstractStorage
10+
*
11+
* @deprecated Database Media Storage is deprecated
1012
*/
1113
abstract class AbstractStorage extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb
1214
{

app/code/Magento/MediaStorage/Model/ResourceModel/File/Storage/Database.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
*
1111
* @api
1212
* @since 100.0.2
13+
*
14+
* @deprecated Database Media Storage is deprecated
1315
*/
1416
class Database extends \Magento\MediaStorage\Model\ResourceModel\File\Storage\AbstractStorage
1517
{

app/code/Magento/MediaStorage/Model/ResourceModel/File/Storage/Directory/Database.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
/**
99
* Class Database
10+
*
11+
* @deprecated Database Media Storage is deprecated
1012
*/
1113
class Database extends \Magento\MediaStorage\Model\ResourceModel\File\Storage\AbstractStorage
1214
{

0 commit comments

Comments
 (0)