MDL-52821 lti: Change tool_consumer_instance_description to site fullname
authorJohn Okely <john@moodle.com>
Wed, 16 Mar 2016 04:04:07 +0000 (12:04 +0800)
committerJohn Okely <john@moodle.com>
Wed, 16 Mar 2016 04:04:09 +0000 (12:04 +0800)
And change tool_consumer_instance_name to site shortname

mod/lti/locallib.php
mod/lti/tests/externallib_test.php

index 94467ce..52a04f7 100644 (file)
@@ -502,9 +502,9 @@ function lti_build_standard_request($instance, $orgid, $islti2) {
     if (!empty($CFG->mod_lti_institution_name)) {
         $requestparams['tool_consumer_instance_name'] = $CFG->mod_lti_institution_name;
     } else {
-        $requestparams['tool_consumer_instance_name'] = get_site()->fullname;
+        $requestparams['tool_consumer_instance_name'] = get_site()->shortname;
     }
-    $requestparams['tool_consumer_instance_description'] = html_to_text(get_site()->summary, 0);
+    $requestparams['tool_consumer_instance_description'] = get_site()->fullname;
 
     return $requestparams;
 }
index 00b64d7..3c7e793 100644 (file)
@@ -95,8 +95,8 @@ class mod_lti_external_testcase extends externallib_advanced_testcase {
         self::assertEquals($USER->lastname, $parameters['lis_person_name_family']);
         self::assertEquals(fullname($USER), $parameters['lis_person_name_full']);
         self::assertEquals($USER->username, $parameters['ext_user_username']);
-        self::assertEquals("This is a LONG front page summary with html, it should exceed more than seventy-five characters.",
-                           $parameters['tool_consumer_instance_description']);
+        self::assertEquals("phpunit", $parameters['tool_consumer_instance_name']);
+        self::assertEquals("PHPUnit test site", $parameters['tool_consumer_instance_description']);
 
     }