Skip to content

Commit 4b98018

Browse files
phpstan-botclaude
authored andcommitted
Update README with missing feature descriptions
Add documentation for features that were implemented but not listed in the README: namedMock() support, alias/overload prefixes, partial mock syntax, multiple interface resolution, constructor args handling, makePartial()/shouldAllowMockingProtectedMethods() return types, shouldNotReceive/shouldHaveReceived/shouldNotHaveReceived methods, and the convertUnionToIntersectionType config parameter. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent c7e87f0 commit 4b98018

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,14 @@
99

1010
This extension provides the following features:
1111

12-
* Interprets `Foo|\Mockery\MockInterface` in phpDoc so that it results in an intersection type instead of a union type.
13-
* `Mockery::mock()` and `Mockery::spy()` return an intersection type (see the [detailed explanation of intersection types](https://phpstan.org/blog/union-types-vs-intersection-types)) so that the returned object can be used as both the mock object and the mocked class object.
14-
* `shouldReceive()`, `allows()` and `expects()` methods can be called on the mock object and they work as expected.
12+
* `Mockery::mock()`, `Mockery::spy()`, and `Mockery::namedMock()` return an intersection type (e.g. `Foo&MockInterface`) so that the mock can be used as both the mocked class and a mock object. See the [detailed explanation of intersection types](https://phpstan.org/blog/union-types-vs-intersection-types).
13+
* Interprets `Foo|\Mockery\MockInterface` in phpDoc so that it results in an intersection type instead of a union type. This can be disabled by setting the `mockery.convertUnionToIntersectionType` parameter to `false`.
14+
* `shouldReceive()`, `shouldNotReceive()`, `shouldHaveReceived()`, `shouldNotHaveReceived()`, `allows()`, and `expects()` methods are understood on mock objects.
15+
* `makePartial()` and `shouldAllowMockingProtectedMethods()` return `static`, preserving the intersection type for chained calls.
16+
* Alias (`alias:`) and overload (`overload:`) mock prefixes are handled.
17+
* Partial mock syntax (`ClassName[methodName]`) is supported.
18+
* Multiple interfaces passed as comma-separated strings or as separate arguments are resolved.
19+
* Constructor argument arrays passed to `mock()` are handled correctly.
1520

1621

1722
## Installation

0 commit comments

Comments
 (0)