Fixed additional test fails

skala
Yannick Warnier 15 years ago
parent f84276b06e
commit 16017dadd7
  1. 2
      tests/main/inc/lib/document.lib.test.php
  2. 15
      tests/main/inc/lib/main_api.lib.test.php
  3. 6
      tests/main/inc/lib/usermanager.lib.test.php

@ -235,7 +235,7 @@ class TestDocumentManager extends UnitTestCase {
if (!headers_sent()) { if (!headers_sent()) {
$res=DocumentManager::string_send_for_download($full_string, $forced, $name); $res=DocumentManager::string_send_for_download($full_string, $forced, $name);
} }
$this->assertTrue($res); $this->assertFalse(empty($res));
} }
/** /**

@ -603,17 +603,14 @@ class TestMainApi extends UnitTestCase {
} }
function testApiChmod_R(){ function testApiChmod_R(){
// We know, it does not work for Windows.
if (IS_WINDOWS_OS) { return true; }
$dirname = api_get_path(SYS_LANG_PATH); $dirname = api_get_path(SYS_LANG_PATH);
$perm_dir = substr(sprintf('%o', fileperms($dirname)), -4); $perm_dir = substr(sprintf('%o', fileperms($dirname)), -4);
if ($perm_dir != '0777') { $this->assertEqual($perm_dir,'0777');
// haha! This one is too good to remove... (for now) $new_filemode = '0775';
$msg = "Error"; $res = api_chmod_R($dirname, $new_filemode);
$this->assertTrue(is_string($msg)); $this->assertTrue($res);
} else {
$filemode = '0777';
$res = api_chmod_R($dirname, $filemode);
$this->assertTrue($res || IS_WINDOWS_OS); // We know, it does not work for Windows.
}
} }
function testApiGetVersion(){ function testApiGetVersion(){

@ -115,9 +115,9 @@ class TestUserManager extends UnitTestCase {
$this->assertTrue(is_bool($res)); $this->assertTrue(is_bool($res));
} }
function testBuildProductionList() { function testBuildProductionListIsFalse() {
$res=UserManager::build_production_list(1, false, false); $res = UserManager::build_production_list(1, false, false);
$this->assertTrue(is_string($res)); $this->assertFalse($res);
} }
function testDeleteApiKey() { function testDeleteApiKey() {

Loading…
Cancel
Save