Google\Cloud\PubSub\Connection\IamTopic::getPolicy PHP Method

getPolicy() public method

public getPolicy ( array $args )
$args array
    public function getPolicy(array $args)
    {
        return $this->connection->getTopicIamPolicy($args);
    }

Usage Example

 public function testProxies()
 {
     $connection = $this->prophesize(ConnectionInterface::class);
     $connection->getTopicIamPolicy(Argument::withEntry('foo', 'bar'))->willReturn('test')->shouldBeCalledTimes(1);
     $connection->setTopicIamPolicy(Argument::withEntry('foo', 'bar'))->willReturn('test')->shouldBeCalledTimes(1);
     $connection->testTopicIamPermissions(Argument::withEntry('foo', 'bar'))->willReturn('test')->shouldBeCalledTimes(1);
     $iamTopic = new IamTopic($connection->reveal());
     $this->assertEquals('test', $iamTopic->getPolicy(['foo' => 'bar']));
     $this->assertEquals('test', $iamTopic->setPolicy(['foo' => 'bar']));
     $this->assertEquals('test', $iamTopic->testPermissions(['foo' => 'bar']));
 }