Commits

Hisateru Tanaka committed 16bfa2e Merge

Merge

Comments (0)

Files changed (12)

 8a690dd17d3a7c97598048a530aab0ce71b3d7b0 stable
 97338b665062565b54c83a7dbd13ae2cb60d5d05 unstable
 8a690dd17d3a7c97598048a530aab0ce71b3d7b0 unstable
+8a690dd17d3a7c97598048a530aab0ce71b3d7b0 stable
+5404ca7daeb23c2f0a905f20431dabebf1209269 stable
+8a690dd17d3a7c97598048a530aab0ce71b3d7b0 unstable
+5404ca7daeb23c2f0a905f20431dabebf1209269 unstable

app/protected/config/common.php

             'clientScript' => array(
                 'class' => 'ClientScript',
             ),
-            'cache' => array(
-                'class' => 'CMemCache',
-                'servers' => $memcacheServers,
-            ),
             'currencyHelper' => array(
                 'class' => 'application.modules.zurmo.components.ZurmoCurrencyHelper',
                 'baseCode' => 'USD',
             'application.extensions.zurmoinc.framework.exceptions.NotFoundException',
             'application.modules.api.tests.unit.models.*',
             'application.modules.api.tests.unit.forms.*',
+            'application.modules.install.serviceHelpers.MemcacheServiceHelper',
+            'application.modules.install.serviceHelpers.ServiceHelper',
+            'application.modules.install.utils.InstallUtil',
         ),
 
         'modules' => array(
         'params' => array(
             'redBeanVersion'    => '1.3',
             'yiiVersion'        => '1.1.10',
+            'memcacheServers'   => $memcacheServers,
             'supportedLanguages' => array(
                 'en' => 'English',
                 'es' => 'Spanish',

app/protected/modules/api/tests/unit/RedBeanModelToApiDataUtilTest.php

                 'currencyValue'     => null,
                 'dropDown'          => null,
                 'radioDropDown'     => null,
+                'multiDropDown'     => array('values' => array('Multi 1', 'Multi 3')),
+                'tagCloud'          => array('values' => array('Cloud 2', 'Cloud 3')),
                 'hasOne'            => null,
                 'hasOneAlso'        => null,
                 'primaryEmail'      => null,
                     'id'       => $super->id,
                     'username' => 'super'
                 ),
-                'multiDropDown'    => array('values' => array('Multi 1', 'Multi 3')),
-                'tagCloud'         => array('values' => array('Cloud 2', 'Cloud 3')),
             );
+            
+            print_r($compareData);
+            echo "\n\n\n";
+            print_r($data);
             $this->assertEquals($compareData, $data);
         }
 

app/protected/modules/home/HomeModule.php

                     }
                     $menuItems[] = array(
                         'label' => $dashboard['name'],
-                        'url'   => array('/home/default/dashboardDetails&id=' . $dashboard['id']),
+                        'url'   => array('/home/default/dashboardDetails?id=' . $dashboard['id']),
                         'right' => self::RIGHT_ACCESS_DASHBOARDS
                     );
                 }

app/protected/modules/install/serviceHelpers/MemcacheServiceHelper.php

                     {
                         $this->checkResultedInWarning = true;
                         $this->message  = $displayLabel . ' ' .
-                        Yii::t('Default', 'is installed, but the version is unknown.');
+                        Yii::t('Default', 'extension is installed, but the version is unknown.');
                         return true;
                     }
                 }
                 else
                 {
-                    $this->message  = $displayLabel . ' ' . Yii::t('Default', 'is not installed');
+                    $this->message  = $displayLabel . ' ' . Yii::t('Default', 'extension is not installed.');
                 }
                 if ($this->message != null)
                 {
                     $this->message .= "\n";
                 }
-                $this->message .= Yii::t('Default', 'Minimum version required:') . ' ' . $minimumVersionLabel;
+                $this->message .= Yii::t('Default', 'Minimum version required:') . ' ' . $minimumVersionLabel . '.';
                 return false;
             }
         }

