Skip to content
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

feat(deps): support laravel 11 #6

Merged
merged 2 commits into from
Apr 12, 2024
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
15 changes: 12 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,15 @@ jobs:
strategy:
fail-fast: true
matrix:
php: [8.0, 8.1, 8.2]
php: ["8.0", "8.1", "8.2", "8.3"]
laravel: ["^9.0", "^10.0", "^11.0"]
exclude:
- { php: "8.0", laravel: "^10.0"}
- { php: "8.0", laravel: "^11.0"}
- { php: "8.1", laravel: "^11.0"}
- { php: "8.3", laravel: "^9.0"}

name: PHP ${{ matrix.php }}
name: PHP ${{ matrix.php }} / Laravel ${{ matrix.laravel }}

steps:
- name: Checkout code
Expand All @@ -30,8 +36,11 @@ jobs:
extensions: dom, curl, libxml, mbstring, zip
coverage: none

- name: Set laravel version
run: composer require "laravel/framework=${{ matrix.laravel }}" --no-update --no-interaction --no-progress

- name: Install dependencies
run: composer update --prefer-dist --no-interaction --no-progress

- name: Execute tests
run: vendor/bin/phpunit --verbose
run: vendor/bin/phpunit
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
"ext-json": "*",
"doctrine/dbal": "^2.6|^3.0",
"goldspecdigital/oooas": "^2.7.1",
"laravel/framework": "5.8.*|^6.0|^7.0|^8.0|^9.0|^10.0",
"laravel/framework": "5.8.*|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0",
"phpdocumentor/reflection-docblock": "^5.0"
},
"require-dev": {
"orchestra/testbench": "^5.3|^6.0|^7.0",
"phpunit/phpunit": "^9.5.13"
"orchestra/testbench": "^5.3|^6.0|^7.0|^8.0|^9.0",
"phpunit/phpunit": "^9.5.13|^10.5"
},
"autoload": {
"psr-4": {
Expand Down
64 changes: 32 additions & 32 deletions tests/Builders/InfoBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ class InfoBuilderTest extends TestCase
/**
* @dataProvider providerBuildContact
*
* @param array $config
* @param array $expected
* @param array $config
* @param array $expected
* @return void
*/
public function testBuildContact(array $config, array $expected): void
Expand All @@ -23,7 +23,7 @@ public function testBuildContact(array $config, array $expected): void
$this->assertSameAssociativeArray($expected, $info->toArray());
}

public function providerBuildContact(): array
public static function providerBuildContact(): array
{
$common = [
'title' => 'sample_title',
Expand All @@ -40,8 +40,8 @@ public function providerBuildContact(): array
'url' => 'sample_contact_url',
],
'license' => [
'name'=>'sample_license_name',
'url'=>'sample_license_url',
'name' => 'sample_license_name',
'url' => 'sample_license_url',
],
]),
array_merge($common, [
Expand All @@ -51,8 +51,8 @@ public function providerBuildContact(): array
'url' => 'sample_contact_url',
],
'license' => [
'name'=>'sample_license_name',
'url'=>'sample_license_url',
'name' => 'sample_license_name',
'url' => 'sample_license_url',
],
]),
],
Expand All @@ -63,8 +63,8 @@ public function providerBuildContact(): array
'url' => 'sample_contact_url',
],
'license' => [
'name'=>'sample_license_name',
'url'=>'sample_license_url',
'name' => 'sample_license_name',
'url' => 'sample_license_url',
],
]),
array_merge($common, [
Expand All @@ -73,8 +73,8 @@ public function providerBuildContact(): array
'url' => 'sample_contact_url',
],
'license' => [
'name'=>'sample_license_name',
'url'=>'sample_license_url',
'name' => 'sample_license_name',
'url' => 'sample_license_url',
],
]),
],
Expand All @@ -85,8 +85,8 @@ public function providerBuildContact(): array
'url' => 'sample_contact_url',
],
'license' => [
'name'=>'sample_license_name',
'url'=>'sample_license_url',
'name' => 'sample_license_name',
'url' => 'sample_license_url',
],
]),
array_merge($common, [
Expand All @@ -95,8 +95,8 @@ public function providerBuildContact(): array
'url' => 'sample_contact_url',
],
'license' => [
'name'=>'sample_license_name',
'url'=>'sample_license_url',
'name' => 'sample_license_name',
'url' => 'sample_license_url',
],
]),
],
Expand All @@ -107,8 +107,8 @@ public function providerBuildContact(): array
'email' => 'sample_contact_email',
],
'license' => [
'name'=>'sample_license_name',
'url'=>'sample_license_url',
'name' => 'sample_license_name',
'url' => 'sample_license_url',
],
]),
array_merge($common, [
Expand All @@ -117,37 +117,37 @@ public function providerBuildContact(): array
'email' => 'sample_contact_email',
],
'license' => [
'name'=>'sample_license_name',
'url'=>'sample_license_url',
'name' => 'sample_license_name',
'url' => 'sample_license_url',
],
]),
],
'If Contact does not exist, the correct json can be output.' => [
array_merge($common, [
'license' => [
'name'=>'sample_license_name',
'url'=>'sample_license_url',
'name' => 'sample_license_name',
'url' => 'sample_license_url',
],
]),
array_merge($common, [
'license' => [
'name'=>'sample_license_name',
'url'=>'sample_license_url',
'name' => 'sample_license_name',
'url' => 'sample_license_url',
],
]),
],
'If Contact.* does not exist, the correct json can be output.' => [
array_merge($common, [
'contact' => [],
'license' => [
'name'=>'sample_license_name',
'url'=>'sample_license_url',
'name' => 'sample_license_name',
'url' => 'sample_license_url',
],
]),
array_merge($common, [
'license' => [
'name'=>'sample_license_name',
'url'=>'sample_license_url',
'name' => 'sample_license_name',
'url' => 'sample_license_url',
],
]),
],
Expand All @@ -160,7 +160,7 @@ public function providerBuildContact(): array
'url' => 'sample_contact_url',
],
'license' => [
'url'=>'sample_license_url',
'url' => 'sample_license_url',
],
]),
array_merge($common, [
Expand All @@ -179,7 +179,7 @@ public function providerBuildContact(): array
'url' => 'sample_contact_url',
],
'license' => [
'name'=>'sample_license_name',
'name' => 'sample_license_name',
],
]),
array_merge($common, [
Expand All @@ -189,7 +189,7 @@ public function providerBuildContact(): array
'url' => 'sample_contact_url',
],
'license' => [
'name'=>'sample_license_name',
'name' => 'sample_license_name',
],
]),
],
Expand Down Expand Up @@ -236,8 +236,8 @@ public function providerBuildContact(): array
/**
* Assert equality as an associative array.
*
* @param array $expected
* @param array $actual
* @param array $expected
* @param array $actual
* @return void
*/
protected function assertSameAssociativeArray(array $expected, array $actual): void
Expand Down
28 changes: 14 additions & 14 deletions tests/Builders/SecurityBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,13 @@ public function testWeCanAddOperationSecurityUsingBuilder()
->action('get');

