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

contexts table not set up correctly for unit testing

    Details

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

      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.

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            timhunt Tim Hunt added a comment -

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

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

            Nor any module nor block tables.

            Show
            timhunt Tim Hunt added a comment - Nor any module nor block tables.
            Hide
            timhunt 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
            timhunt 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
            timhunt 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
            timhunt 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
            skodak Petr Skoda 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
            skodak Petr Skoda 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
            skodak Petr Skoda added a comment -

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

            Petr

            Show
            skodak Petr Skoda 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: