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

PHP 8.0: Strange sorting failure in quizaccess_seb_property_list_testcase

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.10.1
    • 3.9.7, 3.10.4
    • Quiz

    Description

      There is the following failure on PHP8

      It looks like a different sort order or capital/lowercase letters. dmitriim, 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

              pholden Paul Holden
              marina Marina Glancy
              Andrew Lyons Andrew Lyons
              Andrew Lyons Andrew Lyons
              Tim Hunt, Amaia Anabitarte, Brett Dalton, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Kevin Percy, Laurent David, Mathew May, Mihail Geshoski, Sabina Abellan, Sara Arjona (@sarjona), Shamim Rezaie
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                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