Skip to content

Commit 5aceeab

Browse files
committed
- Add rollback for media_asset fixture.
- fix typo
1 parent e69ee88 commit 5aceeab

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

dev/tests/integration/testsuite/Magento/MediaGallery/Model/File/Command/DeleteByAssertIdTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
use Magento\MediaGalleryApi\Model\Asset\Command\GetByIdInterface;
1515

1616
/**
17-
* Test methods of class DeleteByPath
17+
* Test methods of class DeleteByAssertIdTest
1818
*/
1919
class DeleteByAssertIdTest extends \PHPUnit\Framework\TestCase
2020
{
@@ -24,7 +24,7 @@ class DeleteByAssertIdTest extends \PHPUnit\Framework\TestCase
2424
private CONST TEST_DIRECTORY_NAME = 'testDirectory';
2525

2626
/**
27-
* Absolute path to the media direcrory
27+
* Absolute path to the media directory
2828
*/
2929
private static $_mediaPath;
3030

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
declare(strict_types=1);
8+
9+
use Magento\MediaGalleryApi\Model\Asset\Command\DeleteByPathInterface;
10+
use Magento\TestFramework\Helper\Bootstrap;
11+
12+
$objectManager = Bootstrap::getObjectManager();
13+
14+
/** @var DeleteByPathInterface $mediaSave */
15+
$mediaAssetDelete = $objectManager->get(DeleteByPathInterface::class);
16+
17+
try {
18+
$mediaAssetDelete->execute('testDirectory/path.jpg');
19+
} catch (\Exception $exception) {
20+
21+
}
22+

0 commit comments

Comments
 (0)