TestObfun.php 595 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: stanley-king
  5. * Date: 16/8/31
  6. * Time: 下午4:56
  7. */
  8. function callback($buffer)
  9. {
  10. return 'hello world';
  11. }
  12. class TestObfun extends PHPUnit_Framework_TestCase
  13. {
  14. private function work()
  15. {
  16. echo "1 2 3 4 5 6";
  17. }
  18. private function otherStart()
  19. {
  20. ob_start();
  21. $this->work();
  22. ob_end_clean();
  23. }
  24. public function testObstart()
  25. {
  26. ob_start();
  27. $this->work();
  28. $this->otherStart();
  29. ob_end_flush();
  30. $content = ob_get_contents();
  31. ob_clean();
  32. }
  33. }