1
0
mirror of https://github.com/danog/phpseclib.git synced 2024-12-02 17:52:59 +01:00
phpseclib/tests/Functional/Net/SSH2AgentTest.php

34 lines
854 B
PHP
Raw Normal View History

<?php
/**
* @author Andreas Fischer <bantu@phpbb.com>
* @copyright 2014 Andreas Fischer
* @license http://www.opensource.org/licenses/mit-license.html MIT License
*/
2014-12-12 19:20:33 +01:00
use phpseclib\Net\SSH2;
2014-12-15 18:25:46 +01:00
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()
{
2014-12-12 19:20:33 +01:00
$ssh = new SSH2($this->getEnv('SSH_HOSTNAME'));
$agent = new System_SSH_Agent;
$this->assertTrue(
$ssh->login($this->getEnv('SSH_USERNAME'), $agent),
'SSH2 login using Agent failed.'
);
}
}