Just to continue on my earlier report, I have created a project to run the http-factory-tests <https://github.com/http-interop/http-factory-tests> against as many PSR-17 providers as I could find. In the end there were 14 packages I found testable, resulting in 18 different PSR-17 & PSR-7 combinations to actually test. See php-psr17-http-factory-tests-runner <https://github.com/Zegnat/php-psr17-http-factory-tests-runner> for details.
By running a modified version of the tests <https://github.com/Zegnat/http-factory-tests/tree/stream-tell-tests>, one that includes tests for StreamInterface::tell(), I can now confirm the following: 1. All implementations keep the cursor wherever it is in the resource when StreamFactoryInterface::createStreamFromResource() is used. 2. berlioz/http-message is the only implementation (out of 14) to move the cursor to the end when StreamFactoryInterface::createStreamFromFile() is used. All other implementations have the cursor at the start of the Stream. (This is probably because this is where fopen() puts it.) 3. Implementations are very split on where the cursor goes when StreamFactoryInterface::createStream() is used. Depending on how you count the wrapper implementations by http-interop and tuupola the split is almost 50/50. The following implementations put the cursor at the start (position 0) of the stream for StreamFactoryInterface::createStream(): - bulldog/http-factory (Guzzle) - chillerlan/php-httpinterface - http-interop/http-factory-diactoros - http-interop/http-factory-guzzle - http-interop/http-factory-slim - sunrise/http-factory - viserio/http-factory - zendframework/zend-diactoros The following implementations put the cursor at the end (position 29 in the test) of the stream for StreamFactoryInterface::createStream(): - berlioz/http-message - chiron/http - nyholm/psr7 - rancoud/http - tuupola/http-factory (Guzzle, Nyholm, Slim, Diactoros) Any implementations not on either list had other test failures keeping them from performing correctly. I am happy to further assist the WG wherever I can! -- 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 [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/0335ac7b-1e53-4e76-9e12-2160e786897a%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
