diff --git a/tests/Net/SFTPFunctionalTest.php b/tests/Net/SFTPFunctionalTest.php index 4f524be8..9d8d0731 100644 --- a/tests/Net/SFTPFunctionalTest.php +++ b/tests/Net/SFTPFunctionalTest.php @@ -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 */