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:
Andreas Fischer 2014-07-20 22:44:40 +02:00
commit 884c090bf2

View File

@ -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;
} }