コード例 #1
0
<?php

require_once dirname(__FILE__) . '/../bootstrap/unit.php';
$t = new lime_test(7, new lime_output_color());
// Test the tweetify
$t->is(FormattingUtils::tweetify("anon_tweet: Hello!"), '<a href="http://twitter.com/anon_tweet" rel="nofollow">anon_tweet</a>: Hello!');
$t->is(FormattingUtils::tweetify("anon_tweet: Hello!", true), 'Hello!');
$t->is(FormattingUtils::tweetify("anon_tweet: http://example.com/", true), '<a href="http://example.com/" rel="nofollow">[link]</a>');
$t->is(FormattingUtils::tweetify("anon_tweet: Hello @isofarro_public!", true), 'Hello <a href="http://twitter.com/isofarro_public" rel="nofollow">@isofarro_public</a>!');
$t->is(FormattingUtils::tweetify("anon_tweet: Hello #g20!", true), 'Hello <a href="http://search.twitter.com/search?q=%23g20" rel="nofollow">#g20</a>!');
$t->is(FormattingUtils::tweetify("anon_tweet: Hello #g20! and #g21.", true), 'Hello <a href="http://search.twitter.com/search?q=%23g20" rel="nofollow">#g20</a>! and <a href="http://search.twitter.com/search?q=%23g21" rel="nofollow">#g21</a>.');
// Bug when link is wrapped in a round bracket
$t->is(FormattingUtils::tweetify("anon_tweet: (http://example.com/)", true), '(<a href="http://example.com/" rel="nofollow">[link]</a>)');
コード例 #2
0
ファイル: Item.php プロジェクト: BasMatthee/symfony-profile
 /**
  * Extract small thumbnail images from a Flickr description
  **/
 public function getPhotoImage()
 {
     return FormattingUtils::flickrfy($this->getDescription());
 }