fix 8757, get rid of service locator antipattern
fix assertions
Merge pull request #8759 from owncloud/fix-phpunit

fix 8757, get rid of service locator antipattern