Skip to content

Conversation

Qard
Copy link
Contributor

@Qard Qard commented Jun 11, 2025

I forked ext-php-rs here for use in php-node as I needed to make a bunch of changes. I want to backport as much of that as possible now so ideally we don't need to maintain a fork at all. Just starting small here with this small bug I fixed.

When a header value contains a : character, which is in fact valid according to the spec, it will fail in the current code as it will only include the text between the : separating the header name and the first : within the value. This fixes that by only splitting into two pieces.

@Xenira
Copy link
Collaborator

Xenira commented Jun 11, 2025

@Qard first of all thank you for contributing your changes!

Could you add an integration test that covers this?

The lint pipeline is failing because the commit message does not adhere to conventional commits https://www.conventionalcommits.org/en/v1.0.0/

@Qard
Copy link
Contributor Author

Qard commented Jun 11, 2025

I'm not yet sure exactly how to write an integration test for it. Do you have some pointers? There seems to be very little test coverage for the globals interfaces presently, as far as I can tell. 🤔

@coveralls
Copy link

coveralls commented Jun 11, 2025

Pull Request Test Coverage Report for Build 15591754978

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.2%) to 21.105%

Totals Coverage Status
Change from base Build 15473601075: 0.2%
Covered Lines: 829
Relevant Lines: 3928

💛 - Coveralls

@Xenira
Copy link
Collaborator

Xenira commented Jun 11, 2025

Have a look at the existing tests https://github.com/davidcole1340/ext-php-rs/tree/master/tests/src/integration here.

If you have a specific question let me know.

I am currently working on increasing coverage in general, so there is still a lot missing. Integration tests don't show up in coverage report though.

EDIT: Misread that. Guess you wanted to know how to test the globals... Let me check

@Qard
Copy link
Contributor Author

Qard commented Jun 11, 2025

Yeah, all I found for globals was https://github.com/davidcole1340/ext-php-rs/tree/master/tests/src/integration/globals which covers almost none of the API surface, so I'm a bit unsure what a test should actually look like, given there's not really any examples there.

Xenira added a commit to Qard/ext-php-rs that referenced this pull request Jun 11, 2025
@Xenira
Copy link
Collaborator

Xenira commented Jun 11, 2025

@Qard well, looking at it seems like we would need to expand the sapi tests by a decent amount.

At this point a simple unit test should cover this. I added that. Could you check if this covers your case?

@Qard
Copy link
Contributor Author

Qard commented Jun 11, 2025

Yep, that covers it. I'll see about fixing the commit messages for this now. Thanks for the help!

I'll have some more PRs coming over the next couple days. I want to get as much as possible copied over from these commits so I don't need to be running a fork, and so others can benefit from the changes I've made. Much of what's in there will likely need a bit more polish, or at least proper tests and docs, so I'll get through them all one at a time. 🙂

When SapiHeader::value() is used on a header with a value containing
a : character, it cuts off after that character. This change ensures
the full header value can be retrieved.
@Qard Qard force-pushed the fix-sapi-header-value branch from d43c0b1 to 8ab2451 Compare June 11, 2025 17:37
@Xenira
Copy link
Collaborator

Xenira commented Jun 11, 2025

Much appreciated. Sapi needs some love :)

You can always just delegate when you don't have time to polish some parts. Not that much time either, but always happy to help.

@Xenira Xenira merged commit 1ade4eb into davidcole1340:master Jun 11, 2025
34 checks passed
@davidcole1340 davidcole1340 mentioned this pull request Jun 11, 2025
@Qard Qard deleted the fix-sapi-header-value branch June 12, 2025 07:38
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

Successfully merging this pull request may close these issues.

3 participants