Skip to content

Commit 26ab882

Browse files
authored
Merge pull request #85 from andreaselia/feature/laravel-10
Addd Laravel 10 support
2 parents 3fbcfc2 + ee7e371 commit 26ab882

File tree

6 files changed

+23
-21
lines changed

6 files changed

+23
-21
lines changed

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
strategy:
1313
fail-fast: true
1414
matrix:
15-
testbench: ['^6.12', '^7.19']
15+
testbench: ['^8.0']
1616
name: Testbench ${{ matrix.testbench }}
1717
steps:
1818
- uses: actions/checkout@v2

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
/vendor
33
composer.lock
44
.phpunit.result.cache
5+
.phpunit.cache/test-results

composer.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@
2929
"require": {
3030
"php": "^7.4|^8.0",
3131
"ext-json": "*",
32-
"illuminate/config": "^6.0|^7.0|^8.0|^9.0",
33-
"illuminate/console": "^6.0|^7.0|^8.0|^9.0",
34-
"illuminate/contracts": "^6.0|^7.0|^8.0|^9.0",
35-
"illuminate/support": "^6.0|^7.0|^8.0|^9.0",
36-
"illuminate/routing": "^6.0|^7.0|^8.0|^9.0"
32+
"illuminate/config": "^6.0|^7.0|^8.0|^9.0|^10.0",
33+
"illuminate/console": "^6.0|^7.0|^8.0|^9.0|^10.0",
34+
"illuminate/contracts": "^6.0|^7.0|^8.0|^9.0|^10.0",
35+
"illuminate/support": "^6.0|^7.0|^8.0|^9.0|^10.0",
36+
"illuminate/routing": "^6.0|^7.0|^8.0|^9.0|^10.0"
3737
},
3838
"extra": {
3939
"laravel": {
@@ -45,7 +45,7 @@
4545
"minimum-stability": "dev",
4646
"prefer-stable": true,
4747
"require-dev": {
48-
"orchestra/testbench": "^6.12",
49-
"phpunit/phpunit": "^9.5"
48+
"orchestra/testbench": "^8.0",
49+
"phpunit/phpunit": "^10.0"
5050
}
5151
}

phpunit.xml

+3-6
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,12 @@
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
44
bootstrap="vendor/autoload.php"
55
backupGlobals="false"
6-
backupStaticAttributes="false"
76
colors="true"
8-
verbose="true"
9-
convertErrorsToExceptions="true"
10-
convertNoticesToExceptions="true"
11-
convertWarningsToExceptions="true"
127
processIsolation="false"
138
stopOnFailure="false"
14-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
9+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.0/phpunit.xsd"
10+
cacheDirectory=".phpunit.cache"
11+
backupStaticProperties="false"
1512
>
1613
<coverage>
1714
<include>

src/Commands/ExportPostmanCommand.php

+5-1
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,11 @@ protected function getReflectionMethod(array $routeAction): ?object
213213

214214
public static function containsSerializedClosure(array $action): bool
215215
{
216-
return is_string($action['uses']) && Str::startsWith($action['uses'], ['C:32:"Opis\\Closure\\SerializableClosure', 'O:47:"Laravel\SerializableClosure\SerializableClosure']);
216+
return is_string($action['uses']) && Str::startsWith($action['uses'], [
217+
'C:32:"Opis\\Closure\\SerializableClosure',
218+
'O:47:"Laravel\SerializableClosure\\SerializableClosure',
219+
'O:55:"Laravel\\SerializableClosure\\UnsignedSerializableClosure',
220+
]);
217221
}
218222

219223
protected function buildTree(array &$routes, array $segments, array $request): void

tests/Feature/ExportPostmanTest.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -187,11 +187,11 @@ public function test_rules_printing_export_to_human_readable_works()
187187

188188
$fields = collect($targetRequest['request']['body']['urlencoded']);
189189
$this->assertCount(1, $fields->where('key', 'field_1')->where('description', 'The field 1 field is required.'));
190-
$this->assertCount(1, $fields->where('key', 'field_2')->where('description', 'The field 2 field is required., The field 2 must be an integer.'));
191-
$this->assertCount(1, $fields->where('key', 'field_3')->where('description', '(Optional), The field 3 must be an integer.'));
192-
$this->assertCount(1, $fields->where('key', 'field_4')->where('description', '(Nullable), The field 4 must be an integer.'));
190+
$this->assertCount(1, $fields->where('key', 'field_2')->where('description', 'The field 2 field is required., The field 2 field must be an integer.'));
191+
$this->assertCount(1, $fields->where('key', 'field_3')->where('description', '(Optional), The field 3 field must be an integer.'));
192+
$this->assertCount(1, $fields->where('key', 'field_4')->where('description', '(Nullable), The field 4 field must be an integer.'));
193193
// the below fails locally, but passes on GitHub actions?
194-
$this->assertCount(1, $fields->where('key', 'field_5')->where('description', 'The field 5 field is required., The field 5 must be an integer., The field 5 must not be greater than 30., The field 5 must be at least 1.'));
194+
$this->assertCount(1, $fields->where('key', 'field_5')->where('description', 'The field 5 field is required., The field 5 field must be an integer., The field 5 field must not be greater than 30., The field 5 field must be at least 1.'));
195195

196196
/** This looks bad, but this is the default message in lang/en/validation.php, you can update to:.
197197
*
@@ -200,7 +200,7 @@ public function test_rules_printing_export_to_human_readable_works()
200200
$this->assertCount(1, $fields->where('key', 'field_6')->where('description', 'The selected field 6 is invalid.'));
201201
$this->assertCount(1, $fields->where('key', 'field_7')->where('description', 'The field 7 field is required.'));
202202
$this->assertCount(1, $fields->where('key', 'field_8')->where('description', 'validation.'));
203-
$this->assertCount(1, $fields->where('key', 'field_9')->where('description', 'The field 9 field is required., The field 9 must be a string.'));
203+
$this->assertCount(1, $fields->where('key', 'field_9')->where('description', 'The field 9 field is required., The field 9 field must be a string.'));
204204
}
205205

206206
public function test_event_export_works()
@@ -231,7 +231,7 @@ public function test_event_export_works()
231231
}
232232
}
233233

234-
public function providerFormDataEnabled(): array
234+
public static function providerFormDataEnabled(): array
235235
{
236236
return [
237237
[

0 commit comments

Comments
 (0)