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.
     $account = AccountTestHelper::createAccountByNameForOwner('superAccount', $super);
     AccountTestHelper::createAccountByNameForOwner('superAccount2', $super);
     ContactTestHelper::createContactWithAccountByNameForOwner('superContact', $super, $account);
     ContactTestHelper::createContactWithAccountByNameForOwner('superContact2', $super, $account);
     OpportunityTestHelper::createOpportunityStagesIfDoesNotExist();
     OpportunityTestHelper::createOpportunityWithAccountByNameForOwner('superOpp', $super, $account);
     OpportunityTestHelper::createOpportunityWithAccountByNameForOwner('superOpp2', $super, $account);
     OpportunityTestHelper::createOpportunityWithAccountByNameForOwner('superOpp3', $super, $account);
     OpportunityTestHelper::createOpportunityWithAccountByNameForOwner('superOpp4', $super, $account);
     OpportunityTestHelper::createOpportunityWithAccountByNameForOwner('superOpp5', $super, $account);
     OpportunityTestHelper::createOpportunityWithAccountByNameForOwner('superOpp6', $super, $account);
     OpportunityTestHelper::createOpportunityWithAccountByNameForOwner('superOpp7', $super, $account);
     OpportunityTestHelper::createOpportunityWithAccountByNameForOwner('superOpp8', $super, $account);
     OpportunityTestHelper::createOpportunityWithAccountByNameForOwner('superOpp9', $super, $account);
     OpportunityTestHelper::createOpportunityWithAccountByNameForOwner('superOpp10', $super, $account);
     OpportunityTestHelper::createOpportunityWithAccountByNameForOwner('superOpp11', $super, $account);
     OpportunityTestHelper::createOpportunityWithAccountByNameForOwner('superOpp12', $super, $account);
     //Setup default dashboard.
     Dashboard::getByLayoutIdAndUser(Dashboard::DEFAULT_USER_LAYOUT_ID, $super);
 }
 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);
     AccountTestHelper::createAccountByNameForOwner('superAccount2', $super);
     AccountTestHelper::createAccountByNameForOwner('superAccount3', $super);
     AccountTestHelper::createAccountByNameForOwner('superAccount4', $super);
     AccountTestHelper::createAccountByNameForOwner('superAccount5', $super);
     AccountTestHelper::createAccountByNameForOwner('superAccount6', $super);
     AccountTestHelper::createAccountByNameForOwner('superAccount7', $super);
     AccountTestHelper::createAccountByNameForOwner('superAccount8', $super);
     AccountTestHelper::createAccountByNameForOwner('superAccount9', $super);
     AccountTestHelper::createAccountByNameForOwner('superAccount10', $super);
     AccountTestHelper::createAccountByNameForOwner('superAccount11', $super);
     AccountTestHelper::createAccountByNameForOwner('superAccount12', $super);
     AccountTestHelper::createAccountByNameForOwner('superAccount13', $super);
     AccountTestHelper::createAccountByNameForOwner('superAccount14', $super);
     AccountTestHelper::createAccountByNameForOwner('superAccount15', $super);
     AccountTestHelper::createAccountByNameForOwner('superAccount16', $super);
     AccountTestHelper::createAccountByNameForOwner('superAccount17', $super);
     AccountTestHelper::createAccountByNameForOwner('superAccount18', $super);
     AccountTestHelper::createAccountByNameForOwner('superAccount19', $super);
     AccountTestHelper::createAccountByNameForOwner('superAccount20', $super);
     //Setup default dashboard.
     Dashboard::getByLayoutIdAndUser(Dashboard::DEFAULT_USER_LAYOUT_ID, $super);
 }
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     //Setup test data owned by the super user.
     //Setup default dashboard.
     Dashboard::getByLayoutIdAndUser(Dashboard::DEFAULT_USER_LAYOUT_ID, Yii::app()->user->userModel);
 }
 /**
  * @depends testGetNextLayoutId
  */
 public function testGetByLayoutIdAndUserId()
 {
     $user = User::getByUserName('billy');
     Yii::app()->user->userModel = $user;
     for ($i = 1; $i <= 3; $i++) {
         $dashboard = Dashboard::getByLayoutIdAndUser($i, $user);
         $this->assertEquals($i, $dashboard->layoutId);
         $this->assertEquals("Dashboard {$i}", $dashboard->name);
         $this->assertEquals('100', $dashboard->layoutType);
     }
 }
 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);
     //Setup default dashboard.
     Dashboard::getByLayoutIdAndUser(Dashboard::DEFAULT_USER_LAYOUT_ID, $super);
 }
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     //Setup test data owned by the super user.
     AccountTestHelper::createAccountByNameForOwner('superAccount', Yii::app()->user->userModel);
     AccountTestHelper::createAccountByNameForOwner('superAccount2', Yii::app()->user->userModel);
     AccountTestHelper::createAccountByNameForOwner('superAccount3', Yii::app()->user->userModel);
     AccountTestHelper::createAccountByNameForOwner('superAccount4', Yii::app()->user->userModel);
     //Setup default dashboard.
     Dashboard::getByLayoutIdAndUser(Dashboard::DEFAULT_USER_LAYOUT_ID, Yii::app()->user->userModel);
     ReadPermissionsOptimizationUtil::rebuild();
 }
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     $super = Yii::app()->user->userModel;
     //Setup test data owned by the super user.
     ProjectTestHelper::createProjectByNameForOwner("My Project 1", $super);
     ProjectTestHelper::createProjectByNameForOwner("My Project 2", $super);
     ProjectTestHelper::createProjectByNameForOwner("My Project 3", $super);
     ProjectTestHelper::createProjectByNameForOwner("My Project 4", $super);
     //Setup default dashboard.
     Dashboard::getByLayoutIdAndUser(Dashboard::DEFAULT_USER_LAYOUT_ID, $super);
     AllPermissionsOptimizationUtil::rebuild();
 }
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     $super = Yii::app()->user->userModel;
     //Setup test data owned by the super user.
     ContactWebFormTestHelper::createContactWebFormByName("Web Form 1");
     ContactWebFormTestHelper::createContactWebFormByName("Web Form 2");
     ContactWebFormTestHelper::createContactWebFormByName("Web Form 3");
     ContactWebFormTestHelper::createContactWebFormByName("Web Form 4");
     //Setup default dashboard.
     Dashboard::getByLayoutIdAndUser(Dashboard::DEFAULT_USER_LAYOUT_ID, $super);
     AllPermissionsOptimizationUtil::rebuild();
 }
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     $super = Yii::app()->user->userModel;
     //Setup test data owned by the super user.
     LeadTestHelper::createLeadbyNameForOwner('superLead', $super);
     LeadTestHelper::createLeadbyNameForOwner('superLead2', $super);
     LeadTestHelper::createLeadbyNameForOwner('superLead3', $super);
     LeadTestHelper::createLeadbyNameForOwner('superLead4', $super);
     //Setup default dashboard.
     Dashboard::getByLayoutIdAndUser(Dashboard::DEFAULT_USER_LAYOUT_ID, $super);
     AllPermissionsOptimizationUtil::rebuild();
 }
 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.
     LeadTestHelper::createLeadbyNameForOwner('superLead', $super);
     //Setup default dashboard.
     Dashboard::getByLayoutIdAndUser(Dashboard::DEFAULT_USER_LAYOUT_ID, $super);
     //Setup test marketingList
     MarketingListTestHelper::createMarketingListByName('MarketingListName', 'MarketingList Description', 'first', '*****@*****.**');
 }
