testPermissions() public method

Invalid permissions will raise a BadRequestException. A list of allowed permissions can be found in the access control documentation. Example: $allowedPermissions = $iam->testPermissions([ 'pubsub.topics.publish', 'pubsub.topics.attachSubscription' ]);
public testPermissions ( array $permissions, array $options = [] ) : array
$permissions array A list of permissions to test
$options array Configuration Options
return array A subset of $permissions, with only those allowed included.
 public function testTestPermissions()
 {
     $permissions = ['foo', 'bar'];
     $this->connection->testPermissions(Argument::withEntry('permissions', $permissions))->willReturn($permissions);
     $iam = new Iam($this->connection->reveal(), self::RESOURCE);
     $this->assertEquals($permissions, $iam->testPermissions($permissions));
 }