Skip to content

Commit

Permalink
chore: add presubmit and continuous kokoro tests (#5229)
Browse files Browse the repository at this point in the history
* chore: add kokoro configs for running tests on PHP 7.4 and 8.0

* update PHP version for docs

* use php80 for continuous tests

* update kokoro to ues php 8 for docs gen

* update cs library and fix cs

* hopefully fix tests

* Revert "hopefully fix tests"

This reverts commit 60fe1387b5e1d22159f1cee001d4e1078dd3b448.

* fix tests for PHP 7.4

* Update docs.yml

* remove 8.0
  • Loading branch information
bshaffer committed Apr 21, 2022
1 parent 4f25a2f commit bd881fe
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions tests/Unit/FirestoreSessionHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ public function setUp()
public function testOpen()
{
$this->connection->beginTransaction(['database' => $this->dbName()])
->shouldBeCalledTimes(1);
->shouldBeCalledTimes(1)
->willReturn(['transaction' => null]);
$firestoreSessionHandler = new FirestoreSessionHandler(
$this->connection->reveal(),
$this->valueMapper->reveal(),
Expand Down Expand Up @@ -90,6 +91,9 @@ public function testOpenWithException()
*/
public function testReadNotAllowed()
{
$this->connection->beginTransaction(['database' => $this->dbName()])
->shouldBeCalledTimes(1)
->willReturn(['transaction' => null]);
$firestoreSessionHandler = new FirestoreSessionHandler(
$this->connection->reveal(),
$this->valueMapper->reveal(),
Expand Down Expand Up @@ -124,7 +128,8 @@ public function testReadNothing()
->shouldBeCalledTimes(1)
->willReturn(null);
$this->connection->beginTransaction(['database' => $this->dbName()])
->shouldBeCalledTimes(1);
->shouldBeCalledTimes(1)
->willReturn(['transaction' => null]);
$this->connection->batchGetDocuments([
'database' => $this->dbName(),
'documents' => [$this->documentName()],
Expand All @@ -150,7 +155,8 @@ public function testReadNothing()
public function testReadWithException()
{
$this->connection->beginTransaction(['database' => $this->dbName()])
->shouldBeCalledTimes(1);
->shouldBeCalledTimes(1)
->willReturn(['transaction' => null]);
$this->connection->batchGetDocuments([
'database' => $this->dbName(),
'documents' => [$this->documentName()],
Expand Down Expand Up @@ -186,7 +192,8 @@ public function testReadEntity()
->shouldBeCalledTimes(1)
->willReturn(['data' => 'sessiondata']);
$this->connection->beginTransaction(['database' => $this->dbName()])
->shouldBeCalledTimes(1);
->shouldBeCalledTimes(1)
->willReturn(['transaction' => null]);
$this->connection->batchGetDocuments([
'database' => $this->dbName(),
'documents' => [$this->documentName()],
Expand Down Expand Up @@ -217,7 +224,8 @@ public function testWrite()
return ['data' => ['stringValue' => 'sessiondata']];
});
$this->connection->beginTransaction(['database' => $this->dbName()])
->shouldBeCalledTimes(1);
->shouldBeCalledTimes(1)
->willReturn(['transaction' => null]);
$this->connection->commit([
'database' => $this->dbName(),
'writes' => [
Expand Down

0 comments on commit bd881fe

Please sign in to comment.