Currently this resource returns only the topic name, if the topic exists.
It is mostly useful therefore for checking if a topic exists.
Since this method will throw an exception if the topic is not found, you
may find that Topic::exists() is a better fit for a true/false check.
This method will retrieve a new result from the API. To use a previously
cached result, if one exists, use {@see \Google\Cloud\Pubsub\Topic::info()}.
Example:
$topic->reload();
$info = $topic->info();
echo $info['name']; // projects/my-awesome-project/topics/my-new-topic
public function testReload() { $this->connection->getTopic(Argument::withEntry('foo', 'bar'))->willReturn(['name' => 'projects/project-name/topics/topic-name']); $topic = new Topic($this->connection->reveal(), 'topic-name', 'project-name'); $res = $topic->reload(['foo' => 'bar']); $this->assertEquals($res['name'], 'projects/project-name/topics/topic-name'); }