Git Product home page Git Product logo

Comments (4)

padraic avatar padraic commented on May 12, 2024

Thanks Rob,

Could you note what your basic mock() method contained? There are two styles of partial - passing in a full object or passing in a class. Just need to confirm which you used.

from mockery.

RobMasters avatar RobMasters commented on May 12, 2024

It was passing in a full object, a la: m::mock( new ClassWithScalarTypeHint() );

from mockery.

padraic avatar padraic commented on May 12, 2024

Looks like the Proxy generator isn't picking up the bool typehint so it assumes it must be a class type. Should be easy to fix!

Have you checked If the other partial is more suited for you? It uses a square bracket syntax for methods to mock and doesn't require a ready object.

On 27 Jan 2012, at 15:30, Rob Masters [email protected] wrote:

It was passing in a full object, a la: m::mock( new ClassWithScalarTypeHint() );


Reply to this email directly or view it on GitHub:
#47 (comment)

from mockery.

RobMasters avatar RobMasters commented on May 12, 2024

Yeah I do normally use the other partial syntax, thanks, but I was passing in an instance in this case because I needed some configuration to happen inside it's constructor.

Anyway, I just had a go at fixing this myself (for both partial syntaxes) but it turns out that it isn't possible, which is fine I suppose as it isn't a documented PHP feature yet.

Best to just get rid of the typehint, which is what I did anyway as soon as I discovered what the problem was.

from mockery.

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.