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

tool_uploaduser\cli_test.php fails if other installed plugins create custom profile fields on install

XMLWordPrintable

    • MOODLE_400_STABLE, MOODLE_401_STABLE
    • MOODLE_311_STABLE, MOODLE_400_STABLE, MOODLE_401_STABLE
    • MDL-77611_401
    • Hide

      Ideally, first ensure you can reproduce the bug before applying the change with the fix:

      Before the patch
      1. Check out the latest weekly release for the branch you're testing.
      2. Unzip the attached file local_fortest.zip into the local folder of your Moodle install. (It is a simple local plugin that defines a custom profile field with shortname 'catname' when it is installed.)
      3. Initialise PHPUnit and run tool_uploaduser_testsuite

        php admin/tool/phpunit/cli/init.php
        vendor/bin/phpunit --testsuite tool_uploaduser_testsuite
        

        or if using MDK

        mdk phpunit -r -s tool_uploaduser
        

      4. You are expecting to see one failure.
      After the patch
      1. Check out the latest version of the branch you're testing with this patch applied.
      2. Rerun the tool_uploaduser test.
      3. Confirm that it now passes.
      Show
      Ideally, first ensure you can reproduce the bug before applying the change with the fix: Before the patch Check out the latest weekly release for the branch you're testing. Unzip the attached file local_fortest.zip into the local folder of your Moodle install. (It is a simple local plugin that defines a custom profile field with shortname 'catname' when it is installed.) Initialise PHPUnit and run tool_uploaduser_testsuite php admin/tool/phpunit/cli/init.php vendor/bin/phpunit --testsuite tool_uploaduser_testsuite or if using MDK mdk phpunit -r -s tool_uploaduser You are expecting to see one failure. After the patch Check out the latest version of the branch you're testing with this patch applied. Rerun the tool_uploaduser test. Confirm that it now passes.

      Steps to reproduce:

      1. Unzip the attached file local_fortest.zip into the local folder of your Moodle install. (It is a simple local plugin which defines a custom profile field with shortname 'catname' when it is installed.)
      2. php admin/tool/phpunit/cli/init.php
      3. vendor/bin/phpunit --testsuite tool_uploaduser_testsuite

      Expected result: tests pass.

      Actual result:

      ..F........                                                       11 / 11 (100%)
       
      Time: 00:42.449, Memory: 68.00 MB
       
      There was 1 failure:
       
      1) tool_uploaduser\cli_test::test_upload_with_profile_fields
      Failed asserting that two objects are equal.
      --- Expected
      +++ Actual
      @@ @@
       stdClass Object (
           'superfield' => 'Loves cats'
      +    'catname' => ''
       )
      

      So, another case of MDL-62483.

        1. 311.png
          311.png
          174 kB
        2. 400.png
          400.png
          168 kB
        3. 401.png
          401.png
          180 kB
        4. local_fortest.zip
          2 kB
        5. master.gif
          master.gif
          11.25 MB

            timhunt Tim Hunt
            timhunt Tim Hunt
            Mahmoud Kassaei Mahmoud Kassaei
            Jun Pataleta Jun Pataleta
            Ron Carl Alfon Yu Ron Carl Alfon Yu
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours, 53 minutes
                2h 53m

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