Scalr\Tests\Fixtures\Api\V2\Acl\ApiTestAcl::deleteTestAccountRole PHP Метод

deleteTestAccountRole() публичный Метод

Delete test Account Role
public deleteTestAccountRole ( integer $accountId, string $name )
$accountId integer The identifier of the client's account
$name string Role name
    public function deleteTestAccountRole($accountId, $name)
    {
        $rec = $this->getDb()->GetRow("\n            SELECT `account_role_id`\n            FROM   `acl_account_roles`\n            WHERE  `account_id` = ? AND name = ?\n        ", [$accountId, $name]);
        if (isset($rec['account_role_id'])) {
            $this->deleteAccountRole($rec['account_role_id'], $accountId);
        }
    }

Usage Example

Пример #1
0
 /**
  * Removes API key generated for test
  */
 public static function tearDownAfterClass()
 {
     parent::tearDownAfterClass();
     static::$fullAccessAcl->deleteTestAccountRole(static::$user->getAccountId(), static::getTestName(ApiFixture::ACL_FULL_ACCESS));
     static::$readOnlyAccessAcl->deleteTestAccountRole(static::$user->getAccountId(), static::getTestName(ApiFixture::ACL_READ_ONLY_ACCESS));
     if (static::$defaultAcl instanceof Scalr\Acl\Acl) {
         Scalr::getContainer()->release('acl')->setShared('acl', function () {
             return static::$defaultAcl;
         });
     }
 }