Download the PHP package komex/influence without Composer
On this page you can find all versions of the php package komex/influence. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package influence

Influence
Influence is the PHP library gives you ability to mock any objects and static classes. Works only if you use Composer autoloader. This library very useful for testing your code.
Requirements
- PHP 5.4 or higher
- SPL extension
- Tokenizer extension
- Composer loader
Installation
To add Influence as a local, per-project dependency to your project, simply add a dependency on komex/influence
to your project's composer.json
file.
Here is a minimal example of a composer.json
file that just defines a develop dependency on Influence:
Usage
Influence must be injected as early as possible. If you are using unit test framework like unteist or PHPUnit the best way to do this is include autoload and influence in bootstrap file.
Since this moment you are able to mock any objects and static classes. By default, all objects behave as usual. You need to configure behavior of each object or class you need to control.
Manage objects
Let imagine we have a simple class A:
Custom method behavior.
So, if we create an object of class we can invoke only method and control only and never know result of our operation.
`
But with Influence you can simply test this code. Just specify the behavior of like this:
Log method calls
If you don't need to set custom method behavior, but want to know how many times method was called and with what arguments.
License
Influence by Andrey Kolchenko is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
All versions of influence with dependencies
ext-spl Version *
ext-tokenizer Version *