ob_clean_basic_001.phpt 873 B

123456789101112131415161718192021222324252627282930313233343536
  1. --TEST--
  2. Test ob_clean() function : basic functionality
  3. --FILE--
  4. <?php
  5. /* Prototype : proto bool ob_clean(void)
  6. * Description: Clean (delete) the current output buffer
  7. * Source code: main/output.c
  8. * Alias to functions:
  9. */
  10. echo "*** Testing ob_clean() : basic functionality ***\n";
  11. // Zero arguments
  12. echo "\n-- Testing ob_clean() function with Zero arguments --\n";
  13. var_dump( ob_clean() );
  14. ob_start();
  15. echo "You should never see this.";
  16. var_dump(ob_clean());
  17. echo "Ensure the buffer is still active after the clean.";
  18. $out = ob_get_clean();
  19. var_dump($out);
  20. echo "Done";
  21. ?>
  22. --EXPECTF--
  23. *** Testing ob_clean() : basic functionality ***
  24. -- Testing ob_clean() function with Zero arguments --
  25. Notice: ob_clean(): failed to delete buffer. No buffer to delete in %s on line 12
  26. bool(false)
  27. string(61) "bool(true)
  28. Ensure the buffer is still active after the clean."
  29. Done