mirror of
https://github.com/danog/psalm-plugin-laravel.git
synced 2024-11-30 04:39:01 +01:00
Add Psalm 4 and Psalm 5 tests
This commit is contained in:
parent
414b0e7156
commit
325af8daa9
@ -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 |
|
||||
|
Loading…
Reference in New Issue
Block a user