Adding unit tests

resolves https://github.com/owncloud/apps/issues/1933 some cases are not testable in current architecture (per conversation with icewind)

depends on https://github.com/owncloud/core/pull/11322
Its just the reflection class its EXTREMELY powerfule heres the docs for it http://php.net/manual/en/class.reflectionclass.php