{"action":"created","issue":{"url":"https://api.github.com/repos/symfony/symfony/issues/15877","labels_url":"https://api.github.com/repos/symfony/symfony/issues/15877/labels{/name}","comments_url":"https://api.github.com/repos/symfony/symfony/issues/15877/comments","events_url":"https://api.github.com/repos/symfony/symfony/issues/15877/events","html_url":"https://github.com/symfony/symfony/issues/15877","id":107987341,"number":15877,"title":"[console] CommandTester dos not work with phpunit versions > 4.1.* due to the way output buffering is managed.","user":{"login":"localgod","id":1308965,"avatar_url":"https://avatars.githubusercontent.com/u/1308965?v=3","gravatar_id":"","url":"https://api.github.com/users/localgod","html_url":"https://github.com/localgod","followers_url":"https://api.github.com/users/localgod/followers","following_url":"https://api.github.com/users/localgod/following{/other_user}","gists_url":"https://api.github.com/users/localgod/gists{/gist_id}","starred_url":"https://api.github.com/users/localgod/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/localgod/subscriptions","organizations_url":"https://api.github.com/users/localgod/orgs","repos_url":"https://api.github.com/users/localgod/repos","events_url":"https://api.github.com/users/localgod/events{/privacy}","received_events_url":"https://api.github.com/users/localgod/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-23T19:15:28Z","updated_at":"2015-09-26T09:14:04Z","closed_at":null,"body":"If you run the example code:\r\n```php\r\nuse Acme\\Console\\Command\\GreetCommand;\r\nuse Symfony\\Component\\Console\\Application;\r\nuse Symfony\\Component\\Console\\Tester\\CommandTester;\r\n\r\nclass ListCommandTest extends \\PHPUnit_Framework_TestCase\r\n{\r\n    public function testExecute()\r\n    {\r\n        $application = new Application();\r\n        $application->add(new GreetCommand());\r\n\r\n        $command = $application->find('demo:greet');\r\n        $commandTester = new CommandTester($command);\r\n        $commandTester->execute(array('command' => $command->getName()));\r\n\r\n        $this->assertRegExp('/.../', $commandTester->getDisplay());\r\n\r\n        // ...\r\n    }\r\n}\r\n\r\n```\r\n\r\nwith phpunit in verbose mode you get this error:\r\n```\r\nTest code or tested code did not (only) close its own output buffers\r\n```\r\nThis might be a phpunit issue.\r\n\r\nWhatever the cause, the inability to test your console application with newer versions of phpunit is not optimal."},"comment":{"url":"https://api.github.com/repos/symfony/symfony/issues/comments/143414272","html_url":"https://github.com/symfony/symfony/issues/15877#issuecomment-143414272","issue_url":"https://api.github.com/repos/symfony/symfony/issues/15877","id":143414272,"user":{"login":"stof","id":439401,"avatar_url":"https://avatars.githubusercontent.com/u/439401?v=3","gravatar_id":"","url":"https://api.github.com/users/stof","html_url":"https://github.com/stof","followers_url":"https://api.github.com/users/stof/followers","following_url":"https://api.github.com/users/stof/following{/other_user}","gists_url":"https://api.github.com/users/stof/gists{/gist_id}","starred_url":"https://api.github.com/users/stof/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stof/subscriptions","organizations_url":"https://api.github.com/users/stof/orgs","repos_url":"https://api.github.com/users/stof/repos","events_url":"https://api.github.com/users/stof/events{/privacy}","received_events_url":"https://api.github.com/users/stof/received_events","type":"User","site_admin":false},"created_at":"2015-09-26T09:14:04Z","updated_at":"2015-09-26T09:14:04Z","body":"The CommandTester does not use any output buffer.\r\nAre you sure this is related to this test ? When trying this locally, I don't get any warning from PHPUnit (I'm using PHPUnit 4.8.9)"}}