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

Writing PHPT tests #302

Open
jrfnl opened this issue Apr 10, 2023 · 5 comments
Open

Writing PHPT tests #302

jrfnl opened this issue Apr 10, 2023 · 5 comments
Labels
missing Something is not yet documented

Comments

@jrfnl
Copy link
Contributor

jrfnl commented Apr 10, 2023

While most people will primarily write unit tests, at times, it will be useful to write phpt style tests.

Typical use cases include, but are not limited to:

  • End to end tests for CLI tools (including PHPUnit itself)
  • Getting at least some tests in place for legacy codebases which have spaghetti code to safeguard against regressions before refactoring the code.

There is (project specific) information available about the phpt format in the PHP project itself, but that information is not one-on-one applicable for phpt for PHPUnit.

I believe it would be beneficial to add a section to the PHPUnit documentation about writing phpt tests, which at the very least documents the available sections.

@sebastianbergmann sebastianbergmann added the missing Something is not yet documented label Apr 11, 2023
@sebastianbergmann
Copy link
Owner

I never really thought of the PHPT support in PHPUnit's test runner as a "public" feature, and more of an "internal" feature that is used to implement end-to-end tests for PHPUnit's test runner. That is/was probably wrong.

@sebastianbergmann sebastianbergmann changed the title Documentation missing for writing phpt tests Writing PHPT tests Apr 11, 2023
@jrfnl
Copy link
Contributor Author

jrfnl commented Apr 11, 2023

It's definitely a barely known feature, but it is something I have been playing with for a couple of projects now and I'd find it helpful to be able to point project contributors somewhere (quite apart from having the chance to learn more about what I can do with the format myself).

@sebastianbergmann
Copy link
Owner

apart from having the chance to learn more about what I can do with the format myself

Do I understand this correctly that you volunteer to write this documentation? :)

@jrfnl
Copy link
Contributor Author

jrfnl commented Apr 12, 2023

Not necessarily, but willing to give it a try when I have some time (next year or something... way too busy still for now)

@sebastianbergmann
Copy link
Owner

Okay, no worries.

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

No branches or pull requests

2 participants