bug78323.phpt 683 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. --TEST--
  2. FPM: Bug #78323 Test exit code for invalid parameters
  3. --SKIPIF--
  4. <?php include "skipif.inc"; ?>
  5. --FILE--
  6. <?php
  7. require_once "tester.inc";
  8. $php = \FPM\Tester::findExecutable();
  9. // no argument for option
  10. ob_start();
  11. passthru("$php --memory-limit=1G 2>&1", $exitCode);
  12. $output = ob_get_contents();
  13. ob_end_clean();
  14. $lines = preg_split('/\R/', $output);
  15. echo $lines[0], "\n",
  16. "Done: $exitCode\n\n";
  17. // Successful execution
  18. ob_start();
  19. passthru("$php -dmemory-limit=1G -v", $exitCode);
  20. $output = ob_get_contents();
  21. ob_end_clean();
  22. $lines = preg_split('/\R/', $output);
  23. echo $lines[0], "\n",
  24. "Done: $exitCode\n";
  25. ?>
  26. --EXPECTF--
  27. Usage: %s
  28. Done: 64
  29. PHP %s
  30. Done: 0