liip / liip/LiipFunctionalTestBundle
CommandTester getDisplay has not output from monolog
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 648
- Forks
- 179
- PR merge metrics
- No merged PRs in 30d
Description
### Preconditions
Updated from 2.0.0-alpha8 to 2.0.0-alpha12 (it was present in 2.0.0-alpha10).
### Steps to reproduce
In a symfony 3.4 application I'm testing a command that receives a LoggerInterface with DI (it is a monolog logger handler with type console - https://symfony.com/doc/current/logging/monolog_console.html).
Via Monolog Bridge logs are sent to OutputInterface.
Handler is configured in this way:
```
qworker:
type: console
level: info
channels: ['qworker']
formatter: monolog.formatter.line
verbosity_levels:
VERBOSITY_NORMAL: info
```
In previous version I was testing in this way:
### Expected result
```
$output = $this->runCommand(
WorkerManagerConsumerCommand::NAME,
[
'data' => $this->encodePayload($data),
]
);
$this->assertContains('ERROR', $output);
```
### Actual result
In latest version (2.0.0-alpha-12) I have changed my code to this:
```
$commandTester = $this->runCommand(
WorkerManagerConsumerCommand::NAME,
[
'data' => $this->encodePayload($data),
]
);
$output = $commandTester->getDisplay();
$this->assertContains('ERROR', $output);
```
But the $output var now contains an empty string instead of the logged value.
In my integration test the output is always the same.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the integration test described in the issue with Symfony's CommandTester, comparing runCommand behavior with getDisplay across the reported versions. Done means the command tester output contains the logged ERROR value instead of an empty string.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php, symfony
- Domain
- testing
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100