/** * Test the error code handling */ public function testSubscribeToMailingErrorCodeHandling() { $subscribe_to_mailing_xml = file_get_contents(dirname(__FILE__) . '/data/subscribe_to_mailing_error.xml'); $this->oauthClient->expects($this->once())->method('authenticatedPostAsXml')->with('mailing/v2/3/subscribe', array('userId' => 1))->will($this->returnValue($subscribe_to_mailing_xml)); $this->setExpectedException('CultureFeed_InvalidCodeException', 'errormessage'); $this->cultureFeed->subscribeToMailing(1, 3); }