Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add (more) unit-tests #21

Open
Potherca opened this issue Aug 29, 2022 · 0 comments
Open

Add (more) unit-tests #21

Potherca opened this issue Aug 29, 2022 · 0 comments

Comments

@Potherca
Copy link
Member

Potherca commented Aug 29, 2022

Because of the nature of this project, there is only one Server class, which contains all logic.

Likewise, there is also only one class entrypoint: respondToRequest.

Tests should be broken out into separate request methods (GET, PUT, DELETE, POST, etc.).

Although the main components are injected into the class (which makes it possible to mock them) this is not the case for all dependencies. There are still some new ...() calls in the class.

the majority of the tests should exists out of creating a specific setup (both in the Request object passed to the server and various mocks) and and an assert for the returned Response object.

As there are many paths through the code, a lot of tests will be needed to cover them all.

Fixtures that could be used by the mocks already exists, as they have been created for the example.php.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant