Google\Cloud\Tests\PubSub\Connection\IamTopicTest::testProxies PHP Method

testProxies() public method

public testProxies ( )
    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']));
    }
IamTopicTest