/** * @test */ public function getStatuses() { $user1 = $this->getUser("test1"); $user3 = $this->getUser("test3"); $helper = new Helpers_Paginator_Status(); $paginator = $helper->getStatuses($user1->id, array(), 5); $this->eq(18, $paginator->count); $items = $paginator->results; $this->eq(5, count($items)); $this->eq("2008-01-09 06:00:00", $items[0]->created_at); $this->eq($user3->id, $items[0]->reply_user_id); $this->eq("2008-01-09 00:00:00", $items[1]->created_at); $this->eq(null, $items[1]->reply_user_id); $this->eq("2008-01-08 06:00:00", $items[2]->created_at); $this->eq($user3->id, $items[2]->reply_user_id); // ------------------------------------------------------ $paginator = $helper->getStatuses($user1->id, array("page" => 2), 5); $items = $paginator->results; $this->eq("2008-01-07 00:00:00", $items[0]->created_at); $this->eq(null, $items[0]->reply_user_id); $this->eq("2008-01-06 06:00:00", $items[1]->created_at); $this->eq($user3->id, $items[1]->reply_user_id); // ------------------------------------------------------ $paginator = $helper->getStatuses($user1->id, array("page" => 4), 5); $items = $paginator->results; $this->eq(3, count($items)); }
public function archive() { $this->noUsername = true; $helper = new Helpers_Paginator_Status(); $this->paginator = $helper->getStatuses($this->aclUser->id, $this->GET_VARS); $this->view->setName("common"); }
protected function home() { $protected = $this->aUser->isProtected(); $this->clientId = $this->session->getClientId(); if ($authenticated = $this->aclUser->isAuthenticated()) { $this->isFollowed = Follower::isFollowed($this->aclUser->id, $this->aUser->uid); if ($this->isFollowed) { $protected = false; } } if ($protected) { if ($authenticated) { $this->isRequested = Request::isRequested($this->aclUser->id, $this->aUser->uid); } $this->view->setName("protected"); } else { $helper = new Helpers_Paginator_Status(); $this->paginator = $helper->getStatuses($this->aUser->uid, $this->GET_VARS, 50); $this->view->setName("home"); } }