public function testAddBodyElement()
 {
     $bodyElement = new \DOMElement('TestElement');
     $this->_message->addBodyElement($bodyElement);
     $bodyElements = $this->_message->getBodyElements();
     $this->assertEquals($bodyElement, $bodyElements->item(0));
 }
 public function testAddBodyElementImportNodeException()
 {
     $this->setExpectedException('Saml\\Ecp\\Soap\\Exception\\ImportNodeException');
     $dom = $this->getMockBuilder('DomDocument')->getMock();
     $dom->expects($this->once())->method('importNode')->will($this->throwException(new \DomException()));
     $this->_message->setDom($dom);
     $element = $this->getMockBuilder('DomElement')->disableOriginalConstructor()->getMock();
     $this->_message->addBodyElement($element);
 }