mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-12-27 03:42:40 +00:00
Merge pull request #413 from bantu/stat-cache-fix
Put some assertions into testStatcacheFix(). * bantu/stat-cache-fix: Put some assertions into testStatcacheFix().
This commit is contained in:
commit
884c090bf2
@ -348,11 +348,20 @@ class Functional_Net_SFTPUserStoryTest extends PhpseclibFunctionalTestCase
|
|||||||
*/
|
*/
|
||||||
public function testStatcacheFix($sftp)
|
public function testStatcacheFix($sftp)
|
||||||
{
|
{
|
||||||
$sftp->mkdir('testdir');
|
// Name used for both directory and file.
|
||||||
$sftp->chdir('testdir');
|
$name = 'stattestdir';
|
||||||
$sftp->touch('testdir');
|
$this->assertTrue($sftp->mkdir($name));
|
||||||
$sftp->chdir('..');
|
$this->assertTrue($sftp->is_dir($name));
|
||||||
$sftp->delete('testdir', true);
|
$this->assertTrue($sftp->chdir($name));
|
||||||
|
$this->assertStringEndsWith(self::$scratchDir . '/' . $name, $sftp->pwd());
|
||||||
|
$this->assertFalse($sftp->file_exists($name));
|
||||||
|
$this->assertTrue($sftp->touch($name));
|
||||||
|
$this->assertTrue($sftp->is_file($name));
|
||||||
|
$this->assertTrue($sftp->chdir('..'));
|
||||||
|
$this->assertStringEndsWith(self::$scratchDir, $sftp->pwd());
|
||||||
|
$this->assertTrue($sftp->is_dir($name));
|
||||||
|
$this->assertTrue($sftp->is_file("$name/$name"));
|
||||||
|
$this->assertTrue($sftp->delete($name, true));
|
||||||
|
|
||||||
return $sftp;
|
return $sftp;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user