Closed mhf-ir closed 6 years ago
@mhf-ir What do you mean?
if loop run forever how write a sample test unit to create request and mock server dispatch the request and server shutdown after test.
@mhf-ir Testing server shutdown should be as simple as testing your shutdown event class (the one that extends \Igni\Http\Server\OnShutdown
)- you can mockup the \Igni\Http\Server
class in your code in order to achieve this.
Testing your controllers should be similar, you simply declare your test class instantiate your controller (which extends HttpController) and mockup Request class.
Entire application layer with the server flow is already tested in the framework so you don't have to worry about that part.
I can provide example code to help you out.
That's will be awesome, try to using non-block swoole base is new and many developers using Chinease platfroms but it's not documentations well like https://github.com/swoft-cloud/swoft. Documentation and support will be the point.
Thank you for support
Any documentation for test unit ?