remove unused method in CategoryTest
This commit is contained in:
@@ -44,72 +44,6 @@ use Thelia\Tools\URL;
|
|||||||
class CategoryTest extends TestCaseWithURLToolSetup
|
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()
|
public function testCreate()
|
||||||
{
|
{
|
||||||
$event = new CategoryCreateEvent();
|
$event = new CategoryCreateEvent();
|
||||||
|
|||||||
Reference in New Issue
Block a user