Skip to content

Commit 0bf66d9

Browse files
committed
Added integration test to cover the changes
1 parent 9a7d68d commit 0bf66d9

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

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

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,31 @@ public function testFaxEnabled(): void
138138
$this->assertContains('title="Fax"', $block->toHtml());
139139
}
140140

141+
/**
142+
* @magentoAppIsolation enabled
143+
* @magentoDbIsolation enabled
144+
* @return void
145+
*/
146+
public function testTelephoneWithStoreLabel(): void
147+
{
148+
/** @var \Magento\Customer\Model\Attribute $model */
149+
$model = Bootstrap::getObjectManager()->create(
150+
\Magento\Customer\Model\Attribute::class
151+
);
152+
$model->loadByCode('customer_address', 'telephone')->setIsVisible('1')->setStoreLabel('Telephone2');
153+
$model->save();
154+
155+
/** @var \Magento\Customer\Block\Form\Register $block */
156+
$block = Bootstrap::getObjectManager()->create(
157+
Register::class
158+
)->setTemplate('Magento_Customer::form/register.phtml')
159+
->setShowAddressFields(true);
160+
$this->setAttributeDataProvider($block);
161+
162+
$this->assertNotContains('title="Phone Number"', $block->toHtml());
163+
$this->assertContains('title="Telephone2"', $block->toHtml());
164+
}
165+
141166
/**
142167
* @inheritdoc
143168
*/

0 commit comments

Comments
 (0)