diff --git a/BigQuery/tests/Unit/Connection/RestTest.php b/BigQuery/tests/Unit/Connection/RestTest.php index acbb2e117795..90432941e206 100644 --- a/BigQuery/tests/Unit/Connection/RestTest.php +++ b/BigQuery/tests/Unit/Connection/RestTest.php @@ -71,7 +71,7 @@ public function clientUniverseDomainConfigProvider() [['apiEndpoint' => 'https://foobar.com'], 'https://foobar.com/bigquery/v2/'], [['universeDomain' => 'googleapis.com'], 'https://bigquery.googleapis.com/bigquery/v2/'], [['universeDomain' => 'abc.def.ghi'], 'https://bigquery.abc.def.ghi/bigquery/v2/'], - [['universeDomain' => ''], '', true], + [['universeDomain' => null], '', true], ]; } diff --git a/Core/src/RestTrait.php b/Core/src/RestTrait.php index c991c9ac734b..70966a8a0359 100644 --- a/Core/src/RestTrait.php +++ b/Core/src/RestTrait.php @@ -145,7 +145,7 @@ private function getApiEndpoint($default, array $config, string $apiEndpointTemp ); } - if (!isset($config['universeDomain']) || empty($config['universeDomain'])) { + if (!isset($config['universeDomain'])) { throw new UnexpectedValueException( 'The "universeDomain" config value must be set to use the default API endpoint template.' ); diff --git a/Core/tests/Unit/RestTraitTest.php b/Core/tests/Unit/RestTraitTest.php index 423aded91b5f..031a056dd85a 100644 --- a/Core/tests/Unit/RestTraitTest.php +++ b/Core/tests/Unit/RestTraitTest.php @@ -218,8 +218,8 @@ public function universeDomains() [[], '', null, true], [[], null, null, true], [['universeDomain' => null], 'ab.cd', null, true], - [['universeDomain' => ''], 'ab.cd', null, true], - [['universeDomain' => 'defg'], 'ab.cd', 'ab.cd/'], + [['universeDomain' => ''], 'ab.cd/', 'ab.cd/'], + [['universeDomain' => 'defg'], '//ab.cd//', '//ab.cd//'], [['universeDomain' => 'defg'], 'ab.UNIVERSE_DOMAIN.cd', 'ab.defg.cd/'], ]; } diff --git a/PubSub/tests/Unit/Connection/RestTest.php b/PubSub/tests/Unit/Connection/RestTest.php index 0945fd9a49fa..c2cabef93cfe 100644 --- a/PubSub/tests/Unit/Connection/RestTest.php +++ b/PubSub/tests/Unit/Connection/RestTest.php @@ -72,7 +72,7 @@ public function clientUniverseDomainConfigProvider() [['apiEndpoint' => 'https://foobar.com'], 'https://foobar.com/'], [['universeDomain' => 'googleapis.com'], 'https://pubsub.googleapis.com/'], [['universeDomain' => 'abc.def.ghi'], 'https://pubsub.abc.def.ghi/'], - [['universeDomain' => ''], '', true], + [['universeDomain' => null], '', true], ]; } diff --git a/Storage/tests/Unit/Connection/RestTest.php b/Storage/tests/Unit/Connection/RestTest.php index a9c8025b056b..51c97f15e099 100644 --- a/Storage/tests/Unit/Connection/RestTest.php +++ b/Storage/tests/Unit/Connection/RestTest.php @@ -86,7 +86,7 @@ public function clientUniverseDomainConfigProvider() [['apiEndpoint' => 'https://foobar.com'], 'https://foobar.com/storage/v1/'], [['universeDomain' => 'googleapis.com'], 'https://storage.googleapis.com/storage/v1/'], [['universeDomain' => 'abc.def.ghi'], 'https://storage.abc.def.ghi/storage/v1/'], - [['universeDomain' => ''], '', true], + [['universeDomain' => null], '', true], ]; }