Code Monkey home page Code Monkey logo

Comments (1)

uuf6429 avatar uuf6429 commented on June 20, 2024

Hey, I saw the merged PR and I have a few follow up questions:

  1. since it has been merged, shouldn't this ticket be closed (if the problem is now solved)?
  2. looking at the code of the PR, I disagree a bit on how it works:
    1. In my understanding, PHPUnitExceptionStringer->supportsException should have prevented the original problem from happening, so I would recommend looking into why it wasn't
    2. The code of PHPUnitExceptionStringer->stringException is now a bit messier.. "if class exists return x; if class does not exist return z; else it must exist and therefore return y..", IMHO this would be clearer and more readable:
    switch (true) {
        case class_exists('PHPUnit\\Util\\ThrowableToStringMapper'):
            return trim(\PHPUnit\Util\ThrowableToStringMapper::map($exception));
    
        case class_exists('PHPUnit\\Framework\\TestFailure'):
            // PHPUnit assertion exceptions do not include expected / observed info in their
            // messages, but expect the test listeners to format that info like the following
            // (see e.g. PHPUnit_TextUI_ResultPrinter::printDefectTrace)
            return trim(\PHPUnit\Framework\TestFailure::exceptionToString($exception));
    
        case class_exists('PHPUnit_Framework_TestFailure'):
            return trim(\PHPUnit_Framework_TestFailure::exceptionToString($exception));
    
        default:
            // TODO this should also be somehow handled
    }
    It now also exposes the original flaw, which the patch didn't fix adequately IMO.
  3. Shouldn't PHPUnitExceptionStringer->supportsException also be updated to handle the new formatter?

from behat.

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.