PHP Mocking Framework
Full Changelog: https://github.com/phake/phake/compare/v4.4.0...v4.5.0
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.
#308 - Unable to use PHP8 named arguments on static method
#307 - Phake\Matchers\IArgumentMatcher doesn't work as expected
#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.
#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.
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);
#[Phake\Mock]
Throwable
in thenThrow()
and not juste Exception
This release adds phpunit 9 support.
Fixes #279
Fixes #275