mirror of
https://github.com/moodle/moodle.git
synced 2025-04-14 13:02:07 +02:00
MDL-53495 database xmldb: Ensure field tests use constant.
Some tests were still using hard coded values which break if the constants are changed.
This commit is contained in:
parent
0b768e744f
commit
848d212e7a
@ -340,7 +340,7 @@ class core_ddl_testcase extends database_driver_testcase {
|
||||
// Weird column names - the largest allowed.
|
||||
$table = new xmldb_table('test_table3');
|
||||
$table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null);
|
||||
$table->add_field('abcdef____0123456789_______xyz', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '2');
|
||||
$table->add_field(str_repeat('b', xmldb_field::NAME_MAX_LENGTH), XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '2');
|
||||
$table->add_key('primary', XMLDB_KEY_PRIMARY, array('id'));
|
||||
$table->setComment("This is a test'n drop table. You can drop it safely");
|
||||
|
||||
@ -350,10 +350,10 @@ class core_ddl_testcase extends database_driver_testcase {
|
||||
$this->assertTrue($dbman->table_exists($table));
|
||||
$dbman->drop_table($table);
|
||||
|
||||
// Too long field name - max 30.
|
||||
// Too long field name.
|
||||
$table = new xmldb_table('test_table4');
|
||||
$table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null);
|
||||
$table->add_field('abcdeabcdeabcdeabcdeabcdeabcdez', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '2');
|
||||
$table->add_field(str_repeat('a', xmldb_field::NAME_MAX_LENGTH + 1), XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '2');
|
||||
$table->add_key('primary', XMLDB_KEY_PRIMARY, array('id'));
|
||||
$table->setComment("This is a test'n drop table. You can drop it safely");
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user