/
githubmirror
/
magento2
Обзор
Документация
Войти
/
githubmirror
/
magento2
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
2.4-develop
dev/tests/integration/testsuite/Magento/Customer/Block/Widget/CompanyTest.php
57 строк
2 KB
Alexandra Zota
ACP2E-4019: CE copyright updates for 2.4.9-beta1
22 окт 2025, 10:44
22 окт 2025, 10:44
264bea2
Код
Авторство
О чём код?
<?php /** * Copyright 2017 Adobe * All Rights Reserved. */ namespace Magento\Customer\Block\Widget; /** * Test class for \Magento\Customer\Block\Widget\Taxvat * * @magentoAppArea frontend */ class CompanyTest extends \PHPUnit\Framework\TestCase { /** * @magentoAppIsolation enabled */ public function testToHtml() { /** @var \Magento\Customer\Block\Widget\Company $block */ $block = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( \Magento\Customer\Block\Widget\Company::class ); $this->assertStringContainsString('title="Company"', $block->toHtml()); $this->assertStringNotContainsString('required', $block->toHtml()); } /** * @magentoAppIsolation enabled * @magentoDbIsolation enabled */ public function testToHtmlRequired() { /** @var \Magento\Customer\Model\Attribute $model */ $model = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( \Magento\Customer\Model\Attribute::class ); $model->loadByCode('customer_address', 'company')->setIsRequired(true); $model->save(); /** @var \Magento\Customer\Block\Widget\Company $block */ $block = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( \Magento\Customer\Block\Widget\Company::class ); $this->assertStringContainsString('title="Company"', $block->toHtml()); $this->assertStringContainsString('required', $block->toHtml()); } protected function tearDown(): void { /** @var \Magento\Eav\Model\Config $eavConfig */ $eavConfig = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(\Magento\Eav\Model\Config::class); $eavConfig->clear(); } }