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.

Class: tablelib_test  - X-Ref

Test some of tablelib.

generate_columns($cols)   X-Ref
No description

generate_headers($cols)   X-Ref
No description

generate_data($rows, $cols)   X-Ref
No description

run_table_test($columns, $headers, $sortable, $collapsible, $suppress, $nosorting, $data,$pagesize, $caption = '', $captionattribute = [])   X-Ref
Create a table with properties as passed in params, add data and output html.

param: string[] $columns The columns of the table.
param: string[] $headers The header of the table.
param: bool $sortable Sorting of the table.
param: bool $collapsible Is table collapsible.
param: string[] $suppress Suppress columns.
param: string[] $nosorting No sorting.
param: (array|object)[] $data The data of the table.
param: int $pagesize Page size of the table
param: string $caption Caption of the table.
param: array $captionattribute The attribute of the caption.

create_and_setup_table($columns, $headers, $sortable, $collapsible, $suppress, $nosorting,$caption = '', $captionattribute = '')   X-Ref
Create a table with properties as passed in params.

param: string[] $columns The columns of the table.
param: string[] $headers The header of the table.
param: bool $sortable Sorting of the table.
param: bool $collapsible Is table collapsible.
param: string[] $suppress Suppress columns.
param: string[] $nosorting No sorting.
param: string $caption Caption of the table.
param: array $captionattribute The attribute of the caption.
return: flexible_table

test_empty_table()   X-Ref
No description

test_has_next_pagination()   X-Ref
No description

test_has_hide()   X-Ref
No description

test_has_not_hide()   X-Ref
No description

test_has_sort()   X-Ref
No description

test_has_not_sort()   X-Ref
No description

test_has_not_next_pagination()   X-Ref
No description

test_1_col()   X-Ref
No description

test_empty_rows()   X-Ref
No description

test_5_cols()   X-Ref
No description

test_50_cols()   X-Ref
No description

fullname_column_provider()   X-Ref
Data provider for test_fullname_column

return: array

test_fullname_column(string $format)   X-Ref
Test fullname column observes configured alternate fullname format configuration

param: string $format
return: void

test_fullname_column_prohibit_viewfullnames(string $format)   X-Ref
Test fullname column ignores fullname format configuration for a user with viewfullnames capability prohibited

param: string $format
return: void

test_get_row_html()   X-Ref
No description

test_persistent_table()   X-Ref
No description

prepare_table_for_reset_test($tableid)   X-Ref
Helper method for preparing tables instances in {@link self::test_can_be_reset()}.

param: string $tableid
return: testable_flexible_table

test_can_be_reset()   X-Ref
No description

test_table_export()   X-Ref
Test export in CSV format


test_initials_first_set(?string $getvalue, ?string $setvalue, ?string $finalvalue)   X-Ref
Test the initials functionality.

param: string|null $getvalue
param: string|null $setvalue
param: string|null $finalvalue

test_initials_last_set(?string $getvalue, ?string $setvalue, ?string $finalvalue)   X-Ref
Test the initials functionality.

param: string|null $getvalue
param: string|null $setvalue
param: string|null $finalvalue

initials_provider()   X-Ref
Data for testing initials providers.

return: array

test_set_and_render_caption_for_table()   X-Ref
Data test for set and render caption for table.