Skip to content

Commit

Permalink
add tests for appProfileId
Browse files Browse the repository at this point in the history
  • Loading branch information
bshaffer committed Jan 17, 2025
1 parent 5c0fa92 commit 0e6dde1
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions Bigtable/tests/Unit/TableTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,50 @@ public function testMutateRowsOptionalConfiguration()
$this->table->mutateRows($this->rowMutations, $options);
}

public function testAppProfileIdInTableConstructor()
{
$this->serverStream->readAll()
->shouldBeCalled()
->willReturn(
$this->arrayAsGenerator([])
);
$this->bigtableClient->mutateRows(
Argument::that(function (MutateRowsRequest $request) {
return $request->getAppProfileId() === self::APP_PROFILE;
}),
Argument::type('array')
)
->shouldBeCalledOnce()
->willReturn(
$this->serverStream->reveal()
);

$this->table->mutateRows($this->rowMutations);
}

public function testAppProfileIdInMethodOptions()
{
$this->serverStream->readAll()
->shouldBeCalled()
->willReturn(
$this->arrayAsGenerator([])
);

$this->bigtableClient->mutateRows(
Argument::that(function (MutateRowsRequest $request) {
return $request->getAppProfileId() === 'app-profile-id-2';
}),
Argument::type('array')
)
->shouldBeCalledOnce()
->willReturn(
$this->serverStream->reveal()
);
$this->table->mutateRows($this->rowMutations, [
'appProfileId' => 'app-profile-id-2'
]);
}

public function testMutateRowsFailure()
{
$statuses = [];
Expand Down

0 comments on commit 0e6dde1

Please sign in to comment.