Skip to content

Commit be7872a

Browse files
committed
remove clearing cache for integration tests
1 parent f55f411 commit be7872a

File tree

25 files changed

+1
-41
lines changed

25 files changed

+1
-41
lines changed

dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductSearchTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@ private function compareFilterNames(array $a, array $b)
154154
*/
155155
public function testLayeredNavigationForConfigurableProducts()
156156
{
157-
CacheCleaner::cleanAll();
158157
$attributeCode = 'test_configurable';
159158

160159
/** @var Config $eavConfig */
@@ -258,7 +257,7 @@ private function getQueryProductsWithArrayOfCustomAttributes($attributeCode, $fi
258257
*/
259258
public function testFilterProductsByDropDownCustomAttribute()
260259
{
261-
CacheCleaner::cleanAll();
260+
CacheCleaner::clean(['eav']);
262261
$attributeCode = 'second_test_configurable';
263262
$optionValue = $this->getDefaultAttributeOptionValue($attributeCode);
264263
$query = <<<QUERY

dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogUrlRewrite/UrlResolverTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,6 @@ public function testRedirectsAndCustomInput()
224224
$urlRewriteModel->setId($urlRewriteModel->getId());
225225
$urlRewriteModel->save();
226226

227-
ObjectManager::getInstance()->get(\Magento\TestFramework\Helper\CacheCleaner::class)->cleanAll();
228-
229227
//modifying query by adding spaces to avoid getting cached values.
230228
$this->queryUrlAndAssertResponse(
231229
(int) $product->getEntityId(),

dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/ProductTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,6 @@ public function testSaveActionAndDuplicateWithUrlPathAttribute()
138138
$urlPathAttribute = $product->getCustomAttribute('url_path');
139139
$this->assertEquals($urlPathAttribute->getValue(), $product->getSku());
140140

141-
// clean cache
142-
CacheCleaner::cleanAll();
143-
144141
// dispatch Save&Duplicate action and check it
145142
$this->assertSaveAndDuplicateAction($product);
146143
}

dev/tests/integration/testsuite/Magento/Catalog/Model/ConfigTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ protected function setUp(): void
3131
public function testGetEntityAttributeCodes()
3232
{
3333
$entityType = 'catalog_product';
34-
CacheCleaner::cleanAll();
3534
$this->assertEquals(
3635
$this->config->getEntityAttributeCodes($entityType),
3736
$this->config->getEntityAttributeCodes($entityType)
@@ -42,7 +41,6 @@ public function testGetAttribute()
4241
{
4342
$entityType = 'catalog_product';
4443
$attributeCode = 'color';
45-
CacheCleaner::cleanAll();
4644
$this->assertEquals(
4745
$this->config->getAttribute($entityType, $attributeCode),
4846
$this->config->getAttribute($entityType, $attributeCode)
@@ -52,7 +50,6 @@ public function testGetAttribute()
5250
public function testGetEntityType()
5351
{
5452
$entityType = 'catalog_product';
55-
CacheCleaner::cleanAll();
5653
$this->assertEquals(
5754
$this->config->getEntityType($entityType),
5855
$this->config->getEntityType($entityType)

dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Source/CountryofmanufactureTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ protected function setUp(): void
2424

2525
public function testGetAllOptions()
2626
{
27-
CacheCleaner::cleanAll();
2827
$allOptions = $this->model->getAllOptions();
2928
$cachedAllOptions = $this->model->getAllOptions();
3029
$this->assertEquals($allOptions, $cachedAllOptions);

dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/Attribute/Entity/AttributeTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ class AttributeTest extends \PHPUnit\Framework\TestCase
5252
*/
5353
protected function setUp(): void
5454
{
55-
CacheCleaner::cleanAll();
5655
$this->objectManager = Bootstrap::getObjectManager();
5756
$this->productRepository = $this->objectManager->get(ProductRepositoryInterface::class);
5857
$this->attributeRepository = $this->objectManager->get(AttributeRepository::class);

dev/tests/integration/testsuite/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/CategoriesTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ public function testModifyMeta()
3939
{
4040
$inputMeta = include __DIR__ . '/_files/input_meta_for_categories.php';
4141
$expectedCategories = include __DIR__ . '/_files/expected_categories.php';
42-
CacheCleaner::cleanAll();
4342
$this->assertCategoriesInMeta($expectedCategories, $this->object->modifyMeta($inputMeta));
4443
// Verify cached data
4544
$this->assertCategoriesInMeta($expectedCategories, $this->object->modifyMeta($inputMeta));

dev/tests/integration/testsuite/Magento/Customer/Model/AddressMetadataTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ class AddressMetadataTest extends \PHPUnit\Framework\TestCase
1919

2020
protected function setUp(): void
2121
{
22-
CacheCleaner::cleanAll();
2322
$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
2423
$objectManager->configure(
2524
[

dev/tests/integration/testsuite/Magento/Customer/Model/CustomerMetadataTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ class CustomerMetadataTest extends \PHPUnit\Framework\TestCase
2929

3030
protected function setUp(): void
3131
{
32-
CacheCleaner::cleanAll();
3332
$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
3433
$objectManager->configure(
3534
[\Magento\Framework\Api\ExtensionAttribute\Config\Reader::class => [

dev/tests/integration/testsuite/Magento/Directory/Block/DataTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,13 @@ protected function setUp(): void
2222

2323
public function testGetCountryHtmlSelect()
2424
{
25-
CacheCleaner::cleanAll();
2625
$result = $this->block->getCountryHtmlSelect();
2726
$resultTwo = $this->block->getCountryHtmlSelect();
2827
$this->assertEquals($result, $resultTwo);
2928
}
3029

3130
public function testGetRegionHtmlSelect()
3231
{
33-
CacheCleaner::cleanAll();
3432
$result = $this->block->getRegionHtmlSelect();
3533
$resultTwo = $this->block->getRegionHtmlSelect();
3634
$this->assertEquals($result, $resultTwo);

dev/tests/integration/testsuite/Magento/Eav/Model/ConfigTest.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ protected function setUp(): void
3333
public function testGetEntityAttributeCodes()
3434
{
3535
$entityType = 'test';
36-
CacheCleaner::cleanAll();
3736
$entityAttributeCodes1 = $this->config->getEntityAttributeCodes($entityType);
3837
$this->assertEquals(
3938
[
@@ -60,7 +59,6 @@ public function testGetEntityAttributeCodesWithObject()
6059
$testEntityType = Bootstrap::getObjectManager()->create(\Magento\Eav\Model\Entity\Type::class)
6160
->loadByCode('test');
6261
$attributeSetId = $testEntityType->getDefaultAttributeSetId();
63-
CacheCleaner::cleanAll();
6462
$object = new DataObject(
6563
[
6664
'attribute_set_id' => $attributeSetId,
@@ -86,7 +84,6 @@ public function testGetEntityAttributeCodesWithObject()
8684
public function testGetAttributes()
8785
{
8886
$entityType = 'test';
89-
CacheCleaner::cleanAll();
9087
$attributes1 = $this->config->getAttributes($entityType);
9188
$expectedAttributeCodes = [
9289
'attribute_for_search_1',
@@ -111,7 +108,6 @@ public function testGetAttributes()
111108
public function testGetAttribute()
112109
{
113110
$entityType = 'test';
114-
CacheCleaner::cleanAll();
115111
$attribute1 = $this->config->getAttribute($entityType, 'attribute_for_search_1');
116112
$this->assertEquals('attribute_for_search_1', $attribute1->getAttributeCode());
117113
$this->assertEquals('varchar', $attribute1->getBackendType());
@@ -153,8 +149,6 @@ public function testGetAttributeWithCacheUserDefinedAttribute()
153149
$config = Bootstrap::getObjectManager()->create(\Magento\Eav\Model\Config::class);
154150
$updatedAttribute = $config->getAttribute($entityType, 'foo');
155151
$this->assertEquals('foo', $updatedAttribute->getFrontendLabel());
156-
// Clean cache
157-
CacheCleaner::cleanAll();
158152
$config = Bootstrap::getObjectManager()->create(\Magento\Eav\Model\Config::class);
159153
// Check that attribute data has changed
160154
$updatedAttributeAfterCacheClean = $config->getAttribute($entityType, 'foo');

dev/tests/integration/testsuite/Magento/Eav/Model/Entity/Attribute/Frontend/DefaultFrontendTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ class DefaultFrontendTest extends \PHPUnit\Framework\TestCase
5555

5656
protected function setUp(): void
5757
{
58-
CacheCleaner::cleanAll();
5958
$this->objectManager = Bootstrap::getObjectManager();
6059

6160
$this->defaultFrontend = $this->objectManager->get(DefaultFrontend::class);

dev/tests/integration/testsuite/Magento/Eav/Model/Entity/AttributeLoaderTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ class AttributeLoaderTest extends \PHPUnit\Framework\TestCase
3232

3333
protected function setUp(): void
3434
{
35-
CacheCleaner::cleanAll();
3635
$this->objectManager = Bootstrap::getObjectManager();
3736
$this->attributeLoader = $this->objectManager->get(AttributeLoader::class);
3837
$entityType = $this->objectManager->create(\Magento\Eav\Model\Entity\Type::class)

dev/tests/integration/testsuite/Magento/Framework/App/Config/InitialTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ protected function setUp(): void
2424

2525
public function testGetMetadata()
2626
{
27-
CacheCleaner::cleanAll();
2827
$this->assertEquals(
2928
$this->objectManager->create(Config::class)->getMetadata(),
3029
$this->objectManager->create(Config::class)->getMetadata()
@@ -37,7 +36,6 @@ public function testGetMetadata()
3736
*/
3837
public function testGetData($scope)
3938
{
40-
CacheCleaner::cleanAll();
4139
$this->assertEquals(
4240
$this->objectManager->create(Config::class)->getData($scope),
4341
$this->objectManager->create(Config::class)->getData($scope)

dev/tests/integration/testsuite/Magento/Framework/App/ObjectManager/ConfigLoaderTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ protected function setUp(): void
2424

2525
public function testLoad()
2626
{
27-
CacheCleaner::cleanAll();
2827
$data = $this->object->load('global');
2928
$this->assertNotEmpty($data);
3029
$cachedData = $this->object->load('global');

dev/tests/integration/testsuite/Magento/Framework/App/Route/ConfigTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ protected function setUp(): void
2828
*/
2929
public function testGetRouteFrontName($route, $scope)
3030
{
31-
CacheCleaner::cleanAll();
3231
$this->assertEquals(
3332
$this->objectManager->create(Config::class)->getRouteFrontName($route, $scope),
3433
$this->objectManager->create(Config::class)->getRouteFrontName($route, $scope)

dev/tests/integration/testsuite/Magento/Framework/DB/Adapter/Pdo/MysqlTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ protected function setUp(): void
2727
set_error_handler(null);
2828
$this->resourceConnection = Bootstrap::getObjectManager()
2929
->get(ResourceConnection::class);
30-
CacheCleaner::cleanAll();
3130
}
3231

3332
protected function tearDown(): void

dev/tests/integration/testsuite/Magento/Framework/Reflection/MethodsMapTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ protected function setUp(): void
2424

2525
public function testGetMethodsMap()
2626
{
27-
CacheCleaner::cleanAll();
2827
$data = $this->object->getMethodsMap(\Magento\Framework\Reflection\MethodsMap::class);
2928
$this->assertArrayHasKey('getMethodsMap', $data);
3029
$cachedData = $this->object->getMethodsMap(\Magento\Framework\Reflection\MethodsMap::class);
@@ -33,7 +32,6 @@ public function testGetMethodsMap()
3332

3433
public function testGetMethodParams()
3534
{
36-
CacheCleaner::cleanAll();
3735
$data = $this->object->getMethodParams(
3836
\Magento\Framework\Reflection\MethodsMap::class,
3937
'getMethodParams'

dev/tests/integration/testsuite/Magento/Framework/TranslateTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ protected function setUp(): void
9494
public function testLoadData()
9595
{
9696
$data = $this->translate->loadData(null, true)->getData();
97-
CacheCleaner::cleanAll();
9897
$this->translate->loadData()->getData();
9998
$dataCached = $this->translate->loadData()->getData();
10099
$this->assertEquals($data, $dataCached);

dev/tests/integration/testsuite/Magento/Framework/View/Element/UiComponent/Config/Provider/TemplateTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ public function testGetTemplate()
4949
\Magento\TestFramework\Helper\Bootstrap::getInstance()->loadArea('adminhtml');
5050
$this->objectManager->get(\Magento\Framework\View\DesignInterface::class)
5151
->setDesignTheme('FrameworkViewUiComponent/default');
52-
CacheCleaner::cleanAll();
5352

5453
$resultOne = $this->model->getTemplate('test.xml');
5554
$resultTwo = $this->model->getTemplate('test.xml');

dev/tests/integration/testsuite/Magento/ProductAlert/Model/ObserverTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ public function testProcessPortuguese()
9393
$secondStore = $storeRepository->get('fixture_second_store');
9494

9595
// check if Portuguese language is specified for the second store
96-
CacheCleaner::cleanAll();
9796
$storeResolver = $this->_objectManager->get(Resolver::class);
9897
$storeResolver->emulate($secondStore->getId());
9998
$this->assertEquals('pt_BR', $storeResolver->getLocale());

dev/tests/integration/testsuite/Magento/ReleaseNotification/Controller/Adminhtml/Dashboard/IndexTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ public function testExecute()
4444
{
4545
$content = include __DIR__ . '/../../../_files/validContent.php';
4646

47-
CacheCleaner::cleanAll();
4847
$this->contentProviderMock->expects($this->any())
4948
->method('getContent')
5049
->willReturn($content);
@@ -62,7 +61,6 @@ public function testExecute()
6261

6362
public function testExecuteEmptyContent()
6463
{
65-
CacheCleaner::cleanAll();
6664
$this->contentProviderMock->expects($this->any())
6765
->method('getContent')
6866
->willReturn('[]');
@@ -77,7 +75,6 @@ public function testExecuteEmptyContent()
7775

7876
public function testExecuteFalseContent()
7977
{
80-
CacheCleaner::cleanAll();
8178
$this->contentProviderMock->expects($this->any())
8279
->method('getContent')
8380
->willReturn(false);

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ public function testGetStoreData()
2828
$storeResolver = $this->objectManager->get(\Magento\Store\Model\StoreResolver::class);
2929

3030
$storesDataRead = $methodReadStoresData->invoke($storeResolver);
31-
CacheCleaner::cleanAll();
3231
$storesData = $methodGetStoresData->invoke($storeResolver);
3332
$storesDataCached = $methodGetStoresData->invoke($storeResolver);
3433
$this->assertEquals($storesDataRead, $storesData);

dev/tests/integration/testsuite/Magento/Theme/Model/Theme/ThemeProviderTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ protected function setUp(): void
3333
$this->themeProviderOne = $objectManager->create(ThemeProvider::class);
3434
$this->themeProviderTwo = clone $this->themeProviderOne;
3535
$this->themeCollection = $objectManager->create(ThemeCollection::class);
36-
CacheCleaner::clean();
3736
}
3837

3938
public function testGetThemeById()

dev/tests/integration/testsuite/Magento/Translation/Model/Js/PreProcessorTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ protected function tearDown(): void
8282
*/
8383
public function testProcess(string $content, string $translation)
8484
{
85-
CacheCleaner::cleanAll();
8685
$this->assertEquals($translation, $this->model->translate($content));
8786
}
8887

0 commit comments

Comments
 (0)