public function testCanCreateFromRawPost() { // Prep php://input with mocked data MockPhpStream::setStartingData(json_encode($this->messageData)); stream_wrapper_unregister('php'); stream_wrapper_register('php', __NAMESPACE__ . '\\MockPhpStream'); $message = Message::fromRawPostData(); $this->assertInstanceOf('Aws\\Sns\\MessageValidator\\Message', $message); stream_wrapper_restore("php"); }
public function testCreateFromRawPostFailsWithMissingData() { $this->setExpectedException('Aws\\Common\\Exception\\UnexpectedValueException'); Message::fromRawPostData(); }