Skip to content

Addd Laravel 10 support #85

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
fail-fast: true
matrix:
testbench: ['^6.12', '^7.19']
testbench: ['^8.0']
name: Testbench ${{ matrix.testbench }}
steps:
- uses: actions/checkout@v2
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
/vendor
composer.lock
.phpunit.result.cache
.phpunit.cache/test-results
14 changes: 7 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@
"require": {
"php": "^7.4|^8.0",
"ext-json": "*",
"illuminate/config": "^6.0|^7.0|^8.0|^9.0",
"illuminate/console": "^6.0|^7.0|^8.0|^9.0",
"illuminate/contracts": "^6.0|^7.0|^8.0|^9.0",
"illuminate/support": "^6.0|^7.0|^8.0|^9.0",
"illuminate/routing": "^6.0|^7.0|^8.0|^9.0"
"illuminate/config": "^6.0|^7.0|^8.0|^9.0|^10.0",
"illuminate/console": "^6.0|^7.0|^8.0|^9.0|^10.0",
"illuminate/contracts": "^6.0|^7.0|^8.0|^9.0|^10.0",
"illuminate/support": "^6.0|^7.0|^8.0|^9.0|^10.0",
"illuminate/routing": "^6.0|^7.0|^8.0|^9.0|^10.0"
},
"extra": {
"laravel": {
Expand All @@ -45,7 +45,7 @@
"minimum-stability": "dev",
"prefer-stable": true,
"require-dev": {
"orchestra/testbench": "^6.12",
"phpunit/phpunit": "^9.5"
"orchestra/testbench": "^8.0",
"phpunit/phpunit": "^10.0"
}
}
9 changes: 3 additions & 6 deletions phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,12 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
bootstrap="vendor/autoload.php"
backupGlobals="false"
backupStaticAttributes="false"
colors="true"
verbose="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.0/phpunit.xsd"
cacheDirectory=".phpunit.cache"
backupStaticProperties="false"
>
<coverage>
<include>
Expand Down
6 changes: 5 additions & 1 deletion src/Commands/ExportPostmanCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,11 @@ protected function getReflectionMethod(array $routeAction): ?object

public static function containsSerializedClosure(array $action): bool
{
return is_string($action['uses']) && Str::startsWith($action['uses'], ['C:32:"Opis\\Closure\\SerializableClosure', 'O:47:"Laravel\SerializableClosure\SerializableClosure']);
return is_string($action['uses']) && Str::startsWith($action['uses'], [
'C:32:"Opis\\Closure\\SerializableClosure',
'O:47:"Laravel\SerializableClosure\\SerializableClosure',
'O:55:"Laravel\\SerializableClosure\\UnsignedSerializableClosure',
]);
}

protected function buildTree(array &$routes, array $segments, array $request): void
Expand Down
12 changes: 6 additions & 6 deletions tests/Feature/ExportPostmanTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,11 @@ public function test_rules_printing_export_to_human_readable_works()

$fields = collect($targetRequest['request']['body']['urlencoded']);
$this->assertCount(1, $fields->where('key', 'field_1')->where('description', 'The field 1 field is required.'));
$this->assertCount(1, $fields->where('key', 'field_2')->where('description', 'The field 2 field is required., The field 2 must be an integer.'));
$this->assertCount(1, $fields->where('key', 'field_3')->where('description', '(Optional), The field 3 must be an integer.'));
$this->assertCount(1, $fields->where('key', 'field_4')->where('description', '(Nullable), The field 4 must be an integer.'));
$this->assertCount(1, $fields->where('key', 'field_2')->where('description', 'The field 2 field is required., The field 2 field must be an integer.'));
$this->assertCount(1, $fields->where('key', 'field_3')->where('description', '(Optional), The field 3 field must be an integer.'));
$this->assertCount(1, $fields->where('key', 'field_4')->where('description', '(Nullable), The field 4 field must be an integer.'));
// the below fails locally, but passes on GitHub actions?
$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.'));
$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.'));

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

public function test_event_export_works()
Expand Down Expand Up @@ -231,7 +231,7 @@ public function test_event_export_works()
}
}

public function providerFormDataEnabled(): array
public static function providerFormDataEnabled(): array
{
return [
[
Expand Down