Google\Cloud\Tests\Snippets\Logging\MetricTest::testExists PHP Method

testExists() public method

public testExists ( )
    public function testExists()
    {
        $snippet = $this->snippetFromMethod(Metric::class, 'exists');
        $snippet->addLocal('metric', $this->metric);
        $this->connection->getMetric(Argument::any())->shouldBeCalled()->willReturn([]);
        $this->metric->setConnection($this->connection->reveal());
        $res = $snippet->invoke();
        $this->assertEquals("Metric exists!", $res->output());
    }