Refactoring PHPUnit tests