How can i test multiple queries result with phpunit

I am a bit new in phpunit, after hours of researching I am not quite find a way. How can I test function getResults using phpunit.\[code\] public function getResults($fName, $lName) { $userIDs = searchUser($fName, $lName); return array( 'userIDs' => $userIDs, 'count' => getResultDetails($userIDs), 'results' => getResultDetails($userIDs, 0, 500), ) }\[/code\]This is the search forUser base on firName and lastName it will return string of userIDs seperate by commas\[code\] public function searchUser($fName, $lName) { // logic to do search user and return user result seperate by commas return userIDs; } \[/code\]Ift limit and offset being pass in then return the result, otherwise return count for everything\[code\] public function getResultDetails($userIDs, $limit = null, $offset =null) { //open db connection $sql = ''; if(!$limit && !$offset) { $sql .= 'SELECT count(*) '; } else { $sql .= 'SELECT a.info, b.info, d.info '; } $sql .= 'FROM a '; $sql .= 'inner join b on blah blah'; $sql .= 'inner join d blah blah'; $sql .= "where d.userID in ($userIDs)"; if($limit && $offset) $sql .= "LIMIT $limit, $offset"; return mysql_query($sql); }\[/code\]
 
Top