public function href($href = null) { if ($href !== null) { $this->node->setAttribute('href', $href); } return $this->node->getAttribute('href'); }
public function testSetAttribute() { $node = new HtmlNode('a'); $node->setAttribute('class', 'foo'); $this->assertEquals('foo', $node->getAttribute('class')); }