Google\Cloud\Tests\Compute\MetadataTest::testGetProjectId PHP Метод

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

public testGetProjectId ( )
    public function testGetProjectId()
    {
        $expected_path = 'project/project-id';
        $expected_val = 'my-project';
        $this->mock->expects($this->once())->method('read')->with($this->equalTo($expected_path))->willReturn($expected_val);
        $project_id = $this->metadata->getProjectId();
        $this->assertEquals($expected_val, $project_id);
        // Ensure this value is cached thus we `read` only once.
        $this->metadata->getProjectId();
    }