mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-09-07 14:21:49 +00:00
SFTP: add more unit tests
This commit is contained in:
parent
69e15b3855
commit
6e8e44b120
@ -19,6 +19,7 @@ class Net_SFTPFunctionalTest extends PhpseclibFunctionalTestCase
|
||||
'This test hangs on Travis CI on PHP 5.3.3 and below.'
|
||||
);
|
||||
}
|
||||
|
||||
parent::setUpBeforeClass();
|
||||
|
||||
self::$scratchDir = uniqid('phpseclib-sftp-scratch-');
|
||||
@ -123,6 +124,22 @@ class Net_SFTPFunctionalTest extends PhpseclibFunctionalTestCase
|
||||
return $sftp;
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testChDirScratch
|
||||
*/
|
||||
public function testStatOnDir($sftp)
|
||||
{
|
||||
$stat = $sftp->stat('.');
|
||||
|
||||
$this->assertThat(
|
||||
$stat,
|
||||
$this->logicalNot($this->equalTo(array())),
|
||||
'Failed asserting that the cwd has a non-empty stat'
|
||||
);
|
||||
|
||||
return $sftp;
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testChDirScratch
|
||||
*/
|
||||
@ -148,6 +165,19 @@ class Net_SFTPFunctionalTest extends PhpseclibFunctionalTestCase
|
||||
return $sftp;
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testPutSizeGetFile
|
||||
*/
|
||||
public function testChDirOnFile($sftp)
|
||||
{
|
||||
$this->assertFalse(
|
||||
$sftp->chdir('file1.txt'),
|
||||
'Failed to assert that the cwd cannot be changed to a file'
|
||||
);
|
||||
|
||||
return $sftp;
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testPutSizeGetFile
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user