$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));
*/
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();
$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('');
// 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();
}
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);
require_once 'archive.php';
-if (!OC_Util::runningOnWindows()) {
class Test_Archive_TAR extends Test_Archive {
public function setUp() {
- if (floatval(phpversion())>=5.5) {
+ parent::setUp();
+
+ if (floatval(phpversion()) >= 5.5) {
$this->markTestSkipped('php 5.5 changed unpack function.');
- return;
+ }
+
+ if (OC_Util::runningOnWindows()) {
+ $this->markTestSkipped('[Windows] tar archives are not supported on Windows');
}
}
protected function getExisting() {
return new OC_Archive_TAR(OCP\Files::tmpFile('.tar.gz'));
}
}
-}
$longPath = '';
// 4000 is the maximum path length in file_cache.path
$folderName = 'abcdefghijklmnopqrstuvwxyz012345678901234567890123456789';
- $depth = (4000 / 57);
+
+ $tmpdirLength = strlen(\OC_Helper::tmpFolder());
+ if (\OC_Util::runningOnWindows()) {
+ $this->markTestSkipped('[Windows] ');
+ $depth = ((260 - $tmpdirLength) / 57);
+ } elseif (\OC_Util::runningOnMac()){
+ $depth = ((1024 - $tmpdirLength) / 57);
+ } else {
+ $depth = ((4000 - $tmpdirLength) / 57);
+ }
+
foreach (range(0, $depth - 1) as $i) {
$longPath .= '/' . $folderName;
$result = $rootView->mkdir($longPath);
}
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);
$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() {