fixed phpdoc, added tests