Google\Cloud\Tests\Logging\LoggingClientTest::testCreatesMetric PHP Method

testCreatesMetric() public method

public testCreatesMetric ( )
    public function testCreatesMetric()
    {
        $filter = 'logName = myLog';
        $this->connection->createMetric(['parent' => $this->formattedProjectId, 'name' => $this->metricName, 'filter' => $filter])->willReturn(['name' => $this->metricName, 'filter' => $filter])->shouldBeCalledTimes(1);
        $this->client->setConnection($this->connection->reveal());
        $metric = $this->client->createMetric($this->metricName, $filter);
        $this->assertInstanceOf(Metric::class, $metric);
        $this->assertEquals($this->metricName, $metric->info()['name']);
    }