$aErrors = $oUpgrader->getErrors(); if (count($aErrors) > 0) { ?> <div class='errormessage'><img class='errormessage' src='<?php echo OX::assetPath(); ?> /images/errormessage.gif' width='16' height='16' border='0' align='absmiddle'> <?php foreach ($aErrors as $k => $err) { echo $err . '<br />'; } ?> </div> <?php } $aMessages = $oUpgrader->getMessages(); if (count($aMessages) > 0) { ?> <div class='errormessage' style='background-color: #eee;'><img class='errormessage' src='<?php echo OX::assetPath(); ?> /images/info.gif' width='16' height='16' border='0' align='absmiddle'> <?php foreach ($aMessages as $k => $msg) { echo $msg . '<br />'; } ?> </div> <?php } /*-------------------------------------------------------*/
function testCanUpgradeOrInstall() { // run once upgrade or install $oUpgrade = new OA_Upgrade(); $firstResult = $oUpgrade->canUpgradeOrInstall(); $existing_installation_status = $oUpgrade->existing_installation_status; $aPackageList = $oUpgrade->aPackageList; $aMessages = $oUpgrade->getMessages(); $oUpgrade->oLogger->logClear(); $oUpgrade->aPackageList = array(); $oUpgrade->existing_installation_status = 235234; // run another one and check values $this->assertEqual($oUpgrade->canUpgradeOrInstall(), $firstResult); $this->assertEqual($oUpgrade->existing_installation_status, $existing_installation_status); $this->assertEqual($oUpgrade->aPackageList, $aPackageList); $this->assertEqual($oUpgrade->getMessages(), $aMessages); }