public function info(array $options = [])
{
if (!$this->info) {
$this->reload($options);
}
return $this->info;
}
public function testInfo() { $this->connection->getTopic(Argument::withEntry('foo', 'bar'))->willReturn(['name' => 'projects/project-name/topics/topic-name'])->shouldBeCalledTimes(1); $topic = new Topic($this->connection->reveal(), 'topic-name', 'project-name'); $res = $topic->info(['foo' => 'bar']); $res2 = $topic->info(); $this->assertEquals($res, $res2); $this->assertEquals($res['name'], 'projects/project-name/topics/topic-name'); }