diff options
author | Lukas Reschke <lukas@statuscode.ch> | 2016-07-11 13:16:03 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-11 13:16:03 +0200 |
commit | 0c1cf5f7eb15532901aa3b4f29a4e3ee5fa58467 (patch) | |
tree | 1503a3a06e94d9f36b1675a0b4f46284c0f83b23 /tests | |
parent | 34c0b9d2c02f787b46dd27af66ab2726d6024636 (diff) | |
parent | 6ea77abb38e4b85556ccde8801071f5f10a92ced (diff) | |
download | nextcloud-server-0c1cf5f7eb15532901aa3b4f29a4e3ee5fa58467.tar.gz nextcloud-server-0c1cf5f7eb15532901aa3b4f29a4e3ee5fa58467.zip |
Merge pull request #347 from nextcloud/drop-windows-foo
Remove unneeded checks if it runs on a Windows machine
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/Archive/TARTest.php | 8 | ||||
-rw-r--r-- | tests/lib/Archive/ZIPTest.php | 8 | ||||
-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 | ||||
-rw-r--r-- | tests/lib/ImageTest.php | 4 | ||||
-rw-r--r-- | tests/lib/LargeFileHelperGetFileSizeTest.php | 10 | ||||
-rw-r--r-- | tests/lib/TempManagerTest.php | 6 | ||||
-rw-r--r-- | tests/lib/UtilCheckServerTest.php | 3 | ||||
-rw-r--r-- | tests/lib/UtilTest.php | 6 |
12 files changed, 9 insertions, 175 deletions
diff --git a/tests/lib/Archive/TARTest.php b/tests/lib/Archive/TARTest.php index 998ce201e72..7575f6c5176 100644 --- a/tests/lib/Archive/TARTest.php +++ b/tests/lib/Archive/TARTest.php @@ -12,14 +12,6 @@ namespace Test\Archive; use OC\Archive\TAR; class TARTest extends TestBase { - protected function setUp() { - parent::setUp(); - - if (\OC_Util::runningOnWindows()) { - $this->markTestSkipped('[Windows] tar archives are not supported on Windows'); - } - } - protected function getExisting() { $dir = \OC::$SERVERROOT . '/tests/data'; return new TAR($dir . '/data.tar.gz'); diff --git a/tests/lib/Archive/ZIPTest.php b/tests/lib/Archive/ZIPTest.php index 8d639e0d686..ff0155f3d01 100644 --- a/tests/lib/Archive/ZIPTest.php +++ b/tests/lib/Archive/ZIPTest.php @@ -12,14 +12,6 @@ namespace Test\Archive; use OC\Archive\ZIP; class ZIPTest extends TestBase { - protected function setUp() { - parent::setUp(); - - if (\OC_Util::runningOnWindows()) { - $this->markTestSkipped('[Windows] '); - } - } - protected function getExisting() { $dir = \OC::$SERVERROOT . '/tests/data'; return new ZIP($dir . '/data.zip'); 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); diff --git a/tests/lib/ImageTest.php b/tests/lib/ImageTest.php index 9dba7e3739b..9176b8cf6c9 100644 --- a/tests/lib/ImageTest.php +++ b/tests/lib/ImageTest.php @@ -75,10 +75,6 @@ class ImageTest extends \Test\TestCase { $img = new \OC_Image(null); $this->assertEquals('', $img->mimeType()); - if (\OC_Util::runningOnWindows()) { - $this->markTestSkipped('[Windows] Images created with imagecreate() are pngs on windows'); - } - $img = new \OC_Image(file_get_contents(OC::$SERVERROOT.'/tests/data/testimage.jpg')); $this->assertEquals('image/jpeg', $img->mimeType()); diff --git a/tests/lib/LargeFileHelperGetFileSizeTest.php b/tests/lib/LargeFileHelperGetFileSizeTest.php index ac81a31819f..0c3a11e971a 100644 --- a/tests/lib/LargeFileHelperGetFileSizeTest.php +++ b/tests/lib/LargeFileHelperGetFileSizeTest.php @@ -28,12 +28,10 @@ class LargeFileHelperGetFileSizeTest extends TestCase { public function dataFileNameProvider() { $path = dirname(__DIR__) . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR; - $filePaths = array(array($path . 'lorem.txt', 446)); - if (!\OC_Util::runningOnWindows()) { - $filePaths[] = array($path . 'strängé filename (duplicate #2).txt', 446); - } - - return $filePaths; + return [ + [ $path . 'lorem.txt', 446 ], + [ $path . 'strängé filename (duplicate #2).txt', 446 ], + ]; } /** diff --git a/tests/lib/TempManagerTest.php b/tests/lib/TempManagerTest.php index c4b88469b89..d3f6ee1dc47 100644 --- a/tests/lib/TempManagerTest.php +++ b/tests/lib/TempManagerTest.php @@ -138,9 +138,6 @@ class TempManagerTest extends \Test\TestCase { } public function testLogCantCreateFile() { - if (\OC_Util::runningOnWindows()) { - $this->markTestSkipped('[Windows] chmod() does not work as intended on Windows.'); - } $this->markTestSkipped('TODO: Disable because fails on drone'); $logger = $this->getMock('\Test\NullLogger'); @@ -153,9 +150,6 @@ class TempManagerTest extends \Test\TestCase { } public function testLogCantCreateFolder() { - if (\OC_Util::runningOnWindows()) { - $this->markTestSkipped('[Windows] chmod() does not work as intended on Windows.'); - } $this->markTestSkipped('TODO: Disable because fails on drone'); $logger = $this->getMock('\Test\NullLogger'); diff --git a/tests/lib/UtilCheckServerTest.php b/tests/lib/UtilCheckServerTest.php index 6465f8dd42b..b1152e97256 100644 --- a/tests/lib/UtilCheckServerTest.php +++ b/tests/lib/UtilCheckServerTest.php @@ -145,9 +145,6 @@ class UtilCheckServerTest extends \Test\TestCase { * Tests an error is given when the datadir is not writable */ public function testDataDirNotWritable() { - if (\OC_Util::runningOnWindows()) { - $this->markTestSkipped('[Windows] chmod() does not work as intended on Windows.'); - } $this->markTestSkipped('TODO: Disable because fails on drone'); chmod($this->datadir, 0300); diff --git a/tests/lib/UtilTest.php b/tests/lib/UtilTest.php index 7da7db0291c..c68f8d00a40 100644 --- a/tests/lib/UtilTest.php +++ b/tests/lib/UtilTest.php @@ -396,10 +396,8 @@ class UtilTest extends \Test\TestCase { $this->assertNotEmpty($errors); \OCP\Files::rmdirr($dataDir); - if (!\OC_Util::runningOnWindows()) { - $errors = \OC_Util::checkDataDirectoryValidity('relative/path'); - $this->assertNotEmpty($errors); - } + $errors = \OC_Util::checkDataDirectoryValidity('relative/path'); + $this->assertNotEmpty($errors); } protected function setUp() { |