/**
  * Delete category.
  *
  * @param CatalogCategory $category
  * @return void
  */
 public function test(CatalogCategory $category)
 {
     // Preconditions:
     $category->persist();
     // Steps:
     $this->catalogCategoryIndex->open();
     $this->catalogCategoryIndex->getTreeCategories()->selectCategory($category);
     $this->catalogCategoryIndex->getFormPageActions()->deleteAndAcceptAlert();
 }
 /**
  * Create category.
  *
  * @param CatalogCategory $category
  * @param string $addCategory
  * @return void
  */
 public function test(CatalogCategory $category, $addCategory)
 {
     // Steps
     $this->catalogCategoryIndex->open();
     $this->catalogCategoryIndex->getTreeCategories()->selectCategory($category, false);
     $this->catalogCategoryIndex->getTreeCategories()->{$addCategory}();
     $this->catalogCategoryIndex->getCategoryForm()->fill($category);
     $this->catalogCategoryIndex->getFormPageActions()->save();
 }
 /**
  * Update category.
  *
  * @param CatalogCategory $category
  * @param CatalogCategory $initialCategory
  * @param string $unassignedProductsKeys [optional]
  * @return array
  */
 public function test(CatalogCategory $category, CatalogCategory $initialCategory, $unassignedProductsKeys = '')
 {
     $this->unassignedProductsKeys = $unassignedProductsKeys;
     $initialCategory->persist();
     $this->catalogCategoryIndex->open();
     $this->catalogCategoryIndex->getTreeCategories()->selectCategory($initialCategory);
     $category = $this->updateCategoryFixture($initialCategory, $category);
     $this->catalogCategoryIndex->getCategoryForm()->fill($category);
     $this->catalogCategoryIndex->getFormPageActions()->save();
     return ['category' => $category, 'unassignedProducts' => $this->unassignedProducts];
 }