/** * @covers sCategories::sGetCategoryPath */ public function testsGetCategoryPath() { // Default arguments should work $this->assertEquals($this->module->sGetCategoryPath(21), $this->module->sGetCategoryPath(21, Shopware()->Shop()->get('parentID'))); // Looking for elements in root gives full path $this->assertCount(2, $this->module->sGetCategoryPath(21, 3)); // Looking for elements in wrong paths returns empty array $this->assertCount(0, $this->module->sGetCategoryPath(21, 39)); }
/** * Returns a category path by category id. * * @param int $category * @param int $end * @return array */ public function getCategoryPath($category, $end) { return $this->module->sGetCategoryPath($category, $end); }