Added test. In some cases $result is null

Replaces https://github.com/owncloud/core/pull/7375 by adding also a check whether the value is empty

@MorrisJobke @schiesbn 
See https://github.com/owncloud/core/commit/9f15e31069de111b7ba37561de5ea6b7160b5e89#commitcomment-7754851
`isset()` and `empty()` return booleans. No point in using ===.

Furthermore: `empty($x) === !isset($x) || !$x` and as such
`isset($result) === true && empty($result) === false` <=>
`isset($result) && !empty($result)` <=>
`isset($result) && !(!isset($result) || !$result)` <=> (DeMorgan)
`isset($result) && !!(isset($result) && $result)` <=> 
`isset($result) && isset($result) && $result` <=>
`isset($result) && $result` <=>
`!!(isset($result) && $result)` <=>
`!(!isset($result) || !$result)` <=>
`!empty($result)`