Commit graph

139 commits

Author SHA1 Message Date
Thomas Müller
268d346b36 fixing unit tests 2015-04-07 13:30:31 +02:00
Thomas Müller
fce42a3161 fixing unit test execution - test dummy module was behaving wrong 2015-04-07 13:30:31 +02:00
Thomas Müller
870c53ee37 fixing unit test execution 2015-04-07 13:30:31 +02:00
Thomas Müller
104d11ec4c Fixing encryption storage wrapper tests 2015-04-07 13:30:30 +02:00
Thomas Müller
e0ab2c34ea update unit tests after ctor signature change of \OC\Encryption\Util 2015-04-07 13:30:28 +02:00
Bjoern Schiessle
0eee3a2618 remove unencrypted_size from the cache, size will contain the unencrypted size 2015-04-07 13:30:28 +02:00
Thomas Müller
a905f641b3 various fixes & start to unit test the encryption storage wrapper 2015-04-07 13:30:28 +02:00
Vincent Petry
5c9998179f Properly quote file names in listFiles query for GDrive 2015-03-31 15:14:03 +02:00
Lukas Reschke
53f67fc65d Revert "Properly quote file names in listFiles query for GDrive" 2015-03-31 15:12:35 +02:00
Frank Karlitschek
b216b3fad0 Merge pull request #15215 from owncloud/ext-gdrivelistfilequoting
Properly quote file names in listFiles query for GDrive
2015-03-31 09:08:59 -04:00
Robin Appelman
cb9ead7dde add priority to storage wrappers 2015-03-26 21:26:38 +01:00
Vincent Petry
43588fe2f7 Properly quote file names in listFiles query for GDrive 2015-03-26 12:15:02 +01:00
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
Robin Appelman
97f0bc1c4a Storage: remove tests for search 2013-07-16 23:05:23 +02:00
Christian Berendt
8c9e6db1b1 increasing allowed time difference 2013-07-08 15:03:55 +02:00
Christian Berendt
92e7392852 revoking additional tests 2013-07-04 09:01:36 +02:00
Christian Berendt
37254744b5 remove tests from the wrong test method 2013-07-03 18:41:14 +02:00
Christian Berendt
818e2a364a test moving and copying of subdirectories 2013-07-03 18:38:34 +02:00
Christian Berendt
407753f594 move new tests into the correct test method 2013-07-03 18:34:33 +02:00
Christian Berendt
0a5e18335e test working with files in subdirectories 2013-07-03 18:23:09 +02:00
Christian Berendt
e556b7ab55 test working with subdirectories 2013-07-03 18:16:50 +02:00
Christian Berendt
81acfc9498 test copying and moving files in subdirectories 2013-07-03 18:11:54 +02:00
Christian Berendt
21601fd784 increasing difference for modifcation time tests
one second is sometimes not enough when using a slow storage connection,
three seconds is working better (at least when testing against S3)
2013-07-03 18:08:19 +02:00
Thomas Müller
8beec2015a Merge pull request #3763 from owncloud/recursive-rmdir
Make rmdir recursive for local storage
2013-06-30 09:16:32 -07:00
Robin Appelman
a7c70915d5 fix storage wrapper namespaces 2013-06-28 18:18:12 +02:00
Robin Appelman
63c898c064 Make rmdir recursive for local storage 2013-06-17 17:34:09 +02:00
Robin Appelman
ba9db19640 Add wrapper storage backend 2013-05-08 16:53:05 +02:00
Robin Appelman
258ad38fd3 Fix touch for creating new files 2013-04-10 13:48:24 +02:00
Thomas Mueller
a05820c659 fixing various filesystem/storage unit tests on windows
fixing copy operation on mapper
2013-03-12 15:30:10 +01:00
Thomas Mueller
191da024fa new test cases added to search in sub folders 2013-02-15 17:40:52 +01:00
Thomas Mueller
c0f3d8578a folder should be created :-( 2013-02-15 17:40:07 +01:00
Thomas Mueller
e3ba0c3082 adding a new test class for mapped local using a dot in the datadir - reflects the issue described in #1659 2013-02-15 14:46:09 +01:00
Thomas Müller
8174e5faf1 make MappedLocal available and testable within Linux as well 2013-02-09 19:03:03 +01:00
Thomas Mueller
fd8cb9974b initial version of a local storage implementation which will use unique slugified filename on the local filesystem.
This implementation will only be enabled on windows based system to solve the issues around UTF-8 file names with php on windows.
2013-02-06 23:41:52 +01:00
Thomas Mueller
997259df4b reuse \OC_Helper::tmpFolder() 2013-02-04 14:11:51 +01:00
Robin Appelman
930b9b9cd0 merge master into filesystem 2013-01-26 18:49:45 +01:00
Robin Appelman
5445b94416 merge master into filesystem 2013-01-16 19:04:50 +01:00
Robin Appelman
fb2d2bc201 merge master into filesystem 2012-10-11 22:54:39 +02:00
Robin Appelman
e7899e17de merge phpunit into filesystem 2012-10-08 13:53:53 +02:00
Robin Appelman
96b798a59f move storage backend test cases to their own namespace 2012-09-22 14:51:15 +02:00