{"action":"created","issue":{"url":"https://api.github.com/repos/liip/LiipFunctionalTestBundle/issues/229","labels_url":"https://api.github.com/repos/liip/LiipFunctionalTestBundle/issues/229/labels{/name}","comments_url":"https://api.github.com/repos/liip/LiipFunctionalTestBundle/issues/229/comments","events_url":"https://api.github.com/repos/liip/LiipFunctionalTestBundle/issues/229/events","html_url":"https://github.com/liip/LiipFunctionalTestBundle/issues/229","id":126916034,"number":229,"title":"`WebTestCase::retrieveVerbosityLevel()` can't return `$this->verbosityLevel` and `liip_functional_test.command_verbosity`","user":{"login":"Aerendir","id":1968622,"avatar_url":"https://avatars.githubusercontent.com/u/1968622?v=3","gravatar_id":"","url":"https://api.github.com/users/Aerendir","html_url":"https://github.com/Aerendir","followers_url":"https://api.github.com/users/Aerendir/followers","following_url":"https://api.github.com/users/Aerendir/following{/other_user}","gists_url":"https://api.github.com/users/Aerendir/gists{/gist_id}","starred_url":"https://api.github.com/users/Aerendir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Aerendir/subscriptions","organizations_url":"https://api.github.com/users/Aerendir/orgs","repos_url":"https://api.github.com/users/Aerendir/repos","events_url":"https://api.github.com/users/Aerendir/events{/privacy}","received_events_url":"https://api.github.com/users/Aerendir/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-01-15T17:17:26Z","updated_at":"2016-01-15T17:30:13Z","closed_at":null,"body":"I'm trying to use `WebTestCase::runCommand()` but it ever returns an empty output while I'm expecting something.\r\n\r\nIn fact, to get the output I need, I have to set the `verbosity_level` to `debug`.\r\n\r\nBut the method ever returns `StreamOutput::VERBOSITY_NORMAL`.\r\n\r\nGoing deeper in the issue, I found the bug is in the method `WebTestCase::getVerbosityLevel()` that works this way:\r\n\r\n```php\r\nprivate function retrieveVerbosityLevel()\r\n    {\r\n        // Returns the local verbosity level\r\n        if ($this->verbosityLevel) {\r\n            $verbosity = 'StreamOutput::VERBOSITY_'.strtoupper($this->verbosityLevel);\r\n            if (defined($verbosity)) {\r\n                return $verbosity;\r\n            }\r\n        }\r\n\r\n        // Returns the global verbosity level\r\n        if ($this->getContainer()->hasParameter('liip_functional_test.command_verbosity')) {\r\n            $verbosity = 'StreamOutput::VERBOSITY_'.strtoupper($this->getContainer()->getParameter('liip_functional_test.command_verbosity'));\r\n            if (defined($verbosity)) {\r\n                return $verbosity;\r\n            }\r\n        }\r\n\r\n        // Returns the default verbosity level\r\n        return StreamOutput::VERBOSITY_NORMAL;\r\n    }\r\n```\r\n\r\nThe problem is in the checks `if (defined($verbosity))` that seems ever return `false`.\r\n\r\nIn fact, trying to print some breakthrough, the method ever fallbacks to the default `verbosity_level` while I'm configuring it as `debug` (I've tried to configure it both as local with `$this->verbosityLevel = 'debug'` and as global, by setting in the `config_test.yml` the key `liip_functional_test.command_verbosity`).\r\n\r\nThis is the modified method I've used to discover the problem:\r\n\r\n```php\r\nprivate function retrieveVerbosityLevel()\r\n    {\r\n        // Returns the local verbosity level\r\n        if ($this->verbosityLevel) {\r\n            printf(\"Local verbosity is set to %s\", $this->verbosityLevel);\r\n            $verbosity = 'StreamOutput::VERBOSITY_'.strtoupper($this->verbosityLevel);\r\n            if (defined($verbosity)) {\r\n                return $verbosity;\r\n            } else {\r\n                printf(\" but the constant doesn't exist.\\n\", $this->verbosityLevel);\r\n            }\r\n        }\r\n\r\n        // Returns the global verbosity level\r\n        if ($this->getContainer()->hasParameter('liip_functional_test.command_verbosity')) {\r\n            printf(\"\\nGlobal verbosity is set to %s\", $this->getContainer()->getParameter('liip_functional_test.command_verbosity'));\r\n            $verbosity = 'StreamOutput::VERBOSITY_'.strtoupper($this->getContainer()->getParameter('liip_functional_test.command_verbosity'));\r\n            if (defined($verbosity)) {\r\n                return $verbosity;\r\n            }\r\n        } else {\r\n            printf(\" but the constant doesn't exist.\\n\", $this->verbosityLevel);\r\n        }\r\n\r\n        printf(\"\\nFallback to the default value of verbosity\");\r\n        // Returns the default verbosity level\r\n        return StreamOutput::VERBOSITY_NORMAL;\r\n    }\r\n```\r\n\r\nCan someone confirm the bug, please?"},"comment":{"url":"https://api.github.com/repos/liip/LiipFunctionalTestBundle/issues/comments/172026023","html_url":"https://github.com/liip/LiipFunctionalTestBundle/issues/229#issuecomment-172026023","issue_url":"https://api.github.com/repos/liip/LiipFunctionalTestBundle/issues/229","id":172026023,"user":{"login":"alexislefebvre","id":2071331,"avatar_url":"https://avatars.githubusercontent.com/u/2071331?v=3","gravatar_id":"","url":"https://api.github.com/users/alexislefebvre","html_url":"https://github.com/alexislefebvre","followers_url":"https://api.github.com/users/alexislefebvre/followers","following_url":"https://api.github.com/users/alexislefebvre/following{/other_user}","gists_url":"https://api.github.com/users/alexislefebvre/gists{/gist_id}","starred_url":"https://api.github.com/users/alexislefebvre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexislefebvre/subscriptions","organizations_url":"https://api.github.com/users/alexislefebvre/orgs","repos_url":"https://api.github.com/users/alexislefebvre/repos","events_url":"https://api.github.com/users/alexislefebvre/events{/privacy}","received_events_url":"https://api.github.com/users/alexislefebvre/received_events","type":"User","site_admin":false},"created_at":"2016-01-15T17:30:13Z","updated_at":"2016-01-15T17:30:13Z","body":"> I'm trying to use `WebTestCase::runCommand()` but it ever returns an empty output while I'm expecting something.\r\n\r\nThat's strange, the following test works, the output is successfully tested: https://github.com/liip/LiipFunctionalTestBundle/blob/master/Tests/Command/CommandTest.php"}}