diff --git a/tests/acceptance/EloquentBuilderTypes.feature b/tests/acceptance/EloquentBuilderTypes.feature index f899200..e9e3ad7 100644 --- a/tests/acceptance/EloquentBuilderTypes.feature +++ b/tests/acceptance/EloquentBuilderTypes.feature @@ -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 |