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

PHP 8.0: Strange sorting failure in quizaccess_seb_property_list_testcase

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.10.1
    • Fix Version/s: 3.9.7, 3.10.4
    • Component/s: Quiz
    • Labels:

      Description

      There is the following failure on PHP8

      It looks like a different sort order or capital/lowercase letters. Dmitrii Metelkin, would be great if you can look at it.

      12) quizaccess_seb_property_list_testcase::test_export_to_json with data set "unordered elements" ('<key>testKey</key><string>tes...tring>', '{"allowWlan":"testValue3","al...alue"}')
      Failed asserting that two strings are equal.
      --- Expected
      +++ Actual
      @@ @@
      -'{"allowWlan":"testValue3","allowWLAN":"testValue2","testKey":"testValue"}'
      +'{"allowWLAN":"testValue2","allowWlan":"testValue3","testKey":"testValue"}'
       
      /var/www/html/mod/quiz/accessrule/seb/tests/property_list_test.php:240
      /var/www/html/lib/phpunit/classes/advanced_testcase.php:80
      
      

      I have a quick fix for it in my test branch but I don't really understand what happened in PHP 8 and why did it change

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              pholden Paul Holden
              Reporter:
              marina Marina Glancy
              Integrator:
              Andrew Lyons Andrew Lyons
              Tester:
              Andrew Lyons Andrew Lyons
              Participants:
              Component watchers:
              Tim Hunt, Andrew Lyons, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                10/May/21

                  Time Tracking

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