Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

Differences Between: [Versions 310 and 311] [Versions 39 and 311]

(no description)

File Size: 221 lines (8 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: dml_table_test  - X-Ref

DML Table tests.

get_field_select_provider()   X-Ref
Data provider for various \core\dml\table method tests.

return: array

test_get_field_select(string $tablename,array $fieldlist,string $primarykey,string $fieldprefix,string $tablealias,string $expected)   X-Ref
Ensure that \core\dml\table::get_field_select() works as expected.

param: string      $tablename The name of the table
param: array       $fieldlist The list of fields
param: string      $primarykey The name of the primary key
param: string      $fieldprefix The prefix to use for each field
param: string      $tablealias The table AS alias name
param: string      $expected The expected SQL

extract_from_result_provider()   X-Ref
Data provider for \core\dml\table::extract_from_result() tests.

return: array

test_extract_fields_from_result(array $fieldlist,string $primarykey,string $fieldprefix,\stdClass $result,\stdClass $expected)   X-Ref
Ensure that \core\dml\table::extract_from_result() works as expected.

param: array       $fieldlist The list of fields
param: string      $primarykey The name of the primary key
param: string      $fieldprefix The prefix to use for each field
param: \stdClass $result The result of the get_records_sql
param: \stdClass $expected The expected output

test_get_from_sql(string $tablename,array $fieldlist,string $primarykey,string $fieldprefix,string $tablealias,string $expected)   X-Ref
Ensure that \core\dml\table::get_from_sql() works as expected.

param: string      $tablename The name of the table
param: array       $fieldlist The list of fields
param: string      $primarykey The name of the primary key
param: string      $fieldprefix The prefix to use for each field
param: string      $tablealias The table AS alias name
param: string      $expected The expected SQL