Merge remote-tracking branch 'origin/QA_4_1' into QA_4_1

This commit is contained in:
Weblate 2014-03-06 09:18:17 +01:00
commit 3093f0f0bc

View File

@ -34,6 +34,13 @@ class PMA_ConfigTest extends PHPUnit_Framework_TestCase
* @var PMA_Config
*/
protected $object;
/**
* @var object to test file permission
*/
protected $permTestObj;
/**
* Sets up the fixture, for example, opens a network connection.
@ -47,6 +54,9 @@ class PMA_ConfigTest extends PHPUnit_Framework_TestCase
$GLOBALS['server'] = 0;
$_SESSION['is_git_revision'] = true;
$GLOBALS['PMA_Config'] = new PMA_Config(CONFIG_FILE);
//for testing file permissions
$this->permTestObj = new PMA_Config("./config.sample.inc.php");
}
/**
@ -58,6 +68,7 @@ class PMA_ConfigTest extends PHPUnit_Framework_TestCase
protected function tearDown()
{
unset($this->object);
unset($this->permTestObj);
}
/**
@ -957,11 +968,13 @@ class PMA_ConfigTest extends PHPUnit_Framework_TestCase
$this->assertFalse(!($perms === false) && ($perms & 2));
//load file permissions for the current permissions file
$perms = @fileperms($GLOBALS['PMA_Config']->getSource());
//if the above assertion is true then applying further assertions
$perms = @fileperms($this->permTestObj->getSource());
//testing for permissions
$this->assertFalse(!($perms === false) && ($perms & 2));
//if the above assertion is false then applying further assertions
if(!($perms === false) && ($perms & 2)) {
$this->assertFalse($GLOBALS['PMA_Config']->get('PMA_IS_WINDOWS') == 0);
$this->assertFalse($this->permTestObj->get('PMA_IS_WINDOWS') == 0);
}
}