Fix bug in case REQUEST_URI does not contain the tests path
 Refs #3722