public function testDestroy()
 {
     $this->testCreateNew();
     //Create new first
     $category = Category::find('1');
     $category->delete();
     $result = Category::find('1');
     $this->assertTrue($result == null);
 }
Exemplo n.º 2
0
 public static function printCategory($id)
 {
     $category = Category::find($id);
     if ($category != null) {
         echo "<ul>";
         echo "<li><a href='" . $category->id . "'>" . $category->name . "</a>";
         foreach (Category::where('category_id', $id)->where('active', true)->get() as $cat) {
             Category::printCategory($cat->id);
         }
         echo "</li>";
         echo "</ul>";
     }
 }