Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/helhum/sf-console-test
https://github.com/helhum/sf-console-test
Last synced: 24 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/helhum/sf-console-test
- Owner: helhum
- Created: 2020-04-24T12:05:14.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-04-24T12:05:36.000Z (over 4 years ago)
- Last Synced: 2024-10-14T04:12:35.446Z (2 months ago)
- Language: PHP
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Demonstrate breaking behaviour of [#33897](https://github.com/symfony/symfony/pull/33897)
In general I agree with the changes made with the intention to allow
providing input to the application using STDIN.
There are however some edge cases demonstrated here that need some attention.### Tests with current state (symfony/console 5.0.7/4.4.7)
#### Test 1
Forcing detached terminal (no tty) and not providing any input via STDIN
`echo '' | php console.php hidden:input`
#### Expectation
Error message saying that two required arguments are missing
Output:
```
Not enough arguments (missing: "password, action").
```
#### Actual
Infinite loop.
This definitely needs a fix in `AskHidden` handling to avoid the infinite loop.
Additionally it would be helpful to inform users that action argument is missing as well.
```
Password:
> stty: stdin isn't a terminal
stty: stdin isn't a terminal
[ERROR] Password must not be empty.
Password:
> stty: stdin isn't a terminal
stty: stdin isn't a terminal
[ERROR] Password must not be empty.
...```
#### Test 2
Forcing detached terminal (no tty) and not providing any input via STDIN,
but providing password argument
`echo '' | php console.php hidden:input 123456`
#### Expectation
Password argument is set to "123456" and error message that action argument is missing
Output:
```
Not enough arguments (missing: "action").
```
#### Actual
Works in general, but would be helpful to inform users that action argument is missing
```
What do you want to do:
>
[ERROR] Action must not be empty.
What do you want to do:
>
Aborted.
hidden:input
```#### Test 3
Forcing detached terminal (no tty) and providing password argument via STDIN
`echo '123456' | php console.php hidden:input`
#### Expectation
Password argument is set to "123456" and error message that action argument is missing
Output:
```
Not enough arguments (missing: "action").
```
#### Actual
Works in general, but would be helpful to inform users that action argument is missing.
```
Password:
> stty: stdin isn't a terminal
stty: stdin isn't a terminalWhat do you want to do:
>
Aborted.
hidden:input
```