Skip to content

Commit d30c589

Browse files
Merge pull request #93 from stackkit/feature/laravel-10
Update to Laravel 10
2 parents a4d3efa + fed5c1c commit d30c589

File tree

7 files changed

+44
-47
lines changed

7 files changed

+44
-47
lines changed

.github/workflows/run-tests.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,20 @@ jobs:
1313
matrix:
1414
db: ['mysql', 'pgsql']
1515
payload:
16+
- { queue: 'github-actions-laravel9-php81', laravel: '10.*', php: '8.2', 'testbench': '8.*'}
17+
- { queue: 'github-actions-laravel9-php81', laravel: '10.*', php: '8.1', 'testbench': '8.*'}
18+
- { queue: 'github-actions-laravel9-php81', laravel: '9.*', php: '8.2', 'testbench': '7.*'}
1619
- { queue: 'github-actions-laravel9-php81', laravel: '9.*', php: '8.1', 'testbench': '7.*'}
1720
- { queue: 'github-actions-laravel9-php80', laravel: '9.*', php: '8.0', 'testbench': '7.*'}
1821
- { queue: 'github-actions-laravel8-php81', laravel: '8.*', php: '8.1', 'testbench': '6.*'}
1922
- { queue: 'github-actions-laravel8-php80', laravel: '8.*', php: '8.0', 'testbench': '6.*'}
2023
- { queue: 'github-actions-laravel8-php74', laravel: '8.*', php: '7.4', 'testbench': '6.*'}
21-
- { queue: 'github-actions-laravel7-php80', laravel: '7.*', php: '8.0', 'testbench': '5.*' }
22-
- { queue: 'github-actions-laravel7-php74', laravel: '7.*', php: '7.4', 'testbench': '5.*' }
23-
- { queue: 'github-actions-laravel6-php80', laravel: '6.*', php: '8.0', 'testbench': '4.*' }
24-
- { queue: 'github-actions-laravel6-php74', laravel: '6.*', php: '7.4', 'testbench': '4.*' }
2524

2625
name: PHP ${{ matrix.payload.php }} - Laravel ${{ matrix.payload.laravel }} - DB ${{ matrix.db }}
2726

2827
steps:
2928
- name: Checkout code
30-
uses: actions/checkout@v1
29+
uses: actions/checkout@v3
3130

3231
- name: Setup PHP
3332
uses: shivammathur/setup-php@v2

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
66

7+
## 3.4.0 - 2023-02-08
8+
9+
**Changed**
10+
11+
- Added support for Laravel 10
12+
- Dropped support for Laravel 6 and 7
13+
714
## 3.3.2 - 2022-11-19
815

916
**Changed**

README.md

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,9 @@ This package allows Google Cloud Tasks to be used as the queue driver.
2121
</summary>
2222

2323
<br>
24-
This package requires Laravel 6 or higher and supports MySQL 8 and PostgreSQL 14. Might support older database versions too, but package hasn't been tested for it.
24+
This package requires Laravel 8 or higher and supports MySQL 8 and PostgreSQL 14. Might support older database versions too, but package hasn't been tested for it.
2525

