Google\Cloud\Tests\Snippets\Logging\LoggingClientTest::testEntries PHP Method

testEntries() public method

public testEntries ( )
    public function testEntries()
    {
        $snippet = $this->snippetFromMethod(LoggingClient::class, 'entries');
        $snippet->addLocal('logging', $this->client);
        $this->connection->listEntries(Argument::any())->shouldBeCalled()->willReturn(['entries' => [['textPayload' => 'Entry 1'], ['textPayload' => 'Entry 2']]]);
        $this->client->setConnection($this->connection->reveal());
        $res = $snippet->invoke('entries');
        $this->assertInstanceOf(\Generator::class, $res->returnVal());
        $this->assertEquals('Entry 1', explode(PHP_EOL, $res->output())[0]);
        $this->assertEquals('Entry 2', explode(PHP_EOL, $res->output())[1]);
    }