function get_navigation_default() { $page = new certificatelistpage(array()); return array(array('name' => get_string('certificatelist', 'block_curr_admin'), 'link' => $page->get_url())); }
/** * Test helper method for getting the course name via certificate settings data */ public function test_class_name_helper_with_cert_setting_data() { $this->load_csv_data(); $certdata = new stdClass(); $certdata->id = 1; $certdata->csid = 2; $certdata->cm_userid = 6; $certdata->entity_id = 3; $certdata->timeissued = 1358139600; $certdata->entity_type = CERTIFICATE_ENTITY_TYPE_COURSE; $certlist = new certificatelistpage(); $certlist->get_cert_entity_name($certdata); $result = $certlist->entitynamebuffer[CERTIFICATE_ENTITY_TYPE_COURSE][0]; // The output string may change the format in which the certificate are displayed. // As long as the string contains both bits of information (query string and course name). $this->assertRegExp('/entity_certificate.php\\?id=1\\&csid=2/', $result); $this->assertRegExp('/Test Course 0/', $result); }