Skip to content

Commit 322639e

Browse files
committed
Update to Laravel 10
1 parent a4d3efa commit 322639e

File tree

4 files changed

+17
-9
lines changed

4 files changed

+17
-9
lines changed

.github/workflows/run-tests.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ 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.*'}
@@ -27,7 +30,7 @@ jobs:
2730

2831
steps:
2932
- name: Checkout code
30-
uses: actions/checkout@v1
33+
uses: actions/checkout@v3
3134

3235
- name: Setup PHP
3336
uses: shivammathur/setup-php@v2

composer.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"thecodingmachine/safe": "^1.0|^2.0"
1515
},
1616
"require-dev": {
17-
"orchestra/testbench": "^4.0 || ^5.0 || ^6.0 || ^7.0",
17+
"orchestra/testbench": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0",
1818
"nunomaduro/larastan": "^1.0 || ^2.0",
1919
"thecodingmachine/phpstan-safe-rule": "^1.2",
2020
"laravel/legacy-factories": "^1.3"
@@ -37,7 +37,13 @@
3737
]
3838
}
3939
},
40+
"minimum-stability": "dev",
41+
"prefer-stable": true,
4042
"scripts": {
43+
"l10": [
44+
"composer require laravel/framework:10.* orchestra/testbench:8.* --no-interaction --no-update",
45+
"composer update --prefer-stable --prefer-dist --no-interaction --no-suggest"
46+
],
4147
"l9": [
4248
"composer require laravel/framework:9.* orchestra/testbench:7.* --no-interaction --no-update",
4349
"composer update --prefer-stable --prefer-dist --no-interaction --no-suggest"

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)