public function testMakeDataProviderBySearchAttributeData() { $role = Role::getById(self::$roleId); $searchAttributeData = UsersByRoleModalListControllerUtil::makeModalSearchAttributeDataByRoleModel($role); $dataProvider = UsersByRoleModalListControllerUtil::makeDataProviderBySearchAttributeData($searchAttributeData); $this->assertTrue($dataProvider instanceof RedBeanModelDataProvider); $data = $dataProvider->getData(); $this->assertEquals(1, count($data)); $this->assertEquals($role->id, $data[0]->role->id); }
public function actionUsersInRoleModalList($id) { $model = Role::getById((int) $id); ControllerSecurityUtil::resolveAccessCanCurrentUserReadModel($model); $searchAttributeData = UsersByRoleModalListControllerUtil::makeModalSearchAttributeDataByRoleModel($model); $dataProvider = UsersByRoleModalListControllerUtil::makeDataProviderBySearchAttributeData($searchAttributeData); Yii::app()->getClientScript()->setToAjaxMode(); echo UsersByRoleModalListControllerUtil::renderList($this, $dataProvider); }