3 require_once('include/generic/SugarWidgets/SugarWidgetSubPanelTopButtonQuickCreate.php');
4 require_once('include/SubPanel/SubPanel.php');
5 require_once('include/SubPanel/SubPanelDefinitions.php');
7 class Bug44272Test extends PHPUnit_Framework_TestCase
12 public function setUp()
16 require('include/modules.php');
17 $GLOBALS['beanList'] = $beanList;
18 $GLOBALS['beanFiles'] = $beanFiles;
20 $this->account = SugarTestAccountUtilities::createAccount();
23 public function tearDown()
25 SugarTestAccountUtilities::removeAllCreatedAccounts();
28 public function testSugarWidgetSubpanelTopButtonQuickCreate()
31 $defines['focus'] = $this->account;
32 $defines['module'] = 'Accounts';
33 $defines['action'] = 'DetailView';
35 $subpanel_definitions = new SubPanelDefinitions(new Contact());
36 $contactSubpanelDef = $subpanel_definitions->load_subpanel('contacts');
38 $subpanel = new SubPanel('Accounts', $this->account->id, 'contacts', $contactSubpanelDef, 'Accounts');
39 $defines['subpanel_definition'] = $subpanel->subpanel_defs;
41 $button = new SugarWidgetSubPanelTopButtonQuickCreate();
42 $code = $button->_get_form($defines);
43 $this->assertRegExp('/\<input[^\>]*?name=\"return_name\"/', $code, "Assert that the hidden input field return_name was created");