Move stub setup outside the test method
Move stub setup outside the test method

Stubs should be restored outside the test method in which they are used
to ensure that they are properly restored no matter the result of the
test (for example, if an exception is thrown).

Besides that, this will make possible to reuse the stub in other sibling
tests without having to explicitly setup it in them.

Signed-off-by: Daniel Calviño Sánchez <bd7629e975cc0e00ea7cda4ab6a120f2ee42ac1b@gmail.com>

nextcloud/server,andreas-p/nextcloud-server,andreas-p/nextcloud-server,andreas-p/nextcloud-server,nextcloud/server,andreas-p/nextcloud-server,nextcloud/server,nextcloud/server,andreas-p/nextcloud-server