012-2.phpt 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. --TEST--
  2. more invalid arguments and error messages
  3. --EXTENSIONS--
  4. readline
  5. --SKIPIF--
  6. <?php include "skipif.inc"; ?>
  7. --FILE--
  8. <?php
  9. $php = getenv('TEST_PHP_EXECUTABLE');
  10. // -r : behavior = CLI_DIRECT
  11. // -F / -R / -B / -E : behavior = PROCESS_STDIN
  12. // -l : behavior = LINT
  13. // -s : behavior = HIGHLIGHT
  14. // -w : behavior = STRIP
  15. var_dump(`"$php" -n -r "echo 1;" -F some.php`);
  16. var_dump(`"$php" -n -r "echo 2;" -f some.php`);
  17. var_dump(`"$php" -n -r "echo 3;" -l`); // ignores linting
  18. var_dump(`"$php" -n -r "echo 4;" -R some.php`);
  19. var_dump(`"$php" -n -r "echo 5;" -B ""`);
  20. var_dump(`"$php" -n -a -B ""`);
  21. var_dump(`"$php" -n -r "echo 6;" -E ""`);
  22. var_dump(`"$php" -n -a -E ""`);
  23. var_dump(`"$php" -n -r "echo 7;" -s`);
  24. var_dump(`"$php" -n -r "echo 8;" -w`);
  25. var_dump(`"$php" -n -l -r "echo 9;"`);
  26. echo "Done\n";
  27. ?>
  28. --EXPECT--
  29. string(57) "Either execute direct code, process stdin or use a file.
  30. "
  31. string(57) "Either execute direct code, process stdin or use a file.
  32. "
  33. string(1) "3"
  34. string(57) "Either execute direct code, process stdin or use a file.
  35. "
  36. string(57) "Either execute direct code, process stdin or use a file.
  37. "
  38. string(57) "Either execute direct code, process stdin or use a file.
  39. "
  40. string(57) "Either execute direct code, process stdin or use a file.
  41. "
  42. string(57) "Either execute direct code, process stdin or use a file.
  43. "
  44. string(42) "Source highlighting only works for files.
  45. "
  46. string(39) "Source stripping only works for files.
  47. "
  48. string(57) "Either execute direct code, process stdin or use a file.
  49. "
  50. Done