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

mod_forum unittests check itemid but not component/filearea

    XMLWordPrintable

    Details

    • Testing Instructions:
      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
    • Affected Branches:
      MOODLE_37_STABLE
    • Fixed Branches:
      MOODLE_36_STABLE, MOODLE_37_STABLE
    • Pull Master Branch:
      MDL-66163-master

      Description

      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

        Attachments

          Activity

            People

            Assignee:
            marina Marina Glancy
            Reporter:
            marina Marina Glancy
            Peer reviewer:
            Eloy Lafuente (stronk7)
            Integrator:
            Andrew Nicols
            Tester:
            CiBoT
            Participants:
            Component watchers:
            Andrew Nicols, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              9/Sep/19

                Time Tracking

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