No longer need to manually restore GLOBALS

This commit is contained in:
Madhura Jayaratne 2013-06-11 18:34:47 +05:30
parent 19de1a197b
commit 0f4e573b1e
2 changed files with 0 additions and 12 deletions

View File

@ -56,7 +56,6 @@ class Node_Column_Test extends PHPUnit_Framework_TestCase
$dbNode->addChild($tableNode);
$colNode = PMA_NodeFactory::getInstance('Node_Column', 'colName', Node::OBJECT);
$tableNode->addChild($colNode);
$origDbi = $GLOBALS['dbi'];
$dbi = $this->getMockBuilder('PMA_DatabaseInterface')
->disableOriginalConstructor()
@ -66,8 +65,6 @@ class Node_Column_Test extends PHPUnit_Framework_TestCase
->with($query);
$GLOBALS['dbi'] = $dbi;
$colNode->getComment();
$GLOBALS['dbi'] = $origDbi;
}
}
?>

View File

@ -306,7 +306,6 @@ class Node_Test extends PHPUnit_Framework_TestCase
// It would have been better to mock _getWhereClause method
// but stangely, mocking private methods is not supported in PHPUnit
$node = PMA_NodeFactory::getInstance();
$origDbi = $GLOBALS['dbi'];
$dbi = $this->getMockBuilder('PMA_DatabaseInterface')
->disableOriginalConstructor()
@ -316,8 +315,6 @@ class Node_Test extends PHPUnit_Framework_TestCase
->with($expectedSql);
$GLOBALS['dbi'] = $dbi;
$node->getData('', $pos);
$GLOBALS['dbi'] = $origDbi;
}
/**
@ -346,7 +343,6 @@ class Node_Test extends PHPUnit_Framework_TestCase
// It would have been better to mock _getWhereClause method
// but stangely, mocking private methods is not supported in PHPUnit
$node = PMA_NodeFactory::getInstance();
$origDbi = $GLOBALS['dbi'];
$dbi = $this->getMockBuilder('PMA_DatabaseInterface')
->disableOriginalConstructor()
@ -356,8 +352,6 @@ class Node_Test extends PHPUnit_Framework_TestCase
->with($query);
$GLOBALS['dbi'] = $dbi;
$node->getPresence();
$GLOBALS['dbi'] = $origDbi;
}
/**
@ -380,7 +374,6 @@ class Node_Test extends PHPUnit_Framework_TestCase
$GLOBALS['cfg']['Servers'][0]['DisableIS'] = true;
$node = PMA_NodeFactory::getInstance();
$origDbi = $GLOBALS['dbi'];
// test with no search clause
$dbi = $this->getMockBuilder('PMA_DatabaseInterface')
@ -401,8 +394,6 @@ class Node_Test extends PHPUnit_Framework_TestCase
->with("SHOW DATABASES LIKE '%dbname%' ");
$GLOBALS['dbi'] = $dbi;
$node->getPresence('', 'dbname');
$GLOBALS['dbi'] = $origDbi;
}
public function testComment()