]> source.dussan.org Git - nextcloud-server.git/commitdiff
Skip some more tests on Windows which just can not work at all
authorJoas Schilling <nickvergessen@gmx.de>
Mon, 10 Nov 2014 10:01:43 +0000 (11:01 +0100)
committerJoas Schilling <nickvergessen@gmx.de>
Mon, 17 Nov 2014 09:48:06 +0000 (10:48 +0100)
apps/files_encryption/tests/stream.php
apps/files_sharing/tests/cache.php
tests/lib/archive/tar.php
tests/lib/files/storage/local.php
tests/lib/files/view.php
tests/lib/helper.php
tests/lib/image.php

index 2b57f11c680c825b716f90b3ff990fe037c179c5..c3f777df85924e2d6be7f7579fdf56b0e9a9e3d7 100644 (file)
@@ -134,6 +134,13 @@ class Test_Encryption_Stream extends \PHPUnit_Framework_TestCase {
 
                $handle = $view->fopen($filename, 'r');
 
+
+               if (\OC_Util::runningOnWindows()) {
+                       fclose($handle);
+                       $view->unlink($filename);
+                       $this->markTestSkipped('[Windows] stream_set_blocking() does not work as expected on Windows.');
+               }
+
                // set stream options
                $this->assertTrue(stream_set_blocking($handle, 1));
 
index 2c9790ce66deed2cba9e2fa035d05c5a9f7c01c2..0e96f5a4e09bf185159e835586b6aa79456ff7b3 100644 (file)
@@ -30,6 +30,18 @@ class Test_Files_Sharing_Cache extends TestCase {
         */
        public $user2View;
 
+       /** @var \OC\Files\Cache\Cache */
+       protected $ownerCache;
+
+       /** @var \OC\Files\Cache\Cache */
+       protected $sharedCache;
+
+       /** @var \OC\Files\Storage\Storage */
+       protected $ownerStorage;
+
+       /** @var \OC\Files\Storage\Storage */
+       protected $sharedStorage;
+
        function setUp() {
                parent::setUp();
 
@@ -54,7 +66,7 @@ class Test_Files_Sharing_Cache extends TestCase {
                $this->view->file_put_contents('container/shareddir/subdir/another too.txt', $textData);
                $this->view->file_put_contents('container/shareddir/subdir/not a text file.xml', '<xml></xml>');
 
-               list($this->ownerStorage, $internalPath) = $this->view->resolvePath('');
+               list($this->ownerStorage,) = $this->view->resolvePath('');
                $this->ownerCache = $this->ownerStorage->getCache();
                $this->ownerStorage->getScanner()->scan('');
 
@@ -72,7 +84,7 @@ class Test_Files_Sharing_Cache extends TestCase {
 
                // retrieve the shared storage
                $secondView = new \OC\Files\View('/' . self::TEST_FILES_SHARING_API_USER2);
-               list($this->sharedStorage, $internalPath) = $secondView->resolvePath('files/shareddir');
+               list($this->sharedStorage,) = $secondView->resolvePath('files/shareddir');
                $this->sharedCache = $this->sharedStorage->getCache();
        }
 
@@ -354,7 +366,7 @@ class Test_Files_Sharing_Cache extends TestCase {
                self::loginHelper(self::TEST_FILES_SHARING_API_USER1);
                \OC\Files\Filesystem::mkdir('foo');
                \OC\Files\Filesystem::mkdir('foo/bar');
-               \OC\Files\Filesystem::touch('foo/bar/test.txt', 'bar');
+               \OC\Files\Filesystem::touch('foo/bar/test.txt');
                $folderInfo = \OC\Files\Filesystem::getFileInfo('foo');
                $fileInfo = \OC\Files\Filesystem::getFileInfo('foo/bar/test.txt');
                \OCP\Share::shareItem('folder', $folderInfo->getId(), \OCP\Share::SHARE_TYPE_USER, self::TEST_FILES_SHARING_API_USER2, \OCP\PERMISSION_ALL);
index 5b9089b32e14cee8f3581ad08d4731d31e822451..99f7fb30e2bca8b84ed6fe1c0151433874b359ab 100644 (file)
@@ -9,7 +9,7 @@
 class Test_Archive_TAR extends Test_Archive {
        public function setUp() {
                if (OC_Util::runningOnWindows()) {
-                       $this->markTestSkipped('tar archives are not supported on windows');
+                       $this->markTestSkipped('[Windows] tar archives are not supported on Windows');
                }
                parent::setUp();
        }
index 37462941d0c024274c8800e2bfcd4f7e113796a8..490086c62f2a4ec0197a83c37376bfbd7cd37933 100644 (file)
@@ -39,7 +39,7 @@ class Local extends Storage {
 
        public function testStableEtag() {
                if (\OC_Util::runningOnWindows()) {
-                       $this->markTestSkipped('On Windows platform we have no stable etag generation - yet');
+                       $this->markTestSkipped('[Windows] On Windows platform we have no stable etag generation - yet');
                }
 
                $this->instance->file_put_contents('test.txt', 'foobar');
@@ -50,7 +50,7 @@ class Local extends Storage {
 
        public function testEtagChange() {
                if (\OC_Util::runningOnWindows()) {
-                       $this->markTestSkipped('On Windows platform we have no stable etag generation - yet');
+                       $this->markTestSkipped('[Windows] On Windows platform we have no stable etag generation - yet');
                }
 
                $this->instance->file_put_contents('test.txt', 'foo');
index 5f030f29fa7520f1a0c080e7e32da243c89a05f5..931f5acd95a0034b906805182e95ba562b480480 100644 (file)
@@ -598,7 +598,7 @@ class View extends \PHPUnit_Framework_TestCase {
                $folderName = 'abcdefghijklmnopqrstuvwxyz012345678901234567890123456789';
                $tmpdirLength = strlen(\OC_Helper::tmpFolder());
                if (\OC_Util::runningOnWindows()) {
-                       $this->markTestSkipped();
+                       $this->markTestSkipped('[Windows] ');
                        $depth = ((260 - $tmpdirLength) / 57);
                }elseif(\OC_Util::runningOnMac()){
                        $depth = ((1024 - $tmpdirLength) / 57);
index 520a3e0e6695e39ae74baddf85247f4155a061fc..57c72c11987bf7af3650c9b241215e144f12fa6c 100644 (file)
@@ -115,6 +115,10 @@ class Test_Helper extends PHPUnit_Framework_TestCase {
        }
 
        function testGetStringMimeType() {
+               if (\OC_Util::runningOnWindows()) {
+                       $this->markTestSkipped('[Windows] Strings have mimetype application/octet-stream on Windows');
+               }
+
                $result = OC_Helper::getStringMimeType("/data/data.tar.gz");
                $expected = 'text/plain; charset=us-ascii';
                $this->assertEquals($result, $expected);
index 795bc4641595be562a04f4768c2e9a19e9c688e2..a683c3d2c8b674b66f93dd639249fe1248adb310 100644 (file)
@@ -62,14 +62,18 @@ class Test_Image extends PHPUnit_Framework_TestCase {
                $img = new \OC_Image(OC::$SERVERROOT.'/tests/data/testimage.png');
                $this->assertEquals('image/png', $img->mimeType());
 
+               $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());
 
                $img = new \OC_Image(base64_encode(file_get_contents(OC::$SERVERROOT.'/tests/data/testimage.gif')));
                $this->assertEquals('image/gif', $img->mimeType());
-
-               $img = new \OC_Image(null);
-               $this->assertEquals('', $img->mimeType());
        }
 
        public function testWidth() {