Skip to content

Commit 88da24a

Browse files
committed
Switched to use data fixture in the integration tests
1 parent 2f0dae9 commit 88da24a

File tree

2 files changed

+23
-23
lines changed

2 files changed

+23
-23
lines changed

dev/tests/integration/testsuite/Magento/Customer/Block/Form/RegisterTest.php

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -139,38 +139,19 @@ public function testFaxEnabled(): void
139139
}
140140

141141
/**
142-
* @magentoAppIsolation enabled
143-
* @magentoDbIsolation disabled
144-
* @return void
142+
* @magentoDataFixture Magento/Customer/_files/attribute_city_store_label_address.php
145143
*/
146-
public function testTelephoneWithStoreLabel(): void
144+
public function testCityWithStoreLabel(): void
147145
{
148-
/** @var \Magento\Store\Model\StoreManager $storeManager */
149-
$storeManager = Bootstrap::getObjectManager()->create(
150-
\Magento\Store\Model\StoreManagerInterface::class
151-
);
152-
$stores = $storeManager->getStores();
153-
/** @var \Magento\Eav\Model\Config $eavConfig */
154-
$eavConfig = Bootstrap::getObjectManager()->create(
155-
\Magento\Eav\Model\Config::class
156-
);
157-
$model = $eavConfig->getAttribute('customer_address', 'telephone');
158-
$storeLabels = $model->getStoreLabels();
159-
foreach ($stores as $store) {
160-
$storeLabels[$store->getId()] = 'Phone NumberX';
161-
}
162-
$model->setStoreLabels([$storeLabels]);
163-
$model->save();
164-
165146
/** @var \Magento\Customer\Block\Form\Register $block */
166147
$block = Bootstrap::getObjectManager()->create(
167148
Register::class
168149
)->setTemplate('Magento_Customer::form/register.phtml')
169150
->setShowAddressFields(true);
170151
$this->setAttributeDataProvider($block);
171152

172-
$this->assertNotContains('title="Phone Number"', $block->toHtml());
173-
$this->assertContains('title="Phone NumberX"', $block->toHtml());
153+
$this->assertNotContains('title="City"', $block->toHtml());
154+
$this->assertContains('title="Suburb"', $block->toHtml());
174155
}
175156

176157
/**
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
/** @var \Magento\Customer\Model\Attribute $model */
8+
$model = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(\Magento\Customer\Model\Attribute::class);
9+
/** @var \Magento\Store\Model\StoreManagerInterface $storeManager */
10+
$storeManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(\Magento\Store\Model\StoreManager::class);
11+
$model->loadByCode('customer_address', 'city');
12+
$storeLabels = $model->getStoreLabels();
13+
$websites = $storeManager->getWebsites();
14+
/** @var \Magento\Store\Api\Data\WebsiteInterface $website */
15+
foreach ($websites as $website) {
16+
$storeLabels[$website->getId()] = 'Suburb';
17+
}
18+
$model->setStoreLabels($storeLabels);
19+
$model->save();

0 commit comments

Comments
 (0)