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

Random error in test_loadAddons()

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.8.5, 3.9.2, 3.10, 4.0
    • 3.8.6, 3.9.3
    • H5P
    • Moppies Kanban

    Description

      In test_loadAddons() this sentence $this->framework->loadAddons() is used to load the addons libraries and get the info related. The results are not sorted, so in the test when this assert is done ["$this->assertEquals('Library', $addons[0]['machineName']);"|https://github.com/moodle/moodle/blob/master/h5p/tests/framework_test.php#L476] we don't really know if 'Library' will be the first element of the array. So, sometimes we get some error in the PHPUnit test because it's expected one value and it gets another.

      Example of the error: Failed asserting that two strings are equal.

       

      1) core_h5p\framework_testcase::test_loadAddons
      Failed asserting that two strings are equal.
      --- Expected
      +++ Actual1
      -'Library'
      +'Library1'
      /moodle/h5p/tests/framework_test.php:
      /moodle/lib/phpunit/classes/advanced_testcase.php:
      To re-run: vendor/bin/phpunit --verbose "core_h5p\framework_testcase" h5p/tests/framework_test.php
      

      Attachments

        Issue Links

          Activity

            People

              pholden Paul Holden
              cescobedo Carlos Escobedo
              Carlos Escobedo Carlos Escobedo
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              CiBoT CiBoT
              Amaia Anabitarte, Carlos Escobedo, Laurent David, Mikel Martín Corrales, Sabina Abellan, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                9/Nov/20

                Time Tracking

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