flightphp / core

An extensible micro-framework for PHP
https://docs.flightphp.com
MIT License
2.6k stars 407 forks source link

added plain stream() method #575

Closed n0nag0n closed 2 months ago

n0nag0n commented 2 months ago

Simplified streaming methods with stream() route method

fadrian06 commented 2 months ago

In a while I'll run the tests just in case hehe, right now I don't have electricity

fadrian06 commented 2 months ago

PHPUnit 9.6.18 by Sebastian Bergmann and contributors.

Runtime: PHP 7.4.33 Configuration: C:\xampp\htdocs\libs\flight\phpunit.xml Random Seed: 1712965480

............................................................... 63 / 288 ( 21%) .................................................F

Time: 00:01.854, Memory: 10.00 MB

There was 1 failure:

1) tests\ResponseTest::testResponseBodyCallbackGzip Failed asserting that two strings are equal. --- Expected +++ Actual @@ @@ -'H4sIAAAAAAAAAytJLS4BAAx+f9gEAAAA' +'H4sIAAAAAAAACitJLS4BAAx+f9gEAAAA'

C:\xampp\htdocs\libs\flight\tests\ResponseTest.php:285 phpvfscomposer://C:\xampp\htdocs\libs\flight\vendor\phpunit\phpunit\phpunit:106 C:\xampp\htdocs\libs\flight\vendor\bin\phpunit:118

FAILURES! Tests: 113, Assertions: 206, Failures: 1.

fadrian06 commented 2 months ago

PHPUnit 9.6.18 by Sebastian Bergmann and contributors.

Runtime: PHP 8.2.17 Configuration: C:\xampp\htdocs\libs\flight\phpunit.xml Random Seed: 1712965580

............................................................... 63 / 288 ( 21%) ......................................F

Time: 00:00.733, Memory: 8.00 MB

There was 1 failure:

1) tests\ResponseTest::testResponseBodyCallbackGzip Failed asserting that two strings are equal. --- Expected +++ Actual @@ @@ -'H4sIAAAAAAAAAytJLS4BAAx+f9gEAAAA' +'H4sIAAAAAAAACitJLS4BAAx+f9gEAAAA'

C:\xampp\htdocs\libs\flight\tests\ResponseTest.php:285 C:\xampp\htdocs\libs\flight\vendor\bin\phpunit:122

FAILURES! Tests: 102, Assertions: 152, Failures: 1.

n0nag0n commented 2 months ago

Huh, I wonder if that's a difference between windows vs linux implementation of gzip? Just double check and run composer update On your recent PR I had an error in PHPStan and I couldn't make it go away until I updated (not realizing it was out of date), and updated whatever packages you have for php/gzip. Just in case they are out of date. It's really weird it's only mixing up two characters in the middle.

fadrian06 commented 2 months ago

I guess I'll make an assert for windows and another for unix xD

fadrian06 commented 2 months ago

I'm checking phpstan right now

fadrian06 commented 2 months ago

image image image