/**
  * @dataProvider providerStripColonSting
  * @ticket 41983
  */
 public function testStripColonString($string, $returnedString)
 {
     $langpack = new SugarTestLangPackCreator();
     $langpack->setModString('LBL_TEST_JS_ESCAPED_STRING', $string, 'Contacts');
     $langpack->save();
     $smarty = new Sugar_Smarty();
     $this->assertEquals($returnedString, smarty_function_sugar_translate(array('label' => 'LBL_TEST_JS_ESCAPED_STRING', 'module' => 'Contacts', 'trimColon' => false), $smarty));
 }
 public function testSetAnyLanguageStrings()
 {
     $langpack = new SugarTestLangPackCreator();
     $langpack->setAppString('NTC_WELCOME', 'stringname');
     $langpack->setAppListString('checkbox_dom', array('' => '', '1' => 'Yep', '2' => 'Nada'));
     $langpack->setModString('LBL_MODULE_NAME', 'stringname', 'Contacts');
     $langpack->save();
     $app_strings = return_application_language($GLOBALS['current_language']);
     $app_list_strings = return_app_list_strings_language($GLOBALS['current_language']);
     $mod_strings = return_module_language($GLOBALS['current_language'], 'Contacts');
     $this->assertEquals($app_strings['NTC_WELCOME'], 'stringname');
     $this->assertEquals($app_list_strings['checkbox_dom'], array('' => '', '1' => 'Yep', '2' => 'Nada'));
     $this->assertEquals($mod_strings['LBL_MODULE_NAME'], 'stringname');
 }
Exemple #3
0
 /**
  * @group bug40999
  * Check if empty status is handled correctly
  */
 public function testCallEmptyStatusLangConfig()
 {
     $this->markTestIncomplete("This test is failing on Jenkins only.  Disabling for now");
     $langpack = new SugarTestLangPackCreator();
     $langpack->setModString('LBL_DEFAULT_STATUS', 'FAILED!', 'Calls');
     $langpack->save();
     $GLOBALS['mod_strings'] = return_module_language($GLOBALS['current_language'], 'Calls');
     $call = new Call();
     $call->field_defs['status']['default'] = 'My Call';
     $call = new Call();
     $this->callid = $call->id = create_guid();
     $call->new_with_id = 1;
     $call->save();
     // then retrieve
     $call = new Call();
     $call->retrieve($this->callid);
     $this->assertEquals('My Call', $call->status);
 }