2 require_once 'include/MassUpdate.php';
3 require_once 'include/dir_inc.php';
5 class Bug43468Test extends Sugar_PHPUnit_Framework_TestCase
7 public function setUp()
9 $GLOBALS['current_user'] = SugarTestUserUtilities::createAnonymousUser();
10 $GLOBALS['current_user']->setPreference('datef', "Y/m/d");
11 $GLOBALS['app_strings'] = return_application_language($GLOBALS['current_language']);
14 public function tearDown()
16 SugarTestUserUtilities::removeAllCreatedAnonymousUsers();
17 unset($GLOBALS['current_user']);
18 unset($GLOBALS['app_strings']);
21 public function testGetMassUpdateForm()
23 global $current_user, $timedate;
24 $expected_dateformat = $timedate->get_cal_date_format();
26 $_REQUEST['module'] = 'Calls';
27 $mass = new MassUpdate();
29 $call->fieldDefs['date_start']['massupdate'] = true;
30 $mass->setSugarBean($call);
31 $form_results = $mass->getMassUpdateForm();
33 if(preg_match('/daFormat\s+?\:\s+\"(.*?)\"/', $form_results, $matches))
35 $this->assertEquals($expected_dateformat, $matches[1], 'Assert that the daFormat set in Calendar widget is %Y/%m/%d');
38 $this->assertEquals($found_match, true, 'Assert that the daFormat value was set');