26-
Please check the table below for supported Laravel and PHP versions:
27-
28-
|Laravel Version| PHP Version |
29-
|---|---|
30-
| 6.x | 7.4 or 8.0
31-
| 7.x | 7.4 or 8.0
32-
| 8.x | 7.4 or 8.0 or 8.1
33-
| 9.x | 8.0 or 8.1
26+
Please check the [Laravel support policy](https://laravel.com/docs/master/releases#support-policy) table for supported Laravel and PHP versions.
3427
</details>
3528
<details>
3629
<summary>Installation</summary>

composer.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@
1111
"ext-json": "*",
1212
"phpseclib/phpseclib": "~2.0",
1313
"google/cloud-tasks": "^1.10",
14+
"illuminate/support": "^8.0|^9.0|^10.0",
1415
"thecodingmachine/safe": "^1.0|^2.0"
1516
},
1617
"require-dev": {
17-
"orchestra/testbench": "^4.0 || ^5.0 || ^6.0 || ^7.0",
18+
"orchestra/testbench": "^6.0 || ^7.0 || ^8.0",
1819
"nunomaduro/larastan": "^1.0 || ^2.0",
1920
"thecodingmachine/phpstan-safe-rule": "^1.2",
2021
"laravel/legacy-factories": "^1.3"
@@ -37,7 +38,13 @@
3738
]
3839
}
3940
},
41+
"minimum-stability": "dev",
42+
"prefer-stable": true,
4043
"scripts": {
44+
"l10": [
45+
"composer require laravel/framework:10.* orchestra/testbench:8.* --no-interaction --no-update",
46+
"composer update --prefer-stable --prefer-dist --no-interaction --no-suggest"
47+
],
4148
"l9": [
4249
"composer require laravel/framework:9.* orchestra/testbench:7.* --no-interaction --no-update",
4350
"composer update --prefer-stable --prefer-dist --no-interaction --no-suggest"

phpunit.xml

Lines changed: 17 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,19 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit backupGlobals="false"
3-
backupStaticAttributes="false"
4-
bootstrap="vendor/autoload.php"
5-
colors="true"
6-
convertErrorsToExceptions="true"
7-
convertNoticesToExceptions="true"
8-
convertWarningsToExceptions="true"
9-
processIsolation="false"
10-
stopOnFailure="false">
11-
<testsuites>
12-
<testsuite name="Testsuite">
13-
<directory suffix="Test.php">./tests</directory>
14-
</testsuite>
15-
</testsuites>
16-
<php>
17-
<env name="APP_DEBUG" value="1"/>
18-
<env name="APP_ENV" value="testing"/>
19-
<env name="APP_KEY" value="AckfSECXIvnK5r28GVIWUAxmbBSjTsmF"/>
20-
<env name="CACHE_DRIVER" value="array"/>
21-
<env name="SESSION_DRIVER" value="array"/>
22-
<env name="MAIL_DRIVER" value="log"/>
23-
<env name="GOOGLE_APPLICATION_CREDENTIALS" value="./tests/Support/gcloud-key-valid.json" />
24-
<env name="QUEUE_DRIVER" value="cloudtasks"/>
25-
<env name="DB_DRIVER" value="mysql" />
26-
</php>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" bootstrap="vendor/autoload.php" colors="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.0/phpunit.xsd" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
3+
<testsuites>
4+
<testsuite name="Testsuite">
5+
<directory suffix="Test.php">./tests</directory>
6+
</testsuite>
7+
</testsuites>
8+
<php>
9+
<env name="APP_DEBUG" value="1"/>
10+
<env name="APP_ENV" value="testing"/>
11+
<env name="APP_KEY" value="AckfSECXIvnK5r28GVIWUAxmbBSjTsmF"/>
12+
<env name="CACHE_DRIVER" value="array"/>
13+
<env name="SESSION_DRIVER" value="array"/>
14+
<env name="MAIL_DRIVER" value="log"/>
15+
<env name="GOOGLE_APPLICATION_CREDENTIALS" value="./tests/Support/gcloud-key-valid.json"/>
16+
<env name="QUEUE_DRIVER" value="cloudtasks"/>
17+
<env name="DB_DRIVER" value="mysql"/>
18+
</php>
2719
</phpunit>

tests/TaskHandlerTest.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,19 +76,18 @@ public function it_returns_responses_for_invalid_json($debug)
7676
// Assert
7777
if ($debug) {
7878
$response->assertJsonValidationErrors('task');
79-
$this->assertEquals('The json must be a valid JSON string.', $response->json('errors.json.0'));
8079
} else {
8180
$response->assertNotFound();
8281
}
8382
}
8483

8584
/**
8685
* @test
87-
* @testWith ["{\"invalid\": \"data\"}", "The task.data field is required."]
88-
* ["{\"data\": \"\"}", "The task.data field is required."]
89-
* ["{\"data\": \"test\"}", "The task.data must be an array."]
86+
* @testWith ["{\"invalid\": \"data\"}"]
87+
* ["{\"data\": \"\"}"]
88+
* ["{\"data\": \"test\"}"]
9089
*/
91-
public function it_returns_responses_for_invalid_payloads(string $payload, string $expectedMessage)
90+
public function it_returns_responses_for_invalid_payloads(string $payload)
9291
{
9392
// Arrange
9493

@@ -107,7 +106,6 @@ public function it_returns_responses_for_invalid_payloads(string $payload, strin
107106

108107
// Assert
109108
$response->assertJsonValidationErrors('task.data');
110-
$this->assertEquals($expectedMessage, $response->json(['errors', 'task.data', 0]));
111109
}
112110

113111
/**

tests/TestCase.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ protected function getEnvironmentSetUp($app)
109109

110110
$disableDashboardPrefix = 'when_dashboard_is_disabled';
111111

112-
if (substr($this->getName(), 0, strlen($disableDashboardPrefix)) === $disableDashboardPrefix) {
112+
$testName = method_exists($this, 'name') ? $this->name() : $this->getName();
113+
if (substr($testName, 0, strlen($disableDashboardPrefix)) === $disableDashboardPrefix) {
113114
$app['config']->set('cloud-tasks.dashboard.enabled', false);
114115
} else {
115116
$app['config']->set('cloud-tasks.dashboard.enabled', true);

0 commit comments

Comments
 (0)