From aae5db1ca9b7b1765c9abfb326760fc64da2a1c3 Mon Sep 17 00:00:00 2001 From: Artur Neumann Date: Fri, 2 Jun 2017 10:27:27 +0545 Subject: [PATCH 1/9] make File::put() more testable fix tests --- apps/dav/lib/Connector/Sabre/File.php | 28 +++++++++++++++---- .../tests/unit/Connector/Sabre/FileTest.php | 4 +-- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/apps/dav/lib/Connector/Sabre/File.php b/apps/dav/lib/Connector/Sabre/File.php index 122bb69eb25f..810368668977 100644 --- a/apps/dav/lib/Connector/Sabre/File.php +++ b/apps/dav/lib/Connector/Sabre/File.php @@ -59,6 +59,24 @@ class File extends Node implements IFile { + protected $request; + + /** + * Sets up the node, expects a full path name + * + * @param \OC\Files\View $view + * @param \OCP\Files\FileInfo $info + * @param IManager $shareManager + */ + public function __construct($view, $info, IManager $shareManager = null, \OC\AppFramework\Http\Request $request = null) { + if (isset($request)) { + $this->request = $request; + } else { + $this->request = \OC::$server->getRequest(); + } + parent::__construct($view, $info, $shareManager); + } + /** * Updates the data * @@ -210,9 +228,8 @@ public function put($data) { } // allow sync clients to send the mtime along in a header - $request = \OC::$server->getRequest(); - if (isset($request->server['HTTP_X_OC_MTIME'])) { - if ($this->fileView->touch($this->path, $request->server['HTTP_X_OC_MTIME'])) { + if (isset($this->request->server['HTTP_X_OC_MTIME'])) { + if ($this->fileView->touch($this->path, $this->request->server['HTTP_X_OC_MTIME'])) { header('X-OC-MTime: accepted'); } } @@ -473,9 +490,8 @@ private function createFileChunked($data) { } // allow sync clients to send the mtime along in a header - $request = \OC::$server->getRequest(); - if (isset($request->server['HTTP_X_OC_MTIME'])) { - if ($targetStorage->touch($targetInternalPath, $request->server['HTTP_X_OC_MTIME'])) { + if (isset($this->request->server['HTTP_X_OC_MTIME'])) { + if ($targetStorage->touch($targetInternalPath, $this->request->server['HTTP_X_OC_MTIME'])) { header('X-OC-MTime: accepted'); } } diff --git a/apps/dav/tests/unit/Connector/Sabre/FileTest.php b/apps/dav/tests/unit/Connector/Sabre/FileTest.php index 5d3a5f226345..9559d42c41ab 100644 --- a/apps/dav/tests/unit/Connector/Sabre/FileTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/FileTest.php @@ -299,7 +299,7 @@ function ($path) use ($storage) { * * @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 = Filesystem::getView(); if (!is_null($viewRoot)) { $view = new View($viewRoot); @@ -315,7 +315,7 @@ private function doPut($path, $viewRoot = null) { null ); - $file = new File($view, $info); + $file = new File($view, $info, null, $request); // beforeMethod locks $view->lockFile($path, ILockingProvider::LOCK_SHARED); From d1f73456b89fae516c7b3063c00cdcc0d8382c9e Mon Sep 17 00:00:00 2001 From: Artur Neumann Date: Fri, 2 Jun 2017 10:46:36 +0545 Subject: [PATCH 2/9] make sure HTTP_X_OC_MTIME is an int and in limits --- apps/dav/lib/Connector/Sabre/File.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/apps/dav/lib/Connector/Sabre/File.php b/apps/dav/lib/Connector/Sabre/File.php index 810368668977..caacb81613b7 100644 --- a/apps/dav/lib/Connector/Sabre/File.php +++ b/apps/dav/lib/Connector/Sabre/File.php @@ -229,7 +229,15 @@ public function put($data) { // allow sync clients to send the mtime along in a header if (isset($this->request->server['HTTP_X_OC_MTIME'])) { - if ($this->fileView->touch($this->path, $this->request->server['HTTP_X_OC_MTIME'])) { + $mtime = (float) $this->request->server['HTTP_X_OC_MTIME']; + if ($mtime >= PHP_INT_MAX) { + $mtime = PHP_INT_MAX; + } elseif ($mtime <= (PHP_INT_MAX*-1)) { + $mtime = (PHP_INT_MAX*-1); + } else { + $mtime = (int) $this->request->server['HTTP_X_OC_MTIME']; + } + if ($this->fileView->touch($this->path, $mtime)) { header('X-OC-MTime: accepted'); } } From 5fe04c22b6ede44012d221f36aab0d20c6888e5c Mon Sep 17 00:00:00 2001 From: Artur Neumann Date: Fri, 2 Jun 2017 12:08:09 +0545 Subject: [PATCH 3/9] tests to test uploading a file with HTTP_X_OC_MTIME fix type error delete unused mocks --- apps/dav/lib/Connector/Sabre/File.php | 4 +- .../tests/unit/Connector/Sabre/FileTest.php | 94 +++++++++++++++++++ 2 files changed, 96 insertions(+), 2 deletions(-) diff --git a/apps/dav/lib/Connector/Sabre/File.php b/apps/dav/lib/Connector/Sabre/File.php index caacb81613b7..a2acf3f5f380 100644 --- a/apps/dav/lib/Connector/Sabre/File.php +++ b/apps/dav/lib/Connector/Sabre/File.php @@ -66,9 +66,9 @@ class File extends Node implements IFile { * * @param \OC\Files\View $view * @param \OCP\Files\FileInfo $info - * @param IManager $shareManager + * @param \OCP\Share\IManager $shareManager */ - public function __construct($view, $info, IManager $shareManager = null, \OC\AppFramework\Http\Request $request = null) { + public function __construct($view, $info, $shareManager = null, \OC\AppFramework\Http\Request $request = null) { if (isset($request)) { $this->request = $request; } else { diff --git a/apps/dav/tests/unit/Connector/Sabre/FileTest.php b/apps/dav/tests/unit/Connector/Sabre/FileTest.php index 9559d42c41ab..1995058fa855 100644 --- a/apps/dav/tests/unit/Connector/Sabre/FileTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/FileTest.php @@ -62,6 +62,9 @@ class FileTest extends TestCase { */ private $user; + /** @var IConfig | \PHPUnit_Framework_MockObject_MockObject */ + protected $config; + public function setUp() { parent::setUp(); unset($_SERVER['HTTP_OC_CHUNKED']); @@ -75,6 +78,8 @@ public function setUp() { $userManager->createUser($this->user, 'pass'); $this->loginAsUser($this->user); + + $this->config = $this->getMockBuilder('\OCP\IConfig')->getMock(); } public function tearDown() { @@ -335,6 +340,76 @@ public function testPutSingleFile() { $this->assertNotEmpty($this->doPut('/foo.txt')); } + public function legalMtimeProvider() { + return [ + "string" => [ + 'HTTP_X_OC_MTIME' => "string", + 'expected result' => 0 + ], + "castable string (int)" => [ + 'HTTP_X_OC_MTIME' => "34", + 'expected result' => 34 + ], + "castable string (float)" => [ + 'HTTP_X_OC_MTIME' => "34.56", + 'expected result' => 34 + ], + "float" => [ + 'HTTP_X_OC_MTIME' => 34.56, + 'expected result' => 34 + ], + "zero" => [ + 'HTTP_X_OC_MTIME' => 0, + 'expected result' => 0 + ], + "zero string" => [ + 'HTTP_X_OC_MTIME' => "0", + 'expected result' => 0 + ], + "negative zero string" => [ + 'HTTP_X_OC_MTIME' => "-0", + 'expected result' => 0 + ], + "string starting with number following by char" => [ + 'HTTP_X_OC_MTIME' => "2345asdf", + 'expected result' => 2345 + ], + "negative int" => [ + 'HTTP_X_OC_MTIME' => -34, + 'expected result' => -34 + ], + "negative float" => [ + 'HTTP_X_OC_MTIME' => -34.43, + 'expected result' => -34 + ], + "string castable hex int" => [ + 'HTTP_X_OC_MTIME' => "0x45adf", + 'expected result' => 0 + ], + "string that looks like invalid hex int" => [ + 'HTTP_X_OC_MTIME' => "0x123g", + 'expected result' => 0 + ] + ]; + } + + /** + * Test putting a file with string Mtime + * @runInSeparateProcess + * @dataProvider legalMtimeProvider + */ + public function testPutSingleFileLegalMtime($requestMtime, $resultMtime) { + $request = new \OC\AppFramework\Http\Request([ + 'server' => [ + 'HTTP_X_OC_MTIME' => $requestMtime, + ] + ], null, $this->config, null); + + $file = 'foo.txt'; + $this->doPut($file, null, $request); + $this->assertEquals($resultMtime, $this->getFileInfos($file)['mtime']); + } + /** * Test putting a file using chunking */ @@ -973,6 +1048,25 @@ private function listPartFiles(View $userView = null, $path = '') { return $files; } + /** + * returns an array of file information filesize, mtime, filetype, mimetype + * + * @param string $path + * @param View $userView + * @return array + */ + private function getFileInfos($path = '', View $userView = null) { + if ($userView === null) { + $userView = Filesystem::getView(); + } + return [ + "filesize" => $userView->filesize($path), + "mtime" => $userView->filemtime($path), + "filetype" => $userView->filetype($path), + "mimetype" => $userView->getMimeType($path) + ]; + } + /** * @expectedException \Sabre\DAV\Exception\ServiceUnavailable */ From dc460777fb15e38ab6b46d874209354e18de8b64 Mon Sep 17 00:00:00 2001 From: Artur Neumann Date: Fri, 2 Jun 2017 17:59:09 +0545 Subject: [PATCH 4/9] changes as requested by review --- apps/dav/lib/Connector/Sabre/File.php | 30 ++++++++++++------- .../tests/unit/Connector/Sabre/FileTest.php | 21 +++++++++++++ 2 files changed, 41 insertions(+), 10 deletions(-) diff --git a/apps/dav/lib/Connector/Sabre/File.php b/apps/dav/lib/Connector/Sabre/File.php index a2acf3f5f380..1dc69ed80a84 100644 --- a/apps/dav/lib/Connector/Sabre/File.php +++ b/apps/dav/lib/Connector/Sabre/File.php @@ -56,6 +56,7 @@ use Sabre\DAV\Exception\ServiceUnavailable; use Sabre\DAV\IFile; use Sabre\DAV\Exception\NotFound; +use OC\AppFramework\Http\Request; class File extends Node implements IFile { @@ -68,7 +69,7 @@ class File extends Node implements IFile { * @param \OCP\Files\FileInfo $info * @param \OCP\Share\IManager $shareManager */ - public function __construct($view, $info, $shareManager = null, \OC\AppFramework\Http\Request $request = null) { + public function __construct($view, $info, $shareManager = null, Request $request = null) { if (isset($request)) { $this->request = $request; } else { @@ -229,14 +230,9 @@ public function put($data) { // allow sync clients to send the mtime along in a header if (isset($this->request->server['HTTP_X_OC_MTIME'])) { - $mtime = (float) $this->request->server['HTTP_X_OC_MTIME']; - if ($mtime >= PHP_INT_MAX) { - $mtime = PHP_INT_MAX; - } elseif ($mtime <= (PHP_INT_MAX*-1)) { - $mtime = (PHP_INT_MAX*-1); - } else { - $mtime = (int) $this->request->server['HTTP_X_OC_MTIME']; - } + $mtime = $this->sanitizeMtime( + $this->request->server ['HTTP_X_OC_MTIME'] + ); if ($this->fileView->touch($this->path, $mtime)) { header('X-OC-MTime: accepted'); } @@ -499,7 +495,10 @@ private function createFileChunked($data) { // allow sync clients to send the mtime along in a header if (isset($this->request->server['HTTP_X_OC_MTIME'])) { - if ($targetStorage->touch($targetInternalPath, $this->request->server['HTTP_X_OC_MTIME'])) { + $mtime = $this->sanitizeMtime( + $this->request->server ['HTTP_X_OC_MTIME'] + ); + if ($targetStorage->touch($targetInternalPath, $mtime)) { header('X-OC-MTime: accepted'); } } @@ -628,6 +627,17 @@ private function convertToSabreException(\Exception $e) { throw new \Sabre\DAV\Exception($e->getMessage(), 0, $e); } + private function sanitizeMtime ($mtimeFromRequest) { + $mtime = (float) $mtimeFromRequest; + if ($mtime >= PHP_INT_MAX) { + $mtime = PHP_INT_MAX; + } elseif ($mtime <= (PHP_INT_MAX*-1)) { + $mtime = (PHP_INT_MAX*-1); + } else { + $mtime = (int) $mtimeFromRequest; + } + return $mtime; + } /** * Set $algo to get a specific checksum, leave null to get all checksums diff --git a/apps/dav/tests/unit/Connector/Sabre/FileTest.php b/apps/dav/tests/unit/Connector/Sabre/FileTest.php index 1995058fa855..bb839a2d2de2 100644 --- a/apps/dav/tests/unit/Connector/Sabre/FileTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/FileTest.php @@ -396,6 +396,7 @@ public function legalMtimeProvider() { /** * Test putting a file with string Mtime * @runInSeparateProcess + * @preserveGlobalState disabled * @dataProvider legalMtimeProvider */ public function testPutSingleFileLegalMtime($requestMtime, $resultMtime) { @@ -410,6 +411,26 @@ public function testPutSingleFileLegalMtime($requestMtime, $resultMtime) { $this->assertEquals($resultMtime, $this->getFileInfos($file)['mtime']); } + /** + * Test putting a file with string Mtime using chunking + * @runInSeparateProcess + * @preserveGlobalState disabled + * @dataProvider legalMtimeProvider + */ + public function testChunkedPutLegalMtime($requestMtime, $resultMtime) { + $request = new \OC\AppFramework\Http\Request([ + 'server' => [ + 'HTTP_X_OC_MTIME' => $requestMtime, + ] + ], null, $this->config, null); + + $_SERVER['HTTP_OC_CHUNKED'] = true; + $file = 'foo.txt'; + $this->doPut($file.'-chunking-12345-2-0', null, $request); + $this->doPut($file.'-chunking-12345-2-1', null, $request); + $this->assertEquals($resultMtime, $this->getFileInfos($file)['mtime']); + } + /** * Test putting a file using chunking */ From ec8823b795dacb9c9b334c19f6bdbbd0eebd5b65 Mon Sep 17 00:00:00 2001 From: Artur Neumann Date: Wed, 7 Jun 2017 15:39:10 +0545 Subject: [PATCH 5/9] correct expectations when running tests on swift storage --- .../tests/unit/Connector/Sabre/FileTest.php | 38 ++++++++++++++----- 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/apps/dav/tests/unit/Connector/Sabre/FileTest.php b/apps/dav/tests/unit/Connector/Sabre/FileTest.php index bb839a2d2de2..2785cb30acbc 100644 --- a/apps/dav/tests/unit/Connector/Sabre/FileTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/FileTest.php @@ -341,7 +341,8 @@ public function testPutSingleFile() { } public function legalMtimeProvider() { - return [ + $primaryStorageConfig = getenv("PRIMARY_STORAGE_CONFIG"); + $testValues = [ "string" => [ 'HTTP_X_OC_MTIME' => "string", 'expected result' => 0 @@ -374,14 +375,6 @@ public function legalMtimeProvider() { 'HTTP_X_OC_MTIME' => "2345asdf", 'expected result' => 2345 ], - "negative int" => [ - 'HTTP_X_OC_MTIME' => -34, - 'expected result' => -34 - ], - "negative float" => [ - 'HTTP_X_OC_MTIME' => -34.43, - 'expected result' => -34 - ], "string castable hex int" => [ 'HTTP_X_OC_MTIME' => "0x45adf", 'expected result' => 0 @@ -390,7 +383,32 @@ public function legalMtimeProvider() { 'HTTP_X_OC_MTIME' => "0x123g", 'expected result' => 0 ] - ]; + ]; + + if ($primaryStorageConfig === "swift") { + $testValuesNegativeMtime = [ + "negative int" => [ + 'HTTP_X_OC_MTIME' => -34, + 'expected result' => 0 + ], + "negative float" => [ + 'HTTP_X_OC_MTIME' => -34.43, + 'expected result' => 0 + ], + ]; + } else { + $testValuesNegativeMtime = [ + "negative int" => [ + 'HTTP_X_OC_MTIME' => -34, + 'expected result' => -34 + ], + "negative float" => [ + 'HTTP_X_OC_MTIME' => -34.43, + 'expected result' => -34 + ], + ]; + } + return array_merge($testValues, $testValuesNegativeMtime); } /** From fb463171630d65b0cf28684ba03b251e5e7ddcb5 Mon Sep 17 00:00:00 2001 From: Artur Neumann Date: Wed, 7 Jun 2017 16:41:56 +0545 Subject: [PATCH 6/9] shake jenkins --- apps/dav/tests/unit/Connector/Sabre/FileTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/dav/tests/unit/Connector/Sabre/FileTest.php b/apps/dav/tests/unit/Connector/Sabre/FileTest.php index 2785cb30acbc..58eefd843e80 100644 --- a/apps/dav/tests/unit/Connector/Sabre/FileTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/FileTest.php @@ -411,6 +411,7 @@ public function legalMtimeProvider() { return array_merge($testValues, $testValuesNegativeMtime); } + /** * Test putting a file with string Mtime * @runInSeparateProcess From 84cfd433435b993e8fb382040ecc1aeee5d838ef Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Thu, 8 Jun 2017 09:50:11 +0545 Subject: [PATCH 7/9] Refactor negative mtime support checking Signed-off-by: Phil Davis --- .../tests/unit/Connector/Sabre/FileTest.php | 128 ++++++++---------- 1 file changed, 59 insertions(+), 69 deletions(-) diff --git a/apps/dav/tests/unit/Connector/Sabre/FileTest.php b/apps/dav/tests/unit/Connector/Sabre/FileTest.php index 58eefd843e80..85fe87d07815 100644 --- a/apps/dav/tests/unit/Connector/Sabre/FileTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/FileTest.php @@ -340,77 +340,67 @@ public function testPutSingleFile() { $this->assertNotEmpty($this->doPut('/foo.txt')); } - public function legalMtimeProvider() { - $primaryStorageConfig = getenv("PRIMARY_STORAGE_CONFIG"); - $testValues = [ - "string" => [ - 'HTTP_X_OC_MTIME' => "string", - 'expected result' => 0 - ], - "castable string (int)" => [ - 'HTTP_X_OC_MTIME' => "34", - 'expected result' => 34 - ], - "castable string (float)" => [ - 'HTTP_X_OC_MTIME' => "34.56", - 'expected result' => 34 - ], - "float" => [ - 'HTTP_X_OC_MTIME' => 34.56, - 'expected result' => 34 - ], - "zero" => [ - 'HTTP_X_OC_MTIME' => 0, - 'expected result' => 0 - ], - "zero string" => [ - 'HTTP_X_OC_MTIME' => "0", - 'expected result' => 0 - ], - "negative zero string" => [ - 'HTTP_X_OC_MTIME' => "-0", - 'expected result' => 0 - ], - "string starting with number following by char" => [ - 'HTTP_X_OC_MTIME' => "2345asdf", - 'expected result' => 2345 - ], - "string castable hex int" => [ - 'HTTP_X_OC_MTIME' => "0x45adf", - 'expected result' => 0 - ], - "string that looks like invalid hex int" => [ - 'HTTP_X_OC_MTIME' => "0x123g", - 'expected result' => 0 - ] - ]; - - if ($primaryStorageConfig === "swift") { - $testValuesNegativeMtime = [ - "negative int" => [ - 'HTTP_X_OC_MTIME' => -34, - 'expected result' => 0 - ], - "negative float" => [ - 'HTTP_X_OC_MTIME' => -34.43, - 'expected result' => 0 - ], - ]; - } else { - $testValuesNegativeMtime = [ - "negative int" => [ - 'HTTP_X_OC_MTIME' => -34, - 'expected result' => -34 - ], - "negative float" => [ - 'HTTP_X_OC_MTIME' => -34.43, - 'expected result' => -34 - ], - ]; - } - return array_merge($testValues, $testValuesNegativeMtime); + /** + * Determine if the underlying storage supports a negative mtime value + * + * @return boolean true if negative mtime is supported + */ + private function supportsNegativeMtime() { + return (getenv("PRIMARY_STORAGE_CONFIG") !== "swift"); } + public function legalMtimeProvider() { + return [ + "string" => [ + 'HTTP_X_OC_MTIME' => "string", + 'expected result' => 0 + ], + "castable string (int)" => [ + 'HTTP_X_OC_MTIME' => "34", + 'expected result' => 34 + ], + "castable string (float)" => [ + 'HTTP_X_OC_MTIME' => "34.56", + 'expected result' => 34 + ], + "float" => [ + 'HTTP_X_OC_MTIME' => 34.56, + 'expected result' => 34 + ], + "zero" => [ + 'HTTP_X_OC_MTIME' => 0, + 'expected result' => 0 + ], + "zero string" => [ + 'HTTP_X_OC_MTIME' => "0", + 'expected result' => 0 + ], + "negative zero string" => [ + 'HTTP_X_OC_MTIME' => "-0", + 'expected result' => 0 + ], + "string starting with number following by char" => [ + 'HTTP_X_OC_MTIME' => "2345asdf", + 'expected result' => 2345 + ], + "string castable hex int" => [ + 'HTTP_X_OC_MTIME' => "0x45adf", + 'expected result' => 0 + ], + "string that looks like invalid hex int" => [ + 'HTTP_X_OC_MTIME' => "0x123g", + 'expected result' => 0 + ], + "negative int" => [ + 'HTTP_X_OC_MTIME' => -34, + 'expected result' => (supportsNegativeMtime() ? -34 : 0) + ], + "negative float" => [ + 'HTTP_X_OC_MTIME' => -34.43, + 'expected result' => (supportsNegativeMtime() ? -34 : 0) + ], + ]; + } /** * Test putting a file with string Mtime From 9cca47825df350e155eceeb77df2a6e12057357d Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Thu, 8 Jun 2017 10:55:12 +0545 Subject: [PATCH 8/9] Fix supportsNegativeMtime calls Signed-off-by: Phil Davis --- apps/dav/tests/unit/Connector/Sabre/FileTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/dav/tests/unit/Connector/Sabre/FileTest.php b/apps/dav/tests/unit/Connector/Sabre/FileTest.php index 85fe87d07815..f448af1e6295 100644 --- a/apps/dav/tests/unit/Connector/Sabre/FileTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/FileTest.php @@ -393,11 +393,11 @@ public function legalMtimeProvider() { ], "negative int" => [ 'HTTP_X_OC_MTIME' => -34, - 'expected result' => (supportsNegativeMtime() ? -34 : 0) + 'expected result' => ($this->supportsNegativeMtime() ? -34 : 0) ], "negative float" => [ 'HTTP_X_OC_MTIME' => -34.43, - 'expected result' => (supportsNegativeMtime() ? -34 : 0) + 'expected result' => ($this->supportsNegativeMtime() ? -34 : 0) ], ]; } From 332d4baa4e81da9340606a5b5349eee041e832fd Mon Sep 17 00:00:00 2001 From: Artur Neumann Date: Thu, 8 Jun 2017 20:27:38 +0545 Subject: [PATCH 9/9] shake jenkins --- apps/dav/tests/unit/Connector/Sabre/FileTest.php | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/dav/tests/unit/Connector/Sabre/FileTest.php b/apps/dav/tests/unit/Connector/Sabre/FileTest.php index f448af1e6295..5954cb66a11d 100644 --- a/apps/dav/tests/unit/Connector/Sabre/FileTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/FileTest.php @@ -414,7 +414,6 @@ public function testPutSingleFileLegalMtime($requestMtime, $resultMtime) { 'HTTP_X_OC_MTIME' => $requestMtime, ] ], null, $this->config, null); - $file = 'foo.txt'; $this->doPut($file, null, $request); $this->assertEquals($resultMtime, $this->getFileInfos($file)['mtime']);