array (
'form' => array('buttons' => array ('SAVE', 'CANCEL'),
'hidden' => array ('HiddenPlaceHolder',
),
),
'maxColumns' => '2',
'useTabs' => true,
'widths' => array( array ('label' => '10', 'field' => '30'),
array ('label' => '10', 'field' => '30'),
),
'javascript' => array( array ('file' => 'custom/modules/Leads/javascript/LeadJS1.js'),
array ('file' => 'custom/modules/Leads/javascript/LeadJS2.js'),
),
),
'panels' => array ('default' => array (0 => array (0 => array ('name' => 'first_name',
),
1 => array ('name' => 'last_name',
),
),
1 => array (0 => array ('name' => 'unknown_field',
'customCode' => 'Unknown Field Link',
),
),
),
),
);
?>
EOQ;
fputs( $fh, $string);
fclose( $fh );
}
}
public function tearDown()
{
if ( is_dir("cache/modules/Leads") )
rmdir_recursive("cache/modules/Leads");
if (file_exists("custom/modules/Leads/metadata/editviewdefs.php"))
unlink("custom/modules/Leads/metadata/editviewdefs.php");
SugarTestUserUtilities::removeAllCreatedAnonymousUsers();
unset($GLOBALS['app_list_strings']);
unset($GLOBALS['current_user']);
unset($_SERVER['REQUEST_METHOD']);
}
/**
* @group bug44831
*/
public function testJSInjection()
{
$this->markTestIncomplete('Marked as skipped for now... too problematic');
return;
require_once('include/utils/layout_utils.php');
$_SERVER['REQUEST_METHOD'] = "POST";
$lead = SugarTestLeadUtilities::createLead();
$lead->name = 'LeadName';
$lead->save();
$_REQUEST['module'] = 'Leads';
$_REQUEST['action'] = 'EditView';
$_REQUEST['record'] = $lead->id;
require_once('include/MVC/Controller/ControllerFactory.php');
require_once('include/MVC/View/ViewFactory.php');
$GLOBALS['app']->controller = ControllerFactory::getController($_REQUEST['module']);
//ob_start();
$GLOBALS['app']->controller->execute();
//$tStr = ob_get_clean();
// First of all, need to be sure that I'm actually dealing with my new custom DetailView Layout
$this->expectOutputRegex('/.*HiddenPlaceHolder.*/');
// Then check inclusion of LeadJS1.js
$this->expectOutputRegex('/.*