Fix doc, fix tests and add phpt tests