-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support for resolving private key from callable
- Loading branch information
1 parent
644de19
commit b211d67
Showing
3 changed files
with
37 additions
and
1 deletion.
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,23 @@ | ||
<?php | ||
|
||
use ProtoneMedia\LaravelTaskRunner\Connection; | ||
|
||
function addConnectionToConfig() | ||
{ | ||
config(['task-runner.connections.production' => [ | ||
'host' => '1.1.1.1', | ||
'port' => '21', | ||
'username' => 'root', | ||
'private_key' => fn() => 'secret', | ||
'passphrase' => 'password', | ||
'script_path' => '', | ||
]]); | ||
} | ||
|
||
it('can resolve a private key from a callable', function () { | ||
addConnectionToConfig(); | ||
|
||
$connection = Connection::fromConfig('production'); | ||
|
||
expect($connection->privateKey)->toBe('secret'); | ||
}); |