{"id":19060539,"url":"https://github.com/uiii/tense","last_synced_at":"2025-07-04T11:05:19.374Z","repository":{"id":57074813,"uuid":"75287793","full_name":"uiii/tense","owner":"uiii","description":"Easy testing against multiple versions of ProcessWire CMF","archived":false,"fork":false,"pushed_at":"2017-04-23T21:57:32.000Z","size":1934,"stargazers_count":8,"open_issues_count":2,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-24T06:53:01.727Z","etag":null,"topics":["php","processwire","testing","tool"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/uiii.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-12-01T11:50:55.000Z","updated_at":"2020-12-12T14:29:44.000Z","dependencies_parsed_at":"2022-08-24T14:55:37.606Z","dependency_job_id":null,"html_url":"https://github.com/uiii/tense","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/uiii/tense","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uiii%2Ftense","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uiii%2Ftense/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uiii%2Ftense/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uiii%2Ftense/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/uiii","download_url":"https://codeload.github.com/uiii/tense/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uiii%2Ftense/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263499192,"owners_count":23476021,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["php","processwire","testing","tool"],"created_at":"2024-11-09T00:15:52.563Z","updated_at":"2025-07-04T11:05:19.325Z","avatar_url":"https://github.com/uiii.png","language":"PHP","readme":"# Tense\n\n[![Packagist](https://img.shields.io/packagist/v/uiii/tense.svg)](https://packagist.org/packages/uiii/tense)\n[![travis-linux](http://badge.uiii.cz/?service=Travis\u0026repo=uiii/tense\u0026branch=master\u0026label=Linux\u0026params[os]=linux)](https://travis-ci.org/uiii/tense)\n[![travis-osx](http://badge.uiii.cz/?service=Travis\u0026repo=uiii/tense\u0026branch=master\u0026label=Mac\u0026params[os]=osx)](https://travis-ci.org/uiii/tense)\n[![AppVeyor](https://img.shields.io/appveyor/ci/uiii/tense.svg?label=Windows)](https://ci.appveyor.com/project/uiii/tense)\n\nTense (**T**est **EN**vironment **S**etup \u0026 **E**xecution) is a command-line tool to easily run tests agains\nmultiple versions of [ProcessWire CMF](https://processwire.com).\n\nAre you building a module, or a template and you need to make sure it works in all supported ProcessWire versions?\nThen `Tense` is exactly what you need. Write the tests in any testing framework, tell `Tense` which ProcessWire versions you are interested in and it will do the rest for you.\n\n**See [example](https://github.com/uiii/tense/tree/master/example)**\nor **see [usage](https://github.com/uiii/ProcessWire-FieldtypePDF#test-multiple-processwire-versions-automatically) in a real project**.\n\n[![video](example/asciicast.gif)](https://asciinema.org/a/109559)\n\n## Table of Contents\n\n1. [Requirements](#requirements)\n2. [Installation](#installation)\n3. [Usage](#usage)\n7. [Configuration](#configuration)\n8. [Troubleshooting](#troubleshooting)\n\n## Requirements\n\n- PHP 5.6 or higher\n- Composer (https://getcomposer.org)\n- Git (https://git-scm.com)\n- MySQL or MariaDB 5.0.15 or higher\n\n### php.ini\n\n`php.ini` used by `php` cli command must have enabled these extensions:\n\n- curl\n- gd2\n- mbstring\n- mysqli\n- openssl\n- pdo_mysql\n\n## Installation\n\n\u003e Don't forget to setup all [requirements](#requirements) first.\n\nInstall globally:\n```\ncomposer global require uiii/tense\n```\n\nor install as a project dependency:\n```\ncd \u003cyour-project\u003e\ncomposer require --dev uiii/tense\n```\n\n## Usage\n\nGo to your **project's root** directory.\n\n1. create [config](#configuration) file `tense.yml`:\n\n    ```\n    tense init\n    ```\n\n2. run tests:\n\n    ```\n    tense run\n    ```\n\n\u003e if you've installed `Tense` locally as project's dependecy, use `vendor/bin/tense` instead of `tense`\n\n## Configuration\n\nTense uses [YAML](http://yaml.org/) configuration files. There are two types of config files:\n\n- **project** (`tense.yml`): It should contain options directly related to the project's testing. This config is intended to be shared (VCS, ...).\n- **local** (`tense.local.yml`): It should contain options related to the machine's environment setup (database connection, ...), overwrites options from project's config. This is **not** intended to be shared.\n\nThe **project**'s config can be created either manually or interactively by running the command:\n\n```\ntense init\n```\n\nThe **local** config is automatically initialized on each `tense run` when missing.\n\n### tmpDir\n\u003e *optional*, config: project, local\n\nPath to a directory where files needed for testing\n(e.g ProcessWire installation, ...) are stored.\n\n\u003e Path is relative to the config file's parent directory.\n\n*Default is `.tense`*\n\n### db\n\u003e **required**, config: local\n\nDatabase connection parameters.\n\n\u003e They are used to create the database\nfor ProcessWire installation, so the user\nmust have the privileges to create a database.\n\n\u003e `db.name` is a name of the database.\n\n*Example:*\n```yaml\ndb:\n    host: localhost\n    port: 3306\n    user: root\n    pass: \"\"\n    name: tense\n```\n\n### testTags\n\u003e **required**, config: project\n\nList of ProcessWire tags/versions used for testing.\n\nIt doesn't have to be exact version number.\nFor each tag/version will be found latest matching\nexisting tag (e.g. `3.0` -\u003e `3.0.42`).\n\nVersions are tested in the specified order.\n\n\u003e Minimal supported version is `2.5`.\n\n\u003e Version `2.8` is not currently supported.\n\n*Example:*\n```yaml\ntestTags:\n    - \"2.5\"\n    - \"2.6\"\n    - \"2.7.1\"\n    - \"3.0\"\n```\n\n### copySources\n\u003e *optional*, config: project\n\nCopy source files into ProcessWire's' installation before testing.\n\nIt is a list of objects with `destination` and `source` properties.\n\n\u003e Destination paths are relative to ProcessWire's installation root.\n\n\u003e Source paths are relative to the config file's parent directory.\n\nSources can either be a single string or an array of strings.\nIf the source is a string, file to file copy is used.\nIf the source is an array of strings, the destination\nis considered to be a directory where all sources are copied into.\n\n\u003e If source item is a directory, it will be copied recursively.\n\n*Example:*\n\n```yaml\ncopySources:\n    - destination: \"site/templates/HomeTemplate.php\"\n    source: \"src/templates/home.php\"\n\n    - destination: \"site/modules/Module\"\n    source:\n        - \"Libs\"\n        - \"Module.module\"\n```\n\nConsider `tense.yml` is in project's root and `\u003cproject-root\u003e/Libs` is a directory. In this example these files will be copied:\n- `\u003cproject-root\u003e/templates/home.php` to `\u003cpw-path\u003e/site/templates/HomeTemplate.php`\n- `\u003cproject-root\u003e/Libs/*` to `\u003cpw-path\u003e/site/modules/Module/Libs`\n- `\u003cproject-root\u003e/Module.module` to `\u003cpw-path\u003e/site/modules/Module/Module.module`\n\n### beforeCmd\n\u003e *optional*, config: project, local\n\nCommand to execute before a test suite, but after a PW instance is installed and [sources](#copysources) are copied.\n\nThis is just a single command, if you need to run multiple commands, put them into an external script.\n\n\u003e Remember, the command should be platform independent, so using `.sh` or `.bat` files are not recommended.\n\u003e Best option is to use PHP as you can see in the [example](https://github.com/uiii/tense/tree/master/example),\n\u003e but you can use any other platform independent scripting language.\n\n\u003e Path to the ProcessWire installation will be in `PW_PATH` environment variable.\n\n*Example:*\n```yaml\nbeforeCmd: \"composer install\"\n```\n\n### testCmd\n\u003e **required**, config: project\n\nCommand to execute a test suite.\n\n\u003e Path to the ProcessWire installation will be in `PW_PATH` environment variable.\n\n*Example:*\n```yaml\ntestCmd: \"vendor/bin/phpunit --bootstrap vendor/autoload.php tests/Test.php\"\n```\n\n### pause\n\u003e *optional*, config: local\n\nAfter each test suite against a ProcessWire instance\nbut before a clean up test runner can pause and ask the user what to do.\n\nThis is useful e.g. to examine the installed ProcessWire instance.\n\n*Possible values are:*\n- `never` - never pause (*default*)\n- `onFailure` - pause after failed test suite\n- `always` - always pause after a test suite\n\n## Troubleshooting\n\n### cURL error: SSL certificate problem: unable to get local issuer certificate\n\nIf you got this error, you haven't properly configured PHP's `curl` extension. You can solve this e.g. by\n\n1. download the [https://curl.haxx.se/ca/cacert.pem](https://curl.haxx.se/ca/cacert.pem) file\n2. place it somewhere, e.g. in PHP's installation directory\n3. edit `php.ini` file and set `curl.cainfo = \u003caboslute-path-to-cacert-file\u003e`\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuiii%2Ftense","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuiii%2Ftense","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuiii%2Ftense/lists"}