diff --git a/core/lib/Thelia/Tests/Action/CategoryTest.php b/core/lib/Thelia/Tests/Action/CategoryTest.php index 50d60f01a..c33bd66ac 100644 --- a/core/lib/Thelia/Tests/Action/CategoryTest.php +++ b/core/lib/Thelia/Tests/Action/CategoryTest.php @@ -44,72 +44,6 @@ use Thelia\Tools\URL; class CategoryTest extends TestCaseWithURLToolSetup { - protected function getRandomCategory() - { - $category = CategoryQuery::create() - ->addAscendingOrderByColumn('RAND()') - ->findOne(); - - if (null === $category) { - $this->fail('use fixtures before launching test, there is no category in database'); - } - - return $category; - } - - public function getUpdateEvent(&$category) - { - if (!$category instanceof \Thelia\Model\Category) { - $category = $this->getRandomCategory(); - } - - $event = new CategoryUpdateEvent($category->getId()); - - $event - ->setLocale('en_US') - ->setTitle('bar') - ->setDescription('bar description') - ->setChapo('bar chapo') - ->setPostscriptum('bar postscriptum') - ->setVisible(0) - ->setParent(0) - ->setDispatcher($this->getDispatcher()) - ; - } - - public function getUpdateSeoEvent(&$category) - { - if (!$category instanceof \Thelia\Model\Category) { - $category = $this->getRandomCategory(); - } - - $event = new UpdateSeoEvent($category->getId()); - $event->setDispatcher($this->getDispatcher()); - $event - ->setLocale($category->getLocale()) - ->setMetaTitle($category->getMetaTitle()) - ->setMetaDescription($category->getMetaDescription()) - ->setMetaKeywords($category->getMetaKeywords()); - - return $event; - } - - public function processUpdateAction($event) - { - $action = new Category(); - $action->update($event); - - return $event->getCategory(); - } - - public function processUpdateSeoAction($event) - { - $action = new Category(); - - return $action->updateSeo($event); - - } - public function testCreate() { $event = new CategoryCreateEvent();