mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-12-26 03:27:31 +00:00
34 lines
855 B
PHP
34 lines
855 B
PHP
<?php
|
|
|
|
/**
|
|
* @author Andreas Fischer <bantu@phpbb.com>
|
|
* @copyright 2014 Andreas Fischer
|
|
* @license http://www.opensource.org/licenses/mit-license.html MIT License
|
|
*/
|
|
|
|
use phpseclib\System\SSH\Agent;
|
|
|
|
class Functional_Net_SSH2AgentTest extends PhpseclibFunctionalTestCase
|
|
{
|
|
public static function setUpBeforeClass()
|
|
{
|
|
if (!isset($_SERVER['SSH_AUTH_SOCK'])) {
|
|
self::markTestSkipped(
|
|
'This test requires an SSH Agent (SSH_AUTH_SOCK env variable).'
|
|
);
|
|
}
|
|
parent::setUpBeforeClass();
|
|
}
|
|
|
|
public function testAgentLogin()
|
|
{
|
|
$ssh = new Net_SSH2($this->getEnv('SSH_HOSTNAME'));
|
|
$agent = new Agent;
|
|
|
|
$this->assertTrue(
|
|
$ssh->login($this->getEnv('SSH_USERNAME'), $agent),
|
|
'SSH2 login using Agent failed.'
|
|
);
|
|
}
|
|
}
|