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

core\output\icon_system static cache isn't cleared between unit tests

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.3.2
    • Fix Version/s: 3.3.3
    • Component/s: Unit tests
    • Labels:

      Description

      core\output\icon_system stores the instance in private static $instance the first time the instance() method is called, and has no way of clearing it.  This means that if you are testing output for themes that use different icons systems, the second one will use the first icon system.

      Steps to reproduce:

      1. Download attached icon_test.php and place it /lib/phpunit/tests
      2. Re-ininitialise PHPUnit
      3. Run test_two(), verify that it passes.
      4. Run the whole file, test_one() will pass but test_two() will fail.

        Attachments

          Activity

            People

            Assignee:
            marxjohnson Mark Johnson
            Reporter:
            marxjohnson Mark Johnson
            Peer reviewer:
            Sam Marshall
            Integrator:
            David Monllaó
            Tester:
            Simey Lameze
            Participants:
            Component watchers:
            Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              13/Nov/17