Skip to content

Commit f894321

Browse files
engcom-FoxtrotNazar65
authored andcommitted
refactor integration tests, change fixtures
1 parent 94b6a17 commit f894321

File tree

6 files changed

+17
-16
lines changed

6 files changed

+17
-16
lines changed

app/code/Magento/SalesSequence/Model/Sequence/DeleteByStore.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
use Magento\SalesSequence\Model\ResourceModel\Meta as ResourceMetadata;
1313

1414
/**
15-
* Class DeleteByStore
15+
* Delete Sequence by Store.
1616
*/
1717
class DeleteByStore
1818
{

app/code/Magento/SalesSequence/Observer/SequenceRemovalObserver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
use Magento\SalesSequence\Model\Sequence\DeleteByStore;
1313

1414
/**
15-
* Class SequenceRemovalObserver
15+
* Observer for Sequence Removal.
1616
*/
1717
class SequenceRemovalObserver implements ObserverInterface
1818
{

app/code/Magento/SalesSequence/Test/Unit/Model/Sequence/DeleteByStoreTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
use PHPUnit\Framework\TestCase;
1818

1919
/**
20-
* Class DeleteByStoreTest
20+
* Test for \Magento\SalesSequence\Model\Sequence\DeleteByStore class.
2121
*/
2222
class DeleteByStoreTest extends TestCase
2323
{

dev/tests/integration/framework/Magento/TestFramework/Application.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ private function copyAppConfigFiles()
558558
}
559559
}
560560
}
561-
561+
562562
/**
563563
* Copies global configuration file from the tests folder (see TESTS_GLOBAL_CONFIG_FILE)
564564
*

dev/tests/integration/testsuite/Magento/Catalog/Model/Product/UrlTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ public function testGetUrlInStore()
5353
* @magentoConfigFixture fixturestore_store web/unsecure/base_url http://sample-second.com/
5454
* @magentoConfigFixture fixturestore_store web/unsecure/base_link_url http://sample-second.com/
5555
* @magentoDataFixture Magento/Catalog/_files/product_simple_multistore.php
56-
* @magentoDbIsolation enabled
5756
* @dataProvider getUrlsWithSecondStoreProvider
57+
* @magentoDbIsolation disabled
5858
* @magentoAppArea adminhtml
5959
*/
6060
public function testGetUrlInStoreWithSecondStore($storeCode, $expectedProductUrl)

dev/tests/integration/testsuite/Magento/Store/Model/StoreTest.php

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -278,8 +278,8 @@ public function testIsCanDelete()
278278

279279
/**
280280
* @magentoDataFixture Magento/Store/_files/core_second_third_fixturestore.php
281-
* @magentoDataFixture Magento/Catalog/_files/product_simple.php
282-
* @magentoDbIsolation disabled
281+
* @magentoDataFixture Magento/Catalog/_files/products.php
282+
* @magentoAppIsolation enabled
283283
*/
284284
public function testGetCurrentUrl()
285285
{
@@ -318,8 +318,9 @@ public function testGetCurrentUrl()
318318
}
319319

320320
/**
321-
* @magentoDataFixture Magento/Store/_files/second_store.php
322-
* @magentoDataFixture Magento/Catalog/_files/category_product.php
321+
* @magentoDataFixture Magento/Store/_files/core_second_third_fixturestore.php
322+
* @magentoDataFixture Magento/Catalog/_files/products.php
323+
* @magentoAppIsolation enabled
323324
* @magentoDbIsolation enabled
324325
*/
325326
public function testGetCurrentUrlWithUseStoreInUrlFalse()
@@ -329,34 +330,34 @@ public function testGetCurrentUrlWithUseStoreInUrlFalse()
329330
->setValue('web/url/use_store', false, ScopeInterface::SCOPE_STORE, 'default');
330331

331332
/** @var \Magento\Store\Model\Store $secondStore */
332-
$secondStore = $objectManager->get(StoreRepositoryInterface::class)->get('fixture_second_store');
333+
$secondStore = $objectManager->get(StoreRepositoryInterface::class)->get('secondstore');
333334

334335
/** @var \Magento\Catalog\Model\ProductRepository $productRepository */
335336
$productRepository = $objectManager->create(ProductRepository::class);
336-
$product = $productRepository->get('simple333');
337+
$product = $productRepository->get('simple');
337338

338339
$product->setStoreId($secondStore->getId());
339340
$url = $product->getUrlInStore();
340341

341342
/** @var \Magento\Catalog\Model\CategoryRepository $categoryRepository */
342343
$categoryRepository = $objectManager->get(\Magento\Catalog\Model\CategoryRepository::class);
343-
$category = $categoryRepository->get(333, $secondStore->getStoreId());
344+
$category = $categoryRepository->get(2, $secondStore->getStoreId());
344345

345346
$this->assertEquals(
346-
$secondStore->getBaseUrl() . 'catalog/category/view/s/category-1/id/333/',
347+
$secondStore->getBaseUrl() . 'catalog/category/view/s/default-category/id/2/',
347348
$category->getUrl()
348349
);
349350
$this->assertEquals(
350351
$secondStore->getBaseUrl() .
351-
'catalog/product/view/id/333/s/simple-product-three/?___store=fixture_second_store',
352+
'catalog/product/view/id/1/s/simple-product/?___store=secondstore',
352353
$url
353354
);
354355
$this->assertEquals(
355-
$secondStore->getBaseUrl() . '?___store=fixture_second_store&___from_store=default',
356+
$secondStore->getBaseUrl() . '?___store=secondstore&___from_store=default',
356357
$secondStore->getCurrentUrl()
357358
);
358359
$this->assertEquals(
359-
$secondStore->getBaseUrl() . '?___store=fixture_second_store',
360+
$secondStore->getBaseUrl() . '?___store=secondstore',
360361
$secondStore->getCurrentUrl(false)
361362
);
362363
}

0 commit comments

Comments
 (0)