Example:
use Google\Cloud\ServiceBuilder;
$client = new ServiceBuilder();
$pubsub = $client->pubsub();
$topic = $pubsub->topic('my-new-topic');
You can also pass a fully-qualified topic name:
$topic = $pubsub->topic('projects/my-awesome-project/topics/my-new-topic');
public function testIam() { $topic = new Topic($this->connection->reveal(), 'topic-name', 'project-name'); $this->assertInstanceOf(Iam::class, $topic->iam()); }