diff --git a/test/classes/PMA_Config_test.php b/test/classes/PMA_Config_test.php index 4c9af24c30..2f967fcb1a 100644 --- a/test/classes/PMA_Config_test.php +++ b/test/classes/PMA_Config_test.php @@ -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); } }