From 81aaa5cbc668f59cda651695fe5594f7c7f851c8 Mon Sep 17 00:00:00 2001 From: Rhys Lees <43909932+RhysLees@users.noreply.github.com> Date: Thu, 14 Mar 2024 17:28:15 +0000 Subject: [PATCH 1/7] WIP --- composer.json | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/composer.json b/composer.json index 73da90a..83e55e2 100644 --- a/composer.json +++ b/composer.json @@ -22,21 +22,21 @@ } ], "require": { - "php": "^8.2", - "guzzlehttp/guzzle": "^7.8.1", - "illuminate/contracts": "^10.0", + "php": "^8.3", + "guzzlehttp/guzzle": "^7.8", + "illuminate/contracts": "^11.0", "spatie/laravel-package-tools": "^1.16", - "saloonphp/laravel-plugin": "^3.3", - "saloonphp/saloon": "^3.6" + "saloonphp/laravel-plugin": "^3.5", + "saloonphp/saloon": "^3.7" }, "require-dev": { "laravel/pint": "^1.13", - "nunomaduro/collision": "^7.10", - "nunomaduro/larastan": "^2.8", + "nunomaduro/collision": "^8.1", + "larastan/larastan": "^2.9", "pestphp/pest": "^2.3", - "orchestra/testbench": "^8.20", + "orchestra/testbench": "^9.0", "pestphp/pest-plugin-laravel": "^2.2", - "pestphp/pest-plugin-arch": "^2.6", + "pestphp/pest-plugin-arch": "^2.7", "phpstan/extension-installer": "^1.3", "phpstan/phpstan-deprecation-rules": "^1.1", "phpstan/phpstan-phpunit": "^1.3", From ecb4c9994daafaa503687b56cbd22207217678f3 Mon Sep 17 00:00:00 2001 From: Rhys Lees <43909932+RhysLees@users.noreply.github.com> Date: Thu, 14 Mar 2024 22:01:52 +0000 Subject: [PATCH 2/7] WIP --- .github/workflows/run-tests.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 3eff870..970c18c 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -14,12 +14,12 @@ jobs: max-parallel: 1 matrix: os: [ ubuntu-latest, windows-latest ] - php: [ 8.2, 8.3 ] - laravel: [ 10.* ] + php: [ 8.3 ] + laravel: [ 11.* ] stability: [ prefer-lowest, prefer-stable ] include: - - laravel: 10.* - testbench: 8.* + - laravel: 11.* + testbench: 9.* name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} From fa31d11fe6bd1c66cee2dae8b38d328b9f4035ea Mon Sep 17 00:00:00 2001 From: Rhys Lees <43909932+RhysLees@users.noreply.github.com> Date: Fri, 15 Mar 2024 11:43:22 +0000 Subject: [PATCH 3/7] WIP --- .github/workflows/run-tests.yml | 7 ++----- composer.json | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 970c18c..020894a 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -14,12 +14,9 @@ jobs: max-parallel: 1 matrix: os: [ ubuntu-latest, windows-latest ] - php: [ 8.3 ] + php: [ 8.2, 8.3 ] laravel: [ 11.* ] stability: [ prefer-lowest, prefer-stable ] - include: - - laravel: 11.* - testbench: 9.* name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} @@ -41,7 +38,7 @@ jobs: - name: Install dependencies run: | - composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update + composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update composer update --${{ matrix.stability }} --prefer-dist --no-interaction - name: Set phpunit.xml diff --git a/composer.json b/composer.json index 83e55e2..b1a5670 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ } ], "require": { - "php": "^8.3", + "php": ">=8.2", "guzzlehttp/guzzle": "^7.8", "illuminate/contracts": "^11.0", "spatie/laravel-package-tools": "^1.16", From 0d7fd6a00e62431a7b3a134cd56aa95cb33500a2 Mon Sep 17 00:00:00 2001 From: Rhys Lees <43909932+RhysLees@users.noreply.github.com> Date: Thu, 27 Feb 2025 11:07:00 +0000 Subject: [PATCH 4/7] WIP --- src/Classes/RequestClass.php | 2 +- src/DTO/Attachment.php | 3 +- src/DTO/Comment.php | 3 +- src/DTO/ObjectAttribute.php | 3 +- src/DTO/User.php | 3 +- src/Events/ZammadResponseLog.php | 4 +- .../AccessTokens/CreateAccessTokenRequest.php | 3 +- .../DestroyAccessTokenRequest.php | 3 +- .../Attachment/GetAttachmentRequest.php | 3 +- .../Comments/CreateCommentRequest.php | 3 +- .../Comments/DestroyCommentRequest.php | 3 +- .../Comments/GetCommentByTicketRequest.php | 3 +- src/Requests/Comments/GetCommentRequest.php | 3 +- .../CreateObjectAttributeRequest.php | 3 +- .../DestroyObjectAttributeRequest.php | 3 +- .../GetObjectAttributeRequest.php | 3 +- .../UpdateObjectAttributeRequest.php | 3 +- src/Requests/Tickets/AllTicketsRequest.php | 3 +- src/Requests/Tickets/CreateTicketRequest.php | 3 +- src/Requests/Tickets/DestroyTicketRequest.php | 3 +- src/Requests/Tickets/GetTicketRequest.php | 3 +- src/Requests/Tickets/SearchTicketRequest.php | 3 +- src/Requests/Users/AllUsersRequest.php | 3 +- src/Requests/Users/CreateUserRequest.php | 3 +- src/Requests/Users/DestroyUserRequest.php | 3 +- src/Requests/Users/GetUserRequest.php | 3 +- src/Requests/Users/SearchUserRequest.php | 3 +- src/Requests/Users/UpdateUserRequest.php | 3 +- src/Zammad.php | 12 ++--- tests/Feature/AttachmentResourceTest.php | 2 +- tests/Feature/CommentResourceTest.php | 14 +++--- tests/Feature/ObjectAttributeResourceTest.php | 26 +++++----- tests/Feature/TicketResourceTest.php | 28 +++++------ tests/Feature/UserAccessTokenRequestTest.php | 12 ++--- tests/Feature/UserResourceTest.php | 48 +++++++++---------- tests/Feature/ZammadConnectorTest.php | 8 ++-- 36 files changed, 103 insertions(+), 131 deletions(-) diff --git a/src/Classes/RequestClass.php b/src/Classes/RequestClass.php index 419fcdc..9af34fd 100644 --- a/src/Classes/RequestClass.php +++ b/src/Classes/RequestClass.php @@ -30,7 +30,7 @@ public function __construct() $this->ignoreReferenceErrorIngore = config('zammad.object_reference_error_ignore'); $this->objectHasReferenceError = config('zammad.objet_reference_error'); - $this->connector = new ZammadConnector(); + $this->connector = new ZammadConnector; } private function performRequest(Request $request): Response diff --git a/src/DTO/Attachment.php b/src/DTO/Attachment.php index 8c72a44..9342766 100644 --- a/src/DTO/Attachment.php +++ b/src/DTO/Attachment.php @@ -28,8 +28,7 @@ public function __construct( public int $size, public string $name, public string $type, - ) { - } + ) {} public function url(): string { diff --git a/src/DTO/Comment.php b/src/DTO/Comment.php index 3f6159b..9671204 100644 --- a/src/DTO/Comment.php +++ b/src/DTO/Comment.php @@ -89,8 +89,7 @@ public function __construct( public Collection $attachments, public Carbon $updated_at, public Carbon $created_at, - ) { - } + ) {} public static function fake( ?int $id = null, diff --git a/src/DTO/ObjectAttribute.php b/src/DTO/ObjectAttribute.php index d30b8ea..6e6a5b4 100644 --- a/src/DTO/ObjectAttribute.php +++ b/src/DTO/ObjectAttribute.php @@ -31,8 +31,7 @@ public function __construct( public int $position, public array $data_option, public ?array $data_option_new, - ) { - } + ) {} public static function fake( ?int $id = null, diff --git a/src/DTO/User.php b/src/DTO/User.php index 439629e..0ccdaed 100644 --- a/src/DTO/User.php +++ b/src/DTO/User.php @@ -31,8 +31,7 @@ public function __construct( public Carbon $updated_at, public Carbon $created_at, public ?array $expanded = null, - ) { - } + ) {} public static function fake( ?int $id = null, diff --git a/src/Events/ZammadResponseLog.php b/src/Events/ZammadResponseLog.php index 59fc7bd..66bf7b1 100644 --- a/src/Events/ZammadResponseLog.php +++ b/src/Events/ZammadResponseLog.php @@ -13,7 +13,5 @@ class ZammadResponseLog use InteractsWithSockets; use SerializesModels; - public function __construct(public Response $response) - { - } + public function __construct(public Response $response) {} } diff --git a/src/Requests/AccessTokens/CreateAccessTokenRequest.php b/src/Requests/AccessTokens/CreateAccessTokenRequest.php index a3e7c5f..970eb96 100644 --- a/src/Requests/AccessTokens/CreateAccessTokenRequest.php +++ b/src/Requests/AccessTokens/CreateAccessTokenRequest.php @@ -15,8 +15,7 @@ class CreateAccessTokenRequest extends Request implements HasBody public function __construct( protected array $payload - ) { - } + ) {} public function resolveEndpoint(): string { diff --git a/src/Requests/AccessTokens/DestroyAccessTokenRequest.php b/src/Requests/AccessTokens/DestroyAccessTokenRequest.php index 7ee21a5..d8c45c5 100644 --- a/src/Requests/AccessTokens/DestroyAccessTokenRequest.php +++ b/src/Requests/AccessTokens/DestroyAccessTokenRequest.php @@ -12,8 +12,7 @@ class DestroyAccessTokenRequest extends Request public function __construct( public int $id, public bool $expand = false - ) { - } + ) {} public function resolveEndpoint(): string { diff --git a/src/Requests/Attachment/GetAttachmentRequest.php b/src/Requests/Attachment/GetAttachmentRequest.php index d4b6ef3..6d2c997 100644 --- a/src/Requests/Attachment/GetAttachmentRequest.php +++ b/src/Requests/Attachment/GetAttachmentRequest.php @@ -13,8 +13,7 @@ public function __construct( public int $ticketId, public int $commentId, public int $attachmentId, - ) { - } + ) {} public function resolveEndpoint(): string { diff --git a/src/Requests/Comments/CreateCommentRequest.php b/src/Requests/Comments/CreateCommentRequest.php index 9f445db..e9f4fed 100644 --- a/src/Requests/Comments/CreateCommentRequest.php +++ b/src/Requests/Comments/CreateCommentRequest.php @@ -17,8 +17,7 @@ class CreateCommentRequest extends Request implements HasBody public function __construct( protected array $payload - ) { - } + ) {} public function resolveEndpoint(): string { diff --git a/src/Requests/Comments/DestroyCommentRequest.php b/src/Requests/Comments/DestroyCommentRequest.php index 94600ec..44c7f75 100644 --- a/src/Requests/Comments/DestroyCommentRequest.php +++ b/src/Requests/Comments/DestroyCommentRequest.php @@ -11,8 +11,7 @@ class DestroyCommentRequest extends Request public function __construct( public int $id - ) { - } + ) {} public function resolveEndpoint(): string { diff --git a/src/Requests/Comments/GetCommentByTicketRequest.php b/src/Requests/Comments/GetCommentByTicketRequest.php index 9ffe5db..058ee99 100644 --- a/src/Requests/Comments/GetCommentByTicketRequest.php +++ b/src/Requests/Comments/GetCommentByTicketRequest.php @@ -11,8 +11,7 @@ class GetCommentByTicketRequest extends Request public function __construct( public int $id - ) { - } + ) {} public function resolveEndpoint(): string { diff --git a/src/Requests/Comments/GetCommentRequest.php b/src/Requests/Comments/GetCommentRequest.php index 68c7278..79d1bdc 100644 --- a/src/Requests/Comments/GetCommentRequest.php +++ b/src/Requests/Comments/GetCommentRequest.php @@ -13,8 +13,7 @@ class GetCommentRequest extends Request public function __construct( public int $id - ) { - } + ) {} public function resolveEndpoint(): string { diff --git a/src/Requests/ObjectAttribute/CreateObjectAttributeRequest.php b/src/Requests/ObjectAttribute/CreateObjectAttributeRequest.php index 62f861d..19f6e27 100644 --- a/src/Requests/ObjectAttribute/CreateObjectAttributeRequest.php +++ b/src/Requests/ObjectAttribute/CreateObjectAttributeRequest.php @@ -17,8 +17,7 @@ class CreateObjectAttributeRequest extends Request implements HasBody public function __construct( protected array $payload - ) { - } + ) {} public function resolveEndpoint(): string { diff --git a/src/Requests/ObjectAttribute/DestroyObjectAttributeRequest.php b/src/Requests/ObjectAttribute/DestroyObjectAttributeRequest.php index 6b49619..e8a918f 100644 --- a/src/Requests/ObjectAttribute/DestroyObjectAttributeRequest.php +++ b/src/Requests/ObjectAttribute/DestroyObjectAttributeRequest.php @@ -11,8 +11,7 @@ class DestroyObjectAttributeRequest extends Request public function __construct( public int $id - ) { - } + ) {} public function resolveEndpoint(): string { diff --git a/src/Requests/ObjectAttribute/GetObjectAttributeRequest.php b/src/Requests/ObjectAttribute/GetObjectAttributeRequest.php index 5b09e93..0e4e34a 100644 --- a/src/Requests/ObjectAttribute/GetObjectAttributeRequest.php +++ b/src/Requests/ObjectAttribute/GetObjectAttributeRequest.php @@ -13,8 +13,7 @@ class GetObjectAttributeRequest extends Request public function __construct( public int $id - ) { - } + ) {} public function resolveEndpoint(): string { diff --git a/src/Requests/ObjectAttribute/UpdateObjectAttributeRequest.php b/src/Requests/ObjectAttribute/UpdateObjectAttributeRequest.php index 616979a..b0bf783 100644 --- a/src/Requests/ObjectAttribute/UpdateObjectAttributeRequest.php +++ b/src/Requests/ObjectAttribute/UpdateObjectAttributeRequest.php @@ -18,8 +18,7 @@ class UpdateObjectAttributeRequest extends Request implements HasBody public function __construct( public int $id, public array $payload - ) { - } + ) {} public function resolveEndpoint(): string { diff --git a/src/Requests/Tickets/AllTicketsRequest.php b/src/Requests/Tickets/AllTicketsRequest.php index ccaff28..c4cea11 100644 --- a/src/Requests/Tickets/AllTicketsRequest.php +++ b/src/Requests/Tickets/AllTicketsRequest.php @@ -12,8 +12,7 @@ class AllTicketsRequest extends Request public function __construct( public ?int $perPage = null, public ?int $page = null, - ) { - } + ) {} public function resolveEndpoint(): string { diff --git a/src/Requests/Tickets/CreateTicketRequest.php b/src/Requests/Tickets/CreateTicketRequest.php index e705921..7527602 100644 --- a/src/Requests/Tickets/CreateTicketRequest.php +++ b/src/Requests/Tickets/CreateTicketRequest.php @@ -18,8 +18,7 @@ class CreateTicketRequest extends Request implements HasBody public function __construct( protected array $payload, public bool $expand = false - ) { - } + ) {} public function resolveEndpoint(): string { diff --git a/src/Requests/Tickets/DestroyTicketRequest.php b/src/Requests/Tickets/DestroyTicketRequest.php index a25b7f3..5c7f77d 100644 --- a/src/Requests/Tickets/DestroyTicketRequest.php +++ b/src/Requests/Tickets/DestroyTicketRequest.php @@ -11,8 +11,7 @@ class DestroyTicketRequest extends Request public function __construct( public int $id - ) { - } + ) {} public function resolveEndpoint(): string { diff --git a/src/Requests/Tickets/GetTicketRequest.php b/src/Requests/Tickets/GetTicketRequest.php index 9e9289c..53454fc 100644 --- a/src/Requests/Tickets/GetTicketRequest.php +++ b/src/Requests/Tickets/GetTicketRequest.php @@ -14,8 +14,7 @@ class GetTicketRequest extends Request public function __construct( public int $id, public bool $expand = false - ) { - } + ) {} public function resolveEndpoint(): string { diff --git a/src/Requests/Tickets/SearchTicketRequest.php b/src/Requests/Tickets/SearchTicketRequest.php index 10264ab..cc0967a 100644 --- a/src/Requests/Tickets/SearchTicketRequest.php +++ b/src/Requests/Tickets/SearchTicketRequest.php @@ -14,8 +14,7 @@ public function __construct( public ?int $limit = null, public ?int $perPage = null, public ?int $page = null, - ) { - } + ) {} public function resolveEndpoint(): string { diff --git a/src/Requests/Users/AllUsersRequest.php b/src/Requests/Users/AllUsersRequest.php index 25a09e0..0adac61 100644 --- a/src/Requests/Users/AllUsersRequest.php +++ b/src/Requests/Users/AllUsersRequest.php @@ -12,8 +12,7 @@ class AllUsersRequest extends Request public function __construct( public ?int $perPage = null, public ?int $page = null, - ) { - } + ) {} public function resolveEndpoint(): string { diff --git a/src/Requests/Users/CreateUserRequest.php b/src/Requests/Users/CreateUserRequest.php index 6171350..6df74ff 100644 --- a/src/Requests/Users/CreateUserRequest.php +++ b/src/Requests/Users/CreateUserRequest.php @@ -18,8 +18,7 @@ class CreateUserRequest extends Request implements HasBody public function __construct( protected array $payload, public bool $expand = false - ) { - } + ) {} public function resolveEndpoint(): string { diff --git a/src/Requests/Users/DestroyUserRequest.php b/src/Requests/Users/DestroyUserRequest.php index aab4a60..cb8d315 100644 --- a/src/Requests/Users/DestroyUserRequest.php +++ b/src/Requests/Users/DestroyUserRequest.php @@ -11,8 +11,7 @@ class DestroyUserRequest extends Request public function __construct( public int $id - ) { - } + ) {} public function resolveEndpoint(): string { diff --git a/src/Requests/Users/GetUserRequest.php b/src/Requests/Users/GetUserRequest.php index ccebd48..2b8826e 100644 --- a/src/Requests/Users/GetUserRequest.php +++ b/src/Requests/Users/GetUserRequest.php @@ -14,8 +14,7 @@ class GetUserRequest extends Request public function __construct( public ?int $id = null, public bool $expand = false - ) { - } + ) {} public function resolveEndpoint(): string { diff --git a/src/Requests/Users/SearchUserRequest.php b/src/Requests/Users/SearchUserRequest.php index 56f7145..dfacd36 100644 --- a/src/Requests/Users/SearchUserRequest.php +++ b/src/Requests/Users/SearchUserRequest.php @@ -12,8 +12,7 @@ class SearchUserRequest extends Request public function __construct( public string $term, public ?int $limit = null, - ) { - } + ) {} public function resolveEndpoint(): string { diff --git a/src/Requests/Users/UpdateUserRequest.php b/src/Requests/Users/UpdateUserRequest.php index c0e3019..28b6462 100644 --- a/src/Requests/Users/UpdateUserRequest.php +++ b/src/Requests/Users/UpdateUserRequest.php @@ -19,8 +19,7 @@ public function __construct( public int $id, public array $payload, public bool $expand = false - ) { - } + ) {} public function resolveEndpoint(): string { diff --git a/src/Zammad.php b/src/Zammad.php index f004a51..28dbebc 100644 --- a/src/Zammad.php +++ b/src/Zammad.php @@ -13,31 +13,31 @@ class Zammad { public function user(): UserResource { - return new UserResource(); + return new UserResource; } public function userAccessToken(): UserAccessToken { - return new UserAccessToken(); + return new UserAccessToken; } public function ticket(): TicketResource { - return new TicketResource(); + return new TicketResource; } public function comment(): CommentResource { - return new CommentResource(); + return new CommentResource; } public function attachment(): AttachmentResource { - return new AttachmentResource(); + return new AttachmentResource; } public function object(): ObjectAttributeResource { - return new ObjectAttributeResource(); + return new ObjectAttributeResource; } } diff --git a/tests/Feature/AttachmentResourceTest.php b/tests/Feature/AttachmentResourceTest.php index 1e01621..f9a5bb8 100644 --- a/tests/Feature/AttachmentResourceTest.php +++ b/tests/Feature/AttachmentResourceTest.php @@ -5,7 +5,7 @@ use Illuminate\Support\Facades\Event; it('can download an attachment', function () { - $content = (new Zammad())->attachment()->download( + $content = (new Zammad)->attachment()->download( ticketId: 32, commentId: 111, attachmentId: 42, diff --git a/tests/Feature/CommentResourceTest.php b/tests/Feature/CommentResourceTest.php index 1054d9c..f20642b 100644 --- a/tests/Feature/CommentResourceTest.php +++ b/tests/Feature/CommentResourceTest.php @@ -13,7 +13,7 @@ it('does show by ticket', function () { $id = 32; - $comments = (new Zammad())->comment()->showByTicket($id); + $comments = (new Zammad)->comment()->showByTicket($id); $this->assertInstanceOf(Collection::class, $comments); @@ -28,7 +28,7 @@ it('does show comment', function () { $id = 66; - $comment = (new Zammad())->comment()->show($id); + $comment = (new Zammad)->comment()->show($id); $this->assertInstanceOf(Comment::class, $comment); $this->assertSame($id, $comment->id); @@ -50,7 +50,7 @@ ], ]; - $comment = (new Zammad())->comment()->create($data); + $comment = (new Zammad)->comment()->create($data); $this->assertInstanceOf(Comment::class, $comment); $this->assertSame('::subject::', $comment->subject); @@ -64,12 +64,12 @@ $this->assertSame('text/plain', $attachment->type); }); Event::assertDispatched(ZammadResponseLog::class, 1); - (new Zammad())->comment()->delete($comment->id); + (new Zammad)->comment()->delete($comment->id); Event::assertDispatched(ZammadResponseLog::class, 2); })->group('comments'); it('does parse body from comment', function () { - $comment = (new Zammad())->comment()->show(342); + $comment = (new Zammad)->comment()->show(342); $this->assertStringContainsString( 'Abgeschieden wohnen sie in Buchstabhausen an der Küste des Semantik, eines großen Sprachozeans.', @@ -88,7 +88,7 @@ it('has a from name helper', function () { $id = 66; - $comment = (new Zammad())->comment()->show($id); + $comment = (new Zammad)->comment()->show($id); $this->assertSame( Str::before(Str::between($comment->from, '"', '"'), '<'), @@ -99,7 +99,7 @@ it('has a from email helper', function () { $id = 66; - $comment = (new Zammad())->comment()->show($id); + $comment = (new Zammad)->comment()->show($id); $this->assertSame( Str::between($comment->from, '<', '>'), diff --git a/tests/Feature/ObjectAttributeResourceTest.php b/tests/Feature/ObjectAttributeResourceTest.php index dd6ac88..c88341e 100644 --- a/tests/Feature/ObjectAttributeResourceTest.php +++ b/tests/Feature/ObjectAttributeResourceTest.php @@ -7,39 +7,39 @@ use Illuminate\Support\Facades\Event; it('lists objects', function () { - $objects = (new Zammad())->object()->list(); + $objects = (new Zammad)->object()->list(); $this->assertInstanceOf(Collection::class, $objects); $this->assertTrue($objects->count() > 0); Event::assertDispatched(ZammadResponseLog::class, 1); })->group('objects', 'list-objects'); it('shows a object', function () { - $objects = (new Zammad())->object()->list(); + $objects = (new Zammad)->object()->list(); Event::assertDispatched(ZammadResponseLog::class, 1); $object = $objects->last(); - $newObject = (new Zammad())->object()->show($object->id); + $newObject = (new Zammad)->object()->show($object->id); $this->assertSame($object->id, $newObject->id); Event::assertDispatched(ZammadResponseLog::class, 2); })->group('objects', 'show-object'); it('creates a object', function () { $objectAttribute = ObjectAttribute::fakeCreateToArray(); - $object = (new Zammad())->object()->create($objectAttribute); + $object = (new Zammad)->object()->create($objectAttribute); $this->assertInstanceOf(ObjectAttribute::class, $object); $this->assertSame($objectAttribute['name'], $object->name); $this->assertSame($objectAttribute['display'], $object->display); Event::assertDispatched(ZammadResponseLog::class, 1); - (new Zammad())->object()->delete($object->id); - (new Zammad())->object()->executeMigrations(); + (new Zammad)->object()->delete($object->id); + (new Zammad)->object()->executeMigrations(); })->group('objects', 'create-object'); it('update a object', function () { $objectAttribute = ObjectAttribute::fakeCreateToArray(); - $object = (new Zammad())->object()->create($objectAttribute); + $object = (new Zammad)->object()->create($objectAttribute); Event::assertDispatched(ZammadResponseLog::class, 1); $this->assertInstanceOf(ObjectAttribute::class, $object); @@ -63,28 +63,28 @@ expect($objectAttribute['display'])->toEqual($object->display); expect($updatedObjectAttribute['display'])->not()->toEqual($object->display); - $object = (new Zammad())->object()->update($object->id, $updatedObjectAttribute); + $object = (new Zammad)->object()->update($object->id, $updatedObjectAttribute); Event::assertDispatched(ZammadResponseLog::class, 2); expect($updatedObjectAttribute['display'])->toEqual($object->display); expect($objectAttribute['display'])->not()->toEqual($object->display); - (new Zammad())->object()->delete($object->id); - (new Zammad())->object()->executeMigrations(); + (new Zammad)->object()->delete($object->id); + (new Zammad)->object()->executeMigrations(); })->group('objects', 'update-object'); it('deletes a object', function () { $objectAttribute = ObjectAttribute::fakeCreateToArray(); - $object = (new Zammad())->object()->create($objectAttribute); + $object = (new Zammad)->object()->create($objectAttribute); Event::assertDispatched(ZammadResponseLog::class, 1); - (new Zammad())->object()->delete($object->id); + (new Zammad)->object()->delete($object->id); Event::assertDispatched(ZammadResponseLog::class, 2); })->group('objects'); // this test is migrating the zammad database which can take up to 30seconds. it('execute database migrations', function () { - (new Zammad())->object()->executeMigrations(); + (new Zammad)->object()->executeMigrations(); Event::assertDispatched(ZammadResponseLog::class, 1); sleep(30); })->group('objects'); diff --git a/tests/Feature/TicketResourceTest.php b/tests/Feature/TicketResourceTest.php index 64f6c9a..481c8cc 100644 --- a/tests/Feature/TicketResourceTest.php +++ b/tests/Feature/TicketResourceTest.php @@ -9,7 +9,7 @@ use Illuminate\Support\Facades\Event; it('lists tickets', function () { - $tickets = (new Zammad())->ticket()->list(); + $tickets = (new Zammad)->ticket()->list(); $this->assertInstanceOf(Collection::class, $tickets); $tickets->each(function (Ticket $ticket) { @@ -22,7 +22,7 @@ it('searches tickets', function () { $term = 'fix'; - $tickets = (new Zammad())->ticket()->search($term); + $tickets = (new Zammad)->ticket()->search($term); $this->assertInstanceOf(Collection::class, $tickets); $tickets->each(function (Ticket $ticket) { @@ -34,7 +34,7 @@ it('searches tickets with empty result', function () { $term = '::this-should-return-null::'; - $tickets = (new Zammad())->ticket()->search($term); + $tickets = (new Zammad)->ticket()->search($term); $this->assertInstanceOf(Collection::class, $tickets); $this->assertCount(0, $tickets); @@ -44,7 +44,7 @@ it('shows a ticket', function () { $id = 32; - $ticket = (new Zammad())->ticket()->show($id); + $ticket = (new Zammad)->ticket()->show($id); $this->assertInstanceOf(Ticket::class, $ticket); $this->assertSame($id, $ticket->id); @@ -54,7 +54,7 @@ it('shows a ticket with comments', function () { $id = 32; - $ticket = (new Zammad())->ticket()->showWithComments($id); + $ticket = (new Zammad)->ticket()->showWithComments($id); $this->assertInstanceOf(Ticket::class, $ticket); $this->assertSame($id, $ticket->id); @@ -76,24 +76,24 @@ 'house' => 20, ]; - $ticket = (new Zammad())->ticket()->create($data); + $ticket = (new Zammad)->ticket()->create($data); $this->assertInstanceOf(Ticket::class, $ticket); $this->assertSame('::title::', $ticket->subject); - //4 customer_id => Sebastian Fix + // 4 customer_id => Sebastian Fix $this->assertSame(4, $ticket->customer_id); Event::assertDispatched(ZammadResponseLog::class, 1); - (new Zammad())->ticket()->delete($ticket->id); + (new Zammad)->ticket()->delete($ticket->id); Event::assertDispatched(ZammadResponseLog::class, 2); })->group('tickets'); it('shows a ticket expanded', function () { $id = 32; - $ticket = (new Zammad())->ticket()->show($id); - $ticketExpand = (new Zammad())->ticket()->expand()->show($id); + $ticket = (new Zammad)->ticket()->show($id); + $ticketExpand = (new Zammad)->ticket()->expand()->show($id); $this->assertInstanceOf(Ticket::class, $ticket); $this->assertInstanceOf(Ticket::class, $ticketExpand); @@ -105,16 +105,16 @@ })->group('tickets', 'expand'); it('paginates ticket list', function () { - $users = (new Zammad())->ticket()->paginate(1, 2)->list(); - $usersTwo = (new Zammad())->ticket()->paginate(2, 2)->list(); + $users = (new Zammad)->ticket()->paginate(1, 2)->list(); + $usersTwo = (new Zammad)->ticket()->paginate(2, 2)->list(); $this->assertNotSame($users, $usersTwo); })->group('tickets', 'paginate'); it('paginates ticket list with page and perPage methods', function () { - $tickets = (new Zammad())->ticket()->page(1)->perPage(2)->list(); - $ticketsTwo = (new Zammad())->ticket()->page(2)->perPage(2)->list(); + $tickets = (new Zammad)->ticket()->page(1)->perPage(2)->list(); + $ticketsTwo = (new Zammad)->ticket()->page(2)->perPage(2)->list(); $this->assertNotSame($tickets, $ticketsTwo); diff --git a/tests/Feature/UserAccessTokenRequestTest.php b/tests/Feature/UserAccessTokenRequestTest.php index 3aad730..1f6d707 100644 --- a/tests/Feature/UserAccessTokenRequestTest.php +++ b/tests/Feature/UserAccessTokenRequestTest.php @@ -10,7 +10,7 @@ use function PHPUnit\Framework\assertSame; it('lists user tokens', function () { - $tokens = (new Zammad())->userAccesstoken()->list(); + $tokens = (new Zammad)->userAccesstoken()->list(); Event::assertDispatched(ZammadResponseLog::class, 1); })->group('users'); @@ -20,7 +20,7 @@ 'permission' => ['admin'], 'expires_at' => now()->addDay()->format('Y-m-d'), ]; - $token = (new Zammad())->userAccesstoken()->create($data); + $token = (new Zammad)->userAccesstoken()->create($data); Event::assertDispatched(ZammadResponseLog::class, 1); })->group('users'); @@ -30,22 +30,22 @@ 'permission' => ['admin'], 'expires_at' => now()->addDay()->format('Y-m-d'), ]; - (new Zammad())->userAccesstoken()->create($data); + (new Zammad)->userAccesstoken()->create($data); Event::assertDispatched(ZammadResponseLog::class, 1); - $tokensBefore = (new Zammad())->userAccesstoken()->list(); + $tokensBefore = (new Zammad)->userAccesstoken()->list(); Event::assertDispatched(ZammadResponseLog::class, 2); $tokensCountBefore = count($tokensBefore['tokens']); foreach ($tokensBefore['tokens'] as $token) { if ($token['name'] == $data['name']) { - (new Zammad())->userAccesstoken()->delete($token['id']); + (new Zammad)->userAccesstoken()->delete($token['id']); } } Event::assertDispatched(ZammadResponseLog::class, 3); - $tokensAfter = (new Zammad())->userAccesstoken()->list(); + $tokensAfter = (new Zammad)->userAccesstoken()->list(); $tokensCountAfter = count($tokensAfter['tokens']); diff --git a/tests/Feature/UserResourceTest.php b/tests/Feature/UserResourceTest.php index 20e7628..2231a67 100644 --- a/tests/Feature/UserResourceTest.php +++ b/tests/Feature/UserResourceTest.php @@ -10,13 +10,13 @@ use Illuminate\Support\Str; it('show current user', function () { - $user = (new Zammad())->user()->me(); + $user = (new Zammad)->user()->me(); $this->assertInstanceOf(User::class, $user); Event::assertDispatched(ZammadResponseLog::class, 1); })->group('users'); it('list users', function () { - $users = (new Zammad())->user()->list(); + $users = (new Zammad)->user()->list(); $this->assertInstanceOf(Collection::class, $users); $users->each(function (User $user) { @@ -27,11 +27,11 @@ })->group('users', 'list-users'); it('searches a user', function () { - $users = (new Zammad())->user()->paginate(1, 100)->list(); + $users = (new Zammad)->user()->paginate(1, 100)->list(); Event::assertDispatched(ZammadResponseLog::class, 1); $user = $users->last(); - $searchedUser = (new Zammad())->user()->search($user->email); + $searchedUser = (new Zammad)->user()->search($user->email); $this->assertInstanceOf(User::class, $searchedUser); $this->assertSame($user->id, $searchedUser->id); @@ -42,18 +42,18 @@ it('searches a non existing user', function () { $term = 'email:does@not.exist'; - $user = (new Zammad())->user()->search($term); + $user = (new Zammad)->user()->search($term); $this->assertNull($user); Event::assertDispatched(ZammadResponseLog::class, 1); })->group('users'); it('shows a user', function () { - $users = (new Zammad())->user()->list(); + $users = (new Zammad)->user()->list(); Event::assertDispatched(ZammadResponseLog::class, 1); $user = $users->last(); - $newUser = (new Zammad())->user()->show($user->id); + $newUser = (new Zammad)->user()->show($user->id); $this->assertInstanceOf(User::class, $newUser); $this->assertSame($user->id, $newUser->id); @@ -71,7 +71,7 @@ 'email' => $email, ]; - $user = (new Zammad())->user()->create($data); + $user = (new Zammad)->user()->create($data); $this->assertInstanceOf(User::class, $user); $this->assertSame($firstname, $user->first_name); @@ -81,7 +81,7 @@ })->group('users'); it('updates a user', function () { - $users = (new Zammad())->user()->list(); + $users = (new Zammad)->user()->list(); Event::assertDispatched(ZammadResponseLog::class, 1); $user = $users->last(); @@ -93,7 +93,7 @@ 'lastname' => $lastname, ]; - $updatedUser = (new Zammad())->user()->update($user->id, $data); + $updatedUser = (new Zammad)->user()->update($user->id, $data); Event::assertDispatched(ZammadResponseLog::class, 2); expect($firstname)->toEqual($updatedUser->first_name); @@ -102,23 +102,23 @@ it('searches or creates a user', function () { $email = Str::orderedUuid()->toString().'@codebar.ch'; - $user = (new Zammad())->user()->searchOrCreateByEmail($email); + $user = (new Zammad)->user()->searchOrCreateByEmail($email); $this->assertSame($email, $user->email); Event::assertDispatched(ZammadResponseLog::class, 2); })->group('users'); it('deletes a user', function () { $email = Str::orderedUuid()->toString().'@codebar.ch'; - $user = (new Zammad())->user()->searchOrCreateByEmail($email); + $user = (new Zammad)->user()->searchOrCreateByEmail($email); $this->assertSame($email, $user->email); Event::assertDispatched(ZammadResponseLog::class, 2); - (new Zammad())->user()->delete($user->id); + (new Zammad)->user()->delete($user->id); Event::assertDispatched(ZammadResponseLog::class, 3); })->group('users')->skip('not possible via api'); it('show current user expanded', function () { - $user = (new Zammad())->user()->me(); - $userExpand = (new Zammad())->user()->expand()->me(); + $user = (new Zammad)->user()->me(); + $userExpand = (new Zammad)->user()->expand()->me(); $this->assertInstanceOf(User::class, $user); $this->assertInstanceOf(User::class, $userExpand); Event::assertDispatched(ZammadResponseLog::class, 2); @@ -129,12 +129,12 @@ })->group('users', 'expand'); it('show user expanded', function () { - $users = (new Zammad())->user()->list(); + $users = (new Zammad)->user()->list(); Event::assertDispatched(ZammadResponseLog::class, 1); $usr = $users->last(); - $user = (new Zammad())->user()->show($usr->id); - $userExpand = (new Zammad())->user()->expand()->show($usr->id); + $user = (new Zammad)->user()->show($usr->id); + $userExpand = (new Zammad)->user()->expand()->show($usr->id); $this->assertInstanceOf(User::class, $user); $this->assertInstanceOf(User::class, $userExpand); Event::assertDispatched(ZammadResponseLog::class, 3); @@ -145,29 +145,29 @@ })->group('users', 'expand'); it('paginates user list', function () { - $users = (new Zammad())->user()->paginate(1, 2)->list(); - $usersTwo = (new Zammad())->user()->paginate(2, 2)->list(); + $users = (new Zammad)->user()->paginate(1, 2)->list(); + $usersTwo = (new Zammad)->user()->paginate(2, 2)->list(); $this->assertNotSame($users, $usersTwo); })->group('users', 'paginate'); it('paginates user list with page and perPage methods', function () { - $users = (new Zammad())->user()->page(1)->perPage(2)->list(); - $usersTwo = (new Zammad())->user()->page(2)->perPage(2)->list(); + $users = (new Zammad)->user()->page(1)->perPage(2)->list(); + $usersTwo = (new Zammad)->user()->page(2)->perPage(2)->list(); $this->assertNotSame($users, $usersTwo); })->group('users', 'paginate'); it('limits user list with limit method', function () { - $users = (new Zammad())->user()->limit()->search('info'); + $users = (new Zammad)->user()->limit()->search('info'); if (! $users instanceof User) { expect(count($users))->toBeLessThanOrEqual(1); } - $users = (new Zammad())->user()->limit(10)->search('info'); + $users = (new Zammad)->user()->limit(10)->search('info'); expect(count($users))->toBeLessThanOrEqual(10); })->group('users', 'limit'); diff --git a/tests/Feature/ZammadConnectorTest.php b/tests/Feature/ZammadConnectorTest.php index b76b2b9..e39fc31 100644 --- a/tests/Feature/ZammadConnectorTest.php +++ b/tests/Feature/ZammadConnectorTest.php @@ -4,22 +4,22 @@ it('will throw an error if a url is not provided', function () { config(['zammad.url' => '']); - (new ZammadConnector())->resolveBaseUrl(); + (new ZammadConnector)->resolveBaseUrl(); })->throws(\Exception::class, 'No url provided.', 500) ->group('connector'); it('will not throw an error if a url provided', function () { - (new ZammadConnector())->resolveBaseUrl(); + (new ZammadConnector)->resolveBaseUrl(); })->throwsNoExceptions() ->group('connector'); it('will throw an error if a token is not provided', function () { config(['zammad.token' => '']); - (new ZammadConnector())->setAuth(); + (new ZammadConnector)->setAuth(); })->throws(\Exception::class, 'No token provided.', 500) ->group('connector'); it('will not throw an error if a token provided', function () { - (new ZammadConnector())->setAuth(); + (new ZammadConnector)->setAuth(); })->throwsNoExceptions() ->group('connector'); From e6671fe26f1a84e54bace660f7f9f86443d39fa8 Mon Sep 17 00:00:00 2001 From: Rhys Lees <43909932+RhysLees@users.noreply.github.com> Date: Thu, 27 Feb 2025 11:08:54 +0000 Subject: [PATCH 5/7] WIP --- .github/workflows/dependency-review.yml | 2 +- .github/workflows/run-tests.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dependency-review.yml b/.github/workflows/dependency-review.yml index b0dedc4..76d32de 100644 --- a/.github/workflows/dependency-review.yml +++ b/.github/workflows/dependency-review.yml @@ -17,4 +17,4 @@ jobs: - name: 'Checkout Repository' uses: actions/checkout@v3 - name: 'Dependency Review' - uses: actions/dependency-review-action@v3 + uses: actions/dependency-review-action@v4 diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 020894a..c6a1732 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -52,7 +52,7 @@ jobs: ZAMMAD_OBJECT_REFERENCE_ERROR_IGNORE: true - name: Store test reports - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: Store report retention-days: 1 From cb7ac805370fd6796d308075bab594ff99cffd30 Mon Sep 17 00:00:00 2001 From: Rhys Lees <43909932+RhysLees@users.noreply.github.com> Date: Thu, 27 Feb 2025 14:00:33 +0000 Subject: [PATCH 6/7] WIP --- .github/FUNDING.yml | 2 -- .github/ISSUE_TEMPLATE/bug_report.yml | 17 +++++---- .github/dependabot.yml | 12 +++++++ .github/workflows/dependabot-auto-merge.yml | 3 +- .github/workflows/dependency-review.yml | 2 +- .../workflows/fix-php-code-style-issues.yml | 6 ++-- .github/workflows/phpstan.yml | 14 ++++---- .github/workflows/release.yml | 23 ++++++++++++ .github/workflows/run-tests.yml | 19 +++++----- composer.json | 36 +++++++++---------- 10 files changed, 83 insertions(+), 51 deletions(-) delete mode 100644 .github/FUNDING.yml create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index 83b7546..0000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1,2 +0,0 @@ -# These are supported funding model platforms -github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [StanBarrows] diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 7546b77..bc5e177 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -1,18 +1,18 @@ name: Bug Report description: Report an Issue or Bug with the Package title: "[Bug]: " -labels: ["bug"] +labels: [ "bug" ] body: - type: markdown attributes: - value: | - We're sorry to hear you have a problem. Can you help us solve it by providing the following details. + value: "| +We're sorry to hear you have a problem. Can you help us solve it by providing the following details." - type: textarea id: what-happened attributes: label: What happened? description: What did you expect to happen? - placeholder: I cannot currently do X thing because when I do, it breaks X thing. + placeholder: "I cannot currently do X thing because when I do, it breaks X thing." validations: required: true - type: input @@ -20,7 +20,8 @@ body: attributes: label: Package Version description: What version of our Package are you running? Please be as specific as possible - placeholder: 1.0.0 + placeholder: "12.0" + value: "12.0" validations: required: true - type: input @@ -28,7 +29,8 @@ body: attributes: label: PHP Version description: What version of PHP are you running? Please be as specific as possible - placeholder: 8.3.0 + placeholder: "8.4.0" + value: "8.4.0" validations: required: true - type: input @@ -36,7 +38,8 @@ body: attributes: label: Laravel Version description: What version of Laravel are you running? Please be as specific as possible - placeholder: 11.0.0 + placeholder: "12.0.0" + value: "12.0.0" validations: required: true - type: dropdown diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..0bc378d --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,12 @@ +# Please see the documentation for all configuration options: +# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + labels: + - "dependencies" diff --git a/.github/workflows/dependabot-auto-merge.yml b/.github/workflows/dependabot-auto-merge.yml index 3c2cfe9..2df1631 100644 --- a/.github/workflows/dependabot-auto-merge.yml +++ b/.github/workflows/dependabot-auto-merge.yml @@ -13,8 +13,7 @@ jobs: - name: Dependabot metadata id: metadata - - uses: dependabot/fetch-metadata@v1.4.0 + uses: dependabot/fetch-metadata@v2.3.0 with: github-token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/dependency-review.yml b/.github/workflows/dependency-review.yml index 76d32de..0d4a013 100644 --- a/.github/workflows/dependency-review.yml +++ b/.github/workflows/dependency-review.yml @@ -15,6 +15,6 @@ jobs: runs-on: ubuntu-latest steps: - name: 'Checkout Repository' - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: 'Dependency Review' uses: actions/dependency-review-action@v4 diff --git a/.github/workflows/fix-php-code-style-issues.yml b/.github/workflows/fix-php-code-style-issues.yml index cc0c956..ef2fadf 100644 --- a/.github/workflows/fix-php-code-style-issues.yml +++ b/.github/workflows/fix-php-code-style-issues.yml @@ -8,14 +8,14 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: ${{ github.head_ref }} - name: Fix PHP code style issues - uses: aglipanci/laravel-pint-action@2.2.0 + uses: aglipanci/laravel-pint-action@2.5 - name: Commit changes - uses: stefanzweifel/git-auto-commit-action@v4 + uses: stefanzweifel/git-auto-commit-action@v5 with: commit_message: Fix styling diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index 8148c24..b0cde6a 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -2,25 +2,25 @@ name: PHPStan on: push: - branches: [ main ] - pull_request: - branches: [ main ] + paths: + - '**.php' + - 'phpstan.neon.dist' jobs: phpstan: name: phpstan runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.2' + php-version: '8.4' coverage: none - name: Install composer dependencies - uses: ramsey/composer-install@v2 + uses: ramsey/composer-install@v3 - name: Run PHPStan - run: ./vendor/bin/phpstan analyse src --error-format=github \ No newline at end of file + run: ./vendor/bin/phpstan --error-format=github diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..afa28ff --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,23 @@ +name: release + +on: + pull_request: + types: + - closed + branches: + - main +jobs: + release: + name: Release + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: '0' + - name: Bump version and push tag + uses: anothrNick/github-tag-action@master + env: + GITHUB_TOKEN: ${{ secrets.MY_GITHUB_TOKEN }} + WITH_V: true + RELEASE_BRANCHES: main + DEFAULT_BUMP: minor diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index c6a1732..097f540 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -13,16 +13,16 @@ jobs: fail-fast: true max-parallel: 1 matrix: - os: [ ubuntu-latest, windows-latest ] - php: [ 8.2, 8.3 ] - laravel: [ 11.* ] + os: [ ubuntu-latest ] + php: [ 8.2, 8.3, 8.4 ] + laravel: [ 12.* ] stability: [ prefer-lowest, prefer-stable ] name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@v2 @@ -41,7 +41,7 @@ jobs: composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update composer update --${{ matrix.stability }} --prefer-dist --no-interaction - - name: Set phpunit.xml + - name: Execute tests run: cp phpunit.xml.dist phpunit.xml - name: Execute tests @@ -51,10 +51,9 @@ jobs: ZAMMAD_TOKEN: ${{ secrets.ZAMMAD_TOKEN }} ZAMMAD_OBJECT_REFERENCE_ERROR_IGNORE: true - - name: Store test reports + - name: Store Log Artifacts + if: failure() uses: actions/upload-artifact@v4 with: - name: Store report - retention-days: 1 - path: | - ./reports + name: Store report artifacts + path: ./vendor/orchestra/testbench-core/laravel/storage/logs diff --git a/composer.json b/composer.json index b1a5670..3a09f78 100644 --- a/composer.json +++ b/composer.json @@ -11,36 +11,34 @@ "license": "MIT", "authors": [ { - "name": "Sebastian Steiger", - "email": "sebastian.fix@codebar.ch", + "name": "Sebastian Bürgin-Fix", + "email": "sebastian.buergin@buergin.ch", "homepage": "https://www.codebar.ch", - "role": "Developer" + "role": "Sofware-Engineer" }, { "name": "Rhys Lees", - "role": "Software-Developer" + "role": "Software-Engineer" } ], "require": { - "php": ">=8.2", + "php": "8.2.*|8.3.*|8.4.*", "guzzlehttp/guzzle": "^7.8", - "illuminate/contracts": "^11.0", - "spatie/laravel-package-tools": "^1.16", + "illuminate/contracts": "^12.0", + "spatie/laravel-package-tools": "^1.19", + "saloonphp/cache-plugin": "^3.0", "saloonphp/laravel-plugin": "^3.5", - "saloonphp/saloon": "^3.7" + "saloonphp/saloon": "^3.10.1" }, "require-dev": { - "laravel/pint": "^1.13", - "nunomaduro/collision": "^8.1", - "larastan/larastan": "^2.9", - "pestphp/pest": "^2.3", - "orchestra/testbench": "^9.0", - "pestphp/pest-plugin-laravel": "^2.2", - "pestphp/pest-plugin-arch": "^2.7", - "phpstan/extension-installer": "^1.3", - "phpstan/phpstan-deprecation-rules": "^1.1", - "phpstan/phpstan-phpunit": "^1.3", - "spatie/laravel-ray": "^1.33" + "laravel/pint": "^1.21", + "larastan/larastan": "^v3.1", + "orchestra/testbench": "^10.0", + "pestphp/pest": "^3.7", + "phpstan/extension-installer": "^1.4", + "phpstan/phpstan-deprecation-rules": "^2.0", + "phpstan/phpstan-phpunit": "^2.0", + "spatie/laravel-ray": "^1.39" }, "autoload": { "psr-4": { From de0cfb5df60eb0966ee8bee3c3242bebae7273f0 Mon Sep 17 00:00:00 2001 From: Rhys Lees <43909932+RhysLees@users.noreply.github.com> Date: Thu, 27 Feb 2025 14:05:29 +0000 Subject: [PATCH 7/7] WIP --- README.md | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index c3815d2..33d5778 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ [![Latest Version on Packagist](https://img.shields.io/packagist/v/codebar-ag/laravel-zammad.svg?style=flat-square)](https://packagist.org/packages/codebar-ag/laravel-zammad) +[![GitHub-Tests](https://github.com/codebar-ag/laravel-zammad/actions/workflows/run-tests.yml/badge.svg?branch=main)](https://github.com/codebar-ag/laravel-zammad/actions/workflows/run-tests.yml) +[![GitHub Code Style](https://github.com/codebar-ag/laravel-zammad/actions/workflows/fix-php-code-style-issues.yml/badge.svg?branch=main)](https://github.com/codebar-ag/laravel-zammad/actions/workflows/fix-php-code-style-issues.yml) [![Total Downloads](https://img.shields.io/packagist/dt/codebar-ag/laravel-zammad.svg?style=flat-square)](https://packagist.org/packages/codebar-ag/laravel-zammad) -[![run-tests](https://github.com/codebar-ag/laravel-zammad/actions/workflows/run-tests.yml/badge.svg)](https://github.com/codebar-ag/laravel-zammad/actions/workflows/run-tests.yml) -[![PHPStan](https://github.com/codebar-ag/laravel-zammad/actions/workflows/phpstan.yml/badge.svg)](https://github.com/codebar-ag/laravel-zammad/actions/workflows/phpstan.yml) This package was developed to give you a quick start to communicate with the Zammad REST API. It is used to query the most common endpoints. @@ -19,11 +19,13 @@ features to manage customer communication. ## 🛠 Requirements -| Package | PHP | Laravel | Zammad | -|-----------|--------|------------------|----------| -| >v3.0 | >8.2 | > Laravel 10.0 | ✅ | -| >v2.0 | >8.1 | > Laravel 9.0 | ✅ | -| >v1.0 | >8.0 | > Laravel 8.12 | ✅ | +| Package | PHP | Laravel | Zammad | +|-----------|-------------|----------------|----------| +| v12.0 | ^8.2 - ^8.4 | Laravel 12.0 | ✅ | +| v11.0 | ^8.2 - ^8.3 | Laravel 11.0 | ✅ | +| v3.0 | 8.2 | Laravel 10.0 | ✅ | +| v2.0 | 8.1 | Laravel 9.0 | ✅ | +| v1.0 | 8.0 | Laravel 8.12 | ✅ | ## ⚙️ Installation