Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-36952

5 Add and drop Key database DDL Tests pass by accident

XMLWordPrintable

    • Any
    • MOODLE_23_STABLE

      There's five tests relating to adding or dropping keys in ddl_tests.php that appear to be passing by accident.

      testAddUniqueKey
      testAddForeignUniqueKey
      testAddForeignKey
      testDropKey
      testDropForeignKey

      When they add keys the command is being silently dropped because a key with that name already exists.

      Spotted while looking at http://tracker.moodle.org/browse/MDL-36930 (SQLite unit test failure: duplicate keys when adding Foreign Keys)

      Note the tests don't actually test for the presence (or absence) of the keys they add or drop, yet there's a test in the same file called testFindKeyName that (mostly) does exactly that. Perhaps that could be re-used to make these a bit stricter?

            moodle.com Moodle HQ
            bawjaws David Scotson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.