-
Sub-task
-
Resolution: Won't Fix
-
Minor
-
None
-
2.3.3
-
MOODLE_23_STABLE
The following two tests fail with SQLite giving the same error message:
testAddForeignUniqueKey()
testAddForeignKey
The error is:
coding_exception: Coding error detected, it must be fixed by a programmer: Duplicate key course specified in table test_table1
But it seems like the error is legitimate, when the test_table1 is created it has a key of that name added (on line 93 of ddl_test.php).
Changing the name of the key that is to be added makes the test pass.
So, is this test supposed to be testing what happens when adding a second key with the same name? If so the name of the test isn't very clear about that and the test doesn't actually test any expected values, it just assumes that it has succeeded if no errors get thrown but doesn't specifically test that an expected exception gets thrown or test for an error code.
If it isn't intentionally testing adding the same key twice, and it's simply testing adding foreign keys to a table then why is it adding a key that already exists? And why don't any of the other databases complain about it?