Help with testing a sequence of two commands using PHPUnit and ReactPHP #537
Replies: 5 comments 1 reply
-
I think presently there is now way to do this I think. But I have found an another way that reuse the same function from the StartCommandTest class. Would you like to see it?? |
Beta Was this translation helpful? Give feedback.
-
I'm somewhat confused about why the two commands would fail. Showed code should handle that fine? You could rewrite: $response = \React\Async\await(self::$promise->then(function (string $result): string {
return $result;
})); As: $response = \React\Async\await(self::$promise); |
Beta Was this translation helpful? Give feedback.
-
I don't think that would work since conn does not let us write two functions at a time. |
Beta Was this translation helpful? Give feedback.
-
Thank you @WyriHaximus for the help. Not too sure about this one yet. No worries, I suppose for the time being the Selenium automated tests will be kind of equivalent to the so-called functional tests. |
Beta Was this translation helpful? Give feedback.
-
👋 Hi there,
At ChesslaBlab we're using PHPUnit along with
React\Socket\Connector
to write functional tests for the PHP Chess Server.The following example shows how a sequence of one command can be tested successfully.
However, it seems as if we're wissing something when testing a sequence of two commands.
In this case, the expected response should be the following.
See:
I haven't been able to find an example of how to test a sequence of two commands using PHPUnit and ReactPHP.
Any help would be greatly appreciated, thank you!
Beta Was this translation helpful? Give feedback.
All reactions