Example #11
0
 public function actionDashboardDetails($id)
 {
     if (intval($id) > 0) {
         $dashboard = Dashboard::getById(intval($id));
         $layoutId = $dashboard->layoutId;
     } else {
         $dashboard = Dashboard::getByLayoutIdAndUser(Dashboard::DEFAULT_USER_LAYOUT_ID, Yii::app()->user->userModel);
         $layoutId = $dashboard->layoutId;
     }
     $params = array('controllerId' => $this->getId(), 'moduleId' => $this->getModule()->getId());
     ControllerSecurityUtil::resolveAccessCanCurrentUserReadModel($dashboard);
     $homeTitleBarAndDashboardView = new HomeTitleBarAndDashboardView($this->getId(), $this->getModule()->getId(), 'HomeDashboard' . $layoutId, $dashboard, $params);
     $view = new HomePageView(ZurmoDefaultViewUtil::makeStandardViewForCurrentUser($this, $homeTitleBarAndDashboardView));
     echo $view->render();
 }
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     $super = Yii::app()->user->userModel;
     //Setup test data owned by the super user.
     $account = AccountTestHelper::createAccountByNameForOwner('superAccount', $super);
     AccountTestHelper::createAccountByNameForOwner('superAccount2', $super);
     ContactTestHelper::createContactWithAccountByNameForOwner('superContact', $super, $account);
     ContactTestHelper::createContactWithAccountByNameForOwner('superContact2', $super, $account);
     ContractTestHelper::createContractStagesIfDoesNotExist();
     ContractTestHelper::createContractWithAccountByNameForOwner('superOpp', $super, $account);
     ContractTestHelper::createContractWithAccountByNameForOwner('superOpp2', $super, $account);
     ContractTestHelper::createContractWithAccountByNameForOwner('superOpp3', $super, $account);
     ContractTestHelper::createContractWithAccountByNameForOwner('superOpp4', $super, $account);
     //Setup default dashboard.
     Dashboard::getByLayoutIdAndUser(Dashboard::DEFAULT_USER_LAYOUT_ID, $super);
     AllPermissionsOptimizationUtil::rebuild();
 }
 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.
     LeadTestHelper::createLeadbyNameForOwner('superLead', $super);
     LeadTestHelper::createLeadbyNameForOwner('superLead2', $super);
     LeadTestHelper::createLeadbyNameForOwner('superLead3', $super);
     LeadTestHelper::createLeadbyNameForOwner('superLead4', $super);
     LeadTestHelper::createLeadbyNameForOwner('superLead5', $super);
     LeadTestHelper::createLeadbyNameForOwner('superLead6', $super);
     LeadTestHelper::createLeadbyNameForOwner('superLead7', $super);
     LeadTestHelper::createLeadbyNameForOwner('superLead8', $super);
     LeadTestHelper::createLeadbyNameForOwner('superLead9', $super);
     LeadTestHelper::createLeadbyNameForOwner('superLead10', $super);
     LeadTestHelper::createLeadbyNameForOwner('superLead11', $super);
     LeadTestHelper::createLeadbyNameForOwner('superLead12', $super);
     //Setup default dashboard.
     Dashboard::getByLayoutIdAndUser(Dashboard::DEFAULT_USER_LAYOUT_ID, $super);
 }
 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.
     self::$gameReward1 = GameRewardTestHelper::createGameRewardByNameForOwner('superGameReward', $super);
     self::$gameReward2 = GameRewardTestHelper::createGameRewardByNameForOwner('superGameReward2', $super);
     self::$gameReward3 = GameRewardTestHelper::createGameRewardByNameForOwner('superGameReward3', $super);
     self::$gameReward4 = GameRewardTestHelper::createGameRewardByNameForOwner('superGameReward4', $super);
     self::$gameReward5 = GameRewardTestHelper::createGameRewardByNameForOwner('superGameReward5', $super);
     self::$gameReward6 = GameRewardTestHelper::createGameRewardByNameForOwner('superGameReward6', $super);
     self::$gameReward7 = GameRewardTestHelper::createGameRewardByNameForOwner('superGameReward7', $super);
     self::$gameReward8 = GameRewardTestHelper::createGameRewardByNameForOwner('superGameReward8', $super);
     self::$gameReward9 = GameRewardTestHelper::createGameRewardByNameForOwner('superGameReward9', $super);
     self::$gameReward10 = GameRewardTestHelper::createGameRewardByNameForOwner('superGameReward10', $super);
     self::$gameReward11 = GameRewardTestHelper::createGameRewardByNameForOwner('superGameReward11', $super);
     self::$gameReward12 = GameRewardTestHelper::createGameRewardByNameForOwner('superGameReward12', $super);
     //Setup default dashboard.
     Dashboard::getByLayoutIdAndUser(Dashboard::DEFAULT_USER_LAYOUT_ID, $super);
 }
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     SecurityTestHelper::createSuperAdmin();
     $super = User::getByUsername('super');
     Yii::app()->user->userModel = $super;
     ReadPermissionsOptimizationUtil::rebuild();
     //create everyone group
     $everyoneGroup = Group::getByName(Group::EVERYONE_GROUP_NAME);
     $everyoneGroup->save();
     //Create test users
     $steven = UserTestHelper::createBasicUser('steven');
     $sally = UserTestHelper::createBasicUser('sally');
     $mary = UserTestHelper::createBasicUser('mary');
     //give 3 users access to social items
     $steven->setRight('SocialItemsModule', SocialItemsModule::RIGHT_ACCESS_SOCIAL_ITEMS, Right::ALLOW);
     $saved = $steven->save();
     if (!$saved) {
         throw new NotSupportedException();
     }
     $sally->setRight('SocialItemsModule', SocialItemsModule::RIGHT_ACCESS_SOCIAL_ITEMS, Right::ALLOW);
     $saved = $sally->save();
     if (!$saved) {
         throw new NotSupportedException();
     }
     $mary->setRight('SocialItemsModule', SocialItemsModule::RIGHT_ACCESS_SOCIAL_ITEMS, Right::ALLOW);
     $saved = $mary->save();
     if (!$saved) {
         throw new NotSupportedException();
     }
     //Setup test data owned by the super user.
     $account = AccountTestHelper::createAccountByNameForOwner('superAccount', $super);
     //Setup default dashboard.
     Dashboard::getByLayoutIdAndUser(Dashboard::DEFAULT_USER_LAYOUT_ID, $super);
     Dashboard::getByLayoutIdAndUser(Dashboard::DEFAULT_USER_LAYOUT_ID, $mary);
     ContactsModule::loadStartingData();
 }
 public function testAddProductsMyListPortletToDashboard()
 {
     $super = $this->logoutCurrentUserLoginNewUserAndGetByUsername('super');
     $superDashboard1 = Dashboard::getByLayoutIdAndUser(Dashboard::DEFAULT_USER_LAYOUT_ID, $super);
     //load details view
     $this->setGetArray(array('id' => $superDashboard1->id));
     $this->resetPostArray();
     $this->runControllerWithNoExceptionsAndGetContent('home/default/dashboardDetails');
     //Portlet Controller Actions
     $uniqueLayoutId = 'HomeDashboard' . $superDashboard1->layoutId;
     $this->setGetArray(array('dashboardId' => $superDashboard1->id, 'uniqueLayoutId' => $uniqueLayoutId));
     $this->resetPostArray();
     $this->runControllerWithNoExceptionsAndGetContent('home/defaultPortlet/addList');
     //Add ProductsMyList Portlet to dashboard
     $this->setGetArray(array('dashboardId' => $superDashboard1->id, 'portletType' => 'ProductsMyList', 'uniqueLayoutId' => $uniqueLayoutId));
     $this->resetPostArray();
     $this->runControllerWithRedirectExceptionAndGetContent('home/defaultPortlet/add');
     $portlets = Portlet::getByLayoutIdAndUserSortedByColumnIdAndPosition($uniqueLayoutId, $super->id, array());
     $this->assertEquals(9, count($portlets[1]));
     $this->assertEquals(2, count($portlets[2]));
     $portletPostData = array();
     $portletCount = 0;
     foreach ($portlets as $column => $columnPortlets) {
         foreach ($columnPortlets as $position => $portlet) {
             $portletPostData['HomeDashboard1_' . $portlet->id] = array('collapsed' => 'true', 'column' => 0, 'id' => 'HomeDashboard1_' . $portlet->id, 'position' => $portletCount);
             $portletCount++;
         }
     }
     $this->assertEquals(11, $portletCount);
     $this->resetGetArray();
     $this->setPostArray(array('portletLayoutConfiguration' => array('portlets' => $portletPostData, 'uniqueLayoutId' => $uniqueLayoutId)));
     $this->runControllerWithNoExceptionsAndGetContent('home/defaultPortlet/saveLayout', true);
     //load details view
     $this->setGetArray(array('id' => $superDashboard1->id));
     $this->resetPostArray();
     $this->runControllerWithNoExceptionsAndGetContent('home/default/dashboardDetails');
 }
 public function testSuperUserAllDefaultControllerActions()
 {
     //Set the current user as the super user.
     $super = $this->logoutCurrentUserLoginNewUserAndGetByUsername('super');
     //Test all default controller actions that do not require any POST/GET variables to be passed.
     //This does not include portlet controller actions.
     $this->runControllerWithNoExceptionsAndGetContent('home/default');
     $this->runControllerWithNoExceptionsAndGetContent('home/default/index');
     $this->runControllerWithNoExceptionsAndGetContent('home/default/createDashboard');
     //Default Controller actions requiring some sort of parameter via POST or GET
     //Load Model Edit Views
     $superDashboard = Dashboard::getByLayoutIdAndUser(Dashboard::DEFAULT_USER_LAYOUT_ID, $super);
     $this->setGetArray(array('id' => $superDashboard->id));
     $this->runControllerWithNoExceptionsAndGetContent('home/default/editDashboard');
     //Save dashboard.
     $superDashboard = Dashboard::getByLayoutIdAndUser(Dashboard::DEFAULT_USER_LAYOUT_ID, $super);
     $this->assertEquals('Dashboard', $superDashboard->name);
     $this->setPostArray(array('Dashboard' => array('name' => '456765421')));
     $this->runControllerWithRedirectExceptionAndGetContent('home/default/editDashboard');
     $superDashboard = Dashboard::getByLayoutIdAndUser(Dashboard::DEFAULT_USER_LAYOUT_ID, $super);
     $this->assertEquals('456765421', $superDashboard->name);
     //Test having a failed validation on the dashboard during save.
     $this->setGetArray(array('id' => $superDashboard->id));
     $this->setPostArray(array('Dashboard' => array('name' => '')));
     $content = $this->runControllerWithNoExceptionsAndGetContent('home/default/editDashboard');
     $this->assertFalse(strpos($content, 'Name cannot be blank') === false);
     //Load Model Detail Views
     $this->setGetArray(array('id' => -1));
     $this->resetPostArray();
     $this->runControllerWithNoExceptionsAndGetContent('home/default/dashboardDetails');
     $this->setGetArray(array('id' => $superDashboard->id));
     $this->resetPostArray();
     $this->runControllerWithNoExceptionsAndGetContent('home/default/dashboardDetails');
     //Add second dashboard for use in deletion tests.
     $secondDashboard = DashboardTestHelper::createDashboardByNameForOwner('Dashboard2', $super);
     $this->assertTrue($secondDashboard->isDefault == 0);
     $this->assertFalse($secondDashboard->isDefault === 0);
     //Just to prove it does not evaluate to this.
     //Attempt to delete the default dashboard and have it through an exception.
     $dashboards = Dashboard::getRowsByUserId($super->id);
     $this->assertEquals(2, count($dashboards));
     $this->setGetArray(array('dashboardId' => $superDashboard->id));
     $this->resetPostArray();
     $this->runControllerWithNotSupportedExceptionAndGetContent('home/default/deleteDashboard');
     //Delete dashboard that you can delete.
     $dashboards = Dashboard::getRowsByUserId($super->id);
     $this->assertEquals(2, count($dashboards));
     $this->setGetArray(array('dashboardId' => $secondDashboard->id));
     $this->resetPostArray();
     $this->runControllerWithRedirectExceptionAndGetContent('home/default/deleteDashboard');
     $dashboards = Dashboard::getRowsByUserId($super->id);
     $this->assertEquals(1, count($dashboards));
     //Add a dashboard via the create dashboard action.
     $this->assertEquals(1, count(Dashboard::getAll()));
     $this->resetGetArray();
     $this->setPostArray(array('Dashboard' => array('name' => 'myTestDashboard', 'layoutType' => '50,50')));
     // Not Coding Standard
     $this->runControllerWithRedirectExceptionAndGetContent('home/default/createDashboard');
     $dashboards = Dashboard::getAll();
     $this->assertEquals(2, count($dashboards));
     $this->assertEquals('myTestDashboard', $dashboards[1]->name);
     $this->assertEquals($super, $dashboards[1]->owner);
     $this->assertEquals('50,50', $dashboards[1]->layoutType);
     // Not Coding Standard
     //Portlet Controller Actions
     $uniqueLayoutId = 'HomeDashboard' . $superDashboard->layoutId;
     $this->setGetArray(array('dashboardId' => $superDashboard->id, 'uniqueLayoutId' => $uniqueLayoutId));
     $this->resetPostArray();
     $this->runControllerWithNoExceptionsAndGetContent('home/defaultPortlet/addList');
     //Add AccountsMyList Portlet to dashboard
     $this->setGetArray(array('dashboardId' => $superDashboard->id, 'portletType' => 'AccountsMyList', 'uniqueLayoutId' => $uniqueLayoutId));
     $this->resetPostArray();
     $this->runControllerWithRedirectExceptionAndGetContent('home/defaultPortlet/add');
     //Save a layout change. Collapse all portlets
     //At this point portlets for this view should be created because we have already loaded the 'details' page in a request above.
     $portlets = Portlet::getByLayoutIdAndUserSortedByColumnIdAndPosition($uniqueLayoutId, $super->id, array());
     $this->assertEquals(4, count($portlets[1]));
     $this->assertEquals(4, count($portlets[2]));
     $portletPostData = array();
     $portletCount = 0;
     foreach ($portlets as $column => $columnPortlets) {
         foreach ($columnPortlets as $position => $portlet) {
             $this->assertEquals('0', $portlet->collapsed);
             $portletPostData['HomeDashboard1_' . $portlet->id] = array('collapsed' => 'true', 'column' => 0, 'id' => 'HomeDashboard1_' . $portlet->id, 'position' => $portletCount);
             $portletCount++;
         }
     }
     //There should have been a total of 3 portlets. Checking positions as 4 will confirm this.
     $this->assertEquals(8, $portletCount);
     $this->resetGetArray();
     $this->setPostArray(array('portletLayoutConfiguration' => array('portlets' => $portletPostData, 'uniqueLayoutId' => $uniqueLayoutId)));
     $this->runControllerWithNoExceptionsAndGetContent('home/defaultPortlet/saveLayout', true);
     //Now test that all the portlets are collapsed.
     $portlets = Portlet::getByLayoutIdAndUserSortedByColumnIdAndPosition($uniqueLayoutId, $super->id, array());
     $this->assertEquals(8, count($portlets[1]));
     $this->assertFalse(array_key_exists(8, $portlets));
     foreach ($portlets as $column => $columns) {
         foreach ($columns as $position => $positionPortlets) {
             $this->assertEquals('1', $positionPortlets->collapsed);
         }
     }
     //Load up modal config edit view.
     $this->assertTrue($portlets[1][5]->id > 0);
     $this->assertEquals('AccountsMyList', $portlets[1][5]->viewType);
     $this->setGetArray(array('portletId' => $portlets[1][5]->id, 'uniqueLayoutId' => $uniqueLayoutId));
     $this->resetPostArray();
     $this->runControllerWithNoExceptionsAndGetContent('home/defaultPortlet/modalConfigEdit');
     //Now validate the form.
     $this->setGetArray(array('portletId' => $portlets[1][5]->id, 'uniqueLayoutId' => $uniqueLayoutId));
     $this->setPostArray(array('ajax' => 'modal-edit-form', 'AccountsSearchForm' => array()));
     $this->runControllerWithExitExceptionAndGetContent('home/defaultPortlet/modalConfigEdit');
     //save changes to the portlet title
     $this->setGetArray(array('portletId' => $portlets[1][5]->id, 'uniqueLayoutId' => $uniqueLayoutId));
     $this->setPostArray(array('MyListForm' => array('title' => 'something new'), 'AccountsSearchForm' => array()));
     $this->runControllerWithNoExceptionsAndGetContent('home/defaultPortlet/modalConfigSave');
     //Now confirm the title change was successful.
     $portlet = Portlet::getById($portlets[1][5]->id);
     $this->assertEquals('something new', $portlet->getView()->getTitle());
     //Refresh a portlet modally.
     $this->setGetArray(array('portletId' => $portlets[1][5]->id, 'uniqueLayoutId' => $uniqueLayoutId, 'redirectUrl' => 'home/default'));
     $this->resetPostArray();
     $this->runControllerWithNoExceptionsAndGetContent('home/defaultPortlet/modalRefresh');
     //Load Home Dashboard View again to make sure everything is ok after the layout change.
     $this->resetGetArray();
     $this->resetPostArray();
     $this->runControllerWithNoExceptionsAndGetContent('home/default');
     //task sorting issue
     //check whether tasks portlet render or not
     $this->assertTrue($portlets[1][3]->id > 0);
     $this->assertEquals('TasksMyList', $portlets[1][3]->viewType);
     //to sort task list
     $this->setGetArray(array('Task_sort' => 'name', 'portletId' => $portlets[1][3]->id, 'uniqueLayoutId' => $uniqueLayoutId));
     $this->resetPostArray();
     $this->runControllerWithNoExceptionsAndGetContent('home/default');
     //to sort task list after portlet has been edited
     $this->resetGetArray();
     $this->setGetArray(array('Task_sort' => 'dueDateTime', 'portletId' => $portlets[1][3]->id, 'uniqueLayoutId' => $uniqueLayoutId, 'ajax' => 'list-view' . $uniqueLayoutId . '_' . $portlets[1][3]->id));
     $this->runControllerWithNoExceptionsAndGetContent('home/default');
 }