Coder Social home page Coder Social logo

PHP 8.0 support about mezzio HOT 9 CLOSED

mezzio avatar mezzio commented on July 19, 2024
PHP 8.0 support

from mezzio.

Comments (9)

jensdenies avatar jensdenies commented on July 19, 2024

Hi @boesing, regarding the PHPUnit dependency upgrade: the assertions assertAttribute* have been removed #(sebastianbergmann/phpunit#3338). This was primarily done because it makes it too easy to test implementation details.

This repository seems to use these assertions quite a lot, what's the recommended upgrade path for the tests which use these assertions?

from mezzio.

lcobucci avatar lcobucci commented on July 19, 2024

@jensdenies that really depends on the context in which those assertions are used.

Some can be addressed by comparing objects (assertEquals not assertSame, sure). However, there might be cases where the test method is just useless and needs to be removed or adjusted to use the public API.

Perhaps PHPUnit upgrade and dropping PHP 7.3 should be done in a separate PR, so that we can more easily contain the scope of changes?

from mezzio.

jensdenies avatar jensdenies commented on July 19, 2024

Hi @lcobucci, several of these assertions are used to read private properties, which are indeed implementation details. Those properties do not always have an associated getter, so IMO it would be best to remove those and only test the public API of those classes.

Regarding your last comment, that would certainly make thing easier because the assertions are still available in PHPUnit 8. I think it would make the upgrade path a lot easier.

from mezzio.

jensdenies avatar jensdenies commented on July 19, 2024

@lcobucci I've created a draft PR here: #55.

from mezzio.

boesing avatar boesing commented on July 19, 2024

@jensdenies Imho, the current tests can be rewritten with reflection. Feel free to create some trait within the tests directory and share it with those tests which are using the removed assertAttribute* methods.

I wont recommend rewriting the whole testsuite as this would take too much time.
We can still consider this for the next major but for now, just use a self-written method which uses reflection.

We've done so in many other components aswell.

from mezzio.

jensdenies avatar jensdenies commented on July 19, 2024

@boesing I will create a PR with a trait to polyfill those traits, like you proposed.

When looking at other Laminas repositories, I see that in some cases, tests which test implementation details are removed.

https://github.com/laminas/laminas-cache/pull/48/files#diff-5934f6347f914a564aa00ffada1a80a1ad425c8df17ff34de7e0dbe5efd921c0L25

Is that something you'd like to see in the PR as well?

from mezzio.

boesing avatar boesing commented on July 19, 2024

@jensdenies Depends. The tests which were removed were tests to verify if backwards compatibility to servicemanager v2 works.
As we dropped support for the servicemanager v2 in laminas-cache, the tests were removed accordingly along with the implementation.

from mezzio.

jensdenies avatar jensdenies commented on July 19, 2024

@boesing Okay, I will create a PR working on PHP 8.0 with a polyfill trait and let's see from there.

from mezzio.

Ocramius avatar Ocramius commented on July 19, 2024

Handled in #59, #60, #62.

from mezzio.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.