public function testFindAllCategory() { VCR::insertCassette('categories.yml'); $categories = Unsplash\Category::all(); VCR::eject(); $this->assertEquals(6, $categories->count()); }
/** * Request APi to get all categories photos * @return string[] Category names indexed by IDs */ public function allCategories() { $categories = []; foreach (Category::all() as $category) { $categories[$category->id] = $category->title; } return $categories; }