create test for content removal
This commit is contained in:
@@ -24,6 +24,7 @@
|
|||||||
namespace Thelia\Tests\Action;
|
namespace Thelia\Tests\Action;
|
||||||
use Thelia\Action\Content;
|
use Thelia\Action\Content;
|
||||||
use Thelia\Core\Event\Content\ContentCreateEvent;
|
use Thelia\Core\Event\Content\ContentCreateEvent;
|
||||||
|
use Thelia\Core\Event\Content\ContentDeleteEvent;
|
||||||
use Thelia\Core\Event\Content\ContentUpdateEvent;
|
use Thelia\Core\Event\Content\ContentUpdateEvent;
|
||||||
use Thelia\Model\ContentQuery;
|
use Thelia\Model\ContentQuery;
|
||||||
use Thelia\Model\FolderQuery;
|
use Thelia\Model\FolderQuery;
|
||||||
@@ -90,6 +91,22 @@ class ContentTest extends BaseAction
|
|||||||
$this->assertEquals($folder->getId(), $updatedContent->getDefaultFolderId());
|
$this->assertEquals($folder->getId(), $updatedContent->getDefaultFolderId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testDeleteContent()
|
||||||
|
{
|
||||||
|
$content = $this->getRandomContent();
|
||||||
|
|
||||||
|
$event = new ContentDeleteEvent($content->getId());
|
||||||
|
|
||||||
|
$contentAction = new Content($this->getContainer());
|
||||||
|
$contentAction->delete($event);
|
||||||
|
|
||||||
|
$deletedContent = $event->getContent();
|
||||||
|
|
||||||
|
$this->assertInstanceOf('Thelia\Model\Content', $deletedContent);
|
||||||
|
$this->assertTrue($deletedContent->isDeleted());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return \Thelia\Model\Content
|
* @return \Thelia\Model\Content
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user