nextcloud/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 Make root tests extend the \Test\TestCase 2014-11-19 14:53:51 +01:00
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 Allow configuring background job mode from the console 2015-03-02 20:51:40 +01:00
contacts Make class compatible 2014-12-09 12:25:22 +01:00
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 Replace uniqid calls with $this->getUniqueID so tests pass again on windows 2014-12-03 12:10:55 +01:00
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 Workaround to fix the too early init dilemma 2014-12-08 22:33:36 +01:00
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 Make remaining files extend the test base 2014-11-19 14:53:59 +01:00
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 Mock interface 2014-12-08 13:18:00 +01:00
datetimeformatter.php Use a fixed timestamp so we dont switch days/years with the getTimestampAgo 2014-12-11 13:22:05 +01:00
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 Make root tests extend the \Test\TestCase 2014-11-19 14:53:51 +01:00
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 reduce OC_Preferences, OC_Config and \OCP\Config usage 2014-12-08 22:42:37 +01:00
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 Make root tests extend the \Test\TestCase 2014-11-19 14:53:51 +01:00
l10n.php [l10n] remove unused static methods 2015-10-02 12:51:45 +02:00
largefilehelper.php Make root tests extend the \Test\TestCase 2014-11-19 14:53:51 +01:00
largefilehelpergetfilesize.php Check if open_basedir is set 2014-12-11 00:09:55 +01:00
logger.php Remove passwords from logged exception stack traces 2015-09-24 20:01:30 +02:00
naturalsort.php Add PHPunit test for DefaultCollator 2015-02-24 23:51:08 +01:00
navigationmanagertest.php Add tests for the navigation manager (closure) behaviour 2015-03-16 16:46:17 +01:00
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 Make root tests extend the \Test\TestCase 2014-11-19 14:53:51 +01:00
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 Replace originalStorage in tests with a proper teardown 2015-04-08 12:45:38 +02:00
subadmin.php New \OC\SubAdmin class 2015-10-21 11:32:38 +02:00
tags.php remove IDb interface from core class usage 2015-02-25 22:21:24 +01:00
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 Cache \OC\URLGenerator::imagePath 2015-03-17 12:35:47 +01:00
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 Make root tests extend the \Test\TestCase 2014-11-19 14:53:51 +01:00