From 4e323bfe8bd3f04f2d1b252f886d94ad28319289 Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Tue, 1 Oct 2013 16:13:55 +0200 Subject: [PATCH] create test for content removal --- core/lib/Thelia/Tests/Action/ContentTest.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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 */