Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Core/src/Testing/Snippet/SnippetTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
*/
class SnippetTestCase extends TestCase
{
const PROJECT = 'my-awesome-project';

use CheckForClassTrait;

private static $coverage;
Expand Down
7 changes: 4 additions & 3 deletions Core/tests/Unit/Batch/OpisClosureSerializerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,13 @@
/**
* @group core
* @group batch
* @runTestsInSeparateProcesses
*/
class OpisClosureSerializerTest extends TestCase
{
public function testWrapAndUnwrapClosures()
{
if (!method_exists(SerializableClosure::class, 'enterContext')) {
if (!@method_exists(SerializableClosure::class, 'enterContext')) {
$this->markTestSkipped('Requires ops/serializer:v3');
}

Expand All @@ -49,8 +50,8 @@ public function testWrapAndUnwrapClosures()

public function testWrapAndUnwrapClosuresV4()
{
if (!function_exists('Opis\Closure\serialize')) {
$this->markTestSkipped('Requires ops/serializer:v3');
if (@method_exists(SerializableClosure::class, 'enterContext')) {
$this->markTestSkipped('Requires ops/serializer:v4');
}

$data['closure'] = function () {
Expand Down
1 change: 1 addition & 0 deletions Core/tests/Unit/Lock/FlockLockTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
/**
* @group core
* @group lock
* @runTestsInSeparateProcesses
*/
class FlockLockTest extends TestCase
{
Expand Down
1 change: 1 addition & 0 deletions Core/tests/Unit/Lock/SemaphoreLockTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
/**
* @group core
* @group lock
* @runTestsInSeparateProcesses
*/
class SemaphoreLockTest extends TestCase
{
Expand Down
2 changes: 1 addition & 1 deletion Datastore/tests/Snippet/FilterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class FilterTest extends SnippetTestCase
use ProphecyTrait;
use ProtoEncodeTrait;

private const PROJECT = 'alpha-project';
const PROJECT = 'alpha-project';
private $gapicClient;
private $datastore;
private $operation;
Expand Down
2 changes: 1 addition & 1 deletion PubSub/tests/Snippet/PubSubClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class PubSubClientTest extends SnippetTestCase
{
use ProphecyTrait;

private const PROJECT_ID = 'my-awesome-project';
const PROJECT_ID = 'my-awesome-project';
private const TOPIC = 'projects/my-awesome-project/topics/my-new-topic';
private const SUBSCRIPTION = 'projects/my-awesome-project/subscriptions/my-new-subscription';
private const SNAPSHOT = 'projects/my-awesome-project/snapshots/my-snapshot';
Expand Down
2 changes: 1 addition & 1 deletion PubSub/tests/Snippet/SnapshotTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class SnapshotTest extends SnippetTestCase
use ProphecyTrait;
use ApiHelperTrait;

private const PROJECT = 'my-awesome-project';
const PROJECT = 'my-awesome-project';
private const SNAPSHOT = 'projects/my-awesome-project/snapshots/my-snapshot';
private const PROJECT_ID = 'my-awesome-project';

Expand Down
6 changes: 3 additions & 3 deletions Spanner/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
"google/gax": "^1.38.0"
},
"require-dev": {
"phpunit/phpunit": "^9.0",
"phpspec/prophecy-phpunit": "^2.0",
"squizlabs/php_codesniffer": "2.*",
"phpunit/phpunit": "^9.6",
"phpspec/prophecy-phpunit": "^2.1",
"squizlabs/php_codesniffer": "3.*",
"phpdocumentor/reflection": "^5.3.3||^6.0",
"phpdocumentor/reflection-docblock": "^5.3",
"erusev/parsedown": "^1.6",
Expand Down
17 changes: 7 additions & 10 deletions Spanner/src/Backup.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
use DateTimeInterface;
use Google\ApiCore\Options\CallOptions;
use Google\ApiCore\ValidationException;
use Google\Cloud\Core\ApiHelperTrait;
use Google\Cloud\Core\Exception\NotFoundException;
use Google\Cloud\Core\Iterator\ItemIterator;
use Google\Cloud\Core\LongRunning\LongRunningClientConnection;
Expand Down Expand Up @@ -51,6 +52,7 @@
class Backup
{
use RequestTrait;
use ApiHelperTrait;

const STATE_READY = State::READY;
const STATE_CREATING = State::CREATING;
Expand Down Expand Up @@ -372,22 +374,17 @@ public function state(array $options = []): int|null
*/
public function updateExpireTime(DateTimeInterface $newTimestamp, array $options = []): array
{
$options += [
'backup' => [
'name' => $this->name(),
'expireTime' => $this->formatTimeAsArray($newTimestamp),
],
'updateMask' => [
'paths' => ['expire_time']
]
];
$options['expireTime'] = $this->formatTimeAsArray($newTimestamp);

/**
* @var UpdateBackupRequest $updateBackup
* @var array $callOptions
*/
[$updateBackup, $callOptions] = $this->validateOptions(
$options,
[
'backup' => $options + ['name' => $this->name()],
'updateMask' => $this->fieldMask($options),
],
new UpdateBackupRequest(),
CallOptions::class,
);
Expand Down
Loading
Loading