expectOutputString('test'); print 'test'; } public function testOutputWithExpectationAfter() { print 'test'; $this->expectOutputString('test'); } public function testNotMatchingOutput() { print 'bar'; $this->expectOutputString('foo'); } }