Google\Cloud\Tests\PubSub\PubSubClientTest::testCreateTopic PHP Метод

testCreateTopic() публичный Метод

public testCreateTopic ( )
    public function testCreateTopic()
    {
        $topicName = 'test-topic';
        $this->connection->createTopic(Argument::withEntry('foo', 'bar'))->willReturn(['name' => 'projects/project/topics/' . $topicName]);
        // Set this to zero to make sure we're getting the cached result
        $this->connection->getTopic(Argument::any())->shouldNotBeCalled();
        $this->client->setConnection($this->connection->reveal());
        $topic = $this->client->createTopic($topicName, ['foo' => 'bar']);
        $this->assertInstanceOf(Topic::class, $topic);
        $info = $topic->info();
        $this->assertEquals($info['name'], 'projects/project/topics/' . $topicName);
    }