diff options
Diffstat (limited to 'tests/lib/Files')
-rw-r--r-- | tests/lib/Files/FilesystemTest.php | 22 | ||||
-rw-r--r-- | tests/lib/Files/PathVerificationTest.php | 97 | ||||
-rw-r--r-- | tests/lib/Files/Storage/LocalTest.php | 8 | ||||
-rw-r--r-- | tests/lib/Files/Type/DetectionTest.php | 4 | ||||
-rw-r--r-- | tests/lib/Files/ViewTest.php | 8 |
5 files changed, 3 insertions, 136 deletions
diff --git a/tests/lib/Files/FilesystemTest.php b/tests/lib/Files/FilesystemTest.php index 76e3f471633..210ce4edc69 100644 --- a/tests/lib/Files/FilesystemTest.php +++ b/tests/lib/Files/FilesystemTest.php @@ -272,28 +272,6 @@ class FilesystemTest extends \Test\TestCase { $this->assertSame($expected, \OC\Files\Filesystem::isFileBlacklisted($path)); } - public function normalizePathWindowsAbsolutePathData() { - return array( - array('C:/', 'C:\\'), - array('C:/', 'C:\\', false), - array('C:/tests', 'C:\\tests'), - array('C:/tests', 'C:\\tests', false), - array('C:/tests', 'C:\\tests\\'), - array('C:/tests/', 'C:\\tests\\', false), - ); - } - - /** - * @dataProvider normalizePathWindowsAbsolutePathData - */ - public function testNormalizePathWindowsAbsolutePath($expected, $path, $stripTrailingSlash = true) { - if (!\OC_Util::runningOnWindows()) { - $this->markTestSkipped('This test is Windows only'); - } - - $this->assertEquals($expected, \OC\Files\Filesystem::normalizePath($path, $stripTrailingSlash, true)); - } - public function testNormalizePathUTF8() { if (!class_exists('Patchwork\PHP\Shim\Normalizer')) { $this->markTestSkipped('UTF8 normalizer Patchwork was not found'); diff --git a/tests/lib/Files/PathVerificationTest.php b/tests/lib/Files/PathVerificationTest.php index 9ce9416455f..992734bdece 100644 --- a/tests/lib/Files/PathVerificationTest.php +++ b/tests/lib/Files/PathVerificationTest.php @@ -98,63 +98,6 @@ class PathVerificationTest extends \Test\TestCase { } /** - * @dataProvider providesInvalidCharsWindows - * @expectedException \OCP\Files\InvalidCharacterInPathException - */ - public function testPathVerificationInvalidCharsWindows($fileName) { - $storage = new Local(['datadir' => '']); - - $fileName = " 123{$fileName}456 "; - self::invokePrivate($storage, 'verifyWindowsPath', [$fileName]); - } - - public function providesInvalidCharsWindows() { - return [ - [\chr(0)], - [\chr(1)], - [\chr(2)], - [\chr(3)], - [\chr(4)], - [\chr(5)], - [\chr(6)], - [\chr(7)], - [\chr(8)], - [\chr(9)], - [\chr(10)], - [\chr(11)], - [\chr(12)], - [\chr(13)], - [\chr(14)], - [\chr(15)], - [\chr(16)], - [\chr(17)], - [\chr(18)], - [\chr(19)], - [\chr(20)], - [\chr(21)], - [\chr(22)], - [\chr(23)], - [\chr(24)], - [\chr(25)], - [\chr(26)], - [\chr(27)], - [\chr(28)], - [\chr(29)], - [\chr(30)], - [\chr(31)], - ['<'], - ['>'], - [':'], - ['"'], - ['/'], - ['\\'], - ['|'], - ['?'], - ['*'], - ]; - } - - /** * @dataProvider providesInvalidCharsPosix * @expectedException \OCP\Files\InvalidCharacterInPathException */ @@ -162,7 +105,7 @@ class PathVerificationTest extends \Test\TestCase { $storage = new Local(['datadir' => '']); $fileName = " 123{$fileName}456 "; - self::invokePrivate($storage, 'verifyWindowsPath', [$fileName]); + self::invokePrivate($storage, 'verifyPosixPath', [$fileName]); } public function providesInvalidCharsPosix() { @@ -205,50 +148,12 @@ class PathVerificationTest extends \Test\TestCase { } /** - * @dataProvider providesReservedNamesWindows - * @expectedException \OCP\Files\ReservedWordException - */ - public function testPathVerificationReservedNamesWindows($fileName) { - $storage = new Local(['datadir' => '']); - - self::invokePrivate($storage, 'verifyWindowsPath', [$fileName]); - } - - public function providesReservedNamesWindows() { - return [ - [' CON '], - ['prn '], - ['AUX'], - ['NUL'], - ['COM1'], - ['COM2'], - ['COM3'], - ['COM4'], - ['COM5'], - ['COM6'], - ['COM7'], - ['COM8'], - ['COM9'], - ['LPT1'], - ['LPT2'], - ['LPT3'], - ['LPT4'], - ['LPT5'], - ['LPT6'], - ['LPT7'], - ['LPT8'], - ['LPT9'] - ]; - } - - /** * @dataProvider providesValidPosixPaths */ public function testPathVerificationValidPaths($fileName) { $storage = new Local(['datadir' => '']); self::invokePrivate($storage, 'verifyPosixPath', [$fileName]); - self::invokePrivate($storage, 'verifyWindowsPath', [$fileName]); // nothing thrown $this->assertTrue(true); } diff --git a/tests/lib/Files/Storage/LocalTest.php b/tests/lib/Files/Storage/LocalTest.php index cca4d6a6676..89dd2f0786f 100644 --- a/tests/lib/Files/Storage/LocalTest.php +++ b/tests/lib/Files/Storage/LocalTest.php @@ -48,10 +48,6 @@ class LocalTest extends Storage { } public function testStableEtag() { - if (\OC_Util::runningOnWindows()) { - $this->markTestSkipped('[Windows] On Windows platform we have no stable etag generation - yet'); - } - $this->instance->file_put_contents('test.txt', 'foobar'); $etag1 = $this->instance->getETag('test.txt'); $etag2 = $this->instance->getETag('test.txt'); @@ -59,10 +55,6 @@ class LocalTest extends Storage { } public function testEtagChange() { - if (\OC_Util::runningOnWindows()) { - $this->markTestSkipped('[Windows] On Windows platform we have no stable etag generation - yet'); - } - $this->instance->file_put_contents('test.txt', 'foo'); $this->instance->touch('test.txt', time() - 2); $etag1 = $this->instance->getETag('test.txt'); diff --git a/tests/lib/Files/Type/DetectionTest.php b/tests/lib/Files/Type/DetectionTest.php index 5800f4eb8e3..7b9dc1b3e4d 100644 --- a/tests/lib/Files/Type/DetectionTest.php +++ b/tests/lib/Files/Type/DetectionTest.php @@ -80,10 +80,6 @@ class DetectionTest extends \Test\TestCase { } public function testDetectString() { - if (\OC_Util::runningOnWindows()) { - $this->markTestSkipped('[Windows] Strings have mimetype application/octet-stream on Windows'); - } - $result = $this->detection->detectString("/data/data.tar.gz"); $expected = 'text/plain; charset=us-ascii'; $this->assertEquals($expected, $result); diff --git a/tests/lib/Files/ViewTest.php b/tests/lib/Files/ViewTest.php index 87feb63888d..72a91614100 100644 --- a/tests/lib/Files/ViewTest.php +++ b/tests/lib/Files/ViewTest.php @@ -104,7 +104,7 @@ class ViewTest extends \Test\TestCase { $cache->clear(); } - if ($this->tempStorage && !\OC_Util::runningOnWindows()) { + if ($this->tempStorage) { system('rm -rf ' . escapeshellarg($this->tempStorage->getDataDir())); } @@ -761,14 +761,10 @@ class ViewTest extends \Test\TestCase { /* * 4096 is the maximum path length in file_cache.path in *nix * 1024 is the max path length in mac - * 228 is the max path length in windows */ $folderName = 'abcdefghijklmnopqrstuvwxyz012345678901234567890123456789'; $tmpdirLength = strlen(\OC::$server->getTempManager()->getTemporaryFolder()); - if (\OC_Util::runningOnWindows()) { - $this->markTestSkipped('[Windows] '); - $depth = ((260 - $tmpdirLength) / 57); - } elseif (\OC_Util::runningOnMac()) { + if (\OC_Util::runningOnMac()) { $depth = ((1024 - $tmpdirLength) / 57); } else { $depth = ((4000 - $tmpdirLength) / 57); |