Robin Appelman
1de0b10751
add test for trying to fopen a file which no longer exists on disk
Signed-off-by: Robin Appelman <robin@icewind.nl>
1 year ago
Carl Schwan
d5c23dbb9f
Move CappedMemoryCache to OCP
This is an helpful helper that should be used in more place than just
server and this is already the case with groupfodlers, deck, user_oidc
and more using it, so let's make it public
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
1 year ago
Côme Chilliet
6a1510f8ee
Remove some more at matchers in tests/lib
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
1 year ago
Robin Appelman
1c468129af
adjust tests to new fs setup
Signed-off-by: Robin Appelman <robin@icewind.nl>
2 years ago
Côme Chilliet
e053feb5db
Fix PHP deprecation warning in File/ViewTest
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2 years ago
Julius Härtl
98560c80ea
Properly handle result when copying with failure and throw in tests
Signed-off-by: Julius Härtl <jus@bitgrid.net>
3 years ago
Julius Härtl
ee842f1c43
Fix writeStream mocking
Signed-off-by: Julius Härtl <jus@bitgrid.net>
3 years ago
Morris Jobke
83a75c670b
Replace static call to Share::unshare with ShareManager->deleteShare in tests
And then cleanup all the code that is dead then...
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
3 years ago
Morris Jobke
234b510652
Change PHPDoc type hint from PHPUnit_Framework_MockObject_MockObject to \PHPUnit\Framework\MockObject\MockObject
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
3 years ago
Robin Appelman
ad7798f9c9
use exceptions for error signaling in writeStream
this remove the ambiguity when writing zero length files
Signed-off-by: Robin Appelman <robin@icewind.nl>
3 years ago
Robin Appelman
fcad692b4a
rollback cache rename if trashbin move fails
Signed-off-by: Robin Appelman <robin@icewind.nl>
3 years ago
Joas Schilling
89ed2c37bf
Update share type constant usage
Signed-off-by: Joas Schilling <coding@schilljs.com>
3 years ago
Christoph Wurst
caff1023ea
Format control structures, classes, methods and function
To continue this formatting madness, here's a tiny patch that adds
unified formatting for control structures like if and loops as well as
classes, their methods and anonymous functions. This basically forces
the constructs to start on the same line. This is not exactly what PSR2
wants, but I think we can have a few exceptions with "our" style. The
starting of braces on the same line is pracrically standard for our
code.
This also removes and empty lines from method/function bodies at the
beginning and end.
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago
Christoph Wurst
14c996d982
Use elseif instead of else if
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago
Robin Appelman
f984512e33
fix tests
Signed-off-by: Robin Appelman <robin@icewind.nl>
4 years ago
Christoph Wurst
2ee65f177e
Use the shorter phpunit syntax for mocked return values
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago
Roeland Jago Douma
3a7cf40aaa
Mode to modern phpunit
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
4 years ago
Roeland Jago Douma
c007ca624f
Make phpunit8 compatible
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
4 years ago
Arthur Schiwon
fc16b09a2c
Files first to use own GenericEvent
* those are added to 18 only anyway :)
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
4 years ago
Roeland Jago Douma
68748d4f85
Some php-cs fixes
* Order the imports
* No leading slash on imports
* Empty line before namespace
* One line per import
* Empty after imports
* Emmpty line at bottom of file
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
4 years ago
Robin Appelman
1b6e647b63
expose filecache extension data in FileInfo
Signed-off-by: Robin Appelman <robin@icewind.nl>
4 years ago
Robin Appelman
000898d932
fix tests
Signed-off-by: Robin Appelman <robin@icewind.nl>
4 years ago
Robin Appelman
f69c2d1e84
cleanup shared lock if changing to exclusive lock failed
Signed-off-by: Robin Appelman <robin@icewind.nl>
5 years ago
Michael Weimann
d855c38e07
Moves the logo files to logo
Signed-off-by: Michael Weimann <mail@michael-weimann.eu>
5 years ago
Roeland Jago Douma
9c23c7c821
Fix ViewTest
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
6 years ago
Roeland Jago Douma
09f8a755ec
Remove IAppConfig::getValue
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
6 years ago
Morris Jobke
ab36980d20
Use ::class in test mocks of dav app
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
6 years ago
Morris Jobke
a55e794bfd
Cleanup unused methods
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
6 years ago
Morris Jobke
8366dfa50b
Cleanup usage of shareItem in internal code base
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
6 years ago
Lukas Reschke
dfd8125aeb
Replace wrong PHPDocs
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
6 years ago
Robin Appelman
8de4209c3e
round the mtime in touch
Signed-off-by: Robin Appelman <robin@icewind.nl>
7 years ago
Lukas Reschke
ab9e3525cc
Move error message to log entry
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
7 years ago
Joas Schilling
70bd819dd2
Cleanup test
Signed-off-by: Joas Schilling <coding@schilljs.com>
7 years ago
Joas Schilling
2f16f3ba44
Fix unit test
Signed-off-by: Joas Schilling <coding@schilljs.com>
7 years ago
Vincent Petry
7256940524
Redirect unlink to rmdir (#27101)
Many API callers will call unlink even for directories and it can mess
up with some wrappers like the encryption wrapper
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
7 years ago
Lukas Reschke
2ca29f709b
Add tests
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
7 years ago
Robin Appelman
cbcdf69dc2
only query substorages to calculate the final mtime/size/etag lazily
Signed-off-by: Robin Appelman <robin@icewind.nl>
7 years ago
Roeland Jago Douma
31532ecf13
Fix getMock ViewTest
7 years ago
Morris Jobke
c2d88a08b7
Remove unneeded checks if it runs on a Windows machine
* the setup check is still there
7 years ago
Roeland Jago Douma
ea4c5e6e0a
Fix unit tests
8 years ago
blizzz
51fd2602a7
Revert "Downstream 2016-06-08"
8 years ago
Robin Appelman
67c2c85b05
allow deleting "ghost files" trough the View and Node api
8 years ago
Robin Appelman
63408fa6ef
allow deleting "ghost files" trough the View and Node api
8 years ago
Joas Schilling
94ad54ec9b
Move tests/ to PSR-4 (#24731)
* Move a-b to PSR-4
* Move c-d to PSR-4
* Move e+g to PSR-4
* Move h-l to PSR-4
* Move m-r to PSR-4
* Move s-u to PSR-4
* Move files/ to PSR-4
* Move remaining tests to PSR-4
* Remove Test\ from old autoloader
8 years ago
Joas Schilling
f24179a327
Fix deprecated private method
8 years ago
Roeland Jago Douma
0dbcbc4cae
When the scanner detects a file is changed clear checksum
Fixes #23782 and #23783
If the file scanner detects a changed file we clear the checksum while
we update the cache.
* Unit test added
8 years ago
Morris Jobke
90b0831cec
Use TempManager instead of tmpFolder
8 years ago
Robin Appelman
19b2fe6a3a
Fix mimetype filter in getDirectoryContent
8 years ago
Thomas Müller
3bb6dcea64
Apply DB group annotation ...
8 years ago
Robin Appelman
20cad09f7f
Add tests for FileInfo owner
8 years ago