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


PHP SecurityTestHelper::createAccounts方法代码示例

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


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

示例1: setUpBeforeClass

 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     ZurmoDatabaseCompatibilityUtil::dropStoredFunctionsAndProcedures();
     SecurityTestHelper::createSuperAdmin();
     Yii::app()->user->userModel = User::getByUsername('super');
     SecurityTestHelper::createUsers();
     SecurityTestHelper::createGroups();
     SecurityTestHelper::createAccounts();
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:10,代码来源:ActionSecurityUtilTest.php

示例2: setUpBeforeClass

 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     SecurityTestHelper::createSuperAdmin();
     Yii::app()->user->userModel = User::getByUsername('super');
     SecurityTestHelper::createUsers();
     SecurityTestHelper::createGroups();
     SecurityTestHelper::createAccounts();
     SecurityTestHelper::createRoles();
     $everyone = Group::getByName('Everyone');
     $saved = $everyone->save();
     assert('$saved');
     // Not Coding Standard
     ReadPermissionsOptimizationUtil::rebuild();
 }
开发者ID:youprofit,项目名称:Zurmo,代码行数:15,代码来源:PermissionsTest.php

示例3: setUpBeforeClass

 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     SecurityTestHelper::createSuperAdmin();
     Yii::app()->user->userModel = User::getByUsername('super');
     SecurityTestHelper::createUsers();
     SecurityTestHelper::createGroups();
     SecurityTestHelper::createAccounts();
     SecurityTestHelper::createRoles();
     $everyone = Group::getByName('Everyone');
     $saved = $everyone->save();
     assert('$saved');
     // Not Coding Standard
     //Add contacts to help test that the rebuild is working correctly
     $contact = ContactTestHelper::createContactByNameForOwner('jason', Yii::app()->user->userModel);
     $contact->addPermissions(User::getByUsername('betty'), Permission::READ);
     $contact->addPermissions(Group::getByName('Support Staff'), Permission::READ);
     $saved = $contact->save();
     assert('$saved');
     // Not Coding Standard
     ReadPermissionsOptimizationUtil::rebuild();
     assert('self::getAccountMungeRowCount() == 0');
     // Not Coding Standard
 }
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:24,代码来源:AccountReadPermissionsOptimizationTest.php

示例4: testSecurityExceptionThrownDuringExport

 public function testSecurityExceptionThrownDuringExport()
 {
     $super = User::getByUsername('super');
     Yii::app()->user->userModel = $super;
     SecurityTestHelper::createAccounts();
     $billy = User::getByUsername('billy');
     Yii::app()->user->userModel = $billy;
     AllPermissionsOptimizationUtil::rebuild();
     $numberOfUserNotifications = Notification::getCountByTypeAndUser('ExportProcessCompleted', $billy);
     $account = new Account(false);
     $searchForm = new AccountsSearchForm($account);
     $dataProvider = ExportTestHelper::makeRedBeanDataProvider($searchForm, 'Account', 0, $billy->id);
     $totalItems = $dataProvider->getTotalItemCount();
     $this->assertEquals(3, $totalItems);
     $exportItem = new ExportItem();
     $exportItem->isCompleted = 0;
     $exportItem->exportFileType = 'csv';
     $exportItem->exportFileName = 'test7';
     $exportItem->modelClassName = 'Account';
     $exportItem->serializedData = serialize($dataProvider);
     $exportItem->owner = $billy;
     $this->assertTrue($exportItem->save());
     $id = $exportItem->id;
     $exportItem->forget();
     unset($exportItem);
     //Delete queued jobs from test exportItems created above
     Yii::app()->jobQueue->deleteAll();
     $accounts = Account::getByName('Microsoft');
     $account = $accounts[0];
     $account->owner = $super;
     $this->assertTrue($account->save());
     $job = new ExportJob();
     //ReadPermissionSubscriptionUpdate should get added to jobQueue
     $this->assertEquals(0, count(Yii::app()->jobQueue->getAll()));
     $this->assertTrue($job->run());
     $this->assertEquals(0, count(Yii::app()->jobQueue->getAll()));
     $exportItem = ExportItem::getById($id);
     $fileModel = $exportItem->exportFileModel;
     $this->assertEquals(1, $exportItem->isCompleted);
     $this->assertEquals('csv', $exportItem->exportFileType);
     $this->assertEquals('test7', $exportItem->exportFileName);
     $this->assertTrue($fileModel instanceof ExportFileModel);
     $data = array();
     $rows = $dataProvider->getData();
     $modelToExportAdapter = new ModelToExportAdapter($rows[0]);
     $headerData = $modelToExportAdapter->getHeaderData();
     foreach ($rows as $model) {
         //billy lost access to Microsoft account
         if ($model->id != $account->id) {
             $modelToExportAdapter = new ModelToExportAdapter($model);
             $data[] = $modelToExportAdapter->getData();
         }
     }
     $output = ExportItemToCsvFileUtil::export($data, $headerData, 'test7.csv', false);
     $this->assertEquals($output, $fileModel->fileContent->content);
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:56,代码来源:ExportJobTest.php


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