Search code examples
phpsimpletest

Simpletest: Testing echo statements?


I've just been testing some PHP files with simpletest and found out thatit won't work too well with functions that actually outputs (echoes) anything.

So is there anything I can do to test functions that echoes stuff, without using ob_buffer() in PHP?

Thanks


Solution

  • If you are testing the validity of the output itself, then no. Not without an output buffer. However, you COULD test it with JavaScript. You could even test it with simpletest by passing the output back through ajax to another thread.

    Round-about? Oh yeah, baby.