setArticleBeginCallback(function() { return 'begin'; }); $obj_creator->setArticleEndCallback(function() { return 'end'; }); $obj_creator->setBeforeTitleHtml(''); $obj_creator->setAfterTitleHtml(''); $obj_creator->setContentCallback(function() { return 'content'; }); $obj_creator->setImageCallback(function() { return 'image'; }); $obj_creator->setRelatedCallback(function() { return 'related'; }); $article = Arlima_ListFactory::createArticleDataArray(array('url'=>'http://google.se', 'title'=>'Howdy', 'id'=>99)); $template_obj = $obj_creator->create($article, false, new stdClass(), 1); $this->assertEquals(array( "title"=> "Howdy", "url"=>"http://google.se", "html_title" => 'Howdy', "html_text" => "content", "publish_date" => 0, 'post' => 0, "html_content" => "content" ), $template_obj['article']); $this->assertEquals('image', $template_obj['image']['html']); $this->assertEquals('content', $template_obj['article']['html_content']); $this->assertEquals('related', $template_obj['related']); $this->assertEquals('begin', $template_obj['article_begin']); $this->assertEquals('end', $template_obj['article_end']); } function testUnderScoreToBreakInTitle() { $article = Arlima_ListFactory::createArticleDataArray(array('url'=>'http://google.se', 'title'=>'Howdy__there', 'id'=>99)); $obj_creator = new Arlima_TemplateObjectCreator(); $tmpl_object = $obj_creator->create($article, false, new stdClass(), 1); $this->assertEquals('