You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.
I think this is a php unit problem, or even with your architecture. Why do you have a reason to mock Zend\Config\Config? Normally most objects should not depend on that one. Better would be to use Options classes (Zend\Stdlib\AbstractOptions) to check configuration for a given object.
While I see your point, we shouldn't use self for type-hinting.
On Jan 20, 2013 12:49 PM, "prolic" [email protected] wrote:
I think this is a php unit problem, or even with your architecture. Why do
you have a reason to mock Zend\Config\Config? Normally most objects should
not depend on that one. Better would be to use Options classes
(Zend\Stdlib\AbstractOptions) to check configuration for a given object.
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/2977#issuecomment-12475179.
I've extended ZF2's Zend\Config\Config class with my own.
I then mocked my config class in a PHPUnit test
only to receive an error:
Declaration of Mock_Config_3a90f1fc::merge() should be compatible with that of Zend\Config\Config::merge()
Zend\Config\Config merge() method signature is:
when "self" is amended to "\Zend\Config\Config", mocking works. Can this be changed?
Also see sebastianbergmann/phpunit-mock-objects#107
The text was updated successfully, but these errors were encountered: