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.

Differences Between: [Versions 39 and 311] [Versions 39 and 400] [Versions 39 and 401] [Versions 39 and 402] [Versions 39 and 403]

DML Table tests.

Copyright: 2019 Andrew Nicols <andrew@nicols.co.uk>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 227 lines (9 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: core_dml_table_testcase  - 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