Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doubler does not support old construction way #30

Closed
l3l0 opened this issue Jun 27, 2013 · 2 comments
Closed

Doubler does not support old construction way #30

l3l0 opened this issue Jun 27, 2013 · 2 comments

Comments

@l3l0
Copy link

l3l0 commented Jun 27, 2013

Sometimes we want to create doubles for old libs/classes like https://github.com/phpseclib/phpseclib/blob/master/phpseclib/Net/SSH2.php#L741

Mockery had simillar issue mockery/mockery#139

Most of the time in such cases I would create own interface and wrap such classes probably. Just be aware that it gives such error right now:

PHP Fatal error:  Call to a member function makeProphecyMethodCall()
on a non-object in .../vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/ClassCreator.php(48): eval()'d code on line 105
@everzet
Copy link
Member

everzet commented Jul 5, 2013

  1. I'm not sure we should fix that on the framework level
  2. You can easily fix it on application level - extend your class with all constructor, add __construct and call parent one in it. This will give you modern API to work with and ability to spec it.

Thoughts?

@everzet everzet closed this as completed Jul 7, 2013
@everzet everzet reopened this Jul 7, 2013
@everzet
Copy link
Member

everzet commented Jul 7, 2013

After thinking a bit I think we should support old constructors. Not because it's right, but because I don't want Prophecy users to frustrate of code that doesn't belong to them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants