[svn r22367] Minor - create new function test and new test file all.test1.php

skala
Ricardo Rodriguez 16 years ago
parent 5e81f9c8d4
commit 2bf9880dd9
  1. 32
      tests/all.test1.php
  2. 22
      tests/main/inc/banner.inc.test.php
  3. 45
      tests/main/inc/course_document.inc.test.php

@ -0,0 +1,32 @@
<?php
ini_set('memory_limit','128M');
require_once('simpletest/unit_tester.php');
require_once(dirname(__FILE__).'/../main/inc/global.inc.php');
//require_once(api_get_path(SYS_CODE_PATH).'inc/course_document.inc.php');
require_once('simpletest/web_tester.php');
require_once('simpletest/mock_objects.php');
require_once('simpletest/autorun.php');
class AllTests1 extends TestSuite {
function AllTests1() {
$this->TestSuite('All tests1');
$this->addTestFile(dirname(__FILE__).'/main/inc/banner.inc.test.php');
/**
* Problemas con la funcion prueba, no se ejecuta de manera adecuada.
* $this->addTestFile(dirname(__FILE__).'/main/inc/course_document.inc.test.php');
**/
//$this->addTestFile(dirname(__FILE__).'/main/inc/footer.inc.test.php');
/*$this->addTestFile(dirname(__FILE__).'/main/inc/global.inc.test.php');
$this->addTestFile(dirname(__FILE__).'/main/inc/header.inc.test.php');
$this->addTestFile(dirname(__FILE__).'/main/inc/introductionSection.inc.test.php');
$this->addTestFile(dirname(__FILE__).'/main/inc/latex.inc.test.php');
$this->addTestFile(dirname(__FILE__).'/main/inc/local.inc.test.php');
$this->addTestFile(dirname(__FILE__).'/main/inc/reduced_header.inc.test.php');*/
$this->addTestFile(dirname(__FILE__).'/main/inc/tool_navigation_menu.inc.test.php');
ob_end_clean();
}
}
$test = &new AllTests1();
//$test-> run( new HtmlReporter());

@ -0,0 +1,22 @@
<?php
class TestBanner extends UnitTestCase{
public function TestBanner(){
$this->UnitTestCase('Determine the tabs function tests');
}
public function testGetTabs(){
global $_course, $rootAdminWeb, $_user;
ob_start();
require_once(api_get_path(SYS_CODE_PATH).'inc/banner.inc.php');
ob_end_clean();
$res = get_tabs();
$this->assertTrue(is_array($res));
$this->assertTrue($res);
//var_dump($res);
}
}
?>

@ -0,0 +1,45 @@
<?php
class Testcdocu extends UnitTestCase{
public function Testcdocu(){
$this->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);
}
}
?>
Loading…
Cancel
Save