public function testAppendChildToElementThrowsError() { $this->setExpectedException('Saml\\Ecp\\Soap\\Exception\\AppendChildException'); $child = $this->_getDomElementMock(); $element = $child = $this->_getDomElementMock(); $element->expects($this->once())->method('appendChild')->with($child)->will($this->throwException(new \DomException())); $this->_message->appendChildToElement($element, $child); }