示例#1
0
 protected function tearDown()
 {
     $this->blog->delete();
     $this->article->delete();
 }
示例#2
0
 /**
  * Remove the objects created in the database.
  */
 public static function tearDownAfterClass()
 {
     if (self::$TestBlogID) {
         // Remove it!
         $blog = new BlogModel(self::$TestBlogID);
         $blog->delete();
     }
 }
示例#3
0
 /**
  * Delete a blog
  */
 public function delete()
 {
     $view = $this->getView();
     $request = $this->getPageRequest();
     $blog = new BlogModel($request->getParameter(0));
     if (!$blog->exists()) {
         return View::ERROR_NOTFOUND;
     }
     $manager = \Core\user()->checkAccess('p:/blog/manage_all');
     $editor = \Core\user()->checkAccess($blog->get('manage_articles_permission ')) || $manager;
     if (!$manager) {
         return View::ERROR_ACCESSDENIED;
     }
     if (!$request->isPost()) {
         return View::ERROR_BADREQUEST;
     }
     $blog->delete();
     \core\go_back();
 }