Google\Cloud\Tests\Snippets\PubSub\PubSubClientTest::testTopics PHP Method

testTopics() public method

public testTopics ( )
    public function testTopics()
    {
        $snippet = $this->snippetFromMethod(PubSubClient::class, 'topics');
        $snippet->addLocal('pubsub', $this->client);
        $this->connection->listTopics(Argument::any())->shouldBeCalled()->willReturn(['topics' => [['name' => self::TOPIC]]]);
        $this->client->setConnection($this->connection->reveal());
        $res = $snippet->invoke('topics');
        $this->assertInstanceOf(\Generator::class, $res->returnVal());
        $this->assertEquals(self::TOPIC, $res->output());
    }