From 6196f8df49f0eac32eb08441d40fc593659d9bb3 Mon Sep 17 00:00:00 2001 From: Iain Cambridge Date: Wed, 14 May 2014 14:03:12 +0100 Subject: [PATCH] Add setMessage --- src/Mailgun/Messages/MessageBuilder.php | 5 +++++ tests/Mailgun/Tests/Messages/MessageBuilderTest.php | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/src/Mailgun/Messages/MessageBuilder.php b/src/Mailgun/Messages/MessageBuilder.php index d4aec4f..bf33269 100644 --- a/src/Mailgun/Messages/MessageBuilder.php +++ b/src/Mailgun/Messages/MessageBuilder.php @@ -338,6 +338,11 @@ class MessageBuilder } } + public function setMessage($message) + { + $this->message = $message; + } + public function getMessage() { return $this->message; diff --git a/tests/Mailgun/Tests/Messages/MessageBuilderTest.php b/tests/Mailgun/Tests/Messages/MessageBuilderTest.php index d81eed5..f056d83 100644 --- a/tests/Mailgun/Tests/Messages/MessageBuilderTest.php +++ b/tests/Mailgun/Tests/Messages/MessageBuilderTest.php @@ -254,6 +254,14 @@ class MessageBuilderTest extends \Mailgun\Tests\MailgunTestCase{ $messageObj = $message->getMessage(); $this->assertEquals(array("my-option" => array("yes"), "o:my-other-option" => array("no")), $messageObj); } + + public function testSetMessage(){ + $message = [1,2,3,4,5]; + $messageBuilder = $this->client->MessageBuilder(); + $messageBuilder->setMessage($message); + + $this->assertEquals($message, $messageBuilder->getMessage()); + } } ?> \ No newline at end of file