getCategoryRepository(); $count = $repo->count([]); self::assertSame(self::COUNT, $count); $category = new Category(); $category->setName('grp'); $category->setType(ProductType::OBJECT); $repo->save($category, true); $count = $repo->count([]); self::assertSame(self::COUNT + 1, $count); $repo->remove($category, true); $count = $repo->count([]); self::assertSame(self::COUNT, $count); $child = new Category(); $child->setName('child'); $child->setType(ProductType::OBJECT); $category->addChild($child); self::assertTrue($category->getChildren()->contains($child)); $category->removeChild($child); self::assertFalse($category->getChildren()->contains($child)); } }