Merge branch 'MDL-55022-master' of git://github.com/junpataleta/moodle
authorDan Poltawski <dan@moodle.com>
Tue, 28 Jun 2016 10:27:35 +0000 (11:27 +0100)
committerDan Poltawski <dan@moodle.com>
Thu, 30 Jun 2016 08:24:56 +0000 (09:24 +0100)
mod/lti/classes/external.php
mod/lti/tests/externallib_test.php

index fca7c77..e6d5181 100644 (file)
@@ -523,7 +523,7 @@ class mod_lti_external extends external_api {
         }
 
         if (!empty($capabilityoffered)) {
-            $config->lti_capabilities = $capabilitiesoffered;
+            $config->lti_capabilities = $capabilityoffered;
         }
 
         if (!empty($serviceoffered)) {
index b3ba4ea..a7f0323 100644 (file)
@@ -285,10 +285,12 @@ class mod_lti_external_testcase extends externallib_advanced_testcase {
      * Test create tool proxy
      */
     public function test_mod_lti_create_tool_proxy() {
-        $proxy = mod_lti_external::create_tool_proxy('Test proxy', $this->getExternalTestFileUrl('/test.html'), array(), array());
+        $capabilities = ['AA', 'BB'];
+        $proxy = mod_lti_external::create_tool_proxy('Test proxy', $this->getExternalTestFileUrl('/test.html'), $capabilities, []);
         $this->assertEquals('Test proxy', $proxy->name);
         $this->assertEquals($this->getExternalTestFileUrl('/test.html'), $proxy->regurl);
         $this->assertEquals(LTI_TOOL_PROXY_STATE_PENDING, $proxy->state);
+        $this->assertEquals(implode("\n", $capabilities), $proxy->capabilityoffered);
     }
 
     /*