本文整理匯總了PHP中SugarFeed::parseMessage方法的典型用法代碼示例。如果您正苦於以下問題:PHP SugarFeed::parseMessage方法的具體用法?PHP SugarFeed::parseMessage怎麽用?PHP SugarFeed::parseMessage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類SugarFeed
的用法示例。
在下文中一共展示了SugarFeed::parseMessage方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testEncodeUrls
public function testEncodeUrls()
{
$message = "This test contains a url here http://www.sugarcrm.com and not here amazon.com";
$text = SugarFeed::parseMessage($message);
$this->assertContains("<a href='http://www.sugarcrm.com' target='_blank'>http://www.sugarcrm.com</a>", $text, "Url encoded incorrectly");
$this->assertNotContains("http://amazon.com", $text, "Second link should not be encoded");
}
示例2: testparseMessage
public function testparseMessage()
{
//test with a string with no links
$html = 'some text with no urls';
$result = SugarFeed::parseMessage($html);
$this->assertEquals($html, $result);
//test with a string with links
$html = 'some text http://www.url.com with no urls';
$expected = "some text <a href='http://www.url.com' target='_blank'>http://www.url.com</a> with no urls";
$result = SugarFeed::parseMessage($html);
$this->assertEquals($expected, $result);
}