Refactoring classes to PHPUnit tests