Add testQueryBeforeAfterUpdateForSubobjectToLooseReference

Test is in response to https://github.com/SemanticMediaWiki/SemanticMediaWiki/pull/378#discussion_r14574081
It's nice you've clearly labelled the different parts. Though why not do so by splitting this up in well named methods?