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

Webservice unit test dependancy

XMLWordPrintable

    • MOODLE_31_STABLE, MOODLE_32_STABLE
    • MOODLE_31_STABLE, MOODLE_32_STABLE
    • MDL-57768-webservice-config-error
    • Easy
    • 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

      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

            ilyatregubov Ilya Tregubov
            ilyatregubov Ilya Tregubov
            Ankit Agarwal Ankit Agarwal
            Dan Poltawski Dan Poltawski
            CiBoT CiBoT
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

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