-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[*] changed NginxToolkit env keys format and names (simplified) [!] changed setOption function
- Loading branch information
wombat
committed
Sep 25, 2019
1 parent
083a1fc
commit a8fc731
Showing
3 changed files
with
79 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<?php | ||
|
||
require_once __DIR__ . DIRECTORY_SEPARATOR . '../vendor/autoload.php'; | ||
|
||
use function Arris\setOption; | ||
use function Arris\setOption as test; | ||
|
||
$options = [ | ||
'key1' => 'key1 is 1', | ||
'key2' => 'key2 is 4' | ||
]; | ||
|
||
putenv("FOO=BAR"); | ||
|
||
// 'key1 is 1' | ||
echo __LINE__, ' : '; var_dump( test($options, 'key1', 'FOO', __LINE__) ); | ||
|
||
// BAR | ||
echo __LINE__, ' : '; var_dump( test($options, 'key3', 'FOO', __LINE__) ); | ||
|
||
// 22 | ||
echo __LINE__, ' : '; var_dump( test($options, 'key3', null, __LINE__) ); | ||
|
||
// false (because getenv return false) | ||
echo __LINE__, ' : '; var_dump( test($options, 'key3', 'XXX', __LINE__) ); | ||
|
||
// BAR | ||
echo __LINE__, ' : '; var_dump( test([], 'key3', 'FOO', __LINE__) ); | ||
|
||
// false | ||
echo __LINE__, ' : '; var_dump( test([], 'key3', 'XXX', __LINE__) ); | ||
|
||
// 34 | ||
echo __LINE__, ' : '; var_dump( test([], 'key3', null, __LINE__) ); | ||
|
||
// BAR | ||
echo __LINE__, ' : '; var_dump( test($options, null, 'FOO', __LINE__) ); | ||
|
||
// false | ||
echo __LINE__, ' : '; var_dump( test($options, null, 'XXX', __LINE__) ); | ||
|
||
// 43 | ||
echo __LINE__, ' : '; var_dump( test($options, null, null, __LINE__) ); | ||
|
||
// BAR | ||
echo __LINE__, ' : '; var_dump( test([], null, 'FOO', __LINE__) ); | ||
|
||
// false | ||
echo __LINE__, ' : '; var_dump( test([], null, 'XXX', __LINE__) ); | ||
|
||
// 52 | ||
echo __LINE__, ' : '; var_dump( test([], null, null, __LINE__) ); | ||
|