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

Mustache unit test data provider duplicates are not executed

XMLWordPrintable

      Noticed in MDL-69838, but fixing separately so can be backported

      The data provider method here and here in the Mustache helper class testcase contain duplicate keys, which leads to some tests not being executed at all

      Compare current:

      $ bin/moodle-docker-compose exec webserver vendor/bin/phpunit --filter test_strip_disallowed_helpers
      Moodle 4.2dev (Build: 20230120), df502b3e4c86f9d2d5fbe8baa7ab9d5aa9d45fe8
      Php: 7.4.33, mysqli: 5.7.41, OS: Linux 4.15.0-202-generic x86_64
      PHPUnit 9.5.26 by Sebastian Bergmann and contributors.
       
      ...............                                                   15 / 15 (100%)
       
      Time: 00:00.580, Memory: 298.00 MB
       
      OK (15 tests, 15 assertions)
      

      vs. fixed (unique key names):

      $ bin/moodle-docker-compose exec webserver vendor/bin/phpunit --filter test_strip_disallowed_helpers
      Moodle 4.2dev (Build: 20230120), df502b3e4c86f9d2d5fbe8baa7ab9d5aa9d45fe8
      Php: 7.4.33, mysqli: 5.7.41, OS: Linux 4.15.0-202-generic x86_64
      PHPUnit 9.5.26 by Sebastian Bergmann and contributors.
       
      .................                                                 17 / 17 (100%)
       
      Time: 00:00.444, Memory: 302.00 MB
       
      OK (17 tests, 17 assertions)
      

            pholden Paul Holden
            pholden Paul Holden
            Angelia Dela Cruz Angelia Dela Cruz
            Simey Lameze Simey Lameze
            Kim Jared Lucas Kim Jared Lucas
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 4 hours
                4h

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