Skip to content

Releases: phake/phake

v4.5.0

05 Mar 17:46
v4.5.0
0ec89bb
Compare
Choose a tag to compare

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

10 Feb 20:36
v4.4.0
5c89547
Compare
Choose a tag to compare

New Feature

#312 Add support for Comparator 5 / PHPUnit 10

v4.3.0

19 Dec 00:16
bf2c08d
Compare
Choose a tag to compare

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

27 Nov 17:05
5dbe829
Compare
Choose a tag to compare

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

10 May 17:44
ff8664c
Compare
Choose a tag to compare
  • Fix #299 Interfaces with a method called "list" cannot be mocked

v4.1.0

24 Apr 05:09
7a4beae
Compare
Choose a tag to compare

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

30 Mar 01:31
Compare
Choose a tag to compare
  • 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

PhpUnit 9 support

11 May 18:44
9f9dfb1
Compare
Choose a tag to compare

This release adds phpunit 9 support.

Deprecation fix

06 Dec 04:17
3b7a6db
Compare
Choose a tag to compare

Bug fix

06 Jun 22:42
3848901
Compare
Choose a tag to compare

Fixes #275