A more functional solution to Function Mocker indiscriminate input wrapping.
I’ve update function-mocker and pushed its latest version to ship with the
This will allow for more selective and less intrusive wrapping to happen while still allowing a lazy approach using the
An abstract from the updated README:
By default any library in the
vendorfolder will be excluded from the input wrapping and everything else will be included. If files in any of the
vendorsub-folders need to be wrapped for testing purposes, or a folder that’s not in the
vendorfolder needs to be excluded, then an array of options can be passed to the
<?php // This is global bootstrap for autoloading use tad\FunctionMocker\FunctionMocker; require_once dirname( __FILE__ ) . '/../vendor/autoload.php'; FunctionMocker::init([ 'include' => ['vendor/package', 'vendor/another'], 'exclude' => ['libs/folder', 'src/another-folder'] ]);
If the call to the
initmethod is omitted then it will be called on the first call to the
setUpmethod in the tests.
Time to put the library under some more work and wait for the next bug/issue to happen.