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

PHPUnit does not display all exception data

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.3.4, 2.4.1, 2.5
    • Fix Version/s: 2.3.5, 2.4.2
    • Component/s: Language, Unit tests
    • Labels:
    • Testing Instructions:
      Hide

      This is pretty tricky to test. I believe it is enough to run phpunit to make sure there is no regression.

      In order to see this in action, you would need to

      1. Write a new unit test
      2. Throw moodle_exception in the test, providing the $a parameter (string or object) together with an non-existing error string.
      Show
      This is pretty tricky to test. I believe it is enough to run phpunit to make sure there is no regression. In order to see this in action, you would need to Write a new unit test Throw moodle_exception in the test, providing the $a parameter (string or object) together with an non-existing error string.
    • Affected Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE, MOODLE_25_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-37919-phpunit-exception

      Description

      Let us have moodle_exception thrown during the PHPUnit test. The exception was thrown with additional data passed via the $a parameter. If the exception error string does not exist, the data in the $a parameter are not displayed.

      Normally, when such exception is thrown, the function get_exception_info() appends the contents of the $a placeholder to the exception message. But that function is not used during PHPUnit execution.

      There is already a code that automatically appends the $debuginfo to the message. We need something similar for $a too.

        Gliffy Diagrams

          Attachments

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  11/Mar/13