Skip to content

Commit 60fe138

Browse files
committed
hopefully fix tests
1 parent dd302e2 commit 60fe138

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

BigQuery/tests/Unit/QueryResultsTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ class QueryResultsTest extends TestCase
3636
public $jobId = 'myJobId';
3737
public $queryData = [
3838
'jobComplete' => true,
39+
'jobReference' => ['location' => null],
3940
'rows' => [
4041
['f' => [['v' => 'Alton'], ['v' => 1]]]
4142
],

Firestore/tests/Unit/FirestoreSessionHandlerTest.php

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ public function setUp()
5656
public function testOpen()
5757
{
5858
$this->connection->beginTransaction(['database' => $this->dbName()])
59-
->shouldBeCalledTimes(1);
59+
->shouldBeCalledTimes(1)
60+
->willReturn(['transaction' => 123]);;
6061
$firestoreSessionHandler = new FirestoreSessionHandler(
6162
$this->connection->reveal(),
6263
$this->valueMapper->reveal(),
@@ -90,6 +91,9 @@ public function testOpenWithException()
9091
*/
9192
public function testReadNotAllowed()
9293
{
94+
$this->connection->beginTransaction(['database' => $this->dbName()])
95+
->shouldBeCalledTimes(1)
96+
->willThrow(new ServiceException(''));
9397
$firestoreSessionHandler = new FirestoreSessionHandler(
9498
$this->connection->reveal(),
9599
$this->valueMapper->reveal(),
@@ -124,7 +128,8 @@ public function testReadNothing()
124128
->shouldBeCalledTimes(1)
125129
->willReturn(null);
126130
$this->connection->beginTransaction(['database' => $this->dbName()])
127-
->shouldBeCalledTimes(1);
131+
->shouldBeCalledTimes(1)
132+
->willReturn(['transaction' => 123]);
128133
$this->connection->batchGetDocuments([
129134
'database' => $this->dbName(),
130135
'documents' => [$this->documentName()],
@@ -150,7 +155,8 @@ public function testReadNothing()
150155
public function testReadWithException()
151156
{
152157
$this->connection->beginTransaction(['database' => $this->dbName()])
153-
->shouldBeCalledTimes(1);
158+
->shouldBeCalledTimes(1)
159+
->willReturn(['transaction' => 123]);
154160
$this->connection->batchGetDocuments([
155161
'database' => $this->dbName(),
156162
'documents' => [$this->documentName()],
@@ -217,7 +223,8 @@ public function testWrite()
217223
return ['data' => ['stringValue' => 'sessiondata']];
218224
});
219225
$this->connection->beginTransaction(['database' => $this->dbName()])
220-
->shouldBeCalledTimes(1);
226+
->shouldBeCalledTimes(1)
227+
->willReturn(['transaction' => 123]);
221228
$this->connection->commit([
222229
'database' => $this->dbName(),
223230
'writes' => [

0 commit comments

Comments
 (0)