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

Utility\CaseInsensitiveDictionary: add dedicated unit tests + minor bug fix #558

Merged
merged 2 commits into from
Oct 11, 2021

Commits on Oct 4, 2021

  1. Utility\CaseInsensitiveDictionary: add dedicated unit tests

    While this class was largely already tested via "user" classes, this now adds a set of dedicated tests specifically for this class.
    jrfnl committed Oct 4, 2021
    Configuration menu
    Copy the full SHA
    afc7455 View commit details
    Browse the repository at this point in the history
  2. Utility\CaseInsensitiveDictionary: minor bug fix

    The use of `strtolower()` on non-string keys, is 1) not necessary and 2) had side-effects when non-string keys were used as those were then cast to string, which with the current set of tests would lead to the `false` test case overwritting the `null` test case and potentially "passing null to non-nullable" errors in PHP 8.1.
    
    While this class is intended to be used with requests headers, the class in itself is not limited to this use-case, so should function as per the specifications, independently of the use-case.
    
    Alternatively, a stricter check could be put in place to only allow string keys for the data captured in this class. That would potentially create a bigger breaking change though.
    jrfnl committed Oct 4, 2021
    Configuration menu
    Copy the full SHA
    0cc1e15 View commit details
    Browse the repository at this point in the history