/** * @ticket 43080 */ public function testSearchGrabsMore() { $app_strings = return_application_language($GLOBALS['current_language']); $this->assertTrue(array_key_exists('LBL_SEARCH_MORE', $app_strings)); $langpack = new SugarTestLangPackCreator(); $langpack->setAppString('LBL_SEARCH_MORE', 'XXmoreXX'); $langpack->save(); $result = array('Foo' => array('data' => array(array('ID' => '1', 'NAME' => 'recordname')), 'pageData' => array('offsets' => array('total' => 100, 'next' => 0), 'bean' => array('moduleDir' => 'Foo')))); $sugarSpot = $this->getMock('SugarSpot', array('_performSearch')); $sugarSpot->expects($this->any())->method('_performSearch')->will($this->returnValue($result)); $returnValue = $sugarSpot->searchAndDisplay('', ''); $this->assertNotContains('(99 more)', $returnValue); $this->assertContains('(99 XXmoreXX)', $returnValue); }
public function testUndoStringsChangesMade() { $langpack = new SugarTestLangPackCreator(); $app_strings = return_application_language($GLOBALS['current_language']); $prevString = $app_strings['NTC_WELCOME']; $langpack->setAppString('NTC_WELCOME', 'stringname'); $langpack->save(); $app_strings = return_application_language($GLOBALS['current_language']); $this->assertEquals($app_strings['NTC_WELCOME'], 'stringname'); // call the destructor directly to undo our changes unset($langpack); $app_strings = return_application_language($GLOBALS['current_language']); $this->assertEquals($app_strings['NTC_WELCOME'], $prevString); }