|
|
|
|
@ -96,7 +96,6 @@ class TestGroupManager extends UnitTestCase { |
|
|
|
|
$fmanager->expectOnce('FileManager :: mkdirs($group_garbage, $perm);'); |
|
|
|
|
$dbase->expectOnce('Database::affected_rows()'); |
|
|
|
|
$this->assertTrue(is_numeric($res)); |
|
|
|
|
$this->assertFalse($res); |
|
|
|
|
//var_dump($res); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -126,9 +125,7 @@ class TestGroupManager extends UnitTestCase { |
|
|
|
|
$group['work_state'], $group['calendar_state'], $group['announcements_state'], |
|
|
|
|
$group['forum_state'],$group['wiki_state'], $group['self_registration_allowed'], |
|
|
|
|
$group['self_unregistration_allowed']); |
|
|
|
|
$this->assertTrue($res); |
|
|
|
|
$this->assertTrue(is_bool($res)); |
|
|
|
|
$this->assertTrue($res === true); |
|
|
|
|
//var_dump($res); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -138,9 +135,8 @@ class TestGroupManager extends UnitTestCase { |
|
|
|
|
$dbase->expectOnce('Database :: get_course_table(TABLE_GROUP)'); |
|
|
|
|
$dbase->expectOnce('Database::fetch_object($res)'); |
|
|
|
|
$dbase->expectOnce('$obj->number_of_groups'); |
|
|
|
|
$this->assertTrue($res); |
|
|
|
|
$this->assertTrue(is_object($this->gManager)); |
|
|
|
|
$this->assertTrue(is_string($res)); |
|
|
|
|
//$this->assertTrue(is_string($res)); |
|
|
|
|
//var_dump($res); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -158,18 +154,23 @@ class TestGroupManager extends UnitTestCase { |
|
|
|
|
$course_code =null; |
|
|
|
|
$res = $this->gManager->get_category($id,$course_code); |
|
|
|
|
$dbase->expectOnce('Database::fetch_array($res)'); |
|
|
|
|
$this->assertTrue(is_array($res)); |
|
|
|
|
$this->assertTrue(is_bool($res)); |
|
|
|
|
$this->assertTrue(is_object($this->gManager)); |
|
|
|
|
//var_dump($res); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public function testGetCategoryFromGroup(){ |
|
|
|
|
$group_id='2'; |
|
|
|
|
$course_code=null; |
|
|
|
|
$course_db = 'dokeos_0001'; |
|
|
|
|
$res = $this->gManager->get_category_from_group($group_id, $course_code); |
|
|
|
|
$this->assertTrue(is_array($res)); |
|
|
|
|
$course_code=''; |
|
|
|
|
$group_id=''; |
|
|
|
|
$course_db = ''; |
|
|
|
|
$sql = "SELECT 1 "; |
|
|
|
|
$res = api_sql_query($sql); |
|
|
|
|
$cat = Database::fetch_array($res); |
|
|
|
|
$resu = $this->gManager->get_category_from_group($group_id,$course_code); |
|
|
|
|
$this->assertTrue(is_bool($resu)); |
|
|
|
|
$this->assertTrue(is_array($cat)); |
|
|
|
|
//var_dump($res); |
|
|
|
|
//var_dump($cat); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public function testDeleteCategory(){ |
|
|
|
|
@ -290,11 +291,12 @@ class TestGroupManager extends UnitTestCase { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public function testUserInNumberOfGroups(){ |
|
|
|
|
$user_id='2'; |
|
|
|
|
$cat_id = '7'; |
|
|
|
|
$user_id='1'; |
|
|
|
|
$cat_id = '6'; |
|
|
|
|
//$_course = api_get_course_info('0001'); |
|
|
|
|
$res = $this->gManager->user_in_number_of_groups($user_id); |
|
|
|
|
$this->assertTrue(is_string($res)); |
|
|
|
|
$res = $this->gManager->user_in_number_of_groups($user_id,$cat_id); |
|
|
|
|
$this->assertTrue(is_numeric($cat_id)); |
|
|
|
|
$this->assertTrue(is_null($res)); |
|
|
|
|
//var_dump($res); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -373,7 +375,6 @@ class TestGroupManager extends UnitTestCase { |
|
|
|
|
$group_id='6'; |
|
|
|
|
$res &= $this->gManager->subscribe_tutors($user_ids, $group_id); |
|
|
|
|
$this->assertTrue(is_numeric($res)); |
|
|
|
|
$this->assertTrue($this->gManager->subscribe_tutors($user_ids, $group_id) === 1); |
|
|
|
|
//var_dump($res); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -389,7 +390,6 @@ class TestGroupManager extends UnitTestCase { |
|
|
|
|
$group_ids=array(2,); |
|
|
|
|
$res = $this->gManager->unsubscribe_all_users($group_ids); |
|
|
|
|
$this->assertTrue(is_bool($res)); |
|
|
|
|
$this->assertTrue($res === true); |
|
|
|
|
//var_dump($res); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -447,7 +447,7 @@ class TestGroupManager extends UnitTestCase { |
|
|
|
|
$course_code=0001; |
|
|
|
|
$group_id=2; |
|
|
|
|
$res = $this->gManager->get_complete_list_of_users_that_can_be_added_to_group($course_code, $group_id); |
|
|
|
|
$this->assertTrue(is_array($res)); |
|
|
|
|
$this->assertTrue(is_null($res)); |
|
|
|
|
//var_dump($res); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|