Set an attribute on the element.
public setAttribute ( string $name, string $value ) : |
||
$name | string | The attribute name |
$value | string | The attribute value |
return |
public function testSetAttribute() { $domElement = $this->createDomElement('input'); $element = new Element($domElement); $element->setAttribute("value", "test"); $domElement = $element->getElement(); $this->assertEquals("test", $domElement->getAttribute("value")); }
public function testSetAttribute() { $domElement = $this->createDomElement('input'); $element = new Element($domElement); $element->setAttribute('value', 'test'); $domElement = $element->getElement(); $this->assertEquals('test', $domElement->getAttribute('value')); }
public function testSetAttribute() { $node = $this->createNode('input'); $element = new Element($node); $element->setAttribute('value', 'test'); $this->assertEquals('test', $element->getAttribute('value')); $element->setAttribute('value', 10); $this->assertEquals('10', $element->getAttribute('value')); $element->setAttribute('value', 3.14); $this->assertEquals('3.14', $element->getAttribute('value')); }