Fixed warnings (in PhpStorm) in tests

I wanted to dive a bit in the code, but the tests where almost unreadable. I fixed warnings (in PhpStorm) about unused imports, non existent classes, unused variables in tests files…

I also imported some classes (`use ...`) at some places when appropriate.

All tests are good.

FYI I didn't change a thing in non-tests files except one wrong `@return` phpdoc.