Fixes #4960: Adds unit test for class scanner

https://github.com/Elgg/Elgg/commit/05ad9aada8a68f8802b4c3d85a9263ccdd56505c should've fixed the 5.2 issues, but this adds a proper test for the class scanner with expectations varying by PHP version.