fixed up invite a friend and added PHP tests