diff --git a/.gitignore b/.gitignore index 47e1659..559442e 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ /vendor composer.lock .phpunit.result.cache +.phpunit.cache/test-results diff --git a/composer.json b/composer.json index 731bf41..373effd 100644 --- a/composer.json +++ b/composer.json @@ -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": { @@ -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" } } diff --git a/phpunit.xml b/phpunit.xml index 3f7bdba..15ad20d 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -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" > diff --git a/src/Commands/ExportPostmanCommand.php b/src/Commands/ExportPostmanCommand.php index 012a5a6..f2b2095 100644 --- a/src/Commands/ExportPostmanCommand.php +++ b/src/Commands/ExportPostmanCommand.php @@ -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 diff --git a/tests/Feature/ExportPostmanTest.php b/tests/Feature/ExportPostmanTest.php index 761dbc4..48e131e 100644 --- a/tests/Feature/ExportPostmanTest.php +++ b/tests/Feature/ExportPostmanTest.php @@ -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:. * @@ -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() @@ -231,7 +231,7 @@ public function test_event_export_works() } } - public function providerFormDataEnabled(): array + public static function providerFormDataEnabled(): array { return [ [