create test for content removal

This commit is contained in:
Manuel Raynaud
2013-10-01 16:13:55 +02:00
parent 2f736c7759
commit 4e323bfe8b

View File

@@ -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
*/