Refactor test classes. Move to php 5.4. Add tests