$openApi = OpenApi::create()
->security($globalRequirement)
->components($components)
->paths(
PathItem::create()
->route('/foo')
->operations($operation)
);
->security($globalRequirement)
->components($components)
->paths(
PathItem::create()
->route('/foo')
->operations($operation)
);

self::assertSame([
'paths' => [
Expand Down Expand Up @@ -175,13 +175,13 @@ public function testWeCanAddTurnOffOperationSecurityUsingBuilder()
$operations = $operationsBuilder->build([$routeInfo]);

$openApi = OpenApi::create()
->security($globalRequirement)
->components($components)
->paths(
PathItem::create()
->route('/foo')
->operations(...$operations)
);
->security($globalRequirement)
->components($components)
->paths(
PathItem::create()
->route('/foo')
->operations(...$operations)
);

self::assertSame([
'paths' => [
Expand Down
10 changes: 5 additions & 5 deletions tests/Builders/ServersBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ class ServersBuilderTest extends TestCase
/**
* @dataProvider providerBuild
*
* @param array $config
* @param array $expected
* @param array $config
* @param array $expected
* @return void
*/
public function testBuild(array $config, array $expected): void
Expand All @@ -23,7 +23,7 @@ public function testBuild(array $config, array $expected): void
$this->assertSameAssociativeArray($expected[0], $servers[0]->toArray());
}

public function providerBuild(): array
public static function providerBuild(): array
{
return [
'If the variables field does not exist, it is possible to output the correct json.' => [
Expand Down Expand Up @@ -129,8 +129,8 @@ public function providerBuild(): array
/**
* Assert equality as an associative array.
*
* @param array $expected
* @param array $actual
* @param array $expected
* @param array $actual
* @return void
*/
protected function assertSameAssociativeArray(array $expected, array $actual): void
Expand Down
10 changes: 5 additions & 5 deletions tests/Builders/TagsBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ class TagsBuilderTest extends TestCase
/**
* @dataProvider providerBuild
*
* @param array $config
* @param array $expected
* @param array $config
* @param array $expected
* @return void
*/
public function testBuild(array $config, array $expected): void
Expand All @@ -23,7 +23,7 @@ public function testBuild(array $config, array $expected): void
$this->assertSameAssociativeArray($expected[0], $tags[0]->toArray());
}

public function providerBuild(): array
public static function providerBuild(): array
{
return [
'If the external docs do not exist, it can output the correct json.' => [
Expand Down Expand Up @@ -60,8 +60,8 @@ public function providerBuild(): array
/**
* Assert equality as an associative array.
*
* @param array $expected
* @param array $actual
* @param array $expected
* @param array $actual
* @return void
*/
protected function assertSameAssociativeArray(array $expected, array $actual): void
Expand Down