slimphp / Slim-Psr7

PSR-7 implementation for use with Slim 4
MIT License
131 stars 45 forks source link

Fix phpunit deprecations #311

Closed williamdes closed 2 months ago

williamdes commented 3 months ago

They should be static since a long time, phpunit is now unhappy if not static

Question: should we bump phpunit and migrate to annotations ?

coveralls commented 3 months ago

Coverage Status

coverage: 99.872%. remained the same when pulling 0aa9644cd3ad357f9f4982e36400914078ca2c79 on williamdes:tests into 753e9646def5ff4db1a06e5cf4ef539bfd30f467 on slimphp:master.

williamdes commented 3 months ago

I pushed one last commit to address newer phpunit deprecations.

4 tests triggered 8 PHPUnit deprecations:

1) Slim\Tests\Psr7\ResponseTest::testWithStatusValidReasonPhraseObject
* MockBuilder::addMethods() is deprecated and will be removed in PHPUnit 12 without replacement.

* returnValue() is deprecated and will be removed in PHPUnit 12. Use $double->willReturn() instead of $double->will($this->returnValue())

/mnt/Dev/@debian/@wdes-packaging-team/php-slim-psr7/tests/ResponseTest.php:142

2) Slim\Tests\Psr7\UriTest::testWithHostValidObject
* MockBuilder::addMethods() is deprecated and will be removed in PHPUnit 12 without replacement.

* returnValue() is deprecated and will be removed in PHPUnit 12. Use $double->willReturn() instead of $double->will($this->returnValue())

/mnt/Dev/@debian/@wdes-packaging-team/php-slim-psr7/tests/UriTest.php:134

3) Slim\Tests\Psr7\UriTest::testWithQueryValidObject
* MockBuilder::addMethods() is deprecated and will be removed in PHPUnit 12 without replacement.

* returnValue() is deprecated and will be removed in PHPUnit 12. Use $double->willReturn() instead of $double->will($this->returnValue())

/mnt/Dev/@debian/@wdes-packaging-team/php-slim-psr7/tests/UriTest.php:299

4) Slim\Tests\Psr7\UriTest::testWithFragmentValidObject
* MockBuilder::addMethods() is deprecated and will be removed in PHPUnit 12 without replacement.

* returnValue() is deprecated and will be removed in PHPUnit 12. Use $double->willReturn() instead of $double->will($this->returnValue())

/mnt/Dev/@debian/@wdes-packaging-team/php-slim-psr7/tests/UriTest.php:351
coveralls commented 3 months ago

Coverage Status

coverage: 99.872%. remained the same when pulling 382e260116362be02e67e91ed18c55030a3e49be on williamdes:tests into 753e9646def5ff4db1a06e5cf4ef539bfd30f467 on slimphp:master.

williamdes commented 2 months ago

hello @akrabat what do you think about this PR and #310 ?

williamdes commented 2 months ago

I also did a bump for the workflows and removed the need to require a library to upload coverage, this will help when the code will get incompatible with the uploader module. Now you are sure to always be able to upload coverage. See: https://github.com/coverallsapp/github-action

coveralls commented 2 months ago

Coverage Status

coverage: 99.893% (+0.02%) from 99.872% when pulling b39ca1dd5df41c2db080a20a62b0fab4ebdce6f1 on williamdes:tests into 31237445d1ecfa48e1483bfaf1e35c6b11d18718 on slimphp:master.

akrabat commented 2 months ago

Thanks.