diff --git a/Core/tests/Unit/ServiceBuilderTest.php b/Core/tests/Unit/ServiceBuilderTest.php index 3667628bb29..494d65fb418 100644 --- a/Core/tests/Unit/ServiceBuilderTest.php +++ b/Core/tests/Unit/ServiceBuilderTest.php @@ -20,7 +20,6 @@ use Google\Cloud\Core\ServiceBuilder; use Google\Cloud\Core\Testing\CheckForClassTrait; use Google\Cloud\Core\Testing\GrpcTestTrait; -use Google\Cloud\Datastore\DatastoreClient; use Google\Cloud\Firestore\FirestoreClient; use Google\Cloud\Language\LanguageClient; use Google\Cloud\Logging\LoggingClient; @@ -161,9 +160,6 @@ public function serviceProvider() [ 'bigQuery', BigQueryClient::class - ], [ - 'datastore', - DatastoreClient::class ], [ 'firestore', FirestoreClient::class, diff --git a/Datastore/tests/Unit/DatastoreClientTest.php b/Datastore/tests/Unit/DatastoreClientTest.php index 2e60bf15916..d7bf1072074 100644 --- a/Datastore/tests/Unit/DatastoreClientTest.php +++ b/Datastore/tests/Unit/DatastoreClientTest.php @@ -23,6 +23,7 @@ use Google\Cloud\Core\RequestHandler; use Google\Cloud\Core\Testing\DatastoreOperationRefreshTrait; use Google\Cloud\Core\Testing\GrpcTestTrait; +use Google\Cloud\Core\Testing\Snippet\Fixtures; use Google\Cloud\Core\Testing\TestHelpers; use Google\Cloud\Core\Timestamp; use Google\Cloud\Datastore\Blob; @@ -30,7 +31,6 @@ use Google\Cloud\Datastore\Entity; use Google\Cloud\Datastore\GeoPoint; use Google\Cloud\Datastore\Key; -use Google\Cloud\Datastore\Query\Aggregation; use Google\Cloud\Datastore\Query\AggregationQuery; use Google\Cloud\Datastore\Query\AggregationQueryResult; use Google\Cloud\Datastore\Query\GqlQuery; @@ -40,7 +40,6 @@ use Google\Cloud\Datastore\Transaction; use Google\Cloud\Datastore\V1\CommitRequest\Mode; use PHPUnit\Framework\TestCase; -use Prophecy\Argument; use Prophecy\PhpUnit\ProphecyTrait; /** @@ -63,7 +62,10 @@ class DatastoreClientTest extends TestCase public function setUp(): void { $this->client = TestHelpers::stub(DatastoreClient::class, [ - ['projectId' => self::PROJECT] + [ + 'projectId' => self::PROJECT, + 'credentials' => Fixtures::KEYFILE_STUB_FIXTURE() + ] ], [ 'operation' ]); diff --git a/Datastore/tests/Unit/TransactionTest.php b/Datastore/tests/Unit/TransactionTest.php index a2c404d1dd5..efbc0881dec 100644 --- a/Datastore/tests/Unit/TransactionTest.php +++ b/Datastore/tests/Unit/TransactionTest.php @@ -132,38 +132,6 @@ public function testLookup(callable $transaction) $this->assertEquals($this->key->keyObject(), $res->key()->keyObject()); } - public function testLookupWithReadTime() - { - $time = new Timestamp(new \DateTime()); - - $this->mockSendRequest( - 'lookup', - [ - 'readOptions' => [ - 'readTime' => $time, - 'transaction' => self::TRANSACTION, - ], - 'keys' => [$this->key->keyObject()], - ], - [ - 'found' => [ - [ - 'entity' => $this->entityArray($this->key) - ] - ] - ], - 0 - ); - - $transaction = $this->readOnly; - $this->refreshOperation($transaction,$this->requestHandler->reveal(), [ - 'projectId' => self::PROJECT - ]); - - $res = $transaction->lookup($this->key, ['readTime' => $time]); - $this->assertInstanceOf(Entity::class, $res); - } - /** * @dataProvider transactionProvider */