summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2016-07-08 15:55:17 +0200
committerMorris Jobke <hey@morrisjobke.de>2016-07-08 15:55:17 +0200
commitc2d88a08b796ca19c8b5ec63bfd34ac32ead4208 (patch)
treef18e0ba4d05361456a6712378ccc0784620c1e9c /tests
parent48f9e4ed03f3148d62919a95496ee43164d3e707 (diff)
downloadnextcloud-server-c2d88a08b796ca19c8b5ec63bfd34ac32ead4208.tar.gz
nextcloud-server-c2d88a08b796ca19c8b5ec63bfd34ac32ead4208.zip
Remove unneeded checks if it runs on a Windows machine
* the setup check is still there
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/Archive/TARTest.php8
-rw-r--r--tests/lib/Archive/ZIPTest.php8
-rw-r--r--tests/lib/Files/FilesystemTest.php22
-rw-r--r--tests/lib/Files/Storage/LocalTest.php8
-rw-r--r--tests/lib/Files/Type/DetectionTest.php4
-rw-r--r--tests/lib/Files/ViewTest.php8
-rw-r--r--tests/lib/ImageTest.php4
-rw-r--r--tests/lib/LargeFileHelperGetFileSizeTest.php10
-rw-r--r--tests/lib/TempManagerTest.php6
-rw-r--r--tests/lib/UtilCheckServerTest.php3
-rw-r--r--tests/lib/UtilTest.php6
11 files changed, 8 insertions, 79 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/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() {