3 require_once('ModuleInstall/ModuleInstaller.php');
5 class Bug41829Test extends Sugar_PHPUnit_Framework_TestCase
7 protected $module_installer;
10 public function setUp()
12 $GLOBALS['current_user'] = SugarTestUserUtilities::createAnonymousUser();
13 $this->module_installer = new ModuleInstaller();
14 $this->module_installer->silent = true;
15 $this->module_installer->base_dir = '';
16 $this->module_installer->id_name = 'Bug41829Test';
17 $this->module_installer->installdefs['dcaction'] = array(
19 'from' => '<basepath>/dcaction_file.php',
22 $this->log = $GLOBALS['log'];
23 $GLOBALS['log'] = new SugarMockLogger();
26 public function tearDown()
28 SugarTestUserUtilities::removeAllCreatedAnonymousUsers();
29 unset($GLOBALS['current_user']);
30 $GLOBALS['log'] = $this->log;
33 public function testWarningOnUninstallDCActions()
35 $this->module_installer->uninstall_dcactions();
37 $this->assertTrue(in_array('DEBUG: Uninstalling DCActions ...' . str_replace('<basepath>', $this->module_installer->base_dir, $this->module_installer->installdefs['dcaction'][0]['from']), $GLOBALS['log']->messages));