Fix a new test_documentcontroller test failure
I've neglected to run test_documentcontroller to test my changes in !161 (merged). Once I merged this merge request into 5.6 and master, a new CI test failure appeared in https://build.kde.org/job/KDevelop/job/kdevelop/job/stable-kf5-qt5%20SUSEQt5.14/60/. And the same failure in https://build.kde.org/job/KDevelop/job/kdevelop/job/kf5-qt5%20SUSEQt5.14/116/.
There are more new test failures in https://build.kde.org/job/KDevelop/job/kdevelop/job/kf5-qt5%20FreeBSDQt5.15/71/, https://build.kde.org/job/KDevelop/job/kdevelop/job/stable-kf5-qt5%20FreeBSDQt5.15/36/ and https://build.kde.org/job/KDevelop/job/kdevelop/job/stable-kf5-qt5%20WindowsMSVCQt5.15/11/. But I don't understand how my changes could cause those. At least some of the failures must have been caused by something else.
See the commit message for the problem and fix description.