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

Replace the usage of $this->assertFail to $this->fail in Moodle.

    Details

    • Testing Instructions:
      Hide
      1. Run the following PHPUnit tests.
        1. phpunit lib/tests/moodlelib_test.php
        2. phpunit lib/dml/tests/dml_test.php
      2. Do a grep of the Moodle code for the term "assertFail" and ensure you get no results.
      Show
      Run the following PHPUnit tests. phpunit lib/tests/moodlelib_test.php phpunit lib/dml/tests/dml_test.php Do a grep of the Moodle code for the term "assertFail" and ensure you get no results.
    • Affected Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE, MOODLE_25_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE
    • Pull Master Branch:
      MDL-37854_master

      Description

      The function assertFail does not exist, this is supposed to be the function fail.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              abgreeve Adrian Greeve added a comment -

              [Y] Syntax
              [-] Output
              [Y] Whitespace
              [-] Language
              [-] Databases
              [Y] Testing
              [-] Security
              [-] Documentation
              [Y] Git
              [Y] Sanity check

              Hi Mark,

              Everything looks good to me. Thanks for the link to the PHPUnit test API page.

              +1 for integration.

              Show
              abgreeve Adrian Greeve added a comment - [Y] Syntax [-] Output [Y] Whitespace [-] Language [-] Databases [Y] Testing [-] Security [-] Documentation [Y] Git [Y] Sanity check Hi Mark, Everything looks good to me. Thanks for the link to the PHPUnit test API page. +1 for integration.
              Hide
              markn Mark Nelson added a comment -

              Note to integrators - when set_user_preference throws an exception, it is a coding_exception. I changed Exception $ex to coding_exception $ex as $this->fails throws an exception which we do not want to catch.

              Show
              markn Mark Nelson added a comment - Note to integrators - when set_user_preference throws an exception, it is a coding_exception. I changed Exception $ex to coding_exception $ex as $this->fails throws an exception which we do not want to catch.
              Hide
              stronk7 Eloy Lafuente (stronk7) added a comment -

              Hi, I'm integrating it now, well spotted!

              Just for your consideration, perhaps it would be great to have some assertions @ test_assert_behaviour() checking that ->fail() works as expected (throwing exception..). Not critical, but better if we have it covered, to detect any behavior change in the future... Feel free to create a new issue for that, TIA!

              Ciao

              Show
              stronk7 Eloy Lafuente (stronk7) added a comment - Hi, I'm integrating it now, well spotted! Just for your consideration, perhaps it would be great to have some assertions @ test_assert_behaviour() checking that ->fail() works as expected (throwing exception..). Not critical, but better if we have it covered, to detect any behavior change in the future... Feel free to create a new issue for that, TIA! Ciao
              Hide
              stronk7 Eloy Lafuente (stronk7) added a comment -

              Integrated (23, 24 & master), thanks!

              Show
              stronk7 Eloy Lafuente (stronk7) added a comment - Integrated (23, 24 & master), thanks!
              Hide
              fred Frédéric Massart added a comment -

              Passing, thanks!

              Show
              fred Frédéric Massart added a comment - Passing, thanks!
              Hide
              damyon Damyon Wiese added a comment -

              Congratulations! This issue has been resolved. Thanks for helping to make Moodle better for everyone!

              Regards, Damyon

              Show
              damyon Damyon Wiese added a comment - Congratulations! This issue has been resolved. Thanks for helping to make Moodle better for everyone! Regards, Damyon

                People

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

                  Dates

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