Skip to content

Instantly share code, notes, and snippets.

@pchatterjee
Created November 5, 2018 19:30
Show Gist options
  • Select an option

  • Save pchatterjee/e1327792f4a661992bf91ac1820e9eb5 to your computer and use it in GitHub Desktop.

Select an option

Save pchatterjee/e1327792f4a661992bf91ac1820e9eb5 to your computer and use it in GitHub Desktop.
<?php
# TESTS for catch_errors.php
# Not enough params (format missing)
# header('Location: catch_errors.php?from=USD&to=GBP&amnt=10.00');
# Too many params (other added)
# header('Location: catch_errors.php?from=USD&to=GBP&amnt=10.00&format=xml&other=value');
# from param is not recognized
# header('Location: catch_errors.php?from=AAA&to=GBP&amnt=10.00&format=xml');
# to param is not recognized
# header('Location: catch_errors.php?from=USD&to=ZZZ&amnt=10.00&format=xml');
# format param is not recognized (format is yml)
# header('Location: catch_errors.php?from=USD&to=GBP&amnt=10.00&format=yml');
# amnt is not a decimal value
# header('Location: catch_errors.php?from=USD&to=GBP&amnt=10&format=xml');
# core files missing - temporarly rename either rates or currencies xml
# file to generate this error.
# header('Location: catch_errors.php?from=USD&to=GBP&amnt=10.00&format=xml');
# format has missing value - default to xml
# header('Location: catch_errors.php?from=USD&to=GBP&amnt=10.00&format=');
# good request
# header('Location: catch_errors.php?from=USD&to=GBP&amnt=10&format=xml');
exit;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment