public function testdisplay()
 {
     error_reporting(E_ERROR | E_PARSE);
     //execute the method with required child objects and parameters preset. it will return some html.
     $view = new ViewQuickcreate();
     $_REQUEST['module'] = 'Accounts';
     $view->bean = new Account();
     ob_start();
     $view->display();
     $renderedContent = ob_get_contents();
     ob_end_clean();
     $this->assertGreaterThan(0, strlen($renderedContent));
     $this->assertEquals(false, json_decode($renderedContent));
     //check that it doesn't return json.
 }
 public function preDisplay()
 {
     parent::preDisplay();
     if ($this->_isDCForm) {
         //XXX TODO 20110329 Frank Steegmans: Hack to make quick create fields populate when used through the DC menu
         //          NOTE HOWEVER that sqs_objects form fields are not properly populated because of some other hacks
         //          resulting in none of the fields properly populating when selecting an account
         if (!empty($this->bean->phone_office)) {
             $_REQUEST['phone_work'] = $this->bean->phone_office;
         }
         if (!empty($this->bean->billing_address_street)) {
             $_REQUEST['primary_address_street'] = $this->bean->billing_address_street;
         }
         if (!empty($this->bean->billing_address_city)) {
             $_REQUEST['primary_address_city'] = $this->bean->billing_address_city;
         }
         if (!empty($this->bean->billing_address_state)) {
             $_REQUEST['primary_address_state'] = $this->bean->billing_address_state;
         }
         if (!empty($this->bean->billing_address_country)) {
             $_REQUEST['primary_address_country'] = $this->bean->billing_address_country;
         }
         if (!empty($this->bean->billing_address_postalcode)) {
             $_REQUEST['primary_address_postalcode'] = $this->bean->billing_address_postalcode;
         }
     }
 }