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

Example: $builder->addBinding('roles/admin', [ 'user:admin@domain.com' ]);
public addBinding ( string $role, array $members ) : PolicyBuilder
$role string A valid role for the service
$members array An array of members to assign to the binding
Результат PolicyBuilder
 public function testSetBindings()
 {
     $role = 'test';
     $members = ['user:test@test.com'];
     $builder = new PolicyBuilder();
     $builder->addBinding($role, $members);
     $result = $builder->result();
     $policy = ['bindings' => [['role' => $role, 'members' => $members]]];
     $this->assertEquals($policy, $result);
     $newMembers = ['group:group@test.com'];
     $builder->setBindings([['role' => $role, 'members' => $newMembers]]);
     $newResult = $builder->result();
     $newPolicy = ['bindings' => [['role' => $role, 'members' => $newMembers]]];
     $this->assertEquals($newPolicy, $newResult);
 }