Google\Cloud\Tests\GrpcRequestWrapperTest::testCastsToProperException PHP Method

testCastsToProperException() public method

public testCastsToProperException ( $code, $expectedException )
    public function testCastsToProperException($code, $expectedException)
    {
        $requestWrapper = new GrpcRequestWrapper();
        try {
            $requestWrapper->send(function () use($code) {
                throw new ApiException('message', $code);
            }, [[]], ['retries' => 0]);
        } catch (\Exception $ex) {
            $this->assertInstanceOf($expectedException, $ex);
        }
    }