/** * Hide value to make sure it will not show in HTML * * @param string $index * @return string */ public function getEscapedValue($index = null) { $value = parent::getEscapedValue($index); if (!empty($value)) { return $this->_obscuredValue; } return $value; }
/** * @covers \Magento\Framework\Data\Form\Element\Password::getHtml */ public function testGetHtml() { $html = $this->_model->getHtml(); $this->assertContains('type="password"', $html); $this->assertTrue(preg_match('/class=\\".*input-text.*\\"/i', $html) > 0); }