seed = new Opportunity(); $this->module = 'Opportunities'; $this->action = 'index'; $this->normalAppListStringsOfSalesStageDom = $GLOBALS['app_list_strings']['sales_stage_dom']; $GLOBALS['app_list_strings']['sales_stage_dom'] = array( '' => '', '00' => '0-zero', '10' => '10-ten', '100' => '100-hundred' ); } protected function tearDown() { $GLOBALS['app_list_strings']['sales_stage_dom'] = $this->normalAppListStringsOfSalesStageDom; SugarTestHelper::tearDown(); } /** * Test that indexes of the sales stage field options has not been changed. * @group bug54929 */ public function testIntegerIndexesOfMultiSelectFieldOptionsOnTheAdvancedSearch() { $searchMetaData = SearchForm::retrieveSearchDefs($this->module); $this->searchForm = new SearchForm($this->seed, $this->module, $this->action); $this->searchForm->setup( $searchMetaData['searchdefs'], $searchMetaData['searchFields'], 'SearchFormGeneric.tpl', 'advanced_search', array() ); $result = $this->searchForm->fieldDefs['sales_stage_advanced']['options']; $this->assertArrayHasKey('', $result); $this->assertArrayHasKey('00', $result); $this->assertArrayHasKey(10, $result); $this->assertArrayHasKey(100, $result); $this->assertEquals(4, count($result)); } }