Commit Graph

77 Commits

Author SHA1 Message Date
Robin Appelman 169031d1c5 fix factory test 2015-03-11 15:07:59 +01:00
Robin Appelman 82a62fd249 Add test for storage factory 2015-03-11 15:06:12 +01:00
Vincent Petry 20738d287e Properly detect streamCopy errors
Now checking whether the written bytes match the number of read bytes.
2015-02-25 16:03:15 +01:00
Andreas Fischer 48d6724a6f HHVM sets stream meta datum wrapper_type to 'File' instead of 'user-space'. 2014-12-19 00:58:37 +01:00
Robin Appelman 33b64868d7 Add storage and cache wrappers to apply a permissions mask to a storage 2014-11-27 15:25:57 +01:00
Robin Appelman abb6e89c5d Add storage and cache wrappers to jail a storage to a subfolder 2014-11-27 15:25:53 +01:00
Joas Schilling 76ebd3a050 Make apps/ extend the \Test\TestCase and fix overwritten methods 2014-11-19 14:52:09 +01:00
Joas Schilling bb540722cd Use base class to reset the file mapper 2014-11-19 14:52:07 +01:00
Morris Jobke 146cb920c9 Merge pull request #12218 from owncloud/issue/10991-fixes
Issue/10991 Make unit tests pass on windows
2014-11-17 16:44:45 +01:00
Joas Schilling 53318c4bb5 Fix Files\Storage\Home::testRoot() 2014-11-17 10:48:16 +01:00
Joas Schilling a3a064fe96 Skip some more tests on Windows which just can not work at all 2014-11-17 10:48:06 +01:00
Adam Williamson e0ae87051f storage test: use new file for testTouchCreateFile()
this test would never succeed, because the previous test -
testFOpen() - creates the file 'foo', but testTouchCreateFile()
starts out by asserting it doesn't exist. Change the test to
use a file called 'touch' instead (which does not previously
exist).
2014-11-10 17:49:35 -08:00
Thomas Müller d0ce600eec On Windows platform we have no stable etag generation - yet 2014-10-27 20:48:47 +01:00
Robin Appelman 283c10f010 Generate stable etags for local files 2014-10-24 16:47:58 +02:00
Jörn Friedrich Dreyer 27bb968ffa make some storage tests explain what went wrong 2014-10-08 18:49:52 +02:00
Jörn Friedrich Dreyer 76c1095c25 add unit test for #8325 2014-08-14 17:18:46 +02:00
Robin Appelman a8532aa2f0 Add test for homestorage getOwner 2014-07-22 16:30:25 +02:00
Robin Appelman 8c5521fdfc Add $storage->instanceOfStorage to handle instanceof for storage wrappers 2014-05-29 13:45:50 +02:00
Robin Appelman 03ba497a8c add recursive copy to local storage backend 2014-05-28 18:16:23 +02:00
Robin Appelman 38c1da0976 fix recursive rename for local storage backend 2014-05-28 18:16:23 +02:00
Robin Appelman c99e254178 aditional test cases for copy and rename 2014-05-28 18:16:23 +02:00
Thomas Müller a2efdb8722 Merge pull request #7970 from owncloud/webdav-upload-hash
Fix uploading files containing a # in the path for webdav
2014-04-03 16:09:44 +02:00
Vincent Petry d6ce45fe61 Correctly read the full stream in file_get_contents
When using user-defined stream wrappers, PHP will
return a maximum of 8192 bytes even if more was
requested.

This fix uses stream_get_contents to make sure the full stream is read
and not only the first 8 KB.

Added unit test with a bigger test file to cover this case.
2014-04-01 10:07:16 +02:00
Robin Appelman 76c63a5760 Fix uploading files containing a # in the path for webdav 2014-03-31 17:00:32 +02:00
Thomas Müller 70db348475 Merge pull request #7824 from owncloud/hash-parameter-order
Fix parameter order for Storage\Local::hash
2014-03-28 13:06:07 +01:00
Robin Appelman fffe330bbc Fix parameter order for Storage\Local::hash 2014-03-20 15:32:12 +01:00
Vincent Petry 66bc0f0848 Still return quota value when free space is unknown
Fixed the quota storage wrapper to correctly return the quota value when
the free space is not known (which usually happens when the disk_free_space
function is disabled)
2014-03-19 19:07:11 +01:00
Vincent Petry 48d63a6278 Return unencrypted_size of folder when queried
This fixes the "used space" to be based on the unencrypted size, not
encrypted size, to be consistent with how quota/space is handled when
encryption is enabled
2014-03-07 14:59:09 +01:00
Thomas Müller ec45a3c0e2 Merge pull request #6962 from owncloud/quota-space-root
Allow passing a root folder to get the used space from in the quota wrapper
2014-02-20 16:47:59 +01:00
Vincent Petry b2b35cd335 Fixed ext storage webdav path encoding
- Some WebDAV servers like lighttpd need paths in URLs to be properly
encoded
- Added error log output when curl connection failed
- Added check for 'resourcetype' in case the WebDAV server doesn't
  support/return it
