diff --git a/core/lib/Thelia/Tests/Action/ContentTest.php b/core/lib/Thelia/Tests/Action/ContentTest.php index d3110f249..69a7d42c0 100644 --- a/core/lib/Thelia/Tests/Action/ContentTest.php +++ b/core/lib/Thelia/Tests/Action/ContentTest.php @@ -24,6 +24,7 @@ namespace Thelia\Tests\Action; use Thelia\Action\Content; use Thelia\Core\Event\Content\ContentCreateEvent; +use Thelia\Core\Event\Content\ContentDeleteEvent; use Thelia\Core\Event\Content\ContentUpdateEvent; use Thelia\Model\ContentQuery; use Thelia\Model\FolderQuery; @@ -90,6 +91,22 @@ class ContentTest extends BaseAction $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 */