public function testRenameDirSuccess() { $state = smbclient_state_new(); smbclient_state_init($state, null, SMB_USER, SMB_PASS); // Create mock dir "foo" via regular filesystem: mkdir(SMB_LOCAL . '/foo'); $this->assertTrue(smbclient_rename($state, 'smb://' . SMB_HOST . '/' . SMB_SHARE . '/foo', $state, 'smb://' . SMB_HOST . '/' . SMB_SHARE . '/bar')); $moved = is_dir(SMB_LOCAL . '/bar'); $this->assertTrue($moved); $gone = is_dir(SMB_LOCAL . '/foo'); $this->assertFalse($gone); @rmdir(SMB_LOCAL . '/foo'); @rmdir(SMB_LOCAL . '/bar'); }
/** * @param string $old * @param string $new * @return bool */ public function rename($old, $new) { $result = @smbclient_rename($this->state, $old, $this->state, $new); $this->testResult($result, $new); return $result; }