From d1c3aa3112b363f84d721e9fce299d24833cbe7e Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Tue, 28 Feb 2012 12:06:34 +0100 Subject: add test case for getLocalFile --- tests/lib/filestorage.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/lib/filestorage.php b/tests/lib/filestorage.php index 5a89c74fe89..fb050868ee3 100644 --- a/tests/lib/filestorage.php +++ b/tests/lib/filestorage.php @@ -118,6 +118,12 @@ abstract class Test_FileStorage extends UnitTestCase { $this->assertFalse($this->instance->file_exists('/source.txt')); $this->assertEqual(file_get_contents($textFile),$this->instance->file_get_contents('/target.txt')); } + + public function testLocalFile(){ + $textFile=OC::$SERVERROOT.'/tests/data/lorem.txt'; + $this->instance->file_put_contents('/lorem.txt',file_get_contents($textFile)); + $localFile=$this->instance->getLocalFile('/lorem.txt'); + $this->assertTrue(file_exists($localFile)); + $this->assertEqual(file_get_contents($localFile),file_get_contents($textFile)); + } } - - -- cgit v1.2.3