mirror of
https://github.com/php/pecl-networking-ssh2.git
synced 2026-03-23 22:52:06 +01:00
Since these all need a test ssh server to connect to,
you'll need to set some environment variables.
TEST_SSH2_HOSTNAME - Where to connect to
TEST_SSH2_PORT - Port (default: 22)
TEST_SSH2_USER - Login as (default: getenv('USER'))
TEST_SSH2_AUTH - Mode of authentication ('none', 'password', 'agent')
TEST_SSH2_PASS - Password to authenticate with
TEST_SSH2_TEMPDIR - Where to store temporary files on the remote filesystem
(default: /tmp )
18 lines
407 B
PHP
18 lines
407 B
PHP
<?php
|
|
require('ssh2_test.inc');
|
|
|
|
if (!extension_loaded("ssh2")) print "skip extension not loaded";
|
|
if (TEST_SSH2_HOSTNAME === false) print "skip TEST_SSH2_HOSTNAME not set";
|
|
|
|
function ssh2t_needs_auth() {
|
|
if (TEST_SSH2_AUTH == 'none') {
|
|
print "skip TEST_SSH2_AUTH == 'none'";
|
|
}
|
|
}
|
|
|
|
function ssh2t_writes_remote() {
|
|
if (!TEST_SSH2_TEMPDIR) {
|
|
print "skip TEST_SSH2_TEMPDIR is empty";
|
|
}
|
|
}
|