app/protected/modules/maps/tests/unit/AddressGeoCodeTest.php

-<?php
    /*********************************************************************************
     * Zurmo is a customer relationship management program developed by
     * Zurmo, Inc. Copyright (C) 2012 Zurmo Inc.
     *
     * Zurmo is free software; you can redistribute it and/or modify it under
     * the terms of the GNU General Public License version 3 as published by the
     * Free Software Foundation with the addition of the following permission added
     * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
     * IN WHICH THE COPYRIGHT IS OWNED BY ZURMO, ZURMO DISCLAIMS THE WARRANTY
     * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
     *
     * Zurmo is distributed in the hope that it will be useful, but WITHOUT
     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
     * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
     * details.
     *
     * You should have received a copy of the GNU General Public License along with
     * this program; if not, see http://www.gnu.org/licenses or write to the Free
     * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
     * 02110-1301 USA.
     *
     * You can contact Zurmo, Inc. with a mailing address at 113 McHenry Road Suite 207, 
     * Buffalo Grove, IL 60089, USA. or at email address contact@zurmo.com.
     ********************************************************************************/
    class AddressGeoCodeTest extends BaseTest
    {
        public static function setUpBeforeClass()
        {
            parent::setUpBeforeClass();
            $super = SecurityTestHelper::createSuperAdmin();
            if (Yii::app()->params['testGoogleGeoCodeApiKey'] != null)
            {
                ZurmoConfigurationUtil::setByModuleName('MapsModule', 
                                                        'googleMapApiKey', 
                                                        Yii::app()->params['testGoogleGeoCodeApiKey']);
            }
            Yii::app()->user->userModel = $super;
            AddressGeoCodeTestHelper::createAndRemoveAccountWithAddress($super);
        }
        public function testAddressFetchLatitudeAndLongitude()
        {
            $super = User::getByUsername('super');
            Yii::app()->user->userModel = $super;
            $address = array();
            $address['street1']    = '123 Knob Street';
            $address['street2']    = 'Apartment 4b';
            $address['city']       = 'Chicago';
            $address['state']      = 'Illinois';
            $address['postalCode'] = '60606';
            $address['country']    = 'USA';
            $account1              = AddressGeoCodeTestHelper::createTestAccountsWithBillingAddressAndGetAccount($address, $super);
            $accountId1            = $account1->id;
            unset($account1);
            $address = array();
            $address['street1']    = '18367 South Oak Creek';
            $address['street2']    = '';
            $address['city']       = 'San Jose';
            $address['state']      = 'California';
            $address['postalCode'] = '95131';
            $address['country']    = 'USA';
            $account2              = AddressGeoCodeTestHelper::createTestAccountsWithBillingAddressAndGetAccount($address, $super);
            $accountId2            = $account2->id;
            unset($account2);
            $address = array();
            $address['street1']    = '36826 East Oak Road';
            $address['street2']    = '';
            $address['city']       = 'New York';
            $address['state']      = 'NY';
            $address['postalCode'] = '10001';
            $address['country']    = 'USA';
            $account3              = AddressGeoCodeTestHelper::createTestAccountsWithBillingAddressAndGetAccount($address, $super);
            $accountId3            = $account3->id;
            unset($account3);
            $address = array();
            $address['street1']    = '24948 West Thomas Trail';
            $address['street2']    = '';
            $address['city']       = 'Milwaukee';
            $address['state']      = 'WI';
            $address['postalCode'] = '53219';
            $address['country']    = '';
            $account4              = AddressGeoCodeTestHelper::createTestAccountsWithBillingAddressAndGetAccount($address, $super);
            $accountId4            = $account4->id;
            unset($account4);
            //Check lat/long and invalid values after address creation.
            $account1 = Account::getById($accountId1);
            $this->assertEquals(null, $account1->billingAddress->latitude);
            $this->assertEquals(null, $account1->billingAddress->longitude);
            $this->assertEquals(0,    $account1->billingAddress->invalid);
            unset($account1);
            AddressMappingUtil::updateChangedAddresses(2);
            $account1 = Account::getById($accountId1);
            $this->assertEquals('42.1153153',  $account1->billingAddress->latitude);
            $this->assertEquals('-87.9763703', $account1->billingAddress->longitude);
            $this->assertEquals(0,             $account1->billingAddress->invalid);
            unset($account1);
            $account2 = Account::getById($accountId2);
            $this->assertEquals('37.38926',    $account2->billingAddress->latitude);
            $this->assertEquals('-121.873247', $account2->billingAddress->longitude);
            $this->assertEquals(0,             $account2->billingAddress->invalid);
            unset($account2);
            $account3 = Account::getById($accountId3);
            $this->assertEquals(null, $account3->billingAddress->latitude);
            $this->assertEquals(null, $account3->billingAddress->longitude);
            $this->assertEquals(0,    $account3->billingAddress->invalid);
            unset($account3);
            $account4 = Account::getById($accountId4);
            $this->assertEquals(null, $account4->billingAddress->latitude);
            $this->assertEquals(null, $account4->billingAddress->longitude);
            $this->assertEquals(0,    $account4->billingAddress->invalid);
            unset($account4);
            AddressMappingUtil::updateChangedAddresses();
            $account3 = Account::getById($accountId3);
            $this->assertEquals('40.7274969',  $account3->billingAddress->latitude);
            $this->assertEquals('-73.9601597', $account3->billingAddress->longitude);
            $this->assertEquals(0,             $account3->billingAddress->invalid);
            unset($account3);
            $account4 = Account::getById($accountId4);
            $this->assertEquals('43.06132',    $account4->billingAddress->latitude);
            $this->assertEquals('-87.8880352', $account4->billingAddress->longitude);
            $this->assertEquals(0,             $account4->billingAddress->invalid);
            unset($account4);
            //Check after Modifying address lat / long set to null and flag to flase.
            $account1 = Account::getById($accountId1);
            $account1->billingAddress->street1    = 'xxxxxx';
            $account1->billingAddress->city       = 'xxxxxx';
            $account1->billingAddress->state      = 'xxxxxx';
            $account1->billingAddress->postalCode = '00000';
            $account1->billingAddress->country    = '';
            $this->assertTrue($account1->save(false));
            unset($account1);
            $account1 = Account::getById($accountId1);
            $this->assertEquals(null, $account1->billingAddress->latitude);
            $this->assertEquals(null, $account1->billingAddress->longitude);
            $this->assertEquals(0,    $account1->billingAddress->invalid);
            unset($account1);
            //Test for Invalid address and set invalid flag to true.
            AddressMappingUtil::updateChangedAddresses();
            $account1 = Account::getById($accountId1);
            $this->assertEquals(null, $account1->billingAddress->latitude);
            $this->assertEquals(null, $account1->billingAddress->longitude);
            $this->assertEquals(1,    $account1->billingAddress->invalid);
            unset($account1);
            $account1 = Account::getById($accountId1);
            $account1->billingAddress->street1    = '123 Knob Street';
            $account1->billingAddress->street2    = 'Apartment 4b';
            $account1->billingAddress->city       = 'Chicago';
            $account1->billingAddress->state      = 'Illinois';
            $account1->billingAddress->postalCode = '60606';
            $account1->billingAddress->country    = 'USA';
            $this->assertTrue($account1->save());
            unset($account1);
            $account1 = Account::getById($accountId1);
            $this->assertEquals(null, $account1->billingAddress->latitude);
            $this->assertEquals(null, $account1->billingAddress->longitude);
            $this->assertEquals(0,    $account1->billingAddress->invalid);
            $accountId1 = $account1->id;
            unset($account1);
            AddressMappingUtil::updateChangedAddresses();
            $account1 = Account::getById($accountId1);
            $this->assertEquals('42.1153153',  $account1->billingAddress->latitude);
            $this->assertEquals('-87.9763703', $account1->billingAddress->longitude);
            $this->assertEquals(0,             $account1->billingAddress->invalid);
        }
    }
