Пример #1
0
 /**
  * Index
  */
 public function indexAction()
 {
     $manager = new Forum_Model_Category_Manager();
     $this->view->categories = $manager->getRoot()->getAllChildren(null, 'path');
     $posts = new Forum_Model_Post_Table();
     $this->view->posts = $posts->getLastPosts();
 }
Пример #2
0
 public function testEditWithDataAction()
 {
     $table = new Forum_Model_Post_Table();
     $manager = new Forum_Model_Category_Manager();
     $rootCat = $manager->getRoot();
     $cat = $manager->getDbTable()->createRow($this->_fixture['category']);
     $rootCat->addChild($cat);
     $post = $table->createRow($this->_fixture['post']);
     $post->save();
     $this->_doLogin();
     $this->request->setMethod('POST')->setPost(array('title' => 'tttttttt', 'body' => 'tttttttt', 'categoryId' => 33, 'status' => 'active'));
     $this->dispatch('/forum/post/edit/id/45');
     $this->assertModule('forum');
     $this->assertController('post');
     $this->assertAction('edit');
     $this->assertRedirect();
     $post->delete();
     $cat->delete();
 }