Giter VIP home page Giter VIP logo

Comments (2)

Naktibalda avatar Naktibalda commented on June 12, 2024

I don't think that this error is directly related to upgrade to Codeception 5.
It happens in Symfony module and content of your App\Tests\Helper\MockedServiceContainer class may be very important.

from codeception.

vdanielpop avatar vdanielpop commented on June 12, 2024

Thanks for the fast reply @Naktibalda . I don't know how I missed the traces of MockedServiceContainer, I managed to discover what was causing that error.

However another strange behavior came up after fixing that one:
I have a test definition with the following details:

Feature file:
And I have a product with price "1234.5678"

Implementation:

    /**
     * @Then I have a product with price :price
     */
    public function theProductHasTheGivenPrice(float $price): void {...}

This used to work just fine with the previous version, and by that I mean that $price was correctly passed as float when the method was being called.
However after the update, it comes as string.

Argument #1 ($price) must be of type float, string given, called in /var/www/vendor/codeception/codeception/src/Codeception/Test/Gherkin.php on line 185

I've looked up if there are ways to specify in the feature file that I want value X to represent a float, but I haven't found anything along those lines. I'm not sure if the behaviour of the previous version where the value was type-casted was intended or not. Have you encountered this before ?

Thank you

from codeception.

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.