Example #1
0
 /**
  * @depends testAddCategory
  */
 public function testRemoveCategory(array $productCategory)
 {
     $product = $productCategory['product'];
     $category = $productCategory['category'];
     $product->clearProductCategories();
     $this->assertEquals(2, count($product->getProductCategories()));
     $event = new ProductDeleteCategoryEvent($product, $category->getId());
     $event->setDispatcher($this->getDispatcher());
     $action = new Product();
     $action->removeCategory($event);
     $product->clearProductCategories();
     $this->assertEquals(1, count($product->getProductCategories()));
     return $product;
 }