Example #1
0
 /**
  * test of getPostsToUser method
  */
 public function testGetPostsToUser()
 {
     $dao = new PostMySQLDAO();
     $res = $dao->getPostsToUser('23', 'twitter', 10);
     $this->assertEqual(count($res), 2);
     $this->assertEqual($res[0]->author_user_id, '20');
     $this->assertEqual(sizeof($res[0]->links), 2);
     $this->assertEqual($res[0]->links[0]->url, 'http://alink1.com');
     $this->assertEqual($res[0]->links[1]->url, 'http://alink2.com');
     $this->assertEqual($res[1]->author_user_id, '20');
     $this->assertEqual(sizeof($res[1]->links), 0);
 }