/** * Tests uploading a file. * * @depends testMkdir */ public function testPutFile() { if (empty($GLOBALS['tmp'])) { $this->markTestSkipped('Temp dir not set'); } // Create a temporary file $file = $GLOBALS['tmp'] . '/testfile.txt'; file_put_contents($file, 'test'); // Uploading $this->assertTrue($this->client->putFile($this->dir . '/testfile.txt', $file)); $this->assertTrue($this->client->exists($this->dir . '/testfile.txt')); // Delete the temporary file @unlink($file); }