2 require_once 'include/SearchForm/SugarSpot.php';
4 class SugarSpotTest extends Sugar_PHPUnit_Framework_TestCase
6 public function setUp()
8 $GLOBALS['app_strings'] = return_application_language($GLOBALS['current_language']);
11 public function tearDown()
13 unset($GLOBALS['app_strings']);
19 public function testSearchGrabsModuleDisplayName()
21 $langpack = new SugarTestLangPackCreator();
22 $langpack->setAppListString('moduleList',array('Foo'=>'Bar'));
30 'NAME' => 'recordname',
45 $sugarSpot = $this->getMock('SugarSpot', array('_performSearch'));
46 $sugarSpot->expects($this->any())
47 ->method('_performSearch')
48 ->will($this->returnValue($result));
50 $returnValue = $sugarSpot->searchAndDisplay('','');
52 $this->assertNotContains('<div id="SpotResults"><div>Foo </div>',$returnValue);
53 $this->assertContains('<div id="SpotResults"><div>Bar </div>',$returnValue);