- Fixed touch() to return false if the server doesn't implement
  PROPPATCH
- Added optional delay in WebDAV unit tests to use when testing against
  lighttpd's WebDAV
2014-02-19 18:34:08 +01:00
Scrutinizer Auto-Fixer adaee6a5a1 Scrutinizer Auto-Fixes
This patch was automatically generated as part of the following inspection:
https://scrutinizer-ci.com/g/owncloud/core/inspections/cdfecc4e-a37e-4233-8025-f0d7252a8720

Enabled analysis tools:
 - PHP Analyzer
 - JSHint
 - PHP Copy/Paste Detector
 - PHP PDepend
2014-02-19 09:31:54 +01:00
Robin Appelman 3afdcd85e7 Add unit test for quote wrapper size root 2014-02-04 16:05:12 +01:00
Vincent Petry 1af7dab535 Fixed quota wrapper to not wrap failed fopen streams
When calling fopen() on some storage types, these return false instead
of throwing an exception.

This fix makes sure that in case the stream wasn't opened (for example
when a file doesn't exist any more) the stream isn't wrapped.

Also added 'rb' as another case that doesn't need to be wrapped.

Fixes #6832
2014-01-19 18:51:36 +01:00
Vincent Petry 6cf9844e9c Added unit test for the test() method
This is to make sure that method isn't broken
2013-12-03 14:35:53 +01:00
Vincent Petry d69243ee51 Fixed FTP and SMB to use rmdir() when deleting folders
Some storages need to use different calls for deleting files or folders,
usually unlink() and rmdir().

Fixes #4532 (SMB dir deletion)
Fixes #5941 (FTP dir deletion)

Note that the extra is_dir() should be fast because it's read from the
stat cache.
2013-11-29 13:01:01 +01:00
Vincent Petry 2653d914d9 Merge pull request #6008 from owncloud/extstorage-smb-webdav-renamefix
Fixed SMB rename function to overwrite target file
2013-11-26 06:42:36 -08:00
Vincent Petry 712b47757a Updated unit tests for SMB
- coverage for touch return value
- fixed directory provider to exclude unsupported cases
2013-11-26 12:53:03 +01:00
Vincent Petry c3e34676ba Improved unit test for "overwrite on move"
Now using a different content to make sure the file was overwritten.
2013-11-25 18:54:58 +01:00
Vincent Petry af7118aa5d Added unit test for "overwrite file on rename/move"
Also fixed "rename" unit test that was ready the result out of the wrong
file.
2013-11-25 18:52:14 +01:00
Vincent Petry 5b6d1d79d0 Fixed SMB file deletion success detection
Since unlink() smb4php doesn't return true on deletion success, we need
to check whether the file was deleted to confirm success.

Fixes #5866
2013-11-19 15:05:11 +01:00
Vincent Petry 34c92f6656 Now using HomeStorage for legacy home storage ids
Legacy home storage ids with the format "local://path/to/datadir/user1"
are now also wrapped by the HomeStorage.
2013-11-12 18:01:02 +01:00
Thomas Müller d25c8b43e6 Merge pull request #5652 from owncloud/front-port-5647-master
[WIP] extend unit test to directories starting or ending in whitespace
2013-11-01 23:11:33 -07:00
Jörn Friedrich Dreyer 10b2d649af extend unit test to directories starting or ending in whitespace 2013-10-31 14:24:43 +01:00
Robin Appelman f1e6e80eb1 add specialized storage backend for home folders 2013-10-29 00:14:23 +01:00
Vincent Petry c8df27de73 Fixed quota stream to not wrap read-only fopen calls 2013-10-25 12:33:16 +02:00
Robin Appelman d8c71ba734 merge master in storage-wrapper-quota 2013-08-18 11:34:56 +02:00
Robin Appelman cd8f0c21ce add quota storage wrapper 2013-07-25 00:31:51 +02:00
Robin Appelman a853968f7d move storage wrapper test to new namespace 2013-07-25 00:31:51 +02:00
Thomas Müller c517c845f6 Merge branch 'master' into storage-test-cleanup
Conflicts:
	tests/lib/files/storage/storage.php
2013-07-24 01:01:36 +02:00
Robin Appelman cfac7fcd53 Storage: remove some unneeded strict tests of mtime behaviour 2013-07-16 23:07:35 +02:00