The following were added in MDL-69489 and had a few issues, which are
fixed in this patch:
Unit tests:
- were not using the existing generator.
- were making assertions inside a foreach, which doesn't test anything
if the result set returned is empty (error prone).
- were calling setAdminUser() unnecessarily.
Behat tests:
- the restricttocategory.feature file used manual steps to setup site
tools.