Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is 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