MDL-69810 tool_mobile: Return support contact information via WS
authorJuan Leyva <juanleyvadelgado@gmail.com>
Thu, 1 Oct 2020 13:20:12 +0000 (15:20 +0200)
committerJuan Leyva <juanleyvadelgado@gmail.com>
Fri, 2 Oct 2020 19:02:37 +0000 (21:02 +0200)
admin/tool/mobile/classes/api.php
admin/tool/mobile/tests/externallib_test.php

index 0fd5f72..9ea41b0 100644 (file)
@@ -323,6 +323,12 @@ class api {
             }
         }
 
             }
         }
 
+        if (empty($section) or $section == 'supportcontact') {
+            $settings->supportname = $CFG->supportname;
+            $settings->supportemail = $CFG->supportemail;
+            $settings->supportpage = $CFG->supportpage;
+        }
+
         return $settings;
     }
 
         return $settings;
     }
 
index 1a16eb7..0909aaf 100644 (file)
@@ -230,6 +230,10 @@ class tool_mobile_external_testcase extends externallib_advanced_testcase {
                 'value' => get_config('core_admin', 'coursecolor' . $number)
             ];
         }
                 'value' => get_config('core_admin', 'coursecolor' . $number)
             ];
         }
+        $expected[] = ['name' => 'supportname', 'value' => $CFG->supportname];
+        $expected[] = ['name' => 'supportemail', 'value' => $CFG->supportemail];
+        $expected[] = ['name' => 'supportpage', 'value' => $CFG->supportpage];
+
         $this->assertCount(0, $result['warnings']);
         $this->assertEquals($expected, $result['settings']);
 
         $this->assertCount(0, $result['warnings']);
         $this->assertEquals($expected, $result['settings']);