mirror of
https://github.com/retailcrm/Fetch.git
synced 2025-02-06 10:39:21 +03:00
Update method names to refer specifically to body part of the message rather than the whole message itself.
This commit is contained in:
parent
0fb02cad2c
commit
fd9784d14d
@ -374,19 +374,19 @@ class Message
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function returns the plain text version of the email or false if not present.
|
* This function returns the plain text body of the email or false if not present.
|
||||||
* @return string|bool Returns false if not present
|
* @return string|bool Returns false if not present
|
||||||
*/
|
*/
|
||||||
public function getPlainTextMessage()
|
public function getPlainTextBody()
|
||||||
{
|
{
|
||||||
return isset($this->plaintextMessage) ? $this->plaintextMessage : false;
|
return isset($this->plaintextMessage) ? $this->plaintextMessage : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function returns the HTML version of the email or false if not present.
|
* This function returns the HTML body of the email or false if not present.
|
||||||
* @return string|bool Returns false if not present
|
* @return string|bool Returns false if not present
|
||||||
*/
|
*/
|
||||||
public function getHtmlMessage()
|
public function getHtmlBody()
|
||||||
{
|
{
|
||||||
return isset($this->htmlMessage) ? $this->htmlMessage : false;
|
return isset($this->htmlMessage) ? $this->htmlMessage : false;
|
||||||
}
|
}
|
||||||
|
@ -77,7 +77,7 @@ class MessageTest extends \PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testGetPlainTextMessage()
|
public function testGetPlainTextBody()
|
||||||
{
|
{
|
||||||
// easiest way to deal with php encoding issues is simply not to.
|
// easiest way to deal with php encoding issues is simply not to.
|
||||||
$plaintextTest1 = 'f9377a89c9c935463a2b35c92dd61042';
|
$plaintextTest1 = 'f9377a89c9c935463a2b35c92dd61042';
|
||||||
@ -85,31 +85,31 @@ class MessageTest extends \PHPUnit_Framework_TestCase
|
|||||||
$plaintextTest3 = 'd41d8cd98f00b204e9800998ecf8427e';
|
$plaintextTest3 = 'd41d8cd98f00b204e9800998ecf8427e';
|
||||||
|
|
||||||
$message = static::getMessage(3);
|
$message = static::getMessage(3);
|
||||||
$messagePlainText = $message->getPlainTextMessage();
|
$messagePlainText = $message->getPlainTextBody();
|
||||||
$this->assertEquals($plaintextTest1, md5($messagePlainText), 'Message returns as plaintext.');
|
$this->assertEquals($plaintextTest1, md5($messagePlainText), 'Message returns as plaintext.');
|
||||||
|
|
||||||
$message = static::getMessage(4);
|
$message = static::getMessage(4);
|
||||||
$messagePlainText = $message->getPlainTextMessage();
|
$messagePlainText = $message->getPlainTextBody();
|
||||||
$this->assertEquals($plaintextTest2, md5($messagePlainText), 'Message returns as plaintext.');
|
$this->assertEquals($plaintextTest2, md5($messagePlainText), 'Message returns as plaintext.');
|
||||||
|
|
||||||
$message = static::getMessage(6);
|
$message = static::getMessage(6);
|
||||||
$messagePlainText = $message->getPlainTextMessage();
|
$messagePlainText = $message->getPlainTextBody();
|
||||||
$this->assertEquals($plaintextTest3, md5($messagePlainText), 'Message does not return as plaintext.');
|
$this->assertEquals($plaintextTest3, md5($messagePlainText), 'Message does not return as plaintext.');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testGetHtmlMessage()
|
public function testGetHtmlBody()
|
||||||
{
|
{
|
||||||
// easiest way to deal with php encoding issues is simply not to.
|
// easiest way to deal with php encoding issues is simply not to.
|
||||||
$HtmlTest1 = 'd41d8cd98f00b204e9800998ecf8427e';
|
$HtmlTest1 = 'd41d8cd98f00b204e9800998ecf8427e';
|
||||||
$HtmlTest2 = '6a366ddecf080199284146d991d52169';
|
$HtmlTest2 = '6a366ddecf080199284146d991d52169';
|
||||||
|
|
||||||
$message = static::getMessage(3);
|
$message = static::getMessage(3);
|
||||||
$messageHtml = $message->getHtmlMessage();
|
$messageHtml = $message->getHtmlBody();
|
||||||
$this->assertEquals($HtmlTest1, md5($messageHtml), 'Message does not return as HTML.');
|
$this->assertEquals($HtmlTest1, md5($messageHtml), 'Message does not return as HTML.');
|
||||||
|
|
||||||
$message = static::getMessage(4);
|
$message = static::getMessage(4);
|
||||||
$messageHtml = $message->getHtmlMessage();
|
$messageHtml = $message->getHtmlBody();
|
||||||
$this->assertEquals($HtmlTest2, md5($messageHtml), 'Message returns as HTML.');
|
$this->assertEquals($HtmlTest2, md5($messageHtml), 'Message returns as HTML.');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user