public static function setUpBeforeClass() { parent::setUpBeforeClass(); self::$scratchDir = uniqid('phpseclib-sftp-scratch-'); self::$exampleData = str_repeat('abcde12345', 1000); self::$exampleDataLength = 10000; }
public static function setUpBeforeClass() { if (getenv('TRAVIS') && version_compare(PHP_VERSION, '5.3.3', '<=')) { self::markTestIncomplete('This test hangs on Travis CI on PHP 5.3.3 and below.'); } parent::setUpBeforeClass(); self::$scratchDir = uniqid('phpseclib-sftp-scratch-'); self::$exampleData = str_repeat('abcde12345', 1000); self::$exampleDataLength = 10000; }
/** * @depends testStatOnDir */ public function testPutSizeGetFileCallback($sftp) { self::$buffer = self::$exampleData; $this->assertTrue($sftp->put('file1.txt', array(__CLASS__, 'callback'), $sftp::SOURCE_CALLBACK), 'Failed asserting that example data could be successfully put().'); $this->assertSame(self::$exampleDataLength, $sftp->size('file1.txt'), 'Failed asserting that put example data has the expected length'); $this->assertSame(self::$exampleData, $sftp->get('file1.txt'), 'Failed asserting that get() returns expected example data.'); return $sftp; }