当前位置: 首页>>代码示例>>PHP>>正文


PHP Dashboard::getRowsByUserId方法代码示例

本文整理汇总了PHP中Dashboard::getRowsByUserId方法的典型用法代码示例。如果您正苦于以下问题:PHP Dashboard::getRowsByUserId方法的具体用法?PHP Dashboard::getRowsByUserId怎么用?PHP Dashboard::getRowsByUserId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Dashboard的用法示例。


在下文中一共展示了Dashboard::getRowsByUserId方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testGetRowsByNonexistentUserId

 /**
  * testGetRowsByUserId
  */
 public function testGetRowsByNonexistentUserId()
 {
     $rows = Dashboard::getRowsByUserId(123123);
     $this->assertEquals(0, count($rows));
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:8,代码来源:DashboardTest.php

示例2: renderChangeDashboardLinkActionContent

 protected function renderChangeDashboardLinkActionContent()
 {
     $dashboardsData = Dashboard::getRowsByUserId(Yii::app()->user->userModel->id);
     if (count($dashboardsData) > 1) {
         foreach ($dashboardsData as $key => $dashboardData) {
             if ($dashboardData['id'] == $this->model->id) {
                 unset($dashboardsData[$key]);
             }
         }
         $changeDashboardLinkActionElement = new ChangeDashboardLinkActionElement($this->controllerId, $this->moduleId, $this->modelId, array('dashboardsData' => $dashboardsData));
         return $changeDashboardLinkActionElement->render();
     }
 }
开发者ID:sandeep1027,项目名称:zurmo_,代码行数:13,代码来源:DashboardView.php

示例3: testSuperUserAllDefaultControllerActions

 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->assertContains('Name cannot be blank', $content);
     //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, Dashboard::getCount());
     $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);
         }
//.........这里部分代码省略.........
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:101,代码来源:HomeSuperUserWalkthroughTest.php


注:本文中的Dashboard::getRowsByUserId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。