Fixed tests (added mocks).

Still missing new tests for new classes and PHPDoc.