|
|
|
@ -7,9 +7,28 @@ class TestForumThreadLink extends UnitTestCase { |
|
|
|
|
|
|
|
|
|
public function __construct() { |
|
|
|
|
// The constructor acts like a global setUp for the class |
|
|
|
|
TestManager::create_test_course('COURSEFORUMTHREAD'); |
|
|
|
|
TestManager::create_test_course('COURSEFORUMTHREAD'); |
|
|
|
|
$this->forumthreadlink = new ForumThreadLink(); |
|
|
|
|
$this->forumthreadlink->set_id(1); |
|
|
|
|
$this->forumthreadlink->set_type(5); |
|
|
|
|
$this->forumthreadlink->set_ref_id(1); |
|
|
|
|
$this->forumthreadlink->set_user_id(1); |
|
|
|
|
$this->forumthreadlink->set_course_code('COURSEFORUMTHREAD'); |
|
|
|
|
$this->forumthreadlink->set_category_id(1); |
|
|
|
|
$this->forumthreadlink->set_date(date); |
|
|
|
|
$this->forumthreadlink->set_weight(1); |
|
|
|
|
$this->forumthreadlink->set_visible('visible'); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public function testcalc_score() { |
|
|
|
|
$res = $this->forumthreadlink->calc_score(null); |
|
|
|
|
$this->assertNull($res); |
|
|
|
|
//var_dump($res); |
|
|
|
|
$res2 = $this->forumthreadlink->calc_score(1); |
|
|
|
|
$this->assertTrue(is_array($res2)); |
|
|
|
|
//var_dump($res2); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|