Skip to content

Releases: badoo/soft-mocks

2.0.3

06 Nov 11:13
Compare
Choose a tag to compare

There are next changes:

  • fix recursiveGetTraits method which didn't work for case when one trait uses another trait

2.0.2

30 Oct 17:37
Compare
Choose a tag to compare

There are next changes:

  • fix resolve relative file path

2.0.1

24 Oct 14:39
Compare
Choose a tag to compare

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

2.0.0

24 Oct 14:38
Compare
Choose a tag to compare

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 extends A {}
      \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 extends A {}
      \Badoo\SoftMocks::redefineConstant(A::class . '::NAME', 'B');
      echo A::NAME . "\n"; // B
      echo B::NAME . "\n"; // B
  • 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().

1.3.5

31 Jan 15:22
Compare
Choose a tag to compare

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.

1.3.4

31 Jan 15:22
Compare
Choose a tag to compare

There are next changes:

  • Support private/protected class constants;
  • Using getenv instead of $_ENV global variable.

1.3.3

31 Jan 15:21
Compare
Choose a tag to compare

There are next changes:

  • Added $variadic_params_idx (string, '' - no variadic params, otherwise - it's idx in function arguments).

1.3.2

03 Nov 17:37
Compare
Choose a tag to compare

There are next changes:

  • Line numbering in rewritten code improved
  • Only multiline /**/ comments are present in rewritten file

1.3.0

28 Sep 09:43
Compare
Choose a tag to compare

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.

1.2.0

04 Sep 13:06
Compare
Choose a tag to compare

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.