Ejemplo n.º 1
0
 public function fetchLatest()
 {
     $cache_id = 'latest_post';
     if (!($data = $this->_cache->load($cache_id))) {
         $data = parent::fetchLatest();
         $this->_cache->save($data, $cache_id, array('post'));
     }
     return $data;
 }
Ejemplo n.º 2
0
 public function testCreatePost()
 {
     $this->dispatch('/admin/create-post/');
     $this->assertController('error');
     $this->assertAction('error');
     $this->_login();
     $this->dispatch('/admin/create-post/');
     $this->assertController('admin');
     $this->assertAction('create-post');
     $this->request->setMethod('POST')->setPost(array('title' => 'Test!!!!!!!!' . time(), 'content' => 'The test content.', 'category_id' => '5', 'new_category' => '', 'is_published' => 1));
     $this->dispatch('/admin/create-post/');
     //echo $this->getResponse()->getBody(false);
     $this->assertController('admin');
     $this->assertAction('create-post');
     $mapper = new Model_Mapper_Post();
     $post = $mapper->fetchLatest();
     $mapper->delete($post);
     $this->_logout();
 }