示例#1
0
 public function testDao()
 {
     $title = '{actor} reviewed the book {book}';
     $body = '{book} has received a rating of {num_stars} from the users of BookApplication';
     $titleData = '{"book":"Of Mice and Men"}';
     $bodyData = '{"book":"<a href{{=}}\\"http:\\/\\/www.someurl.com\\/OfMiceAndMen\\">Of Mice and Men<\\/a>","num_stars":5}';
     $bodyGeneral = '<fb:name uid{{=}}"1234" firstnameonly{{=}}true /> said "This book changed my life."';
     $image1 = "http://localhost/somimage.gif";
     $image1Link = "http://test.this.please.sir";
     $image2 = "http://localhost/somimage.gif";
     $image3 = "http://localhost/somimage.gif";
     $image3Link = "http://test.this.please.sir";
     $image4 = "http://localhost/somimage.gif";
     $actor = 12345;
     $targets = '234,345,456';
     $priority = 50;
     $image2Link = null;
     $image4Link = null;
     $created = null;
     // Test just Title
     // public function testInsertRows( $type, $isTemplate, $author , $setParams, $pass )
     $type = Api_Bo_Feed::RS_FBDB_FEED_TYPE_ACTION;
     $templatized = 0;
     $author = '100';
     $ret = Api_Dao_Feed::createFeed($type, $templatized, $title, null, null, null, null, $author, null, null, null, null, null, null, null, null, null, null, null, $created);
     $this->assertTrue($ret, "Title Test should of returned false!");
     // Test title + body
     //array(Api_Dao_Feed::RS_FBDB_FEED_TYPE_STORY, 0, '101', $withBody, true)
     $type = Api_Bo_Feed::RS_FBDB_FEED_TYPE_STORY;
     $templatized = 0;
     $author = '101';
     $ret = Api_Dao_Feed::createFeed($type, $templatized, $title, null, $body, null, null, $author, null, null, null, null, null, null, null, null, null, null, null, $created);
     $this->assertTrue($ret, "Body Test should of returned false!");
     // Test title + body + data
     //array(Api_Dao_Feed::RS_FBDB_FEED_TYPE_ACTION, 1, '102', $withData, true)
     $type = Api_Bo_Feed::RS_FBDB_FEED_TYPE_ACTION;
     $templatized = 0;
     $author = '102';
     $ret = Api_Dao_Feed::createFeed($type, $templatized, $title, $titleData, $body, $bodyData, $bodyGeneral, $author, null, null, null, null, null, null, null, null, null, null, null, $created);
     $this->assertTrue($ret, "Data Test should of returned true!");
     // test title + body + data + image1
     //array(Api_Dao_Feed::RS_FBDB_FEED_TYPE_ACTION, 1, '103', $withImage1, true)
     $type = Api_Bo_Feed::RS_FBDB_FEED_TYPE_ACTION;
     $templatized = 1;
     $author = '103';
     $ret = Api_Dao_Feed::createFeed($type, $templatized, $title, $titleData, $body, $bodyData, $bodyGeneral, $author, $image1, $image1Link, null, null, null, null, null, null, null, null, null, $created);
     $this->assertTrue($ret, "Image 1 Test should of returned true!");
     // test title + body + data + image1 + images
     //array(Api_Dao_Feed::RS_FBDB_FEED_TYPE_ACTION, 1, '104', $withImages, true)
     $type = Api_Bo_Feed::RS_FBDB_FEED_TYPE_ACTION;
     $templatized = 1;
     $author = '104';
     $ret = Api_Dao_Feed::createFeed($type, $templatized, $title, $titleData, $body, $bodyData, $bodyGeneral, $author, $image1, $image1Link, $image2, $image2Link, $image3, $image3Link, $image4, $image4Link, null, null, null, $created);
     $this->assertTrue($ret, "Images Test should of returned true!");
     // test title + body + data + image1 + images + actor
     //array(Api_Dao_Feed::RS_FBDB_FEED_TYPE_ACTION, 1, '105', $withActor, true)
     $type = Api_Bo_Feed::RS_FBDB_FEED_TYPE_ACTION;
     $templatized = 1;
     $author = '105';
     $ret = Api_Dao_Feed::createFeed($type, $templatized, $title, $titleData, $body, $bodyData, $bodyGeneral, $author, $image1, $image1Link, $image2, $image2Link, $image3, $image3Link, $image4, $image4Link, $actor, null, null, $created);
     $this->assertTrue($ret, "Actor Test should of returned true!");
     // test title + body + data + image1 + images + actor + targets
     //array(Api_Dao_Feed::RS_FBDB_FEED_TYPE_ACTION, 1, '106', $withTargets, true)
     $type = Api_Bo_Feed::RS_FBDB_FEED_TYPE_ACTION;
     $templatized = 1;
     $author = '106';
     $ret = Api_Dao_Feed::createFeed($type, $templatized, $title, $titleData, $body, $bodyData, $bodyGeneral, $author, $image1, $image1Link, $image2, $image2Link, $image3, $image3Link, $image4, $image4Link, $actor, $targets, null, $created);
     $this->assertTrue($ret, "Targets Test should of returned true!");
     // test title + body + data + image1 + images + actor + targets + priority
     //array(Api_Dao_Feed::RS_FBDB_FEED_TYPE_ACTION, 1, '107', $withPriority, true)
     $type = Api_Bo_Feed::RS_FBDB_FEED_TYPE_ACTION;
     $templatized = 1;
     $author = '107';
     $ret = Api_Dao_Feed::createFeed($type, $templatized, $title, $titleData, $body, $bodyData, $bodyGeneral, $author, $image1, $image1Link, $image2, $image2Link, $image3, $image3Link, $image4, $image4Link, $actor, $targets, $priority, $created);
     $this->assertTrue($ret, "Priority \r\n\t\tTest should of returned true!");
 }
示例#2
0
文件: Feed.php 项目: jkinner/ringside
 public static function getFeedEntries($uid, $actorid, $friends, $actions, $stories)
 {
     return Api_Dao_Feed::getFeedEntries($uid, $actorid, $friends, $actions, $stories);
 }