Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
rahul2393 committed Sep 30, 2022
1 parent e137583 commit 2dd8290
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
5 changes: 5 additions & 0 deletions Spanner/src/SpannerClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,12 @@
use Google\Cloud\Spanner\Session\SessionPoolInterface;
use Google\Cloud\Spanner\Numeric;
use Google\Cloud\Spanner\Timestamp;
use Google\Cloud\Spanner\Admin\Instance\V1\InstanceConfig;
use Google\Cloud\Spanner\Admin\Instance\V1\ReplicaInfo;
use Google\Cloud\Spanner\V1\SpannerClient as GapicSpannerClient;
use Psr\Cache\CacheItemPoolInterface;
use Psr\Http\StreamInterface;
use Google\ApiCore\ValidationException;

/**
* Cloud Spanner is a highly scalable, transactional, managed, NewSQL
Expand Down Expand Up @@ -275,6 +278,8 @@ public function batch($instanceId, $databaseId)
*
* Example:
* ```
* use Google\Cloud\Spanner\Admin\Instance\V1\ReplicaInfo;
*
* $operation = $spanner->createInstanceConfiguration($baseInstanceConfig,
* // The replicas for the custom instance configuration must include all the replicas of the base
* // configuration, in addition to at least one from the list of optional replicas of the base
Expand Down
2 changes: 2 additions & 0 deletions Spanner/tests/System/AdminTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ public function testDatabase()

public function testCustomerManagedInstanceConfigurations()
{
$this->skipEmulatorTests();

$client = self::$client;

// Custom instance configuration IDs must start with 'custom' and may not contain any underscores.
Expand Down
9 changes: 2 additions & 7 deletions Spanner/tests/Unit/Connection/GrpcTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ public function testCreateInstanceConfig()
public function testUpdateInstanceConfig()
{
list ($args, $config, $fieldMask) = $this->instanceConfig(false);

$this->assertCallCorrect('updateInstanceConfig', $args, $this->expectResourceHeader(self::CONFIG, [
$config, $fieldMask
]), $this->lro, null);
Expand Down Expand Up @@ -1418,9 +1417,7 @@ private function instanceConfig($full = true)

$mask = [];
foreach (array_keys($args) as $key) {
if ($key !== 'name') {
$mask[] = Serializer::toSnakeCase($key);
}
$mask[] = Serializer::toSnakeCase($key);
}

$fieldMask = $this->serializer->decodeMessage(new FieldMask, ['paths' => $mask]);
Expand Down Expand Up @@ -1459,9 +1456,7 @@ private function instance($full = true, $nodes = true)

$mask = [];
foreach (array_keys($args) as $key) {
if ($key !== 'name') {
$mask[] = Serializer::toSnakeCase($key);
}
$mask[] = Serializer::toSnakeCase($key);
}

$fieldMask = $this->serializer->decodeMessage(new FieldMask, ['paths' => $mask]);
Expand Down

0 comments on commit 2dd8290

Please sign in to comment.