Phake Versions Save

PHP Mocking Framework

v4.5.0

1 month ago

What's Changed

Full Changelog: https://github.com/phake/phake/compare/v4.4.0...v4.5.0

v4.4.0

1 year ago

New Feature

#312 Add support for Comparator 5 / PHPUnit 10

v4.3.0

1 year ago

New Features

Add support for PHP8.2 null and false stand-alone types PHP8.2 introduced null and false stand-alone types. It's new possible to mock an object using those types.

Add support for PHP8.2 DNF Types PHP8.2 introduced Disjunctive Normal Form Types. It's now possible to mock an object using DNF types.

Changes

#308 - Unable to use PHP8 named arguments on static method

#307 - Phake\Matchers\IArgumentMatcher doesn't work as expected

v4.2.0

2 years ago

New Features

#304 - Add support for PHP8.1 new in initializers PHP8.1 introduced new in initializers Phake 4.2 can now create mock of object using this feature.

#303 - Add support for PHP8.1 intersection types and never return type PHP8.1 introduced intersection types and never return type. Phake 4.2 supports those new types. When a mocked method returning never is called, Phake will by default throw a Phake\Exception\NeverReturnMethodCalledException exception. Calling Phake::when($mock)->thenReturn($x) will have no effect on this method result.

Changes

#301 - Add #[\ReturnTypeWillChange] on mocked internal methods on PHP8.1+ All internal mocked method under PHP8.1+ will have #[\ReturnTypeWillChange] attribute to avoid any Deprecation warnings.

v3.1.9

2 years ago
  • Fix #299 Interfaces with a method called "list" cannot be mocked

v4.1.0

3 years ago

Add support for PHP8.0 named parameters
PHP8.0 introduced Named arguments

$mock = Phake::mock('PhakeTest_MockedClass');
Phake::when($mock)->fooWithLotsOfParameters(parm3: 3, parm2: 2, parm1: 1)->thenReturn(42);

$this->assertSame(42, $mock->fooWithLotsOfParameters(1, 2, 3));

Phake::verify($mock)->fooWithLotsOfParameters(parm3: 3, parm2: 2, parm1: 1);

v4.0.0

3 years ago
  • Add support for PHP8 union types
  • Add support for PHP8 annotations (attributes) #[Phake\Mock]
  • Change code to use PSR4 standard instead of PSR0
  • Allow Throwable in thenThrow() and not juste Exception

v3.1.8

3 years ago

This release adds phpunit 9 support.

v3.1.7

4 years ago

Fixes #279

v3.1.6

4 years ago

Fixes #275