+<?php
    /*********************************************************************************
     * Zurmo is a customer relationship management program developed by
     * Zurmo, Inc. Copyright (C) 2012 Zurmo Inc.
     *
     * Zurmo is free software; you can redistribute it and/or modify it under
     * the terms of the GNU General Public License version 3 as published by the
     * Free Software Foundation with the addition of the following permission added
     * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
     * IN WHICH THE COPYRIGHT IS OWNED BY ZURMO, ZURMO DISCLAIMS THE WARRANTY
     * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
     *
     * Zurmo is distributed in the hope that it will be useful, but WITHOUT
     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
     * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
     * details.
     *
     * You should have received a copy of the GNU General Public License along with
     * this program; if not, see http://www.gnu.org/licenses or write to the Free
     * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
     * 02110-1301 USA.
     *
     * You can contact Zurmo, Inc. with a mailing address at 113 McHenry Road Suite 207, 
     * Buffalo Grove, IL 60089, USA. or at email address contact@zurmo.com.
     ********************************************************************************/
    class AddressGeoCodeTest extends BaseTest
    {
        public static function setUpBeforeClass()
        {
            parent::setUpBeforeClass();
            $super = SecurityTestHelper::createSuperAdmin();
            if (Yii::app()->params['testGoogleGeoCodeApiKey'] != null)
            {
                ZurmoConfigurationUtil::setByModuleName('MapsModule', 
                                                        'googleMapApiKey', 
                                                        Yii::app()->params['testGoogleGeoCodeApiKey']);
            }
            Yii::app()->user->userModel = $super;
            AddressGeoCodeTestHelper::createAndRemoveAccountWithAddress($super);
        }
        public function testAddressFetchLatitudeAndLongitude()
        {
            $super = User::getByUsername('super');
            Yii::app()->user->userModel = $super;
            $address = array();
            $address['street1']    = '123 Knob Street';
            $address['street2']    = 'Apartment 4b';
            $address['city']       = 'Chicago';
            $address['state']      = 'Illinois';
            $address['postalCode'] = '60606';
            $address['country']    = 'USA';
            $account1              = AddressGeoCodeTestHelper::createTestAccountsWithBillingAddressAndGetAccount($address, $super);
            $accountId1            = $account1->id;
            unset($account1);
            $address = array();
            $address['street1']    = '18367 South Oak Creek';
            $address['street2']    = '';
            $address['city']       = 'San Jose';
            $address['state']      = 'California';
            $address['postalCode'] = '95131';
            $address['country']    = 'USA';
            $account2              = AddressGeoCodeTestHelper::createTestAccountsWithBillingAddressAndGetAccount($address, $super);
            $accountId2            = $account2->id;
            unset($account2);
            $address = array();
            $address['street1']    = '9570 West Michigan Street';
            $address['street2']    = '';
            $address['city']       = 'New York';
            $address['state']      = 'NY';
            $address['postalCode'] = '10169';
            $address['country']    = 'USA';
            $account3              = AddressGeoCodeTestHelper::createTestAccountsWithBillingAddressAndGetAccount($address, $super);
            $accountId3            = $account3->id;
            unset($account3);
            $address = array();
            $address['street1']    = '24948 West Thomas Trail';
            $address['street2']    = '';
            $address['city']       = 'Milwaukee';
            $address['state']      = 'WI';
            $address['postalCode'] = '53219';
            $address['country']    = '';
            $account4              = AddressGeoCodeTestHelper::createTestAccountsWithBillingAddressAndGetAccount($address, $super);
            $accountId4            = $account4->id;
            unset($account4);
            //Check lat/long and invalid values after address creation.
            $account1 = Account::getById($accountId1);
            $this->assertEquals(null, $account1->billingAddress->latitude);
            $this->assertEquals(null, $account1->billingAddress->longitude);
            $this->assertEquals(0,    $account1->billingAddress->invalid);
            unset($account1);
            AddressMappingUtil::updateChangedAddresses(2);
            $account1 = Account::getById($accountId1);
            $this->assertEquals('42.1153153',  $account1->billingAddress->latitude);
            $this->assertEquals('-87.9763703', $account1->billingAddress->longitude);
            $this->assertEquals(0,             $account1->billingAddress->invalid);
            unset($account1);
            $account2 = Account::getById($accountId2);
            $this->assertEquals('37.38926',    $account2->billingAddress->latitude);
            $this->assertEquals('-121.873247', $account2->billingAddress->longitude);
            $this->assertEquals(0,             $account2->billingAddress->invalid);
            unset($account2);
            $account3 = Account::getById($accountId3);
            $this->assertEquals(null, $account3->billingAddress->latitude);
            $this->assertEquals(null, $account3->billingAddress->longitude);
            $this->assertEquals(0,    $account3->billingAddress->invalid);
            unset($account3);
            $account4 = Account::getById($accountId4);
            $this->assertEquals(null, $account4->billingAddress->latitude);
            $this->assertEquals(null, $account4->billingAddress->longitude);
            $this->assertEquals(0,    $account4->billingAddress->invalid);
            unset($account4);
            AddressMappingUtil::updateChangedAddresses();
            $account3 = Account::getById($accountId3);
            $this->assertEquals('40.722668',  $account3->billingAddress->latitude);
            $this->assertEquals('-73.7196971', $account3->billingAddress->longitude);
            $this->assertEquals(0,             $account3->billingAddress->invalid);
            unset($account3);
            $account4 = Account::getById($accountId4);
            $this->assertEquals('43.06132',    $account4->billingAddress->latitude);
            $this->assertEquals('-87.8880352', $account4->billingAddress->longitude);
            $this->assertEquals(0,             $account4->billingAddress->invalid);
            unset($account4);
            //Check after Modifying address lat / long set to null and flag to flase.
            $account1 = Account::getById($accountId1);
            $account1->billingAddress->street1    = 'xxxxxx';
            $account1->billingAddress->city       = 'xxxxxx';
            $account1->billingAddress->state      = 'xxxxxx';
            $account1->billingAddress->postalCode = '00000';
            $account1->billingAddress->country    = '';
            $this->assertTrue($account1->save(false));
            unset($account1);
            $account1 = Account::getById($accountId1);
            $this->assertEquals(null, $account1->billingAddress->latitude);
            $this->assertEquals(null, $account1->billingAddress->longitude);
            $this->assertEquals(0,    $account1->billingAddress->invalid);
            unset($account1);
            //Test for Invalid address and set invalid flag to true.
            AddressMappingUtil::updateChangedAddresses();
            $account1 = Account::getById($accountId1);
            $this->assertEquals(null, $account1->billingAddress->latitude);
            $this->assertEquals(null, $account1->billingAddress->longitude);
            $this->assertEquals(1,    $account1->billingAddress->invalid);
            unset($account1);
            $account1 = Account::getById($accountId1);
            $account1->billingAddress->street1    = '123 Knob Street';
            $account1->billingAddress->street2    = 'Apartment 4b';
            $account1->billingAddress->city       = 'Chicago';
            $account1->billingAddress->state      = 'Illinois';
            $account1->billingAddress->postalCode = '60606';
            $account1->billingAddress->country    = 'USA';
            $this->assertTrue($account1->save());
            unset($account1);
            $account1 = Account::getById($accountId1);
            $this->assertEquals(null, $account1->billingAddress->latitude);
            $this->assertEquals(null, $account1->billingAddress->longitude);
            $this->assertEquals(0,    $account1->billingAddress->invalid);
            $accountId1 = $account1->id;
            unset($account1);
            AddressMappingUtil::updateChangedAddresses();
            $account1 = Account::getById($accountId1);
            $this->assertEquals('42.1153153',  $account1->billingAddress->latitude);
            $this->assertEquals('-87.9763703', $account1->billingAddress->longitude);
            $this->assertEquals(0,             $account1->billingAddress->invalid);
        }
    }

