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: 2508 lines (111 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: ddl_test  - X-Ref

DDL layer tests.

setUp()   X-Ref
No description

create_deftable($tablename)   X-Ref
No description

fill_deftable($tablename)   X-Ref
Fill the given test table with some records, as far as
DDL behaviour must be tested both with real data and
with empty tables

param: string $tablename
return: int count of records

test_table_exists()   X-Ref
Test behaviour of table_exists()


test_create_table()   X-Ref
Test behaviour of create_table()


test_row_size_limits()   X-Ref
Test if database supports tables with many TEXT fields,
InnoDB is known to failed during data insertion instead
of table creation when text fields contain actual data.


test_drop_table()   X-Ref
Test behaviour of drop_table()


test_rename_table()   X-Ref
Test behaviour of rename_table()


test_field_exists()   X-Ref
Test behaviour of field_exists()


test_add_field()   X-Ref
Test behaviour of add_field()


test_drop_field()   X-Ref
Test behaviour of drop_field()


test_change_field_type()   X-Ref
Test behaviour of change_field_type()


test_change_field_precision()   X-Ref
Test behaviour of test_change_field_precision()


testChangeFieldNullability()   X-Ref
No description

testChangeFieldDefault()   X-Ref
No description

testAddUniqueIndex()   X-Ref
No description

testAddNonUniqueIndex()   X-Ref
No description

testFindIndexName()   X-Ref
No description

testDropIndex()   X-Ref
No description

testAddUniqueKey()   X-Ref
No description

testAddForeignUniqueKey()   X-Ref
No description

testDropKey()   X-Ref
No description

testAddForeignKey()   X-Ref
No description

testDropForeignKey()   X-Ref
No description

testRenameField()   X-Ref
No description

testIndexExists()   X-Ref
No description

testFindKeyName()   X-Ref
No description

testDeleteTablesFromXmldbFile()   X-Ref
No description

testInstallFromXmldbFile()   X-Ref
No description

test_temp_tables()   X-Ref
No description

test_concurrent_temp_tables()   X-Ref
No description

test_leftover_temp_tables_columns()   X-Ref
get_columns should return an empty array for ex-temptables.


test_leftover_temp_tables_cache()   X-Ref
Deleting a temp table should not purge the whole cache


test_reset_sequence()   X-Ref
No description

test_reserved_words()   X-Ref
No description

test_index_hints()   X-Ref
No description

test_index_max_bytes()   X-Ref
No description

test_index_composed_max_bytes()   X-Ref
No description

test_char_size_limit()   X-Ref
No description

test_object_name()   X-Ref
No description

get_enc_quoted_provider()   X-Ref
Data provider for test_get_enc_quoted().

return: array The type-value pair fixture.

test_get_enc_quoted($reserved, $columnname)   X-Ref
This is a test for sql_generator::getEncQuoted().

param: bool $reserved Whether the column name is reserved or not.
param: string $columnname The column name to be quoted, according to the value of $reserved.

sql_generator_get_rename_field_sql_provider()   X-Ref
Data provider for test_sql_generator_get_rename_field_sql().

return: array The type-old-new tuple fixture.

test_sql_generator_get_rename_field_sql($reserved, $oldcolumnname, $newcolumnname)   X-Ref
This is a unit test for sql_generator::getRenameFieldSQL().

param: bool $reserved Whether the column name is reserved or not.
param: string $oldcolumnname The column name to be renamed.
param: string $newcolumnname The new column name.

test_get_nullable_fields_in_index()   X-Ref
No description

test_check_database_schema()   X-Ref
Tests check_database_schema().