Example #1
0
 public function add_institution_request($institution, $studentid = null)
 {
     if (empty($institution) || $institution == 'mahara') {
         return;
     }
     require_once 'institution.php';
     $institution = new Institution($institution);
     $institution->addRequestFromUser($this, $studentid);
 }
 function mahara_institution_decline_members($client)
 {
     //Set test data
     $dbuser1 = $this->create_user1_for_update();
     $dbuser2 = $this->create_user2_for_update();
     $this->clean_institution();
     $institution = new Institution($this->testinstitution);
     $institution->addRequestFromUser($dbuser1);
     $institution->addRequestFromUser($dbuser2);
     $dbinvites = get_records_array('usr_institution_request', 'institution', $this->testinstitution);
     $this->assertEquals(2, count($dbinvites));
     //update the users by web service
     $function = 'mahara_institution_decline_members';
     $params = array('institution' => $this->testinstitution, 'users' => array(array('id' => $dbuser1->id), array('id' => $dbuser2->id)));
     $client->call($function, $params);
     $dbinvites = get_records_array('usr_institution_request', 'institution', $this->testinstitution);
     $this->assertTrue(empty($dbinvites));
 }