I am unsure what you mean, Anton. Woody pointed at tests for PSR-17 while I 
pointed at tests for PSR-7, they test implementations of different 
interfaces and you should use the one that matches the interface you are 
implementing.

They are also not *my* tests. I have actually contributed more code to the 
tests Woody linked than to the ones I linked, including an outstanding PR 
about a weird under-specified issue with PSR-17 as it relates to streams (a 
discussion Woody has also previously been involved with). So I am not sure 
this is a me vs Woody’s team situation 😉

To get back to your original email though: according to the PSR-7 
definition of getHeaders it should not change the original case used to 
define the headers. To quote:

While header names are not case-sensitive, getHeaders() will preserve the 
> exact case in which headers were originally specified.
>

I would love to see a test for that added to the PSR-7 test suite I linked, 
so all the big PSR-7 implementations can be tested against the case you 
mentioned to see how they handle it. There is no test for this that I could 
find at a cursory glance. I would expect PSR-7 to mean it would result in 
['Foo' => ['...'], 'foo' => ['...']].

On Monday, 30 September 2019 09:15:37 UTC+2, Anton Fedonjuk wrote:
>
> Sorry but your tests bad wrong, see Woody solution - his team fix all u 
> bugs year ago.
>
> понедельник, 30 сентября 2019 г., 7:04:47 UTC+3 пользователь Martijn van 
> der Ven написал:
>>
>> The PHP HTTP Group also compiles some PSR-7 integration tests that you 
>> could look at:
>> https://github.com/php-http/psr7-integration-tests
>>
>> On Monday, 30 September 2019 03:37:32 UTC+2, Anton Fedonjuk wrote:
>>>
>>> Аbstract implementation or real tests at PHPUnit.
>>> Why I ask about tests for "interfaces" without strict types (in most 
>>> cases)?
>>> Because many packages writing "Implementation of PSR-*" in description 
>>> don't even suspect that is not true.
>>> As example: half libraries based on PSR-7 returning wrong result by 
>>> Psr\Http\Message::getHeaders(). They returns headers with normalized names 
>>> (array keys).
>>> Also some standarts have very abstact description, we do not need to 
>>> look far for an example:
>>> Call Psr\Http\Message::withHeader('Foo', '...')->withAddedHeader('foo', 
>>> '...');
>>> What will return method getHeaders: ['Foo' => '...', ...] or ['foo' => 
>>> '...', ...]? 
>>> I don't found answer in PRS-7 :(
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups "PHP 
Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to php-fig+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/php-fig/eef68974-3674-4177-8099-18b5dfd10fac%40googlegroups.com.

Reply via email to