/** * Tests setting configuration source * * @covers PMA_Config::getSource * @covers PMA_Config::setSource */ public function testGetSetSource() { echo $this->object->getSource(); $this->assertEmpty($this->object->getSource(), "Source is null by default"); $this->object->setSource("config.sample.inc.php"); $this->assertEquals("config.sample.inc.php", $this->object->getSource(), "Cant set new source"); }
/** * Should test checking of config permissions * * @return void */ public function testCheckPermissions() { //load file permissions for the current permissions file $perms = @fileperms($this->object->getSource()); //testing for permissions for no configuration file $this->assertFalse(!($perms === false) && $perms & 2); //load file permissions for the current permissions file $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($this->permTestObj->get('PMA_IS_WINDOWS') == 0); } }