Skip to content

Commit 678e45d

Browse files
authored
Merge pull request #26 from codebar-ag/feature-release
Feature Release
2 parents 470d7f6 + 22d73fe commit 678e45d

File tree

12 files changed

+47
-27
lines changed

12 files changed

+47
-27
lines changed

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
blank_issues_enabled: false
22
contact_links:
33
- name: Ask a question
4-
url: https://github.com/codebar-ag/laravel-zammad/discussions/new?category=q-a
4+
url: https://github.com/codebar-ag/laravel-zammad/issues/new
55
about: Ask the community for help
66
- name: Request a feature
7-
url: https://github.com/codebar-ag/laravel-zammad/discussions/new?category=ideas
7+
url: https://github.com/codebar-ag/laravel-zammad/issues/new
88
about: Share ideas for new features
99
- name: Report a bug
1010
url: https://github.com/codebar-ag/laravel-zammad/issues/new
11-
about: Report a reproducable bug
11+
about: Report a reproducable bug

.github/workflows/phpstan.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ jobs:
2323
uses: ramsey/composer-install@v2
2424

2525
- name: Run PHPStan
26-
run: ./vendor/bin/phpstan --error-format=github
26+
run: ./vendor/bin/phpstan analyse src --error-format=github

.github/workflows/run-tests.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ jobs:
1111
runs-on: ${{ matrix.os }}
1212
strategy:
1313
fail-fast: true
14+
max-parallel: 1
1415
matrix:
1516
os: [ ubuntu-latest, windows-latest ]
1617
php: [ 8.2 ]
@@ -43,6 +44,9 @@ jobs:
4344
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
4445
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
4546
47+
- name: Set phpunit.xml
48+
run: cp phpunit.xml.dist phpunit.xml
49+
4650
- name: Execute tests
4751
run: vendor/bin/pest
4852
env:
@@ -56,4 +60,4 @@ jobs:
5660
name: Store report
5761
retention-days: 1
5862
path: |
59-
./reports
63+
./reports

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ $objects = Zammad::object()->list();
249249
'active' => true,
250250
'position' => 1500,
251251
'data_type' => 'select',
252-
'data_options' => [
252+
'data_option' => [
253253
'options' => [
254254
'key-one' => 'First Key',
255255
'key-two' => 'Second Key',
@@ -298,7 +298,8 @@ $content = Zammad::attachment()->download(
298298

299299
You can use the `expand()` method to expand the response with additional data.
300300

301-
See documentation on this in the [Zammad API Docs](https://docs.zammad.org/en/latest/api/intro.html?highlight=expand#response-payloads-expand).
301+
See documentation on this in
302+
the [Zammad API Docs](https://docs.zammad.org/en/latest/api/intro.html?highlight=expand#response-payloads-expand).
302303

303304
```php
304305
$ticket = Zammad::ticket()->expand()->show(20);
@@ -319,7 +320,8 @@ $user = Zammad::user()->limit(1)->search();
319320

320321
## Paginate list response payloads
321322

322-
You can use the `perPage(int $perPage)` and `page(int $page)` methods to set the page and per page values for the response
323+
You can use the `perPage(int $perPage)` and `page(int $page)` methods to set the page and per page values for the
324+
response
323325
Alternatively you can use the `paginate(int $page, int $perPage):` method to set both at once.
324326

325327
See documentation on this in the [Zammad API Docs](https://docs.zammad.org/en/latest/api/intro.html#pagination).
@@ -407,7 +409,6 @@ CodebarAg\Zammad\DTO\ObjectAttribute {
407409
}
408410
```
409411

410-
411412
## 🔧 Configuration file
412413

413414
You can publish the config file with:

composer.json

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,28 +15,32 @@
1515
"email": "[email protected]",
1616
"homepage": "https://www.codebar.ch",
1717
"role": "Developer"
18+
},
19+
{
20+
"name": "Rhys Lees",
21+
"role": "Software-Developer"
1822
}
1923
],
2024
"require": {
2125
"php": "^8.2",
2226
"guzzlehttp/guzzle": "^7.5",
2327
"illuminate/contracts": "^10.0",
2428
"spatie/laravel-package-tools": "^1.9.2",
25-
"sammyjo20/saloon": "^2.0",
26-
"sammyjo20/saloon-laravel": "^2.0"
29+
"saloonphp/laravel-plugin": "^2.1",
30+
"saloonphp/saloon": "^2.11"
2731
},
2832
"require-dev": {
29-
"laravel/pint": "^1.0",
30-
"nunomaduro/collision": "^7.9",
31-
"nunomaduro/larastan": "^2.0.1",
32-
"orchestra/testbench": "^8.0",
33+
"laravel/pint": "^1.5",
34+
"nunomaduro/collision": "^7.0",
35+
"nunomaduro/larastan": "^2.4.0",
3336
"pestphp/pest": "^2.0",
34-
"pestphp/pest-plugin-arch": "^2.0",
37+
"orchestra/testbench": "^8.0",
3538
"pestphp/pest-plugin-laravel": "^2.0",
39+
"pestphp/pest-plugin-arch": "^2.0",
3640
"phpstan/extension-installer": "^1.1",
3741
"phpstan/phpstan-deprecation-rules": "^1.0",
3842
"phpstan/phpstan-phpunit": "^1.0",
39-
"spatie/laravel-ray": "^1.26"
43+
"spatie/laravel-ray": "^1.9"
4044
},
4145
"autoload": {
4246
"psr-4": {

phpunit.xml.dist

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.1/phpunit.xsd" backupGlobals="false"
3+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.3/phpunit.xsd" backupGlobals="false"
44
bootstrap="vendor/autoload.php" colors="true" processIsolation="false" stopOnFailure="false"
55
executionOrder="random" failOnWarning="true" failOnRisky="true" failOnEmptyTestSuite="true"
66
beStrictAboutOutputDuringTests="true" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
@@ -20,12 +20,12 @@
2020
<junit outputFile="build/report.junit.xml"/>
2121
</logging>
2222
<php>
23-
<env name="ZAMMAD_URL" value="https://domain.zammad.com"/>
23+
<env name="ZAMMAD_URL" value="https://dev-immospace.zammad.com"/>
2424
<env name="ZAMMAD_TOKEN" value="token"/>
2525
</php>
2626
<source>
2727
<include>
2828
<directory suffix=".php">./src</directory>
2929
</include>
3030
</source>
31-
</phpunit>
31+
</phpunit>

src/Resources/TicketResource.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818

1919
class TicketResource extends RequestClass
2020
{
21-
use HasLimit;
2221
use HasExpand;
22+
use HasLimit;
2323
use HasPagination;
2424

2525
/**

src/Resources/UserResource.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919

2020
class UserResource extends RequestClass
2121
{
22-
use HasLimit;
2322
use HasExpand;
23+
use HasLimit;
2424
use HasPagination;
2525

2626
/**

tests/Feature/AttachmentResourceTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
use CodebarAg\Zammad\Events\ZammadResponseLog;
44
use CodebarAg\Zammad\Zammad;
5+
use Illuminate\Support\Facades\Event;
56
use Illuminate\Support\Str;
67

78
it('can download an attachment', function () {

tests/Feature/ObjectAttributeResourceTest.php

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
$this->assertInstanceOf(Collection::class, $objects);
1212
$this->assertTrue($objects->count() > 0);
1313
Event::assertDispatched(ZammadResponseLog::class, 1);
14-
})->group('objects');
14+
})->group('objects', 'list-objects');
1515

1616
it('shows a object', function () {
1717
$objects = (new Zammad())->object()->list();
@@ -21,16 +21,21 @@
2121
$newObject = (new Zammad())->object()->show($object->id);
2222
$this->assertSame($object->id, $newObject->id);
2323
Event::assertDispatched(ZammadResponseLog::class, 2);
24-
})->group('objects');
24+
})->group('objects', 'show-object');
2525

2626
it('creates a object', function () {
2727
$objectAttribute = ObjectAttribute::fakeCreateToArray();
2828
$object = (new Zammad())->object()->create($objectAttribute);
29+
2930
$this->assertInstanceOf(ObjectAttribute::class, $object);
3031
$this->assertSame($objectAttribute['name'], $object->name);
3132
$this->assertSame($objectAttribute['display'], $object->display);
3233
Event::assertDispatched(ZammadResponseLog::class, 1);
33-
})->group('objects');
34+
35+
(new Zammad())->object()->delete($object->id);
36+
(new Zammad())->object()->executeMigrations();
37+
38+
})->group('objects', 'create-object');
3439

3540
it('update a object', function () {
3641
$objectAttribute = ObjectAttribute::fakeCreateToArray();
@@ -62,7 +67,11 @@
6267
Event::assertDispatched(ZammadResponseLog::class, 2);
6368
expect($updatedObjectAttribute['display'])->toEqual($object->display);
6469
expect($objectAttribute['display'])->not()->toEqual($object->display);
65-
})->group('objects');
70+
71+
(new Zammad())->object()->delete($object->id);
72+
(new Zammad())->object()->executeMigrations();
73+
74+
})->group('objects', 'update-object');
6675

6776
it('deletes a object', function () {
6877
$objectAttribute = ObjectAttribute::fakeCreateToArray();

tests/Feature/UserAccessTokenRequestTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use CodebarAg\Zammad\Zammad;
77
use Illuminate\Support\Facades\Event;
88
use Illuminate\Support\Str;
9+
910
use function PHPUnit\Framework\assertSame;
1011

1112
it('lists user tokens', function () {

tests/Feature/UserResourceTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
});
2525

2626
Event::assertDispatched(ZammadResponseLog::class, 1);
27-
})->group('users');
27+
})->group('users', 'list-users');
2828

2929
it('searches a user', function () {
3030
$users = (new Zammad())->user()->paginate(1, 100)->list();

0 commit comments

Comments
 (0)