From 6d69d4e0e513a2f07cccca2d170fb39a3b614fb6 Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Tue, 20 Jul 2010 10:11:13 -0500 Subject: [PATCH] Minor - test lib description update and removing deprecated code --- tests/main/inc/course_document.inc.test.php | 45 ------------------- tests/main/inc/course_document.lib.test.php | 17 ++++--- .../inc/tool_navigation_menu.inc.test.php | 28 +++++------- 3 files changed, 18 insertions(+), 72 deletions(-) delete mode 100644 tests/main/inc/course_document.inc.test.php mode change 100644 => 100755 tests/main/inc/course_document.lib.test.php mode change 100644 => 100755 tests/main/inc/tool_navigation_menu.inc.test.php diff --git a/tests/main/inc/course_document.inc.test.php b/tests/main/inc/course_document.inc.test.php deleted file mode 100644 index df46bfd157..0000000000 --- a/tests/main/inc/course_document.inc.test.php +++ /dev/null @@ -1,45 +0,0 @@ -UnitTestCase('Determine the course of document function tests'); - - } - - public function testGetlist(){ - $directory=''; - $res = getlist($directory); - if(is_bool($res)){ - $this->assertTrue(is_bool($res)); - $this->assertTrue($res ===false); - }else{ - $this->assertTrue(is_array($res)); - } - //var_dump($res); - } - - public function testCheckAndCreateResourceDirectory(){ - global $_course, $_user; - global $group_properties, $to_group_id; - global $permissions_for_new_directories; - ob_start(); - require_once(api_get_path(SYS_CODE_PATH).'inc/course_document.inc.php'); - ob_end_clean(); - $repository_path=''; - $resource_directory=''; - $resource_directory_name=''; - $res = check_and_create_resource_directory($repository_path, $resource_directory, $resource_directory_name); - $this->assertTrue(is_bool($res)); - $this->assertTrue($res === true || $res === false); - var_dump($res); - } - - - -} - - - -?> diff --git a/tests/main/inc/course_document.lib.test.php b/tests/main/inc/course_document.lib.test.php old mode 100644 new mode 100755 index 1fb07962d5..ba0769cf24 --- a/tests/main/inc/course_document.lib.test.php +++ b/tests/main/inc/course_document.lib.test.php @@ -2,15 +2,14 @@ class Testcdocu extends UnitTestCase{ - public function Testcdocu(){ - $this->UnitTestCase('Determine the course of document function tests'); + public function __construct(){ + $this->UnitTestCase('Course documents display library - main/inc/course_document.inc.test.php'); + } - } - public function testGetlist(){ global $is_allowed_in_course; $is_allowed_in_course = true; - $directory = api_get_path(SYS_COURSE_PATH).'/document/audio/'; + $directory = api_get_path(SYS_COURSE_PATH).'/document/audio/'; $res = getlist($directory); if (is_bool($res)){ $this->assertTrue(is_bool($res)); @@ -18,10 +17,10 @@ class Testcdocu extends UnitTestCase{ } else{ $this->assertTrue(is_null($res)); } - - + + } - + public function testCheckAndCreateResourceDirectory(){ global $_course, $_user; global $group_properties, $to_group_id; @@ -33,7 +32,7 @@ class Testcdocu extends UnitTestCase{ $this->assertTrue(is_bool($res)); $this->assertTrue($res === true || $res === false); } - + } diff --git a/tests/main/inc/tool_navigation_menu.inc.test.php b/tests/main/inc/tool_navigation_menu.inc.test.php old mode 100644 new mode 100755 index ca7276a6c6..816445e894 --- a/tests/main/inc/tool_navigation_menu.inc.test.php +++ b/tests/main/inc/tool_navigation_menu.inc.test.php @@ -1,13 +1,11 @@ UnitTestCase('Navigation menu display code function tests'); - - } - public function testGetNavigationItems() { + public function TestToolNavigationMenu(){ + $this->UnitTestCase('Navigation menu display library - main/inc/tool_navigation_menu.inc.test.php'); + } + public function testGetNavigationItemsIsArray() { global $is_courseMember; global $_user; global $_course; @@ -16,26 +14,20 @@ class TestTNMenu extends UnitTestCase{ $this->assertTrue(is_array($res)); } - public function testShowNavigationMenu() { + public function testShowNavigationMenuIsNull() { ob_start(); $navigation_items = get_navigation_items(true); $course_id = api_get_course_id(); $res = show_navigation_menu(); - $this->assertTrue(is_null($res)); + $this->assertNull($res); ob_end_clean(); } - public function testShowNavigationToolShortcuts() { + public function testShowNavigationToolShortcutsIsNull() { ob_start(); $orientation = SHORTCUTS_HORIZONTAL; $res = show_navigation_tool_shortcuts($orientation); - $this->assertTrue(is_null($res)); + $this->assertNull($res); ob_end_clean(); } - - -} - - - -?> +} \ No newline at end of file