You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
->toThrow(TypeError::class, "TypePHP\\Tests\\Fixtures\\Types\\MagicMethodFixture::processId(): Argument \$id must be of type positive-int, negative int (-5) given")
30
+
;
31
+
32
+
expect(fn () => $fixture->processId(42, ''))
33
+
->toThrow(TypeError::class, "TypePHP\\Tests\\Fixtures\\Types\\MagicMethodFixture::processId(): Argument \$name must be of type non-empty-string, empty string ('') given")
34
+
;
35
+
});
36
+
37
+
test('validates variadic arguments passed into dynamic static method', function () {
->toThrow(TypeError::class, "TypePHP\\Tests\\Fixtures\\Types\\MagicMethodFixture::fetchList(): Argument \$items[2] must be of type int, string 'hello' given")
42
+
;
43
+
});
44
+
});
45
+
46
+
describe('Array Shapes & Lists in @method', function () {
47
+
test('validates list arguments and array shape returns on dynamic method', function () {
->toThrow(TypeError::class, "TypePHP\\Tests\\Fixtures\\Types\\MagicMethodFixture::buildPayload(): Argument \$status must be of type ('active' | 'pending')")
59
+
;
60
+
});
61
+
});
62
+
63
+
describe('Generics in @method', function () {
64
+
test('validates generic object instances passed to dynamic method', function () {
->toThrow(TypeError::class, "TypePHP\\Tests\\Fixtures\\Types\\MagicMethodFixture::checkCollection(): Argument \$collection must be of type ((Countable & ArrayAccess) | null)")
86
+
;
87
+
});
88
+
});
89
+
90
+
describe('Type Aliases (@phpstan-type) in @method', function () {
91
+
test('resolves local class-level type aliases inside @method definitions', function () {
->toThrow(TypeError::class, "TypePHP\\Tests\\Fixtures\\Types\\MagicMethodFixture::saveUser(): Argument \$user['role'] must be of type ('admin' | 'user')")
100
+
;
101
+
});
102
+
});
103
+
104
+
describe('Configuration Control', function () {
105
+
test('ignores magic method validation when magic_methods config is false', function () {
0 commit comments