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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user