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

mod_forum unittests check itemid but not component/filearea

XMLWordPrintable

    • MOODLE_37_STABLE
    • MOODLE_36_STABLE, MOODLE_37_STABLE
    • MDL-66163-master
    • Hide

      proper testing is complicated, it involves code modifications (install.php of some plugin) and also running tests on oracle/mssql. I don't think it's necessary. Just simple unittests should be enough to prevent regressions

      Run unittests

      Show
      proper testing is complicated, it involves code modifications (install.php of some plugin) and also running tests on oracle/mssql. I don't think it's necessary. Just simple unittests should be enough to prevent regressions Run unittests

      One of our plugins add files into files table during installation (similar to what assignment pdf feedback does). This broke mod_forum unittests on mssql/oracle (since these two databases don't use random ids).

      The failures are in the line:

      mod_forum_privacy_provider_testcase::test_delete_data_for_user
      Failed asserting that actual size 2 matches expected size 0.
       
      /var/www/html/mod/forum/tests/privacy_provider_test.php:1473
      /var/www/html/lib/phpunit/classes/advanced_testcase.php:80
       
       
      mod_forum_privacy_provider_testcase::test_delete_data_for_users
      Failed asserting that actual size 2 matches expected size 0.
       
      /var/www/html/mod/forum/tests/privacy_provider_test.php:1681
      /var/www/html/lib/phpunit/classes/advanced_testcase.php:80
      

      The code at these lines read something like this:

              $this->assertCount(0, $DB->get_records_select('files', "itemid {$postinsql}", $postinparams));
      

      Clearly component/filearea condition is missing

            marina Marina Glancy
            marina Marina Glancy
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Andrew Lyons Andrew Lyons
            CiBoT CiBoT
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour, 30 minutes
                1h 30m

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