Moodle
  1. Moodle
  2. MDL-17644

contexts table not set up correctly for unit testing

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Duplicate
    • Affects Version/s: 2.0
    • Fix Version/s: None
    • Component/s: Unit tests
    • Labels:
      None
    • Affected Branches:
      MOODLE_20_STABLE
    • Rank:
      2273

      Description

      I only get one context in my test table, the system one. I would expect a front-page course to have been set up, but perhaps I am wrong about that.

      More seriously, the system context has path /1/1 and depth 2. That should be path /1 and depth 1.

      Also, the role assignments table is empty. Is that expected, I would have expected an assignment to admin, but again that might be a wrong expectation.

      Apart from that, the rest of the roles stuff seems to have been set up correctly.

        Issue Links

          Activity

          Hide
          Tim Hunt added a comment -

          And after I click the reinstall test tables button, I end up with no system context at all

          Show
          Tim Hunt added a comment - And after I click the reinstall test tables button, I end up with no system context at all
          Hide
          Tim Hunt added a comment -

          Nor any module nor block tables.

          Show
          Tim Hunt added a comment - Nor any module nor block tables.
          Hide
          Tim Hunt added a comment -

          Drop test tables, then rebuild, gives some error at the bottom of the first page, but it redirects anyway, so you can't see the error message.

          Show
          Tim Hunt added a comment - Drop test tables, then rebuild, gives some error at the bottom of the first page, but it redirects anyway, so you can't see the error message.
          Hide
          Tim Hunt added a comment -

          And I can't even work out how to kill the redirect, so I can see the error message.

          Show
          Tim Hunt added a comment - And I can't even work out how to kill the redirect, so I can see the error message.
          Hide
          Petr Škoda added a comment - - edited

          we cache system context in static variable or defined constant - this is exactly what I expected, there are very many places that are going to break badly
          solution can not be to start adding tons of hacks all over the place, we already have more than enough of these in core - please let's find some long term solution instead

          Show
          Petr Škoda added a comment - - edited we cache system context in static variable or defined constant - this is exactly what I expected, there are very many places that are going to break badly solution can not be to start adding tons of hacks all over the place, we already have more than enough of these in core - please let's find some long term solution instead
          Hide
          Petr Škoda added a comment -

          hello, this should be finally fixed in the phpunit integration in Moodle 2.3 dev. Thanks for the report.

          Petr

          Show
          Petr Škoda added a comment - hello, this should be finally fixed in the phpunit integration in Moodle 2.3 dev. Thanks for the report. Petr

            People

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

              Dates

              • Created:
                Updated:
                Resolved: