mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-11-09 15:20:58 +00:00
Merge branch '2.0'
* 2.0: Tests/SFTP: $lstat->$stat Tests/SFTP: just check to see that stat / lstat return an array SFTP: update conditions under which cache for lstat / . is used Tests/SFTP: add test for stat's on .
This commit is contained in:
commit
1119e4ad91
@ -1175,7 +1175,7 @@ class SFTP extends SSH2
|
||||
|
||||
if ($this->use_stat_cache) {
|
||||
$result = $this->_query_stat_cache($filename);
|
||||
if (is_array($result) && isset($result['.'])) {
|
||||
if (is_array($result) && isset($result['.']) && isset($result['.']->lstat)) {
|
||||
return $result['.']->lstat;
|
||||
}
|
||||
if (is_object($result) && isset($result->lstat)) {
|
||||
|
@ -429,8 +429,28 @@ class Functional_Net_SFTPUserStoryTest extends PhpseclibFunctionalTestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* on older versions this would result in a fatal error
|
||||
* @depends testReadlink
|
||||
* @group github716
|
||||
*/
|
||||
public function testStatOnCWD($sftp)
|
||||
{
|
||||
$stat = $sftp->stat('.');
|
||||
$this->assertInternalType(
|
||||
'array', $stat,
|
||||
'Failed asserting that stat on . returns an array'
|
||||
);
|
||||
$lstat = $sftp->lstat('.');
|
||||
$this->assertInternalType(
|
||||
'array', $lstat,
|
||||
'Failed asserting that lstat on . returns an array'
|
||||
);
|
||||
|
||||
return $sftp;
|
||||
}
|
||||
|
||||
/**
|
||||
* on older versions this would result in a fatal error
|
||||
* @depends testStatOnCWD
|
||||
* @group github402
|
||||
*/
|
||||
public function testStatcacheFix($sftp)
|
||||
|
Loading…
Reference in New Issue
Block a user