Пример #1
0
 /**
  * Delete category
  *
  * @param CatalogCategory $category
  * @return void
  */
 public function test(CatalogCategory $category)
 {
     $category->persist();
     $this->catalogCategoryIndex->open();
     $this->catalogCategoryIndex->getTreeCategories()->selectCategory($category);
     $this->catalogCategoryEdit->getFormPageActions()->delete();
 }
 /**
  * Test for update category
  *
  * @param Category $category
  * @param Category $initialCategory
  * @return void
  */
 public function test(Category $category, Category $initialCategory)
 {
     $this->catalogCategoryIndex->open();
     $this->catalogCategoryIndex->getTreeCategories()->selectCategory($initialCategory);
     $this->catalogCategoryEdit->getEditForm()->fill($category);
     $this->catalogCategoryEdit->getFormPageActions()->save();
 }
Пример #3
0
 /**
  * Delete category.
  *
  * @param Category $category
  * @return void
  */
 public function test(Category $category)
 {
     $category->persist();
     $this->catalogCategoryIndex->open();
     $this->catalogCategoryIndex->getTreeCategories()->selectCategory($category);
     if ($this->catalogCategoryEdit->getFormPageActions()->checkDeleteButton()) {
         $this->catalogCategoryEdit->getFormPageActions()->delete();
         $this->catalogCategoryEdit->getModalBlock()->acceptAlert();
     }
 }
 /**
  * Assert that displayed category data on edit page equals passed from fixture.
  *
  * @param CatalogCategoryIndex $catalogCategoryIndex
  * @param CatalogCategoryEdit $catalogCategoryEdit
  * @param Category $category
  * @return void
  */
 public function processAssert(CatalogCategoryIndex $catalogCategoryIndex, CatalogCategoryEdit $catalogCategoryEdit, Category $category)
 {
     $catalogCategoryIndex->open();
     $catalogCategoryIndex->getTreeCategories()->selectCategory($category, true);
     $fixtureData = $this->prepareFixtureData($category->getData());
     $formData = $catalogCategoryEdit->getEditForm()->getData($category);
     $error = $this->verifyData($this->sortData($fixtureData), $this->sortData($formData));
     \PHPUnit_Framework_Assert::assertEmpty($error, $error);
 }
 /**
  * Assert that not displayed category in backend catalog category tree.
  *
  * @param CatalogCategoryIndex $catalogCategoryIndex
  * @param Category $category
  * @return void
  */
 public function processAssert(CatalogCategoryIndex $catalogCategoryIndex, Category $category)
 {
     $catalogCategoryIndex->open();
     \PHPUnit_Framework_Assert::assertFalse($catalogCategoryIndex->getTreeCategories()->isCategoryVisible($category), 'Category is displayed in backend catalog category tree.');
 }