Moodle
  1. Moodle
  2. MDL-31167 PHP strict META
  3. MDL-32250

Consider updating to simpletest 1.1.0 for 2.3 and upwards

    Details

    • Type: Sub-task Sub-task
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.3
    • Fix Version/s: 2.3
    • Component/s: Unit tests
    • Labels:
    • Rank:
      39033

      Description

      While we are moving in 2.3 to be E_STRICT compliant, current version of Simpletest is not.

      Right now that has been workaround by customizing the debug level before launching the tests, but it may be not a good idea because it could left strict issues hidden.

      So ideally, we should be able to run simpletests with e-strict enabled and to do so, it seems that we need to upgrade to Simpletest 1.1.0

      This issue is about to research and implement that possibility.

      Ciao

        Issue Links

          Activity

          Hide
          Eloy Lafuente (stronk7) added a comment -

          The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week.

          TIA and ciao

          Show
          Eloy Lafuente (stronk7) added a comment - The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week. TIA and ciao
          Hide
          Dan Poltawski added a comment -

          Hi Petr,

          There are changes in question/engine/simpletest/testunitofwork.php to move to assertTrue(), is that intentional?

          In any case there is also an error in that:
          $this->asserttrue($this->quba->get_question_attempt($slot) === reset($newattempts));

          Show
          Dan Poltawski added a comment - Hi Petr, There are changes in question/engine/simpletest/testunitofwork.php to move to assertTrue(), is that intentional? In any case there is also an error in that: $this->asserttrue($this->quba->get_question_attempt($slot) === reset($newattempts));
          Hide
          Petr Škoda added a comment -

          Hi, yes the latest SimpleTest changed the way how comparison of object instances works. Fixing the case typo (which does not affect execution), thanks!!

          Show
          Petr Škoda added a comment - Hi, yes the latest SimpleTest changed the way how comparison of object instances works. Fixing the case typo (which does not affect execution), thanks!!
          Hide
          Petr Škoda added a comment -

          fix pushed to repo

          Show
          Petr Škoda added a comment - fix pushed to repo
          Hide
          Tim Hunt added a comment -

          Just to confirm that Petr and I discussed this. assertIdentical used to do === for objects, which is what I want in these tests, but apparently they changed it, so Petr just changed the code to do an explicit assertTrue ===, which is OK for now.

          Show
          Tim Hunt added a comment - Just to confirm that Petr and I discussed this. assertIdentical used to do === for objects, which is what I want in these tests, but apparently they changed it, so Petr just changed the code to do an explicit assertTrue ===, which is OK for now.
          Hide
          Dan Poltawski added a comment -

          Hmm, they didn't make that behaviour particularly clear in HELP_MY_TESTS_DONT_WORK_ANYMORE

          Show
          Dan Poltawski added a comment - Hmm, they didn't make that behaviour particularly clear in HELP_MY_TESTS_DONT_WORK_ANYMORE
          Hide
          Dan Poltawski added a comment -

          (Also how have I got so far in the journey of life and only just discovered php functions are case-insensitive!)

          Show
          Dan Poltawski added a comment - (Also how have I got so far in the journey of life and only just discovered php functions are case-insensitive!)
          Hide
          Dan Poltawski added a comment -

          Thanks, i've integrated that now

          Show
          Dan Poltawski added a comment - Thanks, i've integrated that now
          Hide
          Adrian Greeve added a comment -

          For me this some of the unit tests are failing due to International extensions bot being properly configured (issues with my environment)
          This has been tested on the integration machine. Passing this test.

          Show
          Adrian Greeve added a comment - For me this some of the unit tests are failing due to International extensions bot being properly configured (issues with my environment) This has been tested on the integration machine. Passing this test.
          Hide
          Aparup Banerjee added a comment -

          The code here has been spread to upstream moodle repositories and mirrors for anyone to use .

          Closing, have a good weekend!

          Show
          Aparup Banerjee added a comment - The code here has been spread to upstream moodle repositories and mirrors for anyone to use . Closing, have a good weekend!

            People

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

              Dates

              • Created:
                Updated:
                Resolved: