cleaned up test php code and fixed scoped transaction test