Google\Cloud\Tests\PubSub\PubSubClientTest::testTopic PHP 메소드

testTopic() 공개 메소드

public testTopic ( )
    public function testTopic()
    {
        $topicName = 'test-topic';
        $this->connection->getTopic(Argument::any())->willReturn(['name' => 'projects/project/topics/' . $topicName])->shouldBeCalledTimes(1);
        $this->client->setConnection($this->connection->reveal());
        $topic = $this->client->topic($topicName);
        $this->assertInstanceOf(Topic::class, $topic);
        $info = $topic->info();
        $this->assertEquals($info['name'], 'projects/project/topics/' . $topicName);
    }