app/protected/modules/maps/tests/unit/GoogleMappingUtilTest.php

             unset($account2);
 
             $address = array();
-            $address['street1']    = '36826 East Oak Road';
+            $address['street1']    = '9570 West Michigan Street';
             $address['street2']    = '';
             $address['city']       = 'New York';
             $address['state']      = 'NY';
-            $address['postalCode'] = '10001';
+            $address['postalCode'] = '10169';
             $address['country']    = 'USA';
             $account3              = AddressGeoCodeTestHelper::createTestAccountsWithBillingAddressAndGetAccount($address, $super);
             $accountId3            = $account3->id;
             $this->assertEquals('-87.9763703', $geoCodeResultObj1->longitude);
             $this->assertEquals('37.38926',    $geoCodeResultObj2->latitude);
             $this->assertEquals('-121.873247', $geoCodeResultObj2->longitude);
-            $this->assertEquals('40.7274969',  $geoCodeResultObj3->latitude);
-            $this->assertEquals('-73.9601597', $geoCodeResultObj3->longitude);
+            $this->assertEquals('40.722668',  $geoCodeResultObj3->latitude);
+            $this->assertEquals('-73.7196971', $geoCodeResultObj3->longitude);
             $this->assertEquals('43.06132',    $geoCodeResultObj4->latitude);
             $this->assertEquals('-87.8880352', $geoCodeResultObj4->longitude);
         }

app/protected/modules/maps/tests/unit/walkthrough/MapsRegularUserWalkthroughTest.php

             $superAccount = AccountTestHelper::createAccountByNameForOwner('accountOwnedBySuper', $super);
 
             //Create address array for the account owned by super user.
-            $address = array('street1'    => '36826 East Oak Road',
-                             'street2'    => '',
-                             'city'       => 'New York',
-                             'state'      => 'NY',
-                             'postalCode' => '10001',
+            $address = array('street1'    => '123 Knob Street',
+                             'street2'    => 'Apartment 4b',
+                             'city'       => 'Chicago',
+                             'state'      => 'Illinois',
+                             'postalCode' => '60606',
                              'country'    => 'USA'
                        );
 
             $accounts = Account::getByName('accountOwnedBySuper');
             $this->assertEquals(1, count($accounts));
 
-            $this->assertEquals('40.7274969',   $accounts[0]->billingAddress->latitude);
-            $this->assertEquals('-73.9601597', $accounts[0]->billingAddress->longitude);
-            $this->assertEquals(0,              $accounts[0]->billingAddress->invalid);
+            $this->assertEquals('42.1153153',  $accounts[0]->billingAddress->latitude);
+            $this->assertEquals('-87.9763703', $accounts[0]->billingAddress->longitude);
+            $this->assertEquals(0,             $accounts[0]->billingAddress->invalid);
 
             $addressString = $accounts[0]->billingAddress->makeAddress();
             $this->setGetArray(array('addressString' => $addressString,

app/protected/modules/maps/tests/unit/walkthrough/MapsSuperUserWalkthroughTest.php

-<?php
    /*********************************************************************************
     * Zurmo is a customer relationship management program developed by
     * Zurmo, Inc. Copyright (C) 2012 Zurmo Inc.
     *
     * Zurmo is free software; you can redistribute it and/or modify it under
     * the terms of the GNU General Public License version 3 as published by the
     * Free Software Foundation with the addition of the following permission added
     * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
     * IN WHICH THE COPYRIGHT IS OWNED BY ZURMO, ZURMO DISCLAIMS THE WARRANTY
     * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
     *
     * Zurmo is distributed in the hope that it will be useful, but WITHOUT
     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
     * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
     * details.
     *
     * You should have received a copy of the GNU General Public License along with
     * this program; if not, see http://www.gnu.org/licenses or write to the Free
     * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
     * 02110-1301 USA.
     *
     * You can contact Zurmo, Inc. with a mailing address at 113 McHenry Road Suite 207, 
     * Buffalo Grove, IL 60089, USA. or at email address contact@zurmo.com.
     ********************************************************************************/
    /**
     * Maps Module Super User Walkthrough.
     * Walkthrough for the super user of all possible controller actions.
     * Since this is a super user, he should have access to all controller actions
     * without any exceptions being thrown.
     */
    class MapsSuperUserWalkthroughTest extends ZurmoWalkthroughBaseTest
    {
        public static function setUpBeforeClass()
        {
            parent::setUpBeforeClass();
            SecurityTestHelper::createSuperAdmin();
            $super = User::getByUsername('super');
            Yii::app()->user->userModel = $super;
            //Setup test data owned by the super user.
            AccountTestHelper::createAccountByNameForOwner('superAccount', $super);
            AddressGeoCodeTestHelper::createAndRemoveAccountWithAddress($super);
        }
        public function testSuperUserAllDefaultControllerActions()
        {
            $super = $this->logoutCurrentUserLoginNewUserAndGetByUsername('super');
            //Retriving the super account id.
            $superAccountId = self::getModelIdByModelNameAndName ('Account', 'superAccount');
            //Create address array for the super account id.
            $address = array('street1'    => '36826 East Oak Road', 
                             'street2'    => '', 
                             'city'       => 'New York', 
                             'state'      => 'NY', 
                             'postalCode' => '10001', 
                             'country'    => 'USA');
            //Assign Address to the super user account.
            AddressGeoCodeTestHelper::updateTestAccountsWithBillingAddress($superAccountId, $address, $super);
            //Fetch Latitute and Longitude values for address and save in Address.
            AddressMappingUtil::updateChangedAddresses();
            $accounts = Account::getByName('superAccount');
            $this->assertEquals(1, count($accounts));
            $this->assertEquals('40.7274969',   $accounts[0]->billingAddress->latitude);
            $this->assertEquals('-73.9601597', $accounts[0]->billingAddress->longitude);
            $this->assertEquals(0,              $accounts[0]->billingAddress->invalid);
            $addressString = $accounts[0]->billingAddress->makeAddress();
            $this->setGetArray(array('addressString' => $addressString, 
                                     'latitude'      => $accounts[0]->billingAddress->latitude, 
                                     'longitude'     => $accounts[0]->billingAddress->longitude));
            $content = $this->runControllerWithNoExceptionsAndGetContent('maps/default/mapAndPoint');
            $this->assertTrue(strpos($content, 'plotMap') > 0);
        }
     }
+<?php
    /*********************************************************************************
     * Zurmo is a customer relationship management program developed by
     * Zurmo, Inc. Copyright (C) 2012 Zurmo Inc.
     *
     * Zurmo is free software; you can redistribute it and/or modify it under
     * the terms of the GNU General Public License version 3 as published by the
     * Free Software Foundation with the addition of the following permission added
     * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
     * IN WHICH THE COPYRIGHT IS OWNED BY ZURMO, ZURMO DISCLAIMS THE WARRANTY
     * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
     *
     * Zurmo is distributed in the hope that it will be useful, but WITHOUT
     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
     * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
     * details.
     *
     * You should have received a copy of the GNU General Public License along with
     * this program; if not, see http://www.gnu.org/licenses or write to the Free
     * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
     * 02110-1301 USA.
     *
     * You can contact Zurmo, Inc. with a mailing address at 113 McHenry Road Suite 207, 
     * Buffalo Grove, IL 60089, USA. or at email address contact@zurmo.com.
     ********************************************************************************/
    /**
     * Maps Module Super User Walkthrough.
     * Walkthrough for the super user of all possible controller actions.
     * Since this is a super user, he should have access to all controller actions
     * without any exceptions being thrown.
     */
    class MapsSuperUserWalkthroughTest extends ZurmoWalkthroughBaseTest
    {
        public static function setUpBeforeClass()
        {
            parent::setUpBeforeClass();
            SecurityTestHelper::createSuperAdmin();
            $super = User::getByUsername('super');
            Yii::app()->user->userModel = $super;
            //Setup test data owned by the super user.
            AccountTestHelper::createAccountByNameForOwner('superAccount', $super);
            AddressGeoCodeTestHelper::createAndRemoveAccountWithAddress($super);
        }
        public function testSuperUserAllDefaultControllerActions()
        {
            $super = $this->logoutCurrentUserLoginNewUserAndGetByUsername('super');
            //Retriving the super account id.
            $superAccountId = self::getModelIdByModelNameAndName ('Account', 'superAccount');
            //Create address array for the super account id.
            $address = array('street1'    => '123 Knob Street', 
                             'street2'    => 'Apartment 4b', 
                             'city'       => 'Chicago', 
                             'state'      => 'Illinois', 
                             'postalCode' => '60606', 
                             'country'    => 'USA'
                       );
            //Assign Address to the super user account.
            AddressGeoCodeTestHelper::updateTestAccountsWithBillingAddress($superAccountId, $address, $super);
            //Fetch Latitute and Longitude values for address and save in Address.
            AddressMappingUtil::updateChangedAddresses();
            $accounts = Account::getByName('superAccount');
            $this->assertEquals(1, count($accounts));
            $this->assertEquals('42.1153153',  $accounts[0]->billingAddress->latitude);
            $this->assertEquals('-87.9763703', $accounts[0]->billingAddress->longitude);
            $this->assertEquals(0,             $accounts[0]->billingAddress->invalid);
            $addressString = $accounts[0]->billingAddress->makeAddress();
            $this->setGetArray(array('addressString' => $addressString, 
                                     'latitude'      => $accounts[0]->billingAddress->latitude, 
                                     'longitude'     => $accounts[0]->billingAddress->longitude));
            $content = $this->runControllerWithNoExceptionsAndGetContent('maps/default/mapAndPoint');
            $this->assertTrue(strpos($content, 'plotMap') > 0);
        }
     }

app/protected/modules/zurmo/components/BeginRequestBehavior.php

     {
         public function attach($owner)
         {
+            $owner->attachEventHandler('onBeginRequest', array($this, 'handleApplicationCache'));
             if (Yii::app()->apiRequest->isApiRequest())
             {
                 $owner->detachEventHandler('onBeginRequest', array(Yii::app()->request, 'validateCsrfToken'));
         }
 
         /**
+        * Load memcache extension if memcache extension is
+        * loaded and if memcache server is avalable
+        * @param $event
+        */
+        public function handleApplicationCache($event)
+        {
+            $memcacheServiceHelper = new MemcacheServiceHelper();
+            if ($memcacheServiceHelper->runCheckAndGetIfSuccessful())
+            {
+                $cacheComponent = Yii::createComponent('CMemCache',
+                    array('servers' => Yii::app()->params['memcacheServers']));
+                Yii::app()->setComponent('cache', $cacheComponent);
+            }
+        }
+
+        /**
         * Import all files that need to be included(for lazy loading)
         * @param $event
         */

app/protected/modules/zurmo/components/CommandBeginRequestBehavior.php

     {
         public function attach($owner)
         {
+            $owner->attachEventHandler('onBeginRequest', array($this, 'handleApplicationCache'));
             $owner->attachEventHandler('onBeginRequest', array($this, 'handleImports'));
             $owner->attachEventHandler('onBeginRequest', array($this, 'handleLibraryCompatibilityCheck'));
             $owner->attachEventHandler('onBeginRequest', array($this, 'handleStartPerformanceClock'));

app/protected/tests/BeginRequestTestBehavior.php

     {
         public function attach($owner)
         {
+            $owner->attachEventHandler('onBeginRequest', array($this, 'handleApplicationCache'));
             $owner->attachEventHandler('onBeginRequest', array($this, 'handleImports'));
         }
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.