File tree Expand file tree Collapse file tree 1 file changed +22
-2
lines changed Expand file tree Collapse file tree 1 file changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -24,8 +24,9 @@ Feature: factory()
24
24
use Tests\Psalm\LaravelPlugin\Models\User;
25
25
"""
26
26
27
- Scenario :
28
- Given I have the following code
27
+ Scenario : can use factory helper in Laravel 6.x and 7.x
28
+ Given I have the "laravel/framework" package satisfying the "6.* || 7.*"
29
+ And I have the following code
29
30
"""
30
31
class FactoryTest {
31
32
/**
@@ -73,3 +74,22 @@ Feature: factory()
73
74
"""
74
75
When I run Psalm
75
76
Then I see no errors
77
+
78
+ Scenario : cannot use factory helper in Laravel 8.x and later
79
+ Given I have the "laravel/framework" package satisfying the ">= 8.0"
80
+ And I have the following code
81
+ """
82
+ class FactoryTest {
83
+ /**
84
+ * @return FactoryBuilder<User, 1>
85
+ */
86
+ public function getFactory(): FactoryBuilder
87
+ {
88
+ return factory(User::class);
89
+ }
90
+ }
91
+ """
92
+ When I run Psalm
93
+ Then I see these errors
94
+ | Type | Message |
95
+ | UndefinedFunction | Function factory does not exist |
You can’t perform that action at this time.
0 commit comments