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

fix: Allow lists on FeatureTestTrait#post $params #9204

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

Conversation

3ynm
Copy link

@3ynm 3ynm commented Sep 27, 2024

Description**

Fixes a bug that doesn't allow to send lists in JSON format in FeatureTestTrait#post or #call('POST',.... This because it expected params to always be an associative array.

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@3ynm
Copy link
Author

3ynm commented Sep 27, 2024

You can reproduce the bug by deleting is_string($index) && on line 293 of system/HTTP/RequestTrait.php and then running the tests.

@michalsn michalsn added the bug Verified issues on the current code behavior or pull requests that will fix them label Sep 27, 2024
@michalsn
Copy link
Member

Thank you for your first contribution!

Can you also add an entry to the changelog, under the section "Bugs Fixed"?
If you're unsure how it should look, you can check previous releases.

@3ynm
Copy link
Author

3ynm commented Sep 27, 2024

Done

@3ynm 3ynm force-pushed the develop branch 2 times, most recently from d58a30a to e40ef7e Compare September 27, 2024 07:40
Comment on lines +33 to +34
**FeatureTestTrait:** Allows `#call` and `#post` to process JSON lists. It failed because `RequestTrait#fetchGlobal` expected the second parameter ($index) to be an associative array.

Copy link
Member

Choose a reason for hiding this comment

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

The bug was in the RequestTrait class.

Suggested change
**FeatureTestTrait:** Allows `#call` and `#post` to process JSON lists. It failed because `RequestTrait#fetchGlobal` expected the second parameter ($index) to be an associative array.
**RequestTrait:** A bug where sending a JSON list in a request caused an error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Verified issues on the current code behavior or pull requests that will fix them
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants