Releases: phake/phake
v4.5.0
What's Changed
- Provide a better type-hint for mock and partial mock objects by @niconoe- in #313
- Add Phake\Mock attribute class by @pierredup in #318
- Make Phake compatible with PHPUnit 11 from Phake v4.4. by @niconoe- in #322
Full Changelog: v4.4.0...v4.5.0
v4.4.0
v4.3.0
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
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
v4.1.0
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
PhpUnit 9 support
This release adds phpunit 9 support.
Deprecation fix
Fixes #279