]> git.quilime.com - plog.git/commitdiff
Added testing suite for Data
authorGabriel Dunne <gdunne@quilime.com>
Mon, 3 Sep 2012 23:01:24 +0000 (16:01 -0700)
committerGabriel Dunne <gdunne@quilime.com>
Mon, 3 Sep 2012 23:01:24 +0000 (16:01 -0700)
lib/test/data_test.php [new file with mode: 0644]

diff --git a/lib/test/data_test.php b/lib/test/data_test.php
new file mode 100644 (file)
index 0000000..5053ee6
--- /dev/null
@@ -0,0 +1,28 @@
+<?
+
+class DataTest extends UnitTestCase {
+
+    function test_GettingEntriesArray() {
+        $entries = get_entries('/');
+        $this->assertTrue(is_array($entries));
+    }
+
+    function test_EntryFolderNotExist() {
+        $this->expectException( new Exception("Directory does not exist") );
+        get_entries('sdfs');
+    }
+
+    function test_GettingPagesArray() {
+        $entries = get_pages();
+        $this->assertTrue(is_array($entries));
+    }
+
+    function test_GettingDirsArray() {
+        $dirs = get_dirs();
+        $this->assertTrue(is_array($dirs));
+    }    
+
+    function test_getEntryIsFileObj() {
+        $this->assertIsA(get_entry('/projects/prism'), 'stdClass');
+    }
+}