public function test_fetching_categories()
 {
     $parent = Factory::create(new Category(), ['is_inheriting' => true, 'page_rows' => 2, 'page_columns' => 2]);
     $child = Factory::create(new Category(), ['parent_id' => $parent->id]);
     $repo = new CategoryRepository();
     $this->assertEquals(1, $repo->getRootCategories()->count());
     $this->assertEquals(2, $repo->getAllCategories()->count());
 }
예제 #2
0
 /**
  * Fetch the categories
  *
  * @return void
  */
 public function onRun()
 {
     $this->categories = $this->repository->getAllCategories();
 }