Add Psalm 4 and Psalm 5 tests

This commit is contained in:
Daniil Gentili 2022-12-01 18:37:23 +01:00
parent 414b0e7156
commit 325af8daa9

View File

@ -253,7 +253,7 @@ Feature: Eloquent Builder types
When I run Psalm
Then I see no errors
Scenario: can not call whereDate with incompatible type
Scenario: can not call whereDate with incompatible type [ Psalm 4 ]
Given I have the following code
"""
/**
@ -264,6 +264,24 @@ Feature: Eloquent Builder types
return $builder->whereDate('created_at', '>', 1);
}
"""
And I have Psalm older than "4.99.0" (because of "changed issue message")
When I run Psalm
Then I see these errors
| Type | Message |
| InvalidScalarArgument | Argument 3 of Illuminate\Database\Eloquent\Builder::whereDate expects DateTimeInterface\|null\|string, 1 provided |
Scenario: can not call whereDate with incompatible type [ Psalm 5 ]
Given I have the following code
"""
/**
* @psalm-param Builder $builder
* @psalm-return Builder
*/
function test_whereDateWithInt(Builder $builder): Builder {
return $builder->whereDate('created_at', '>', 1);
}
"""
And I have Psalm newer than "4.99.0" (because of "changed issue message")
When I run Psalm
Then I see these errors
| Type | Message |