PHPackages                             qase/php-commons - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. qase/php-commons

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

qase/php-commons
================

Library with common classes for Qase PHP reporters

2.1.16(2mo ago)138.8k↓10.5%14Apache-2.0PHPPHP ^8.0CI passing

Since Feb 9Pushed 2mo ago3 watchersCompare

[ Source](https://github.com/qase-tms/qase-php-commons)[ Packagist](https://packagist.org/packages/qase/php-commons)[ Docs](https://qase.io)[ RSS](/packages/qase-php-commons/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (8)Versions (31)Used By (4)

Qase PHP Commons
================

[](#qase-php-commons)

This module is an SDK for developing test reporters for Qase TMS. You should use it if you're developing your own test reporter for a special-purpose framework.

To report results from tests using a popular framework or test runner, don't install this module directly and use the corresponding reporter module instead:

- [PHPUnit](https://github.com/qase-tms/qase-phpunit)

Installation
------------

[](#installation)

```
composer require qase/php-commons
```

Configuration
-------------

[](#configuration)

Qase PHP Reporters can be configured in multiple ways:

- using a config file `qase.config.json`
- using environment variables

All configuration options are listed in the table below:

DescriptionConfig fileEnvironment variableDefault valueRequiredPossible values**Common**Mode of reporter`mode``QASE_MODE``off`No`testops`, `report`, `off`Fallback mode of reporter`fallback``QASE_FALLBACK``off`No`testops`, `report`, `off`Environment slug`environment``QASE_ENVIRONMENT`undefinedNoAny stringRoot suite`rootSuite``QASE_ROOT_SUITE`undefinedNoAny stringEnable debug logs`debug``QASE_DEBUG``False`No`True`, `False`Enable console logging`logging.console``QASE_LOGGING_CONSOLE``True`No`True`, `False`Enable file logging`logging.file``QASE_LOGGING_FILE``True`No`True`, `False`**Qase Report configuration**Driver used for report mode`report.driver``QASE_REPORT_DRIVER``local`No`local`Path to save the report`report.connection.path``QASE_REPORT_CONNECTION_PATH``./build/qase-report`Local report format`report.connection.format``QASE_REPORT_CONNECTION_FORMAT``json``json`, `jsonp`**Qase TestOps configuration**Token for [API access](https://developers.qase.io/#authentication)`testops.api.token``QASE_TESTOPS_API_TOKEN`undefinedYesAny stringQase API host. For enterprise users, specify address: `example.qase.io``testops.api.host``QASE_TESTOPS_API_HOST``qase.io`NoAny stringQase enterprise environment`testops.api.enterprise``QASE_TESTOPS_API_ENTERPRISE``False`No`True`, `False`Code of your project, which you can take from the URL: `https://app.qase.io/project/DEMOTR` - `DEMOTR` is the project code`testops.project``QASE_TESTOPS_PROJECT`undefinedYesAny stringQase test run ID`testops.run.id``QASE_TESTOPS_RUN_ID`undefinedNoAny integerQase test run title`testops.run.title``QASE_TESTOPS_RUN_TITLE``Automated run `NoAny stringQase test run description`testops.run.description``QASE_TESTOPS_RUN_DESCRIPTION`` automated run`NoAny stringQase test run complete`testops.run.complete``QASE_TESTOPS_RUN_COMPLETE``True``True`, `False`Qase test run tags`testops.run.tags``QASE_TESTOPS_RUN_TAGS`undefinedNoConfig: array of strings, Env: comma-separated stringExternal issue type`testops.run.externalLink.type``QASE_TESTOPS_RUN_EXTERNAL_LINK_TYPE`undefinedNo`jiraCloud`, `jiraServer`External issue URL`testops.run.externalLink.link``QASE_TESTOPS_RUN_EXTERNAL_LINK_URL`undefinedNoAny valid URL stringQase test plan ID`testops.plan.id``QASE_TESTOPS_PLAN_ID`undefinedNoAny integerSize of batch for sending test results`testops.batch.size``QASE_TESTOPS_BATCH_SIZE``200`NoAny integerEnable defects for failed test cases`testops.defect``QASE_TESTOPS_DEFECT``False`No`True`, `False`Enable public report link generation after run completion`testops.showPublicReportLink``QASE_TESTOPS_SHOW_PUBLIC_REPORT_LINK``False`No`True`, `False`Configuration values to associate with test run`testops.configurations.values``QASE_TESTOPS_CONFIGURATIONS_VALUES``[]`NoComma-separated key=value pairsCreate configuration groups and values if they don't exist`testops.configurations.createIfNotExists``QASE_TESTOPS_CONFIGURATIONS_CREATE_IF_NOT_EXISTS``False`No`True`, `False`Status filter for test results`testops.statusFilter``QASE_TESTOPS_STATUS_FILTER``[]`NoComma-separated stringStatus mapping for test results`statusMapping``QASE_STATUS_MAPPING``{}`NoJSON object or comma-separated key=value pairs### Example `qase.config.json` config

[](#example-qaseconfigjson-config)

```
{
  "mode": "testops",
  "fallback": "report",
  "debug": false,
  "environment": "local",
  "captureLogs": false,
  "statusMapping": {
    "invalid": "failed",
    "skipped": "passed"
  },
  "report": {
    "driver": "local",
    "connection": {
      "local": {
        "path": "./build/qase-report",
        "format": "json"
      }
    }
  },
  "testops": {
    "api": {
      "token": "",
      "host": "qase.io"
    },
    "run": {
      "title": "Regress run",
      "description": "Regress run description",
      "complete": true,
      "tags": ["tag1", "tag2"],
      "externalLink": {
        "type": "jiraCloud",
        "link": "PROJ-123"
      }
    },
    "defect": false,
    "showPublicReportLink": true,
    "project": "",
    "batch": {
      "size": 100
    },
    "configurations": {
      "values": [
        {
          "name": "browser",
          "value": "chrome"
        },
        {
          "name": "version",
          "value": "latest"
        },
        {
          "name": "environment",
          "value": "staging"
        }
      ],
      "createIfNotExists": true
    },
    "statusFilter": ["skipped", "blocked", "untested"]
  }
}
```

### Environment Variables Example

[](#environment-variables-example)

You can also configure configurations using environment variables:

```
export QASE_TESTOPS_CONFIGURATIONS_VALUES="browser=chrome,version=latest,environment=staging"
export QASE_TESTOPS_CONFIGURATIONS_CREATE_IF_NOT_EXISTS=true
export QASE_TESTOPS_STATUS_FILTER="skipped,blocked,untested"
export QASE_TESTOPS_RUN_EXTERNAL_LINK_TYPE="jiraCloud"
export QASE_TESTOPS_RUN_EXTERNAL_LINK_URL="PROJ-123"
export QASE_TESTOPS_SHOW_PUBLIC_REPORT_LINK=true
export QASE_STATUS_MAPPING="invalid=failed,skipped=passed"
```

The `QASE_TESTOPS_CONFIGURATIONS_VALUES` should be a comma-separated list of key=value pairs.

### How Configurations Work

[](#how-configurations-work)

Configurations in Qase TestOps work as follows:

- **name** field represents the configuration group (e.g., "browser", "environment")
- **value** field represents the configuration item within that group (e.g., "chrome", "staging")
- When `createIfNotExists` is true, the system will:
    1. Create a configuration group with the specified name if it doesn't exist
    2. Create a configuration item with the specified value in that group
    3. Associate the configuration item ID with the test run

### Status Filtering

[](#status-filtering)

You can filter out test results with specific statuses using the `statusFilter` configuration option:

**Config file example:**

```
{
  "testops": {
    "statusFilter": ["skipped", "blocked", "untested"]
  }
}
```

**Environment variable example:**

```
export QASE_TESTOPS_STATUS_FILTER="skipped,blocked,untested"
```

**Available statuses:**

- `passed` - Test passed successfully
- `failed` - Test failed
- `skipped` - Test was skipped
- `blocked` - Test was blocked
- `untested` - Test was not tested

When `statusFilter` is configured, results with the specified statuses will be excluded from being sent to Qase TestOps.

### Status Mapping

[](#status-mapping)

You can map (transform) test result statuses using the `statusMapping` configuration option. This is useful when you need to convert statuses from your testing framework to match Qase's expected statuses.

**Config file example:**

```
{
  "statusMapping": {
    "invalid": "failed",
    "skipped": "passed"
  }
}
```

**Environment variable example:**

```
export QASE_STATUS_MAPPING="invalid=failed,skipped=passed"
```

**Available statuses for mapping:**

- `passed` - Test passed successfully
- `failed` - Test failed due to assertion error
- `skipped` - Test was skipped
- `blocked` - Test was blocked
- `invalid` - Test failed due to non-assertion error (network issues, syntax errors)

**How status mapping works:**

- Status mapping is applied **before** status filtering
- Mapping is applied to both test results and individual test steps
- Invalid mappings are ignored with a warning message
- Mapping is applied centrally for all reporters regardless of testing framework
- Changes are logged for debugging purposes

**Example scenarios:**

1. **Convert invalid to failed**: Map `invalid` status to `failed` to treat infrastructure issues as test failures
2. **Convert skipped to passed**: Map `skipped` status to `passed` to include skipped tests in pass rate calculations
3. **Multiple mappings**: Apply different mappings for different statuses in a single configuration

**Validation rules:**

- Source and target statuses must be valid (from the list above)
- Source and target cannot be the same (redundant mappings are ignored)
- Case-sensitive validation (e.g., `PASSED` is invalid, use `passed`)
- Non-string values are ignored

### External Issue Integration

[](#external-issue-integration)

You can link test runs to external issues (like Jira tickets) by configuring the `externalLink` option:

**Config file example:**

```
{
  "testops": {
    "run": {
      "externalLink": {
        "type": "jiraCloud",
        "link": "PROJ-123"
      }
    }
  }
}
```

**Environment variables example:**

```
export QASE_TESTOPS_RUN_EXTERNAL_LINK_TYPE="jiraCloud"
export QASE_TESTOPS_RUN_EXTERNAL_LINK_URL="PROJ-123"
```

**Supported external issue types:**

- `jiraCloud` - For Jira Cloud instances
- `jiraServer` - For Jira Server/Data Center instances

When an external link is configured, the system will automatically associate the test run with the specified external issue after the run is created.

**Technical Details:**

- External issue functionality uses the Qase API v1 client
- The system automatically maps internal enum values to API enum values:
    - `jiraCloud` → `jira-cloud`
    - `jiraServer` → `jira-server`
- API calls are made using the official Qase API client models (`RunexternalIssues` and `RunexternalIssuesLinksInner`)

###  Health Score

53

—

FairBetter than 97% of packages

Maintenance88

Actively maintained with recent releases

Popularity32

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 83.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~47 days

Recently: every ~12 days

Total

25

Last Release

61d ago

Major Versions

v1.0.0 → 2.0.02025-01-30

PHP version history (2 changes)v1.0.0PHP ^7.4 || ^8.0

2.0.0PHP ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/f9f1a283d3d2006e510da5e8859b4f5c174b3fb1ea67527857ab6d9bbd3ee599?d=identicon)[qase](/maintainers/qase)

---

Top Contributors

[![gibiw](https://avatars.githubusercontent.com/u/17822447?v=4)](https://github.com/gibiw "gibiw (36 commits)")[![ConorEdwardsCP](https://avatars.githubusercontent.com/u/178174879?v=4)](https://github.com/ConorEdwardsCP "ConorEdwardsCP (3 commits)")[![n3r](https://avatars.githubusercontent.com/u/844921?v=4)](https://github.com/n3r "n3r (3 commits)")[![bambamboole](https://avatars.githubusercontent.com/u/8823695?v=4)](https://github.com/bambamboole "bambamboole (1 commits)")

---

Tags

phpcommonreportertmsqase

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/qase-php-commons/health.svg)

```
[![Health](https://phpackages.com/badges/qase-php-commons/health.svg)](https://phpackages.com/packages/qase-php-commons)
```

###  Alternatives

[phpoffice/common

PHPOffice Common

23512.3M36](/packages/phpoffice-common)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
