function test_dropdown_fixed()
 {
     require_once 'modules/UpgradeWizard/uw_utils.php';
     fix_dropdown_list();
     //Check to make sure we don't have the buggy format where '$GLOBALS["app_list_strings"] = array (...' was declared
     $contents = file_get_contents('custom/include/language/en_us.lang.php');
     //$this->assertFalse(preg_match('/\$GLOBALS\[\s*[\"|\']app_list_strings[\"|\']\s*\]\s+=\s+array\s+\(/', $contents));
     unset($GLOBALS['app_list_strings']);
     require 'custom/include/language/en_us.lang.php';
     $this->assertEquals(count($GLOBALS['app_list_strings']), 2);
     $this->assertTrue(isset($GLOBALS['app_list_strings']['moduleList']['my_personal_module']));
     $this->assertEquals($GLOBALS['app_list_strings']['moduleList']['Accounts'], 'Accounts Module');
     $this->assertEquals(count($GLOBALS['app_strings']), 1);
     $this->assertEquals($GLOBALS['app_strings']['LBL_TEST'], 'This is a test');
 }
示例#2
0
 public function test_dropdown_fixed()
 {
     require_once 'modules/UpgradeWizard/uw_utils.php';
     fix_dropdown_list();
     //Check to make sure we don't have the buggy format where '$GLOBALS["app_list_strings"] = array (...' was declared
     $contents = file_get_contents('custom/include/language/en_us.lang.php');
     unset($GLOBALS['app_list_strings']);
     require 'custom/include/language/en_us.lang.php';
     $this->assertTrue(isset($GLOBALS['app_list_strings']['this_would_have_been_missed_']), "Assert that 'this would have been missed! key was fixed");
     preg_match_all('/a_test_that_is_okay/', $contents, $matches);
     $this->assertEquals(count($matches[0]), 1, "Assert that a_test_is_okay entry exists");
     $this->assertEquals(count($GLOBALS['app_list_strings']['a_test_that_is_okay']), 3, "Assert that a_test_that_is_okay has 3 items");
     preg_match_all('/b_test__/', $contents, $matches);
     $this->assertEquals(count($matches[0]), 2, "Assert that b_test__ is declared twice");
     $this->assertEquals(count($GLOBALS['app_list_strings']['b_test__']), 4, "Assert that b_test__ is additive and has 4 entries");
     preg_match_all('/c_test__/', $contents, $matches);
     $this->assertEquals(count($matches[0]), 2, "Assert that c_test__ is declared twice");
     $this->assertEquals(count($GLOBALS['app_list_strings']['c_test__']), 5, "Assert that c_test__ is additive and contains 5 entries");
 }
示例#3
0
 function test_dropdown_fixed()
 {
     require_once 'modules/UpgradeWizard/uw_utils.php';
     fix_dropdown_list();
     //Check to make sure we don't have the buggy format where '$GLOBALS["app_list_strings"] = array (...' was declared
     $contents = file_get_contents('custom/include/language/en_us.lang.php');
     unset($GLOBALS['app_list_strings']);
     require 'custom/include/language/en_us.lang.php';
     $this->assertTrue(isset($GLOBALS['app_list_strings']['this_would_have_been_missed_']));
     preg_match_all('/a_test_that_is_okay/', $contents, $matches);
     $this->assertEquals(count($matches[0]), 1);
     $this->assertEquals(count($GLOBALS['app_list_strings']['a_test_that_is_okay']), 3);
     preg_match_all('/b_test__/', $contents, $matches);
     $this->assertEquals(count($matches[0]), 2);
     $this->assertEquals(count($GLOBALS['app_list_strings']['b_test__']), 4);
     preg_match_all('/c_test__/', $contents, $matches);
     $this->assertEquals(count($matches[0]), 2);
     $this->assertEquals(count($GLOBALS['app_list_strings']['c_test__']), 5);
 }
示例#4
0
         if (isset($_REQUEST['silent']) && $_REQUEST['silent'] != true) {
             $_REQUEST['silent'] = true;
         }
     }
     if ($origVersion < '550') {
         include "install/seed_data/Advanced_Password_SeedData.php";
     }
     logThis('Start rebuild relationships.', $path);
     @rebuildRelations();
     logThis('End rebuild relationships.', $path);
     //logThis('Checking for leads_assigned_user relationship and if not found then create.', $path);
     @createMissingRels();
     //logThis('Checked for leads_assigned_user relationship.', $path);
     ob_end_clean();
     //// run fix on dropdown lists that may have been incorrectly named
     fix_dropdown_list();
 }
 set_upgrade_progress('end', 'in_progress', 'end', 'in_progress');
 /////////////////////////Old Logger settings///////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////
 if (function_exists('deleteCache')) {
     set_upgrade_progress('end', 'in_progress', 'deleteCache', 'in_progress');
     @deleteCache();
     set_upgrade_progress('end', 'in_progress', 'deleteCache', 'done');
 }
 ///////////////////////////////////////////////////////////////////////////////
 ////	TAKE OUT TRASH
 if (empty($errors)) {
     set_upgrade_progress('end', 'in_progress', 'unlinkingfiles', 'in_progress');
     logThis('Taking out the trash, unlinking temp files.', $path);
     unlinkTempFiles(true);
 public function testDropdownFixed()
 {
     require_once 'modules/UpgradeWizard/uw_utils.php';
     fix_dropdown_list();
     unset($GLOBALS['app_list_strings']);
     require 'custom/include/language/en_us.lang.php';
     $this->assertEquals(count($GLOBALS['app_list_strings']), 2);
     $this->assertArrayHasKey('my_personal_module', $GLOBALS['app_list_strings']['moduleList']);
     $this->assertEquals($GLOBALS['app_list_strings']['moduleList']['Accounts'], 'Accounts Module');
     $this->assertEquals(count($GLOBALS['app_strings']), 1);
     $this->assertEquals($GLOBALS['app_strings']['LBL_TEST'], 'This is a test');
 }