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

Webservice unit test dependancy

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      1) Run a single unit test

      vendor/bin/phpunit core_webservice_externallib_testcase webservice/tests/externallib_test.php

      2) Run whole unit test suite

      vendor/bin/phpunit

      There should not be any failures in both cases

      Show
      1) Run a single unit test vendor/bin/phpunit core_webservice_externallib_testcase webservice/tests/externallib_test.php 2) Run whole unit test suite vendor/bin/phpunit There should not be any failures in both cases
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_31_STABLE, MOODLE_32_STABLE
    • Fixed Branches:
      MOODLE_31_STABLE, MOODLE_32_STABLE
    • Pull Master Branch:
      MDL-57768-webservice-config-error

      Description

      If you run a single unit test webservice/tests/externallib_test.php it will fail with the error

      dml_read_exception: Error reading from database (ERROR: column "version" does not exist
      LINE 1: SELECT id, name, version FROM phpu_modules ORDER BY name A...

      So I found out that config is set manually in webservice/tests/externallib_test.php :

      set_config('version', '2012083100.00');

      this causes following condition in lib/classes/plugin_manager.php

      if ($CFG->version < 2013092001.02) {
      // We did not upgrade the database yet.
      $modules = $DB->get_records('modules', array(), 'name ASC', 'id, name, version');

      while modules table doesn't have version column

      However, if you run core_user_testsuite before this test, then everything passes

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                13/Mar/17