public function testCreatesProviderFromPatterns() { $p = EndpointProvider::patterns(['*/*' => ['endpoint' => 'foo.com']]); $this->assertInstanceOf('Vws\\Endpoint\\PatternEndpointProvider', $p); $result = EndpointProvider::resolve($p, []); $this->assertEquals('https://foo.com', $result['endpoint']); }
public static function _apply_endpoint_provider(callable $value, array &$args) { if (!isset($args['endpoint'])) { // Invoke the endpoint provider and throw if it does not resolve. $result = EndpointProvider::resolve($value, ['service' => $args['service'], 'region' => $args['region'], 'scheme' => $args['scheme']]); $args['endpoint'] = $result['endpoint']; } }