Unit test cleanups. Fixes tests so they don't leave left over entries in the database. Add a

check to ensure that row counts in most tables are unchanged from the start and end of the
tests. Refactor some code.
This commit is contained in:
Chris Morgan
2007-07-26 03:47:34 +00:00
committed by WineHQ
parent 0b979fee68
commit 19f6cbc156
16 changed files with 505 additions and 244 deletions

View File

@@ -231,6 +231,8 @@ class Application {
*/
function delete($bSilent=false)
{
$bSuccess = true;
/* make sure the current user has the appropriate permission to delete
this application */
if(!$_SESSION['current']->canDeleteApplication($this))
@@ -246,10 +248,10 @@ class Application {
{
$iVersionId = $oRow->versionId;
$oVersion = new Version($iVersionId);
$oVersion->delete($bSilent);
if(!$oVersion->delete($bSilent))
$bSuccess = false; // return false, deleting the version failed
}
/* fetch urlsIds */
$aUrlsIds = array();
$sQuery = "SELECT id
@@ -289,7 +291,7 @@ class Application {
if(!$bSilent)
$this->SendNotificationMail("delete");
return true;
return $bSuccess;
}