psalm-plugin-laravel/tests/acceptance/EloquentModelTypes.feature
2021-07-04 13:51:08 -04:00

39 lines
943 B
Gherkin

Feature: Eloquent Relation Types
Illuminate\Database\Eloquent\Relations have type support
Background:
Given I have the following config
"""
<?xml version="1.0"?>
<psalm totallyTyped="true">
<projectFiles>
<directory name="."/>
<ignoreFiles> <directory name="../../vendor"/> </ignoreFiles>
</projectFiles>
<plugins>
<pluginClass class="Psalm\LaravelPlugin\Plugin"/>
</plugins>
</psalm>
"""
And I have the following code preamble
"""
<?php declare(strict_types=1);
namespace Tests\Psalm\LaravelPlugin\Sandbox;
use Tests\Psalm\LaravelPlugin\Models\User;
"""
Scenario: Model scope support
Given I have the following code
"""
function test(): \Illuminate\Database\Eloquent\Collection
{
return User::active()->get();
}
"""
When I run Psalm
Then I see no errors