From 4eb9a69bd87f5118dbbef1df2988916b42b1139b Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Mon, 27 Feb 2012 12:01:06 +0100 Subject: [PATCH] fix test case for filestorage file storage no longer needs to implement file_put_contents for streams --- tests/lib/filestorage.php | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/tests/lib/filestorage.php b/tests/lib/filestorage.php index 7f024dafaa..041d858f18 100644 --- a/tests/lib/filestorage.php +++ b/tests/lib/filestorage.php @@ -81,10 +81,6 @@ abstract class Test_FileStorage extends UnitTestCase { $this->instance->file_put_contents('/lorem.txt',$sourceText); $this->assertEqual($sourceText,$this->instance->file_get_contents('/lorem.txt'),'data returned from file_get_contents is not equal to the source data'); - //fill a file with a stream - $this->instance->file_put_contents('/lorem.txt',fopen($sourceFile,'r')); - $this->assertEqual($sourceText,$this->instance->file_get_contents('/lorem.txt'),'data returned from file_get_contents is not equal to the source data'); - //empty the file $this->instance->file_put_contents('/lorem.txt',''); $this->assertEqual('',$this->instance->file_get_contents('/lorem.txt'),'file not emptied'); @@ -98,15 +94,15 @@ abstract class Test_FileStorage extends UnitTestCase { $this->assertEqual(false,$this->instance->getMimeType('/non/existing/file')); $textFile=OC::$SERVERROOT.'/tests/data/lorem.txt'; - $this->instance->file_put_contents('/lorem.txt',fopen($textFile,'r')); + $this->instance->file_put_contents('/lorem.txt',file_get_contents($textFile,'r')); $this->assertEqual('text/plain',$this->instance->getMimeType('/lorem.txt')); $pngFile=OC::$SERVERROOT.'/tests/data/logo-wide.png'; - $this->instance->file_put_contents('/logo-wide.png',fopen($pngFile,'r')); + $this->instance->file_put_contents('/logo-wide.png',file_get_contents($pngFile,'r')); $this->assertEqual('image/png',$this->instance->getMimeType('/logo-wide.png')); $svgFile=OC::$SERVERROOT.'/tests/data/logo-wide.svg'; - $this->instance->file_put_contents('/logo-wide.svg',fopen($svgFile,'r')); + $this->instance->file_put_contents('/logo-wide.svg',file_get_contents($svgFile,'r')); $this->assertEqual('image/svg+xml',$this->instance->getMimeType('/logo-wide.svg')); } }