There are next changes:
- Optimize callFunction
There are next changes:
- Do not try overriding constants for attributes instantiation, e.g.
#[TestAttribute(TestAttribute::TEST_VALUE)]
protected function bar(#[TestAttribute(TestAttribute::TEST_VALUE)] $bar): void {}
There are next changes:
- Fix SoftMocks::isCallable triggering E_DEPRECATED for floats
There are next changes:
- Support for rewriting calls with named arguments
There are next changes:
- Use correct namespace in callFunction
There are next changes:
- Optimize isMocked and getClassConst
There are next changes:
- Ignore some calls in backtrace to fix navigation in PHPStorm, ignore PHPUnit calls by default
There are next changes:
- Update php-parser to a recent version
There are next changes:
- Fixed lines preserving for heredec and elseif
There are next changes:
- PHP 8.0 support: added support for non-capturing catches
- PHP 8.0 support: added attributes printing inside the mocked files
There are next changes:
- Upgrade phpunit dev dependency to be able use PHP 8.0
There are next changes:
- Fixed base path cutoff
There are next changes:
- Removed mb_orig_* helpers, as well as their usages
There are next changes:
- Fixed issue with creating extra empty lines
- ext-mbstring is now required for processing
There are next changes:
- Removed usages of mbstring-overloaded functions
There are next changes:
- Added support of composer 2
There are next changes:
- Added support for PHPUnit 8.4.3
- Fixed unexpected multiline formatting when rewriting function calls
- Fixed handling string-encapsulated function calls
- Added support for fetching constants from imported namespaces, e.g.
use Namespace;
echo Namespace\CONSTANT_NAME;
There are next changes:
- upgrade php-parser to 4.10.2
- fix travis ci composer 2 problem
There are next changes:
- add pause/resume:
- call method \Badoo\SoftMocks::pause to disable all mocks
more mocks can be added when SoftMocks are on pause - call method \Badoo\SoftMocks::resume to enable all mocks
- call method \Badoo\SoftMocks::pause to disable all mocks
There are next changes:
- PHP 7.2, 7.3 and 7.4 language features support
There are next changes:
- fix refer to class const from named function declared in method
- add error handler for php parser errors
There are next changes:
- fix patches for phpunit 8.x
There are next changes:
- fix code generating for rewritten files for right stacktrace
- use \PhpParser\Lexer instead of \PhpParser\Lexer\Emulative and \PhpParser\Parser\Php7 instead of \PhpParser\Parser\Multiple (with both 7 and 5 versions), they are quite quicker
There are next changes:
- add support phpunit 7.x and 8.x
- update
nikic/php-parser
to^4.3.0
, so now version isn't specific - minimum php version now is
7.0
- now ext-json is required for get nikic/php-parser version for right rewritten files cache
- fixed error 'Unbinding $this of closure is deprecated'
There are next changes:
- fix for 2-element-array callable
There are next changes:
- fix
is_callable
method which fails on malformed arrays
There are next changes:
- make more unique rewritten files paths depends on php internals
There are next changes:
- fix
recursiveGetTraits
method which didn't work for case when one trait uses another trait
There are next changes:
- fix resolve relative file path
There are next changes:
- use mb_orig_* functions
- create directory /tmp/mocks for cache by default
- constant SOFTMOCKS_ROOT_PATH marked as deprecated, use
\Badoo\SoftMocks::setProjectPath()
instead of it - fix create mocks cache dir race condition
There are next changes:
- fix short array destructing when some elements are absent;
- dev dependence vaimo/composer-patches was updated from 3.4.3 to 3.23.1;
- patch level for patches was provided;
- phpunit6 support was added;
- class static protected constant was fixed;
- class constants inheritance was fixed:
- before fix:
class A {const NAME = 'A';} class B {} \Badoo\SoftMocks::redefineConstant(A::class . '::NAME', 'B'); echo A::NAME . "\n"; // B echo B::NAME . "\n"; // A
- after fix:
class A {const NAME = 'A';} class B {} \Badoo\SoftMocks::redefineConstant(A::class . '::NAME', 'B'); echo A::NAME . "\n"; // B echo B::NAME . "\n"; // B
- before fix:
- soft-mocks init logic was moved to src/init_with_composer.php script from phpunit patch;
- methods \Badoo\SoftMocks::getRewrittenFilePath() and \Badoo\SoftMocks::getOriginalFilePath() were added;
- SOFT_MOCKS_CACHE_PATH environment variable was added for redefine default mocks cache path;
- Now \RuntimeException() isn't caught in \Badoo\SoftMocks::rewrite().
There are next changes:
- using getenv instead of $_ENV global variable;
- error "PHP Fatal error: Class 'Symfony\Polyfill\Php70\Php70' not found" was fixed;
- use path in project for cached files path.
There are next changes:
- Support private/protected class constants;
- Using getenv instead of $_ENV global variable.
There are next changes:
- Added $variadic_params_idx (string, '' - no variadic params, otherwise - it's idx in function arguments).
There are next changes:
- Line numbering in rewritten code improved;
- Only multiline /**/ comments are present in rewritten file.
There are next changes:
- PHP 7.1 support (mostly nullable and void return type declarations);
- update nikic/php-parser to 3.0.6;
- fix bug with throwing from generators;
- added tests for constants redefine.
There are next changes:
- added Travis and Scrutinizer support;
- skipped running PHP7.0 tests on previously versions of PHP;
- changed default namespace to \Badoo. \QA namespace marked as deprecated and will be removed in 2.0.0;
- \QA\SoftMocksTraverser::$can_ref gone private, was mistakenly without scope.
There are next changes:
- vaimo/composer-patches version was fixed for prevent error 'The "badoo/soft-mocks/patches/phpunit5.x/phpunit_phpunit.patch" file could not be downloaded: failed to open stream: No such file or directory';
- load parser file was added for prevent error "Fatal error: Uncaught Error: Class 'PhpParser\NodeTraverser' not found in vendor/badoo/soft-mocks/src/QA/SoftMocks.php:1154".
There are next changes:
- nikic/php-parser was updated to 2.0.0beta1;
- using nikic/php-parser version in path to rewritten file was added;
- info how reapply patches was added.
There are next changes:
- patches for phpunit in composer.json was added;
- exact version of nikic/php-parser in composer.json was provided;
- parameter $strict for method
\QA\SoftMocks::redefineMethod()
was removed, now only strict mode available; - redefine for built-in mocks was allowed (is activated by
\QA\SoftMocks::setRewriteInternal(true)
) #15, thanks Mougrim; - null for redefined constants was allowed #11, thanks Alexey Manukhin;
- error "Fatal error: Couldn't find constant QA\SoftMocks::CLASS in /src/QA/SoftMocks.php on line 388" was fixed for old versions hhvm #16, thanks Mougrim;
- warning "PHP Warning: array_key_exists() expects exactly 2 parameters" was fixed #14, thanks Mougrim;
- handle phpunit wrapped exceptions (PHPUnit_Framework_ExceptionWrapper, \PHPUnit\Framework\ExceptionWrapper);
- unit tests was added.