account = SugarTestAccountUtilities::createAccount(); } public function tearDown() { SugarTestAccountUtilities::removeAllCreatedAccounts(); } public function testSugarWidgetSubpanelTopButtonQuickCreate() { $defines = array(); $defines['focus'] = $this->account; $defines['module'] = 'Accounts'; $defines['action'] = 'DetailView'; $subpanel_definitions = new SubPanelDefinitions(new Contact()); $contactSubpanelDef = $subpanel_definitions->load_subpanel('contacts'); $subpanel = new SubPanel('Accounts', $this->account->id, 'contacts', $contactSubpanelDef, 'Accounts'); $defines['subpanel_definition'] = $subpanel->subpanel_defs; $button = new SugarWidgetSubPanelTopButtonQuickCreate(); $code = $button->_get_form($defines); $this->assertRegExp('/\]*?name=\"return_name\"/', $code, "Assert that the hidden input field return_name was created"); } }