Test case fixes for Origin [merge]

  * Use PHP_VERSION and MYSQL_VERSION instead of hardcoded values
  * Register test accounts before using them
  * Set max gear limits where assumption of 3 gears is made