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

testEntries() public method

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