/** * @dataProvider localDirs */ public function testStore($localDir, $throwsException) { if (!$localDir) { $localDir = self::$tempDir; } $storage = new Omeka_Storage_Adapter_Filesystem(array('localDir' => $localDir)); $testFile = tempnam(self::$tempDir, 'omeka_storage_filesystem_test'); try { $storage->store($testFile, 'foo.txt'); $this->assertTrue(file_exists("{$localDir}/foo.txt")); if ($throwsException) { $this->fail(); } } catch (Omeka_Storage_Exception $e) { if (!$throwsException) { $this->fail($e->getMessage()); } } }
/** * Move a local file to "storage." * * @param string $source Local filesystem path to file. * @param string $dest Destination path. */ public function store($source, $dest) { $this->_mkdir($dest); parent::store($source, $dest); }