diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index abbd9f1249c4..054eaefda81e 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -21,7 +21,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '7.3' + php-version: '7.4' ini-values: memory_limit=2048M - name: Install Dependencies uses: nick-invision/retry@v1 diff --git a/.kokoro/continuous/php72.cfg b/.kokoro/continuous/php74.cfg similarity index 96% rename from .kokoro/continuous/php72.cfg rename to .kokoro/continuous/php74.cfg index b847cc0d5772..7b1b7fea8d93 100644 --- a/.kokoro/continuous/php72.cfg +++ b/.kokoro/continuous/php74.cfg @@ -15,7 +15,7 @@ env_vars: { # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/php72" + value: "gcr.io/cloud-devrel-kokoro-resources/php74" } # key files from keystore diff --git a/.kokoro/presubmit/php74.cfg b/.kokoro/presubmit/php74.cfg new file mode 100644 index 000000000000..17cf1918a27f --- /dev/null +++ b/.kokoro/presubmit/php74.cfg @@ -0,0 +1,7 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/php74" +} diff --git a/.kokoro/presubmit/run-tests.sh b/.kokoro/presubmit/run-tests.sh index 41ded3340b40..beea3bd6c75a 100755 --- a/.kokoro/presubmit/run-tests.sh +++ b/.kokoro/presubmit/run-tests.sh @@ -45,8 +45,8 @@ echo "Running Snippet Test Suite" vendor/bin/phpunit -c phpunit${PHPUNIT_SUFFIX}.xml.dist --verbose --log-junit \ ${SNIPPETS_LOG_FILENAME} -# Run docs gen on PHP 7.3 only -if [ "7.3" == ${PHP_VERSION:0:3} ]; then +# Run docs gen on PHP 7.4 only +if [ "7.4" == ${PHP_VERSION:0:3} ]; then echo "Running Doc Generator" # Require phpdocumentor:4 for docs generation diff --git a/BigQuery/tests/Unit/QueryResultsTest.php b/BigQuery/tests/Unit/QueryResultsTest.php index a81db69aa84c..329acca4624b 100644 --- a/BigQuery/tests/Unit/QueryResultsTest.php +++ b/BigQuery/tests/Unit/QueryResultsTest.php @@ -36,6 +36,7 @@ class QueryResultsTest extends TestCase public $jobId = 'myJobId'; public $queryData = [ 'jobComplete' => true, + 'jobReference' => ['location' => 123], 'rows' => [ ['f' => [['v' => 'Alton'], ['v' => 1]]] ], @@ -203,7 +204,7 @@ public function testReloadsInfo() public function testGetsIdentity() { - $queryResults = $this->getQueryResults($this->connection); + $queryResults = $this->getQueryResults($this->connection, $this->queryData); $this->assertEquals($this->jobId, $queryResults->identity()['jobId']); $this->assertEquals($this->projectId, $queryResults->identity()['projectId']); diff --git a/Core/src/Batch/BatchTrait.php b/Core/src/Batch/BatchTrait.php index 21f49a2c4fb6..a8a02e98380d 100644 --- a/Core/src/Batch/BatchTrait.php +++ b/Core/src/Batch/BatchTrait.php @@ -130,7 +130,7 @@ public function send(array $items) * * @return array */ - protected abstract function getCallback(); + abstract protected function getCallback(); /** * @param array $options [optional] { diff --git a/Firestore/tests/Unit/FirestoreSessionHandlerTest.php b/Firestore/tests/Unit/FirestoreSessionHandlerTest.php index 0b5b7c4ae33f..2f169bebf015 100644 --- a/Firestore/tests/Unit/FirestoreSessionHandlerTest.php +++ b/Firestore/tests/Unit/FirestoreSessionHandlerTest.php @@ -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(), @@ -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(), @@ -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()], @@ -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()], @@ -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()], @@ -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' => [ diff --git a/Spanner/tests/Snippet/Batch/PartitionSharedSnippetTestTrait.php b/Spanner/tests/Snippet/Batch/PartitionSharedSnippetTestTrait.php index bddfd783e140..78e53d5cb95c 100644 --- a/Spanner/tests/Snippet/Batch/PartitionSharedSnippetTestTrait.php +++ b/Spanner/tests/Snippet/Batch/PartitionSharedSnippetTestTrait.php @@ -26,7 +26,7 @@ trait PartitionSharedSnippetTestTrait private $token = 'token'; private $options = ['hello' => 'world']; - public abstract function setUp(); + abstract public function setUp(); /** * @dataProvider provideSerializeSnippetIndex diff --git a/composer.json b/composer.json index 17ef847ce8a9..ee58f39fff4c 100644 --- a/composer.json +++ b/composer.json @@ -57,7 +57,7 @@ }, "require-dev": { "phpunit/phpunit": "^4.8|^5.0", - "squizlabs/php_codesniffer": "2.*", + "squizlabs/php_codesniffer": "3.*", "phpdocumentor/reflection": "^3.0", "symfony/console": "^3.0", "erusev/parsedown": "^1.6",