RestTestCase::setUp PHP Méthode

setUp() public méthode

public setUp ( )
    public function setUp()
    {
        $this->client = new Client(Yii::app()->params['rest_test_base_url'], array(Client::REQUEST_OPTIONS => array('auth' => array('api', 'password'), 'headers' => array('Accept' => 'application/xml'))));
        parent::setUp();
    }

Usage Example

Exemple #1
0
 public function setUp()
 {
     parent::setUp();
     //If somehow this package already exists copy it
     if (file_exists('custom/modules/' . $this->package)) {
         $this->packageExists = true;
         mkdir_recursive('custom/modules/' . $this->package . '_bak');
         copy_recursive('custom/modules/' . $this->package, 'custom/modules/' . $this->package . '_bak');
     }
     //Make the custom package directory and simulate copying the file in
     mkdir_recursive('custom/modules/' . $this->package . '/Ext/WirelessLayoutdefs');
     $theArray = array($this->package => array('subpanel_setup' => array($this->package . '_accounts' => array('order' => 100, 'module' => 'Contacts', 'subpanel_name' => 'default', 'title_key' => 'LBL_BUG48784TEST', 'get_subpanel_data' => 'Bug48748Test'))));
     $theFile = 'custom/modules/' . $this->package . '/Ext/WirelessLayoutdefs/wireless.subpaneldefs.ext.php';
     write_array_to_file('layout_defs', $theArray, $theFile);
     sugar_chmod('custom/modules/' . $this->package . '/Ext/WirelessLayoutdefs/wireless.subpaneldefs.ext.php', 0655);
     global $beanList, $beanFiles, $current_user;
     //$beanList['Contacts'] = 'Contact';
     //$beanFiles['Bug48784Mock'] = 'modules/Contacts/Contact.php';
     //Create an anonymous user for login purposes/
     $current_user = SugarTestUserUtilities::createAnonymousUser();
     $current_user->status = 'Active';
     $current_user->is_admin = 1;
     $current_user->save();
     $GLOBALS['db']->commit();
     // Making sure we commit any changes before continuing
     $_SESSION['avail_modules'][$this->package] = 'write';
 }
All Usage Examples Of RestTestCase::setUp