sebastianbergmann/phpunit — Issue #420: Promlems with testing output
Author: damnedest
Created: 2011-11-26 09:06:45+00:00
State: open

After 3.6.4 is not possible to test output normally:

```php
expectOutputString('XXX');
}

/**
* Test with output buffering
*
* @outputBuffering enabled
* @access public
* @return void
*/

public function testWithOutpuBuffering()
{
print 'XXX';
$this->expectOutputString('XXX');
}
}
```

If run this test we will have this output:

```
$ phpunit OutputTest.php
PHPUnit 3.6.4 by Sebastian Bergmann.

.XXXF

Time: 0 seconds, Memory: 3.00Mb

There was 1 failure:

1) ClassTest::testWithOutpuBuffering
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'XXX'
+''

FAILURES!
Tests: 2, Assertions: 2, Failures: 1.
```

So if we use output buffering we allways assert with empty string. If we don't use output buffering test is marked as complete, but it makes output.