diff options
author | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2017-11-27 19:41:34 +0100 |
---|---|---|
committer | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2017-11-27 20:39:41 +0100 |
commit | 2af3d8a9b274236f693c79527fb61f42ecd8109a (patch) | |
tree | 75aeb754242ba4cd48b68944d46429964e704087 /apps/dav/tests | |
parent | 01e346b2ae92446e3d86cd54381fb54a5c680fca (diff) | |
download | nextcloud-server-2af3d8a9b274236f693c79527fb61f42ecd8109a.tar.gz nextcloud-server-2af3d8a9b274236f693c79527fb61f42ecd8109a.zip |
Make possible to provide a specific HTTP request object to File
This will be used in a following commit to test how the X-OC-MTime
header is handled.
This commit is based on the "make File::put() more testable" commit
(included in 018d45cad97e0) from ownCloud by Artur Neumann.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'apps/dav/tests')
-rw-r--r-- | apps/dav/tests/unit/Connector/Sabre/FileTest.php | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/apps/dav/tests/unit/Connector/Sabre/FileTest.php b/apps/dav/tests/unit/Connector/Sabre/FileTest.php index 4d106842cf0..0a2abba446d 100644 --- a/apps/dav/tests/unit/Connector/Sabre/FileTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/FileTest.php @@ -284,10 +284,11 @@ class FileTest extends \Test\TestCase { * * @param string $path path to put the file into * @param string $viewRoot root to use for the view + * @param null|\OC\AppFramework\Http\Request $request the HTTP request * * @return null|string of the PUT operaiton which is usually the etag */ - private function doPut($path, $viewRoot = null) { + private function doPut($path, $viewRoot = null, \OC\AppFramework\Http\Request $request = null) { $view = \OC\Files\Filesystem::getView(); if (!is_null($viewRoot)) { $view = new \OC\Files\View($viewRoot); @@ -303,7 +304,7 @@ class FileTest extends \Test\TestCase { null ); - $file = new \OCA\DAV\Connector\Sabre\File($view, $info); + $file = new \OCA\DAV\Connector\Sabre\File($view, $info, null, $request); // beforeMethod locks $view->lockFile($path, ILockingProvider::LOCK_SHARED); |