From 7d96cf81ade2756293a5211d028d47592feeb30c Mon Sep 17 00:00:00 2001 From: Ricardo Rodriguez Date: Mon, 25 May 2009 22:20:10 +0200 Subject: [PATCH] [svn r20979] Minor - tested function testApiIsSelfRegistrationAllowed() --- tests/main/inc/lib/main_api.lib.test.php | 49 ++++++++++++++++++++---- 1 file changed, 42 insertions(+), 7 deletions(-) diff --git a/tests/main/inc/lib/main_api.lib.test.php b/tests/main/inc/lib/main_api.lib.test.php index 454f21d475..5c637de171 100755 --- a/tests/main/inc/lib/main_api.lib.test.php +++ b/tests/main/inc/lib/main_api.lib.test.php @@ -1,12 +1,11 @@ -UnitTestCase('Main API tests'); } - // todo function testApiProtectCourseScriptReturnsFalse() // todo function testApiProtectAdminScriptReturnsFalse() // todo function testApiBlockAnonymousUsers() @@ -113,8 +112,44 @@ class TestMainApi extends UnitTestCase { // todo function testApiUrlToLocalPathReturnString() // todo function testApiResizeImage() // todo function testApiCalculateImageSizeReturnArray() - -// function testApiGetSettingReturnsRightValue() { + /** + * Test out of a course context + */ +/* function testApiProtectCourseScriptReturnsFalseWhenOutOfCourseContext(){ + $res= api_protect_course_script(); + $this->assertTrue($res); + } + function testApiGetSettingReturnsRightValue() { //$this->assertPattern('/\d/',$res); -// } -} \ No newline at end of file + } +} + /** + * Test out of a Admin context + + function testApiProtectAdminScriptReturnsFalseWhenOutOfCourseContext(){ + $res= api_protect_admin_script(); + $this->assertTrue($res); + } + + function testApiBlockAnonymousUsersReturnTrueWhenUserIsAnonymous(){ + $res=api_block_anonymous_users(); + $this->assertTrue($res); + + } + + + function testApiGetNavigator() + { + + + } +*/ + function testApiIsSelfRegistrationAllowed() + { + $res = api_is_self_registration_allowed(); + $this->assertFalse($res); + } + +} + +?>