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

Silent problem in moodle_page_test caused other tests to produce wrong debug information

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.4, 2.1.1, 2.2
    • Fix Version/s: 2.0.6, 2.1.3
    • Component/s: Unit tests
    • Labels:
    • Testing Instructions:
      Hide

      admin -> Development -> Unit tests

      Run the following tests under 20_STABLE, 21_STABLE and master:

      • /lib/simpletest/testpagelib_moodlepage.php
      • /question
      • ALL (box empty)

      TEST: None of them outputs any debugging information like the posted in the description of this issue (box/containers related). You can safely ignore any other exception / failure in the execution. This is only about fix that incorrect debugging.

      Show
      admin -> Development -> Unit tests Run the following tests under 20_STABLE, 21_STABLE and master: /lib/simpletest/testpagelib_moodlepage.php /question ALL (box empty) TEST: None of them outputs any debugging information like the posted in the description of this issue (box/containers related). You can safely ignore any other exception / failure in the execution. This is only about fix that incorrect debugging.
    • Difficulty:
      Moderate
    • Affected Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      Since some time ago, each time ALL unittests are executed, their execution ends ok but a lot of debugging information is send out about incorrectly nested boxes / containers.

      For the records, here it's an excerpt (it's really much, much bigger):

      Some HTML tags were opened in the body of the page but not closed.
       
      Open box at:
      line 1237 of /lib/outputlib.php: call to xhtml_container_stack->log()
      line 2226 of /lib/outputrenderers.php: call to xhtml_container_stack->push()
      line 127 of /admin/tool/unittest/index.php: call to core_renderer->box_start()
      Close box at:
      line 1264 of /lib/outputlib.php: call to xhtml_container_stack->log()
      line 2236 of /lib/outputrenderers.php: call to xhtml_container_stack->pop()
      line 145 of /admin/tool/unittest/index.php: call to core_renderer->box_end()
      Open box at:
      line 1237 of /lib/outputlib.php: call to xhtml_container_stack->log()
      line 2226 of /lib/outputrenderers.php: call to xhtml_container_stack->push()
      line 156 of /admin/tool/unittest/index.php: call to core_renderer->box_start()
      Close box at:
      line 1264 of /lib/outputlib.php: call to xhtml_container_stack->log()
      line 2236 of /lib/outputrenderers.php: call to xhtml_container_stack->pop()
      line 163 of /admin/tool/unittest/index.php: call to core_renderer->box_end()
      ...
      ...
      ...

      After tracing the execution a lot, it was detected that the culprit of the problem was the moodle_page_test unit test (within lib/simpletest/testpagelib_moodlepage.php), because due to one missing global $PAGE it was unable to restitute the original status of the page, so other tests later (/question ones, also playing with page/output...) were running under an incorrect status.

      So this is simply fixed by adding the missing global to moodle_page_test->tearDown(). Doing.

      Ciao

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Votes:
                  0 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    28/Nov/11