Giter Club home page Giter Club logo

Comments (4)

sebastianbergmann avatar sebastianbergmann commented on June 12, 2024

As of #5812 and since PHPUnit 10.5.18, PHPUnit 10.5 warns about tests that "only work by happenstance". These tests, that may already work incorrectly when run with PHPUnit 10.5, no longer work with PHPUnit 11 due to #4964.

PHPUnit 10.5.20 did not introduce any new deprecations, but I guess you are referring to #5819. This, too, is a warning about tests that, if at all, "only work by happenstance".

is there an option that would allow PHPUnit to report a zero status code when there's no failure/errors but only deprecations

What you ask for is the default behaviour. You need to explictly configure that deprecations lead to a non-zero exit code, for instance using the failOnDeprecation attribute in the XML configuration file.

from phpunit.

gnutix avatar gnutix commented on June 12, 2024

failOnDeprecation fixes the status code indeed. Is there a way to not report the thousands of deprecations at the end of each run too ?

Your answer and closing the issue right afterwards doesn't give me a feeling that you really care about the effort fixing these deprecations will require of the developers using your library. Maybe I misunderstand "happenstance", but if it means "by a happy coincidence", I beg to disagree : it worked because there never was any constraint on how data providers keys were to be named, and suddenly you've added such a constraint to fit the plans for the future version.

I'd be curious to hear of other developers if they had such impacts on their test suites, but closing the issue means no one will ever see it...

from phpunit.

Ma-ve avatar Ma-ve commented on June 12, 2024

@gnutix We've seen this too. While it's annoying, as it happened between minor versions, we're not really that worried.

Either:

  • stick with 10.5.18, as PHPUnit 11 is already available
  • remove all array keys from data providers
  • update array keys to match the argument name

We've decided on half/half: removing array keys from data providers that weren't providing additional information, and for those with more complex structures (true/false/true/true), we've updated the array keys to match the argument names.

As for the 'happenstance', I wouldn't much call it that if it weren't for PHPUnit introducing support for named arguments somewhere along the way. PHPUnit doing->{$method}(...array_values($dataProviderData)) worked perfectly fine for many years

from phpunit.

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.