{"id":13410645,"url":"https://github.com/YOURLS/YOURLS-test-suite-for-plugins","last_synced_at":"2025-03-14T16:32:36.891Z","repository":{"id":148165602,"uuid":"480835748","full_name":"YOURLS/YOURLS-test-suite-for-plugins","owner":"YOURLS","description":"🧪 YOURLS test suite for plugins. Write unit tests for your YOURLS plugins!","archived":false,"fork":false,"pushed_at":"2022-04-24T17:22:01.000Z","size":31,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-10-24T00:16:51.524Z","etag":null,"topics":["github-actions","phpunit","testing","unit-tests","yourls","yourls-plugin"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/YOURLS.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null},"funding":{"github":["YOURLS","ozh","LeoColomb","dgw"],"open_collective":"yourls"}},"created_at":"2022-04-12T14:03:05.000Z","updated_at":"2022-07-28T10:02:15.000Z","dependencies_parsed_at":"2023-05-19T08:30:34.951Z","dependency_job_id":null,"html_url":"https://github.com/YOURLS/YOURLS-test-suite-for-plugins","commit_stats":{"total_commits":13,"total_committers":1,"mean_commits":13.0,"dds":0.0,"last_synced_commit":"76588ef39e566074e8aedb5144c1f5f3e15fe085"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YOURLS%2FYOURLS-test-suite-for-plugins","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YOURLS%2FYOURLS-test-suite-for-plugins/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YOURLS%2FYOURLS-test-suite-for-plugins/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YOURLS%2FYOURLS-test-suite-for-plugins/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/YOURLS","download_url":"https://codeload.github.com/YOURLS/YOURLS-test-suite-for-plugins/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242947135,"owners_count":20210969,"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":["github-actions","phpunit","testing","unit-tests","yourls","yourls-plugin"],"created_at":"2024-07-30T20:01:08.175Z","updated_at":"2025-03-14T16:32:36.574Z","avatar_url":"https://github.com/YOURLS.png","language":"Shell","funding_links":["https://github.com/sponsors/YOURLS","https://github.com/sponsors/ozh","https://github.com/sponsors/LeoColomb","https://github.com/sponsors/dgw","https://opencollective.com/yourls"],"categories":["Official Links","Shell"],"sub_categories":[],"readme":"# YOURLS test suite for plugins [![Listed in Awesome YOURLS!](https://img.shields.io/badge/Awesome-YOURLS-C5A3BE)](https://github.com/YOURLS/awesome-yourls/)\n\n\u003e A PHPUnit tool for YOURLS plugins.\n\n\n## About\n\nThe **YOURLS test suite for plugins** is a tool to test YOURLS plugins with standard PHPUnit tests.\n\nThis tool assumes basic knowledge of command line tools and of the [PHPUnit](https://phpunit.de/ \"PHPUnit\") framework.\n\n## Usage\n\n0. **Have a plugin with tests**  \n    See the short [how-to guide](HOWTO.md) about writing unit tests for YOURLS plugins.\n\n1. **Install the YOURLS test suite for plugins**  \n    In `my-cool-plugin/` :\n    ```shell\n    $ git clone https://github.com/YOURLS/YOURLS-test-suite-for-plugins test-suite\n    ```\n\n2. **Install the YOURLS test suite and the testing database**  \n    ```shell\n    $ bash test-suite/src/install-test-suite.sh \u003cdb-name\u003e \u003cdb-user\u003e \u003cdb-password\u003e [db-host, default localhost] [YOURLS version, default master]\n    ```\n    Examples  :\n    ```shell\n    $ bash test-suite/src/install-test-suite.sh yourlstest root \"\"\n    $ bash test-suite/src/install-test-suite.sh yourlstest mydbuser mydbpassword mysql.myserver.com:666 1.8.2\n    ```\n\n3. **Run your plugin unit tests**  \n    Once you have written unit tests, run them :\n    ```sh\n    $ phpunit -c ./test-suite/src/phpunit.xml\n    ```\n    Expected result would be something like :\n    ```sh\n    $ phpunit -c ./test-suite/src/phpunit.xml\n    YOURLS installed, starting PHPUnit\n\n    Plugin Loaded : My cool plugin by Joe (my-cool-plugin/plugin.php)\n\n    PHPUnit 9.5.2 by Sebastian Bergmann and contributors.\n\n    ......                                                              3 / 3 (100%)\n\n    Time: 00:00.007, Memory: 22.00 MB\n\n    OK (3 tests, 6 assertions)\n    $\n    ```\n4. **Automate tests**  \n   On a Github repository, set up Github actions to automatically run tests when your plugin code changes, or when there's a\n   new version of YOURLS available. See the [workflows](WORKFLOWS.md) guide.\n\n## License\n\nFree software. Do whatever the hell you want with it.\nYOURLS is released under the [MIT license](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FYOURLS%2FYOURLS-test-suite-for-plugins","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FYOURLS%2FYOURLS-test-suite-for-plugins","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FYOURLS%2FYOURLS-test-suite-for-plugins/lists"}