예제 #1
0
 public function it_can_append_an_element(Element $element)
 {
     $doc = new DOMDocument('1.0', 'utf-8');
     $div = $doc->createElement('div');
     $p = $doc->createElement('p', 'Hello World');
     $element->getNode()->willReturn($p);
     $this->beConstructedWith($div);
     $this->appendChild($element)->shouldReturn(null);
 }
예제 #2
0
 /**
  * Append an Element as a child of the current element
  *
  * @param  Element $element The element to append as a child
  * @return null
  */
 public function appendChild(Element $element)
 {
     $this->getNode()->appendChild($element->getNode());
 }