From 6577a37ed40afca34c325452c0c96b63ad58d714 Mon Sep 17 00:00:00 2001 From: Arthur Portugal Date: Wed, 10 Mar 2010 08:53:44 -0500 Subject: [PATCH 1/2] Removed \"extra_\" for legal_accept because not exists like element --- main/auth/inscription.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/auth/inscription.php b/main/auth/inscription.php index 42aae77722..d3ce888b9c 100755 --- a/main/auth/inscription.php +++ b/main/auth/inscription.php @@ -328,7 +328,7 @@ if (api_get_setting('allow_terms_conditions') == 'true') { } if ($term_preview['type'] == 1) { $form->addElement('checkbox', 'legal_accept', null, get_lang('IHaveReadAndAgree').' '.get_lang('TermsAndConditions').''); - $form->addRule('extra_legal_accept', get_lang('ThisFieldIsRequired'), 'required'); + $form->addRule('legal_accept', get_lang('ThisFieldIsRequired'), 'required'); } else { if (!empty($term_preview['content'])) { $preview = LegalManager::show_last_condition($term_preview); From 259ef530ffa3d12b5ae48f456235722f5a139d15 Mon Sep 17 00:00:00 2001 From: aportugal Date: Wed, 10 Mar 2010 08:54:44 -0500 Subject: [PATCH 2/2] merge --- .../lib/be/forumthreadlink.class.test.php | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/tests/main/gradebook/lib/be/forumthreadlink.class.test.php b/tests/main/gradebook/lib/be/forumthreadlink.class.test.php index 03a1138164..493db7f7a8 100644 --- a/tests/main/gradebook/lib/be/forumthreadlink.class.test.php +++ b/tests/main/gradebook/lib/be/forumthreadlink.class.test.php @@ -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); + }