-
Notifications
You must be signed in to change notification settings - Fork 6
Mocking problematic classes
Some PHP classes can be difficult, if not impossible, to mock. This page lists classes that may cause issues when mocking with Phony.
In general, classes marked as final
cannot be mocked. However, if the class in
question implements an interface, or extends another class that can be mocked,
proxy mocks may be a workable solution.
Enumerations are marked final
internally. See the section on Final classes
for options.
Mocking of the following classes is not supported by Phony:
__PHP_Incomplete_Class
-
Closure
(because it'sfinal
)
For more information on Phony, please see the documentation.
The Phony wiki is a place for documentation that may be frequently updated, or where updates do not necessarily coincide with a particular release.
These pages are only an addendum to the main documentation, which contains more detailed information.