|
|
@ -134,7 +134,7 @@ class TestSurveyManager extends UnitTestCase { |
|
|
|
$db_name=''; |
|
|
|
$db_name=''; |
|
|
|
$survey_id=''; |
|
|
|
$survey_id=''; |
|
|
|
$res=SurveyManager::get_author($db_name,$survey_id); |
|
|
|
$res=SurveyManager::get_author($db_name,$survey_id); |
|
|
|
$this->assertTrue(is_bool($res)); |
|
|
|
$this->assertTrue(is_null($res)); |
|
|
|
//var_dump($res); |
|
|
|
//var_dump($res); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -142,13 +142,13 @@ class TestSurveyManager extends UnitTestCase { |
|
|
|
$id=''; |
|
|
|
$id=''; |
|
|
|
$field=''; |
|
|
|
$field=''; |
|
|
|
$res=SurveyManager::get_data($id, $field); |
|
|
|
$res=SurveyManager::get_data($id, $field); |
|
|
|
$this->assertTrue(is_bool($res)); |
|
|
|
$this->assertTrue(is_null($res)); |
|
|
|
//var_dump($res); |
|
|
|
//var_dump($res); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function testget_groupname() { |
|
|
|
function testget_groupname() { |
|
|
|
$db_name=''; |
|
|
|
$db_name=''; |
|
|
|
$gid=''; |
|
|
|
$gid='0011'; |
|
|
|
$res=SurveyManager::get_groupname($db_name,$gid); |
|
|
|
$res=SurveyManager::get_groupname($db_name,$gid); |
|
|
|
if(!is_null($res))$this->assertTrue(is_bool($res)); |
|
|
|
if(!is_null($res))$this->assertTrue(is_bool($res)); |
|
|
|
//var_dump($res); |
|
|
|
//var_dump($res); |
|
|
@ -165,12 +165,13 @@ class TestSurveyManager extends UnitTestCase { |
|
|
|
function testget_question_type() { |
|
|
|
function testget_question_type() { |
|
|
|
$questionid=''; |
|
|
|
$questionid=''; |
|
|
|
$res=SurveyManager::get_question_type($questionid); |
|
|
|
$res=SurveyManager::get_question_type($questionid); |
|
|
|
$this->assertTrue(is_bool($res)); |
|
|
|
$this->assertTrue(is_null($res)); |
|
|
|
//var_dump($res); |
|
|
|
//var_dump($res); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function testget_questions_move() { |
|
|
|
function testget_questions_move() { |
|
|
|
$curr_dbname=''; |
|
|
|
$curr_dbname=''; |
|
|
|
|
|
|
|
$row['caption'] = ''; |
|
|
|
$question1=array("caption"=> $row['caption'], "qid" => $row['qid'],"sortby" => $row['sortby']); |
|
|
|
$question1=array("caption"=> $row['caption'], "qid" => $row['qid'],"sortby" => $row['sortby']); |
|
|
|
$res=SurveyManager::get_questions_move($curr_dbname); |
|
|
|
$res=SurveyManager::get_questions_move($curr_dbname); |
|
|
|
$this->assertTrue(is_array($question1)); |
|
|
|
$this->assertTrue(is_array($question1)); |
|
|
@ -185,7 +186,11 @@ class TestSurveyManager extends UnitTestCase { |
|
|
|
$objm=@Database::fetch_object($resm); |
|
|
|
$objm=@Database::fetch_object($resm); |
|
|
|
$ss = $objm->status ; |
|
|
|
$ss = $objm->status ; |
|
|
|
$res=SurveyManager::get_status(); |
|
|
|
$res=SurveyManager::get_status(); |
|
|
|
|
|
|
|
if(!$res = null ){ |
|
|
|
|
|
|
|
$this->assertTrue(is_null($res)); |
|
|
|
|
|
|
|
}else{ |
|
|
|
$this->assertTrue(is_string($res)); |
|
|
|
$this->assertTrue(is_string($res)); |
|
|
|
|
|
|
|
} |
|
|
|
//var_dump($res); |
|
|
|
//var_dump($res); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -196,7 +201,8 @@ class TestSurveyManager extends UnitTestCase { |
|
|
|
$res = Database::query($sql_query, __FILE__, __LINE__); |
|
|
|
$res = Database::query($sql_query, __FILE__, __LINE__); |
|
|
|
$firstname=@Database::result($res,0,'firstname'); |
|
|
|
$firstname=@Database::result($res,0,'firstname'); |
|
|
|
$res=SurveyManager::get_survey_author($authorid); |
|
|
|
$res=SurveyManager::get_survey_author($authorid); |
|
|
|
$this->assertTrue(is_bool($firstname)); |
|
|
|
$this->assertTrue(is_null($firstname)); |
|
|
|
|
|
|
|
$this->assertNull($res); |
|
|
|
//var_dump($firstname); |
|
|
|
//var_dump($firstname); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -204,7 +210,7 @@ class TestSurveyManager extends UnitTestCase { |
|
|
|
$table_survey=''; |
|
|
|
$table_survey=''; |
|
|
|
$survey_code=''; |
|
|
|
$survey_code=''; |
|
|
|
$res=SurveyManager::get_survey_code($table_survey,$survey_code); |
|
|
|
$res=SurveyManager::get_survey_code($table_survey,$survey_code); |
|
|
|
$this->assertTrue(is_bool($res)); |
|
|
|
$this->assertTrue(is_null($res)); |
|
|
|
//var_dump($res); |
|
|
|
//var_dump($res); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -220,7 +226,7 @@ class TestSurveyManager extends UnitTestCase { |
|
|
|
$db_name=''; |
|
|
|
$db_name=''; |
|
|
|
$group_id=''; |
|
|
|
$group_id=''; |
|
|
|
$res=SurveyManager::get_surveyid($db_name,$group_id); |
|
|
|
$res=SurveyManager::get_surveyid($db_name,$group_id); |
|
|
|
$this->assertTrue(is_bool($res)); |
|
|
|
$this->assertTrue(is_null($res)); |
|
|
|
//var_dump($res); |
|
|
|
//var_dump($res); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -228,14 +234,14 @@ class TestSurveyManager extends UnitTestCase { |
|
|
|
$db_name=''; |
|
|
|
$db_name=''; |
|
|
|
$sid=''; |
|
|
|
$sid=''; |
|
|
|
$res=SurveyManager::get_surveyname($db_name,$sid); |
|
|
|
$res=SurveyManager::get_surveyname($db_name,$sid); |
|
|
|
$this->assertTrue(is_bool($res)); |
|
|
|
$this->assertTrue(is_null($res)); |
|
|
|
//var_dump($res); |
|
|
|
//var_dump($res); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function testget_surveyname_display() { |
|
|
|
function testget_surveyname_display() { |
|
|
|
$sid=''; |
|
|
|
$sid=''; |
|
|
|
$res=SurveyManager::get_surveyname_display($sid); |
|
|
|
$res=SurveyManager::get_surveyname_display($sid); |
|
|
|
$this->assertTrue(is_bool($res)); |
|
|
|
$this->assertTrue(is_null($res)); |
|
|
|
//var_dump($res); |
|
|
|
//var_dump($res); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -300,12 +306,12 @@ class TestSurveyManager extends UnitTestCase { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function testinsert_groups() { |
|
|
|
function testinsert_groups() { |
|
|
|
$sid=''; |
|
|
|
$sid='001'; |
|
|
|
$newgid=''; |
|
|
|
$newgid='0001'; |
|
|
|
$gids=''; |
|
|
|
$gids='0011'; |
|
|
|
$table_group=''; |
|
|
|
$table_group='011'; |
|
|
|
$table_question=''; |
|
|
|
$table_question='11'; |
|
|
|
$res=SurveyManager::insert_groups($sid,$gids,$table_group,$table_question ); |
|
|
|
$res=SurveyManager::insert_groups($sid,$newgid,$gids,$table_group,$table_question); |
|
|
|
$this->assertTrue(is_null($res)); |
|
|
|
$this->assertTrue(is_null($res)); |
|
|
|
//var_dump($res); |
|
|
|
//var_dump($res); |
|
|
|
} |
|
|
|
} |
|
|
@ -394,14 +400,14 @@ class TestSurveyManager extends UnitTestCase { |
|
|
|
function testpick_author() { |
|
|
|
function testpick_author() { |
|
|
|
$survey_id=''; |
|
|
|
$survey_id=''; |
|
|
|
$res=SurveyManager::pick_author($survey_id); |
|
|
|
$res=SurveyManager::pick_author($survey_id); |
|
|
|
$this->assertTrue(is_bool($res)); |
|
|
|
$this->assertTrue(is_null($res)); |
|
|
|
//var_dump($res); |
|
|
|
//var_dump($res); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function testpick_surveyname() { |
|
|
|
function testpick_surveyname() { |
|
|
|
$sid=''; |
|
|
|
$sid=''; |
|
|
|
$res=SurveyManager::pick_surveyname($sid); |
|
|
|
$res=SurveyManager::pick_surveyname($sid); |
|
|
|
$this->assertTrue(is_bool($res)); |
|
|
|
$this->assertTrue(is_null($res)); |
|
|
|
//var_dump($res); |
|
|
|
//var_dump($res); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|