Download the PHP package qratorlabs/smocky without Composer
On this page you can find all versions of the php package qratorlabs/smocky. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download qratorlabs/smocky
More information about qratorlabs/smocky
Files in qratorlabs/smocky
Download qratorlabs/smocky
More information about qratorlabs/smocky
Files in qratorlabs/smocky
Vendor qratorlabs
Package smocky
Short Description Mocking library based on runkit
License MIT
Homepage https://github.com/QratorLabs/Smocky
Package smocky
Short Description Mocking library based on runkit
License MIT
Homepage https://github.com/QratorLabs/Smocky
Please rate this library. Is it a good library?
Informations about the package smocky
Mock static methods
...and a bit more ;)
Goals
- easy mocking
- make any changes revertible
- revert changes automatically
Targets
There are several classes that will do the work:
- For class methods:
MockedClassMethod
to mock any class with closureUndefinedClassMethod
to make method disappear
- For class constants:
MockedClassConstant
UndefinedClassConstant
- For global constants:
MockedGlobalConstant
UndefinedGlobalConstant
- For functions (global or Namespaced):
MockedFunction
UndefinedFunction
Install
Note
There is a workaround that ensures that any (defined) children of class, which method is mocking, have its own method, defined by user or mocked (by Smocky - closure that calls parent).
Example for code that will fail without this workaround following code will end up with Segmentation fault: 11
Trivia
Revertible changes
All changes are made revertible by using internal storage and __destruct
methods.
Drawbacks
Thing to keep in mind before using:
- Mocking anything will hit memory consumption (ex. to preserve changes)
- Mocking methods will hit performance (a bit)
- To mock static class we must check (and mock) children of mocking class
Powered by
Tested with
All versions of smocky with dependencies
PHP Build Version
Package Version
The package qratorlabs/smocky contains the following files
Loading the files please wait ....