Merge pull request #104 from psalm/app-env

test: add test for app env
This commit is contained in:
feek 2020-07-25 20:24:25 -07:00 committed by GitHub
commit 4175b445a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -0,0 +1,29 @@
Feature: helpers
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);
"""
Scenario: env can be pulled off the app
Given I have the following code
"""
if (app()->environment('production')) {
// do something
}
"""
When I run Psalm
Then I see no errors