Skip to content

Commit

Permalink
Merge pull request #11 from edersoares/env-not-informed
Browse files Browse the repository at this point in the history
Environment variables not informed
  • Loading branch information
edersoares authored Jun 14, 2023
2 parents 6cde997 + cc8ec98 commit 5b77fc7
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
6 changes: 3 additions & 3 deletions config/frontier.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@
'middleware' => [],

'replaces' => array_combine(
explode(',', env('FRONTIER_FIND')),
explode(',', env('FRONTIER_REPLACE_WITH')),
array_filter(explode(',', env('FRONTIER_FIND'))),
array_filter(explode(',', env('FRONTIER_REPLACE_WITH'))),
),

'proxy' => explode(',', env('FRONTIER_PROXY')),
'proxy' => array_filter(explode(',', env('FRONTIER_PROXY'))),

'cache' => env('FRONTIER_CACHE', true),

Expand Down
3 changes: 3 additions & 0 deletions tests/Pest.php
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
<?php

uses(Dex\Laravel\Frontier\Tests\TestCase::class)
->in('Unit');
19 changes: 19 additions & 0 deletions tests/Unit/DefaultConfigurationTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

test('when `FRONTIER_PROXY` is not informed `proxy` key should be empty', function () {
$config = config('frontier.frontier.proxy');

expect($config)->toBeEmpty();
});

test('when `FRONTIER_FIND` is not informed `replaces` key should be empty', function () {
$config = config('frontier.frontier.replaces');

expect($config)->toBeEmpty();
});

test('when `FRONTIER_REPLACE_WITH` is not informed `replaces` key should be empty', function () {
$config = config('frontier.frontier.replaces');

expect($config)->toBeEmpty();
});

0 comments on commit 5b77fc7

Please sign in to comment.