ob_flush_basic_001.phpt 941 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. --TEST--
  2. Test ob_flush() function : basic functionality
  3. --FILE--
  4. <?php
  5. /* Prototype : proto bool ob_flush(void)
  6. * Description: Flush (send) contents of the output buffer. The last buffer content is sent to next buffer
  7. * Source code: main/output.c
  8. * Alias to functions:
  9. */
  10. echo "*** Testing ob_flush() : basic functionality ***\n";
  11. // Zero arguments
  12. echo "\n-- Testing ob_flush() function with Zero arguments --\n";
  13. var_dump(ob_flush());
  14. ob_start();
  15. echo "This should get flushed.\n";
  16. var_dump(ob_flush());
  17. echo "Ensure the buffer is still active after the flush.\n";
  18. $out = ob_flush();
  19. var_dump($out);
  20. echo "Done";
  21. ?>
  22. --EXPECTF--
  23. *** Testing ob_flush() : basic functionality ***
  24. -- Testing ob_flush() function with Zero arguments --
  25. Notice: ob_flush(): failed to flush buffer. No buffer to flush in %s on line 12
  26. bool(false)
  27. This should get flushed.
  28. bool(true)
  29. Ensure the buffer is still active after the flush.
  30. bool(true)
  31. Done