Moodle

contexts table not set up correctly for unit testing

Details

  • Type: Bug Bug
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • 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.

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 (skodak) 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 (skodak) 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

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated: