Ejemplo n.º 1
0
 /**
  * @magentoDataFixture Magento/Customer/_files/attribute_user_fullname.php
  */
 public function testToHtmlFancyName()
 {
     /** @var \Magento\Customer\Service\V1\Data\CustomerBuilder $customerBuilder */
     $customerBuilder = Bootstrap::getObjectManager()->get('Magento\\Customer\\Service\\V1\\Data\\CustomerBuilder');
     $customerBuilder->setPrefix('Dr.')->setFirstname('Jane')->setMiddlename('Roe')->setLastname('Doe')->setSuffix('Ph.D.');
     $this->_block->setObject($customerBuilder->create());
     $html = $this->_block->toHtml();
     $this->assertContains('title="First Name"', $html);
     $this->assertContains('value="Jane"', $html);
     $this->assertContains('title="Last Name"', $html);
     $this->assertContains('value="Doe"', $html);
     $this->assertContains('title="Middle Name/Initial"', $html);
     $this->assertContains('value="Roe"', $html);
     $this->assertContains('title="Prefix"', $html);
     $this->assertContains('value="Dr."', $html);
     $this->assertContains('title="Suffix"', $html);
     $this->assertContains('value="Ph.D."', $html);
 }
Ejemplo n.º 2
0
 /**
  * @magentoAppIsolation enabled
  * @magentoDataFixture Magento/Customer/_files/attribute_user_fullname.php
  */
 public function testToHtmlFancyName()
 {
     /** @var \Magento\Customer\Api\Data\CustomerInterfaceFactory $customerFactory */
     $customerFactory = Bootstrap::getObjectManager()->get('Magento\\Customer\\Api\\Data\\CustomerInterfaceFactory');
     $customerDataObject = $customerFactory->create();
     $customerDataObject->setPrefix('Dr.')->setFirstname('Jane')->setMiddlename('Roe')->setLastname('Doe')->setSuffix('Ph.D.');
     $this->_block->setObject($customerDataObject);
     $html = $this->_block->toHtml();
     $this->assertContains('title="First Name"', $html);
     $this->assertContains('value="Jane"', $html);
     $this->assertContains('title="Last Name"', $html);
     $this->assertContains('value="Doe"', $html);
     $this->assertContains('title="Middle Name/Initial"', $html);
     $this->assertContains('value="Roe"', $html);
     $this->assertContains('title="Prefix"', $html);
     $this->assertContains('value="Dr."', $html);
     $this->assertContains('title="Suffix"', $html);
     $this->assertContains('value="Ph.D."', $html);
 }