-
Notifications
You must be signed in to change notification settings - Fork 32
Conversation
3c935e2
to
a55e6bd
Compare
\o/ |
\o/ |
\o/ |
*/ | ||
class Cursor extends Test\Unit\Suite | ||
{ | ||
public function setUp() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is probably not what you want here: to execute an initialization before each test method (in the method sub-process) you should override beforeTestMethod
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, it also works, but this is part of the setup too, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Hywan the setUp
is executed in the main process while beforeTestMethod
is in the child process. Your initialization might not be applied when running test methods.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh ok, correct!
Sometimes, `STDIN` is not defined when trying to start advanced interactions. So we must ensure that `STDIN` is correctly set.
Now we are able to set our own instance of `Tput` class.
I don't know how to test |
9c0e07c
to
4219c97
Compare
@Hywan I'll try to have a look at |
Need to mock constant before completing this PR. See atoum/atoum#511. I will try a first implementation in |
\o/ |
Since the `Window` class is a singleton, its constructor must be private.
Instead of using hard-coded number for pointer codes, we introduce constants: * `BUTTON_LEFT`, * `BUTTON_MIDDLE`, * `BUTTON_RIGHT`, * `BUTTON_RELEASE`, * `WHEEL_UP`, * `WHEEL_DOWN`. These codes are the ones used by the terminal.
Instead of silently continue to loop when `stream_select` fails or timed out, i.e. when we no longer have a mouse input, we break the loop and untrack when `stream_select` fails. When it times out, we continue to loop.
The first argument passed to `getOption` is a reference. Its value was not reset each time. Now this is fixed.
The readline was previously based on `STDIN`. Now it is based on `Console::getInput` as every other classes in the `Hoa\Console`.
1. We need it to test advanced part of the API, 2. If a system is missing it, we can fallback to this database.
As @jubianchi noticed, `setUp` runs in the parent process, no inside all child processes. This is what we expect.
Now we have an
Output
interface, this is much easier to test theHoa\Console
library. So here we go. I am writing tests :-].Steps
Console
,Cursor
,GetOption
,Input
,Mouse
,Output
,Parser
,Processus
,Readline
:Readline
,Password
,Autocompleter
:Path
,Word
,Aggregator
,Tput
,Window
.