Skip to content
Draft
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
61 changes: 0 additions & 61 deletions .github/workflows/ci.yml

This file was deleted.

65 changes: 65 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Tests

on:
push:
branches: [master]
pull_request:
workflow_dispatch:

permissions:
contents: read

jobs:
unit:
if: github.event_name != 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6

- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
tools: composer

- name: Install dependencies
run: composer install --no-interaction --prefer-dist

- name: Run PHPCS
run: vendor/bin/phpcs --standard=PSR12 src/

- name: Run PHPStan
run: vendor/bin/phpstan analyse src/ --configuration phpstan.neon.dist

- name: Run PHPUnit unit suite
run: vendor/bin/phpunit --testsuite unit

testcontainers:
if: github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
services:
docker:
image: docker:dind
options: --privileged
ports:
- 2375:2375
env:
DOCKER_HOST: tcp://127.0.0.1:2375
DOCKER_TLS_CERTDIR: ''
steps:
- uses: actions/checkout@v6

- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
tools: composer

- name: Install dependencies
run: composer install --no-interaction --prefer-dist

- name: Verify Docker daemon
run: docker info

- name: Run PHPUnit integration suite
run: vendor/bin/phpunit --no-configuration --bootstrap test/bootstrap.php test/ZammadAPIClient/Resource
43 changes: 37 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,53 @@
"type": "library",
"description": "Zammad API client for PHP",
"homepage": "https://github.com/zammad/zammad-api-client-php",
"keywords": ["zammad", "api"],
"license": ["AGPL-3.0", "MIT"],
"keywords": [
"zammad",
"api"
],
"license": [
"AGPL-3.0",
"MIT"
],
"authors": [
{
"name": "Zammad GmbH",
"homepage": "https://zammad.com"
}
],
"require": {
"php": ">=7.2",
"guzzlehttp/guzzle": "^7"
"php": ">=8.3",
"psr/http-client": "^1.0",
"psr/http-factory": "^1.1",
"psr/log": "^3.0"
},
"require-dev": {
"phpunit/phpunit": ">=5.7 <9"
"guzzlehttp/guzzle": "^7.11",
"league/openapi-psr7-validator": "^0.22",
"mockery/mockery": "^1.6",
"phpstan/phpstan": "^2.2",
"phpunit/phpunit": "^10.5.62",
"squizlabs/php_codesniffer": "^3.11"
},
"suggest": {
"guzzlehttp/guzzle": "Provides the default HTTP client implementation used by ZammadAPIClient\\HTTPClient."
},
"autoload": {
"psr-4": {"ZammadAPIClient\\": "src/"}
"psr-4": {
"ZammadAPIClient\\": "src/"
}
},
"autoload-dev": {
"classmap": [
"test/"
]
},
"scripts": {
"phpcs": "phpcs --standard=PSR12 src/",
"phpstan": "phpstan analyse src/ --configuration phpstan.neon.dist",
"test": "phpunit --testsuite=unit"
},
"config": {
"sort-packages": true
}
}
1 change: 1 addition & 0 deletions examples/config.php.dist
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);

// Copy this file to config.php and insert your credentials.
// Note that you have to activate API access within your Zammad (Settings => System => API)
Expand Down
1 change: 1 addition & 0 deletions examples/tag_admin.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);

/**
* Example for Tag administration scope.
Expand Down
1 change: 1 addition & 0 deletions examples/ticket.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);

require __DIR__ . '/../vendor/autoload.php';
require __DIR__ . '/config.php';
Expand Down
1 change: 1 addition & 0 deletions examples/user.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);

require __DIR__ . '/../vendor/autoload.php';
require __DIR__ . '/config.php';
Expand Down
Loading