1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-05-05 10:28:19 +03:00
ifhub.club/tests/fixtures/BlogFixtures.php

40 lines
1.1 KiB
PHP
Raw Normal View History

<?php
require_once(realpath((dirname(__FILE__)) . "/../AbstractFixtures.php"));
class BlogFixtures extends AbstractFixtures
{
2013-07-24 18:17:30 +03:00
/**
* @return int
*/
public static function getOrder()
{
2013-07-24 18:17:30 +03:00
return 2;
}
2013-07-24 18:17:30 +03:00
/**
* Create Blog
*/
public function load()
{
2012-11-30 14:37:39 +02:00
$oUserFirst = $this->getReference('user-golfer');
2013-07-24 18:17:30 +03:00
$oCategory = $this->getReference('blog-category');
/* @var $oBlogGadgets ModuleBlog_EntityBlog */
$oBlogGadgets = Engine::GetEntity('Blog');
2012-11-29 17:18:57 +02:00
$oBlogGadgets->setOwnerId($oUserFirst->getId());
$oBlogGadgets->setTitle("Gadgets");
$oBlogGadgets->setDescription('Offers latest gadget reviews');
$oBlogGadgets->setType('open');
$oBlogGadgets->setDateAdd(date("Y-m-d H:i:s")); // @todo freeze
$oBlogGadgets->setUrl('gadgets');
$oBlogGadgets->setLimitRatingTopic(0);
2013-07-24 18:17:30 +03:00
$oBlogGadgets->setCategoryId($oCategory->getCategoryId());
$this->oEngine->Blog_AddBlog($oBlogGadgets);
$this->addReference('blog-gadgets', $oBlogGadgets);
}
}