Google\Cloud\Tests\Snippets\Iam\IamTest::testPolicy PHP Method

testPolicy() public method

public testPolicy ( )
    public function testPolicy()
    {
        $snippet = $this->snippetFromMethod(Iam::class, 'policy');
        $snippet->addLocal('iam', $this->iam);
        $this->connection->getPolicy(Argument::any())->shouldBeCalled()->willReturn('foo');
        $this->iam->setConnection($this->connection->reveal());
        $res = $snippet->invoke('policy');
        // The actual value returned doesn't matter. in the real world
        // it's an array. Here it can be anything, so long as we are getting
        // the value of $policy.
        $this->assertEquals('foo', $res->returnVal());
    }