MDL-66815 behat: question category generator must find right parent id
commit6e73157a3cd0f1bb2fe76f2f7e2b2d27bedc92cb
authorTim Hunt <T.J.Hunt@open.ac.uk>
Tue, 1 Oct 2019 15:43:22 +0000 (1 16:43 +0100)
committerTim Hunt <T.J.Hunt@open.ac.uk>
Tue, 1 Oct 2019 15:43:25 +0000 (1 16:43 +0100)
tree9107171171cb6f344d8cfa1dce250a3e0dfbea14
parent9528b1ff5b8c8ff439d5502cfb509c5aacd306b0
MDL-66815 behat: question category generator must find right parent id

This is implemented in a bit of a hacky way, because the only other
alternative would be a large rewrite of the whole class, which is
not feasible for me right now. Note that many other types of thing
that can be generated suffer from the same issue. (E.g. if you ever
wanted to generate two groups with the same name in two different
courses and then add group memebers.)

It is worth doing a special-case fix for question categories, because
way Moodle works, it is inevitable that we end up with many categories
called 'top' in the database.
lib/tests/behat/behat_data_generators.php