Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests/lib
diff options
context:
space:
mode:
authorRobin Appelman <icewind1991@gmail.com>2011-06-12 02:58:47 +0400
committerRobin Appelman <icewind1991@gmail.com>2011-06-12 03:06:27 +0400
commitbb5a2a917b78fb13657ac9ebbcc067bd02b22126 (patch)
treecc0e41caa7577f5ceec02bb4b1e60a89b9a65664 /tests/lib
parent2a5ee9512ee88da53dcba862a32279bdc7096bfb (diff)
test case library and start of filesystem test
Diffstat (limited to 'tests/lib')
-rw-r--r--tests/lib/filesystem.php31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/lib/filesystem.php b/tests/lib/filesystem.php
new file mode 100644
index 00000000000..a1ded471a65
--- /dev/null
+++ b/tests/lib/filesystem.php
@@ -0,0 +1,31 @@
+<?php
+class OC_FILEYSYSTEM_Test extends OC_TestCase
+{
+ public function setup(){
+ OC_UTIL::setupFS('testuser','testcase');
+ }
+
+ public function isDir(){
+ $this->assertEquals(true, OC_FILESYSTEM::is_dir('/'),'Root is not a directory');
+ }
+
+ public function fileExists(){
+ $this->assertEquals(false, OC_FILESYSTEM::file_exists('/dummy'),'Unexpected result with non-existing file');
+ OC_FILESYSTEM::file_put_contents('/dummy','foo');
+ $this->assertEquals(true, OC_FILESYSTEM::file_exists('/dummy'),'Unexpected result with existing file');
+ }
+
+ public function mkdir(){
+ OC_FILESYSTEM::mkdir('/dummy');
+ $this->assertEquals(true, OC_FILESYSTEM::file_exists('/dummy'),'No such file or directory after creating folder');
+ $this->assertEquals(true, OC_FILESYSTEM::is_dir('/dummy'),'File created instead of filder');
+ }
+
+ public function tearDown(){
+ OC_FILESYSTEM::chroot('');
+ OC_FILESYSTEM::delTree('/testuser');
+ OC_UTIL::tearDownFS();
+ }
+}
+return 'OC_FILEYSYSTEM_Test';
+?> \ No newline at end of file