|
5 | 5 | */ |
6 | 6 | namespace Magento\BundleImportExport\Model\Import\Product\Type; |
7 | 7 |
|
8 | | -use Magento\Framework\App\Bootstrap; |
| 8 | +use Magento\TestFramework\Helper\Bootstrap; |
9 | 9 | use Magento\Framework\App\Filesystem\DirectoryList; |
10 | | -use Magento\ImportExport\Model\Import; |
11 | 10 |
|
12 | 11 | /** |
13 | 12 | * @magentoAppArea adminhtml |
| 13 | + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) |
14 | 14 | */ |
15 | | -class BundleTest extends \PHPUnit\Framework\TestCase |
| 15 | +class BundleTest extends \Magento\TestFramework\Indexer\TestCase |
16 | 16 | { |
17 | 17 | /** |
18 | 18 | * Bundle product test Name |
@@ -41,9 +41,22 @@ class BundleTest extends \PHPUnit\Framework\TestCase |
41 | 41 | */ |
42 | 42 | protected $optionSkuList = ['Simple 1', 'Simple 2', 'Simple 3']; |
43 | 43 |
|
| 44 | + public static function setUpBeforeClass() |
| 45 | + { |
| 46 | + $db = Bootstrap::getInstance()->getBootstrap() |
| 47 | + ->getApplication() |
| 48 | + ->getDbInstance(); |
| 49 | + if (!$db->isDbDumpExists()) { |
| 50 | + throw new \LogicException('DB dump does not exist.'); |
| 51 | + } |
| 52 | + $db->restoreFromDbDump(); |
| 53 | + |
| 54 | + parent::setUpBeforeClass(); |
| 55 | + } |
| 56 | + |
44 | 57 | protected function setUp() |
45 | 58 | { |
46 | | - $this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); |
| 59 | + $this->objectManager = Bootstrap::getObjectManager(); |
47 | 60 | $this->model = $this->objectManager->create(\Magento\CatalogImportExport\Model\Import\Product::class); |
48 | 61 | } |
49 | 62 |
|
@@ -122,6 +135,7 @@ public function testBundleImport() |
122 | 135 |
|
123 | 136 | /** |
124 | 137 | * @magentoDataFixture Magento/Store/_files/second_store.php |
| 138 | + * @magentoDbIsolation disabled |
125 | 139 | * @magentoAppArea adminhtml |
126 | 140 | * @return void |
127 | 141 | */ |
@@ -179,4 +193,12 @@ public function testBundleImportWithMultipleStoreViews(): void |
179 | 193 | } |
180 | 194 | } |
181 | 195 | } |
| 196 | + |
| 197 | + /** |
| 198 | + * teardown |
| 199 | + */ |
| 200 | + public function tearDown() |
| 201 | + { |
| 202 | + parent::tearDown(); |
| 203 | + } |
182 | 204 | } |
0 commit comments