Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 3.9.x will end* 10 May 2021 (12 months).
  • Bug fixes for security issues in 3.9.x will end* 8 May 2023 (36 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

Provides \core\update\testable_api class.

Copyright: 2015 David Mudrak <david@moodle.com>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 210 lines (7 kb)
Included or required: 2 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

testable_api:: (3 methods):
  convert_branch_numbering_format()
  get_serviceurl_pluginfo()
  call_service()


Class: testable_api  - X-Ref

Testable variant of \core\update\api class.

Provides access to some protected methods we want to explicitly test and
bypass the actual cURL calls by providing fake responses.

convert_branch_numbering_format($branch)   X-Ref
Provides access to the parent protected method.

param: int $branch
return: string

get_serviceurl_pluginfo()   X-Ref
Returns fake URL of the pluginfo.php API end-point.

return: string

call_service($serviceurl, array $params=array()   X-Ref
Mimics the call to the given end-point service with the given parameters.

This simulates a hypothetical plugins directory with a single plugin
'foo_bar' available (with a single release).

param: string $serviceurl
param: array $params
return: stdClass|bool