From 9637e25bf7b521f408345fc7ae61ed53cb1e46bf Mon Sep 17 00:00:00 2001 From: terrafrost Date: Fri, 18 Dec 2020 21:34:21 -0600 Subject: [PATCH] add unit test for resuming uploads --- tests/Functional/Net/SFTPUserStoryTest.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/Functional/Net/SFTPUserStoryTest.php b/tests/Functional/Net/SFTPUserStoryTest.php index 619e9a96..4485cef7 100644 --- a/tests/Functional/Net/SFTPUserStoryTest.php +++ b/tests/Functional/Net/SFTPUserStoryTest.php @@ -167,6 +167,23 @@ class Functional_Net_SFTPUserStoryTest extends PhpseclibFunctionalTestCase 'Failed asserting that get() returns expected example data.' ); + $this->assertTrue( + $sftp->put('file1.txt', 'xxx', SFTP::RESUME), + 'Failed asserting that an upload could be successfully resumed' + ); + + $this->assertSame( + self::$exampleDataLength + 3, + $sftp->filesize('file1.txt'), + 'Failed asserting that put example data has the expected length' + ); + + $this->assertSame( + self::$exampleData . 'zzz', + $sftp->get('file1.txt'), + 'Failed asserting that get() returns expected example data.' + ); + return $sftp; }