Update getRates.php

Changed scope and added test