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

tests/Integration: Add FileTest #819

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jtojnar
Copy link
Contributor

@jtojnar jtojnar commented Mar 19, 2023

This is a regression test for #812.

@jtojnar
Copy link
Contributor Author

jtojnar commented Mar 20, 2023

@Art4 Do you think something like this is reasonable?

I tried finding a library for the PHP server but after reviewing the following, I gave up and wrote my own helper class:

@Art4
Copy link
Contributor

Art4 commented May 23, 2023

I would have said that it is not worth the effort to create such a test because the File class will be deprecated. But since you've already done the work, we can keep the test. Requiring a separate library for it would definitely be too much.

tests/Integration/HttpServer.php Outdated Show resolved Hide resolved
tests/Integration/Fixtures/redirects.php Outdated Show resolved Hide resolved
tests/Integration/Fixtures/redirects.php Outdated Show resolved Hide resolved
tests/Integration/Fixtures/redirects.php Outdated Show resolved Hide resolved
tests/Integration/Fixtures/redirects.php Outdated Show resolved Hide resolved
tests/Integration/Fixtures/redirects.php Outdated Show resolved Hide resolved
@jtojnar jtojnar force-pushed the redirect-tests branch 3 times, most recently from 3cf2b9f to bdb50df Compare May 23, 2023 18:01
Copy link
Contributor Author

@jtojnar jtojnar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review, updated. I think this integration test will be useful for PSR-18 as well since how the permanent/temporary redirection interact with get_final_url is non-trivial. Though there we at least will not need to spawn a server since that will support mocking.

tests/Integration/HttpServer.php Outdated Show resolved Hide resolved
tests/Integration/Fixtures/redirects.php Outdated Show resolved Hide resolved
Since the custom HTTP client in File based on curl cannot really be mocked,
let’s add an actual HTTP server to allow for integration and regression testing
during the transition to PSR-18 implementations.
This is a regression test for simplepie#812.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants