Added phpt tests for the three functions