server/tests/lib
Lukas Reschke 13e817e901 Throw exception on getPath if file does not exist
Currently the `getPath` methods returned `NULL` in case when a file with the specified ID does not exist. This however mandates that developers are checking for the `NULL` case and if they do not the door for bugs with all kind of impact is widely opened.

This is especially harmful if used in context with Views where the final result is limited based on the result of `getPath`, if `getPath` returns `NULL` PHP type juggles this to an empty string resulting in all possible kind of bugs.

While one could argue that this is a misusage of the API the fact is that it is very often misused and an exception will trigger an immediate stop of execution as well as log this behaviour and show a pretty error page.

I also adjusted some usages where I believe that we need to catch these errors, in most cases this is though simply an error that should hard-fail.
2015-10-25 17:58:21 +01:00
..
app The constant is now deprecated 2015-10-14 15:29:38 +02:00
appframework Remove dependency on ICrypto + use XOR 2015-10-21 17:33:41 +02:00
archive
backgroundjob handle non existing job classes in $jobList->getNext 2015-08-19 14:16:05 +02:00
cache Move dummy backend to Tests namespace 2015-09-22 11:01:11 +02:00
command
contacts
db Allow set('column', 'null') to work like in Doctrine 2015-09-24 09:53:09 +02:00
encryption only check if the user exists if a user was added as parameter 2015-09-24 12:21:40 +02:00
files Throw exception on getPath if file does not exist 2015-10-25 17:58:21 +01:00
group Sort user groups by group name and hide the user count 2015-05-18 12:55:19 +02:00
hooks more type hints 2015-06-02 14:07:55 +02:00
http/client Move the helpful method to the TestCase class 2015-06-03 12:33:29 +02:00
lock expire old lock rows 2015-09-17 13:55:04 +02:00
mail Run test only when idn is available 2015-10-16 11:02:10 +02:00
memcache Fallback to complete Memcached flush if getAllKeys fails 2015-09-05 20:02:49 +01:00
notification Move interfaces to private until they are no longer experimental 2015-09-08 09:01:02 +02:00
ocs
preview Move dummy backend to Tests namespace 2015-09-22 11:01:11 +02:00
public Test overriding channel 2015-05-15 22:37:14 +03:00
repair Do not update mime types for folders with extension 2015-10-09 18:16:36 +02:00
security don't read certificates if ownCloud is not installed 2015-08-30 19:00:03 +02:00
session Write to session in batch at the end of the request 2015-09-09 12:48:37 +02:00
share Check for error when resharing 2015-10-16 20:43:17 +02:00
template Add tests for correct path 2015-04-20 12:31:35 +02:00
traits Move dummy backend to Tests namespace 2015-09-22 11:01:11 +02:00
user Move dummy backend to Tests namespace 2015-09-22 11:01:11 +02:00
util/user Move dummy backend to Tests namespace 2015-09-22 11:01:11 +02:00
activitymanager.php Add test coverage for Activity Event and Manager 2015-08-20 10:25:49 +02:00
allconfig.php
api.php Merge pull request #18184 from owncloud/ocs-merge-headers 2015-10-21 10:36:37 +02:00
app.php Only do the description kung-fu on strings - fixes #17028 2015-07-01 13:15:13 +02:00
appconfig.php Only check the "was updated/inserted" when not on Oracle... 2015-09-14 15:27:06 +02:00
archive.php change tests back to check for logo-wide, make them pass again 2015-05-28 23:39:55 +02:00
autoloader.php verify the path in the autoloader 2015-09-01 15:03:28 +02:00
avatar.php Filter potential dangerous filenames for avatars 2015-04-28 16:57:23 +02:00
cache.php
capabilitiesmanager.php Use DI 2015-08-10 10:45:16 +02:00
configtests.php rename config test to prevent autoloader issue 2015-09-28 10:47:49 +02:00
contactsmanager.php
datetimeformatter.php
db.php Use data provider instead of hand-crafted for loops 2015-04-18 15:19:33 +02:00
dbschema.php Remove remainings of mssql 2015-07-29 18:19:31 +02:00
errorHandler.php
files.php Unit test OC_Files::setUploadLimit() 2015-07-20 15:03:09 +01:00
group.php Move dummy backend to Tests namespace 2015-09-22 11:01:11 +02:00
helper.php Move the helpful method to the TestCase class 2015-06-03 12:33:29 +02:00
helperstorage.php
hookhelper.php Fire prehooks when uploading directly to storage 2015-05-13 17:47:04 +02:00
httphelper.php Add connection timeout to default POST options 2015-05-26 11:22:50 +02:00
image.php Fix max preview, some resizing and caching issues and force preview providers to resize their previews properly 2015-06-06 16:25:04 +02:00
installer.php
l10n.php [l10n] remove unused static methods 2015-10-02 12:51:45 +02:00
largefilehelper.php
largefilehelpergetfilesize.php
logger.php Remove passwords from logged exception stack traces 2015-09-24 20:01:30 +02:00
naturalsort.php
navigationmanagertest.php
ocsclienttest.php Merge pull request #17222 from owncloud/issue-17101-send-oc-version-to-app-store 2015-06-29 15:07:00 +02:00
preview.php Add tests 2015-10-01 13:17:22 +02:00
repair.php
server.php Move interfaces to private until they are no longer experimental 2015-09-08 09:01:02 +02:00
setup.php Check for PDO instead of removed function for PHP 7 compatibility 2015-07-30 12:32:22 +02:00
streamwrappers.php
subadmin.php New \OC\SubAdmin class 2015-10-21 11:32:38 +02:00
tags.php
template.php verify the path in the autoloader 2015-09-01 15:03:28 +02:00
tempmanager.php Unit test getting temp dir from config 2015-08-30 23:34:38 +01:00
testcase.php Clear the shares after the test like storages and files 2015-10-05 10:13:45 +02:00
testmoveablemountpoint.php Keep shared locks in post hooks 2015-06-25 16:33:02 +02:00
updater.php Always pass in ILogger 2015-10-09 14:08:22 +02:00
urlgenerator.php
user.php Move dummy backend to Tests namespace 2015-09-22 11:01:11 +02:00
util.php Remove dependency on ICrypto + use XOR 2015-10-21 17:33:41 +02:00
utilcheckserver.php