diff --git a/apps/pc_backend/modules/communityTopic/actions/actions.class.php b/apps/pc_backend/modules/communityTopic/actions/actions.class.php index 23557bb..b58c782 100644 --- a/apps/pc_backend/modules/communityTopic/actions/actions.class.php +++ b/apps/pc_backend/modules/communityTopic/actions/actions.class.php @@ -42,6 +42,7 @@ public function executeTopicList(sfWebRequest $request) { $this->pager->setQuery($this->form->getQuery()); } + $this->pager->setQuery($this->pager->getQuery()->orderBy('created_at DESC')); $this->pager->setPage($request->getParameter('page', 1)); $this->pager->init(); return sfView::SUCCESS; @@ -82,6 +83,7 @@ public function executeTopicCommentList(sfWebRequest $request) { $this->pager->setQuery($this->form->getQuery()); } + $this->pager->setQuery($this->pager->getQuery()->orderBy('created_at DESC')); $this->pager->setPage($request->getParameter('page', 1)); $this->pager->init(); return sfView::SUCCESS; @@ -122,6 +124,7 @@ public function executeEventList(sfWebRequest $request) { $this->pager->setQuery($this->form->getQuery()); } + $this->pager->setQuery($this->pager->getQuery()->orderBy('created_at DESC')); $this->pager->setPage($request->getParameter('page', 1)); $this->pager->init(); return sfView::SUCCESS; @@ -202,6 +205,7 @@ public function executeEventCommentList(sfWebRequest $request) { $this->pager->setQuery($this->form->getQuery()); } + $this->pager->setQuery($this->pager->getQuery()->orderBy('created_at DESC')); $this->pager->setPage($request->getParameter('page', 1)); $this->pager->init(); return sfView::SUCCESS; diff --git a/test/functional/pc_backend/communityTopicEventCommentListOrderingTest.php b/test/functional/pc_backend/communityTopicEventCommentListOrderingTest.php new file mode 100644 index 0000000..79f3258 --- /dev/null +++ b/test/functional/pc_backend/communityTopicEventCommentListOrderingTest.php @@ -0,0 +1,55 @@ +info('Login') + ->get('/default/login') + ->click('ログイン', array('admin_user' => array( + 'username' => 'admin', + 'password' => 'password', + ))) + ->with('user')->isAuthenticated(); + +$browser->get('/communityTopic/topicList') + ->with('request')->begin() + ->isParameter('module', 'communityTopic') + ->isParameter('action', 'topicList') + ->end() + ->with('response')->begin() + ->isStatusCode(200) + ->end() +; + +$browser->get('/communityTopic/eventList') + ->with('request')->begin() + ->isParameter('module', 'communityTopic') + ->isParameter('action', 'eventList') + ->end() + ->with('response')->begin() + ->isStatusCode(200) + ->end() +; + +$browser->get('/communityTopic/topicCommentList') + ->with('request')->begin() + ->isParameter('module', 'communityTopic') + ->isParameter('action', 'topicCommentList') + ->end() + ->with('response')->begin() + ->isStatusCode(200) + ->end() +; + +$browser->get('/communityTopic/eventCommentList') + ->with('request')->begin() + ->isParameter('module', 'communityTopic') + ->isParameter('action', 'eventCommentList') + ->end() + ->with('response')->begin() + ->isStatusCode(200) + ->end() +; \ No newline at end of file