public function it_should_ignore_rename_fails() { $old = 'old.txt'; $new = 'new.txt'; $this->adapter->rename($old, $new)->willReturn(false); $this->rename($old, $new)->shouldBe(false); }
/** * {@inheritdoc} */ public function rename($path, $newpath) { if (!$this->source->rename($path, $newpath)) { return false; } return $this->replica->rename($path, $newpath); }
/** * Rename a file. * * @param string $path path to file * @param string $newpath new path * * @throws FileExistsException * @throws FileNotFoundException * * @return bool success boolean */ public function rename($path, $newpath) { $path = Util::normalizePath($path); $newpath = Util::normalizePath($newpath); $this->assertPresent($path); $this->assertAbsent($newpath); return (bool) $this->adapter->rename($path, $newpath); }
/** * {@inheritdoc} */ public function rename($path, $newPath) { $result = $this->adapter->rename($path, $newPath); if ($result !== false) { $this->cache->rename($path, $newPath); } return $result; }
/** * {@inheritDoc} */ public function rename($path, $newpath) { $success = $this->adapter->rename($path, $newpath); if ($success) { $this->cache->delete($this->getCacheKey($path)); } return $success; }
/** * {@inheritdoc} */ public function rename($path, $newpath) { if ($this->mainAdapter->has($path)) { return $this->mainAdapter->rename($path, $newpath); } if (false !== $this->portFromFallback($path, $newpath)) { return $this->fallback->delete($path); } return false; }
/** * Rename a file. * * @param string $path path to file * @param string $newpath new path * * @throws FileExistsException * @throws FileNotFoundException * * @return bool success boolean */ public function rename($path, $newpath) { $path = Util::normalizePath($path); $newpath = Util::normalizePath($newpath); $this->assertPresent($path); $this->assertAbsent($newpath); if ($this->adapter->rename($path, $newpath) === false) { return false; } $this->cache->rename($path, $newpath); return true; }
/** * {@inheritDoc} */ public function rename($pathOrUuid, $newpath) { $path = $this->convertToPath($pathOrUuid); $this->guardNoInvalidUuid($pathOrUuid, $path); $this->guardInUploadPath($path); $this->guardInUploadPath($newpath); if ($this->adapter->rename($path, $newpath)) { \Dbafs::moveResource($path, $newpath); return true; } return false; }
/** * {@inheritdoc} */ public function rename($path, $newpath) { return $this->adapter->rename($this->getPath($path), $this->getPath($newpath)); }
function it_renames_file(AdapterInterface $adapter) { $adapter->rename('oldfilename', 'newfilename')->willReturn(true); $this->rename('oldfilename', 'newfilename')->shouldReturn(true); }
/** * {@inheritdoc} */ public function move(string $from, string $to) : bool { return $this->driver->rename($from, $to); }
/** * {@inheritdoc} */ public function rename($sourceKey, $targetKey) { return $this->adapter->rename($sourceKey, $targetKey); }
/** * @inheritdoc */ public function rename($path, $newpath) { return $this->adapter->rename($path, $newpath); }