remove unused method in CategoryTest

This commit is contained in:
Manuel Raynaud
2014-02-04 10:57:59 +01:00
parent 0601d16a52
commit 67365af88e

View File

@@ -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();