{"id":15103732,"url":"https://github.com/sebastianbergmann/phpunit-example-extension","last_synced_at":"2025-09-27T02:31:53.925Z","repository":{"id":57040930,"uuid":"74759652","full_name":"sebastianbergmann/phpunit-example-extension","owner":"sebastianbergmann","description":"Example of an extension for PHPUnit","archived":true,"fork":false,"pushed_at":"2022-04-11T13:50:36.000Z","size":21,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-17T14:35:22.672Z","etag":null,"topics":["phpunit"],"latest_commit_sha":null,"homepage":"https://phpunit.de/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sebastianbergmann.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"sebastianbergmann"}},"created_at":"2016-11-25T13:13:11.000Z","updated_at":"2023-02-16T07:46:00.000Z","dependencies_parsed_at":"2022-08-23T23:30:41.615Z","dependency_job_id":null,"html_url":"https://github.com/sebastianbergmann/phpunit-example-extension","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/sebastianbergmann/phpunit-example-extension","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebastianbergmann%2Fphpunit-example-extension","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebastianbergmann%2Fphpunit-example-extension/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebastianbergmann%2Fphpunit-example-extension/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebastianbergmann%2Fphpunit-example-extension/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sebastianbergmann","download_url":"https://codeload.github.com/sebastianbergmann/phpunit-example-extension/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebastianbergmann%2Fphpunit-example-extension/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":277171544,"owners_count":25773237,"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","status":"online","status_checked_at":"2025-09-27T02:00:08.978Z","response_time":73,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["phpunit"],"created_at":"2024-09-25T19:41:47.423Z","updated_at":"2025-09-27T02:31:53.683Z","avatar_url":"https://github.com/sebastianbergmann.png","language":"PHP","funding_links":["https://github.com/sponsors/sebastianbergmann"],"categories":[],"sub_categories":[],"readme":"# PHPUnit Example Extension\n\nExample of an extension for [PHPUnit](https://phpunit.de/).\n\n## Installation\n\n### Composer\n\nIf you use [Composer](https://getcomposer.org/) to manage the dependencies of your project then you can add the PHPUnit example extension as a development-time dependency to your project:\n\n```\n$ composer require --dev phpunit/example-extension\n```\n\n### PHP Archive (PHAR)\n\nIf you use PHPUnit 5.7 (or later) from a [PHP Archive (PHAR)](https://php.net/phar) then you can download a PHAR of the PHPUnit example extension:\n\n```\n$ wget https://phar.phpunit.de/phpunit-example-extension.phar\n```\n\nThe example below shows how to configure PHPUnit to load all `*.phar` files found in a given directory (`tools/phpunit.d` in this example):\n\n```xml\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n\u003cphpunit xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:noNamespaceSchemaLocation=\"https://schema.phpunit.de/6.3/phpunit.xsd\"\n         extensionsDirectory=\"tools/phpunit.d\"\u003e\n\u003c/phpunit\u003e\n```\n\nPHPUnit will only load a an extension PHAR if it provides valid manifest information in a `manifest.xml` file:\n\n```xml\n\u003c?xml version=\"1.0\" encoding=\"utf-8\" ?\u003e\n\u003cphar xmlns=\"https://phar.io/xml/manifest/1.0\"\u003e\n    \u003ccontains name=\"phpunit/phpunit-example-extension\" version=\"3.0.0\" type=\"extension\"\u003e\n        \u003cextension for=\"phpunit/phpunit\" compatible=\"^6.3\"/\u003e\n    \u003c/contains\u003e\n\n    \u003ccopyright\u003e\n        \u003cauthor name=\"Sebastian Bergmann\" email=\"sebastian@phpunit.de\"/\u003e\n        \u003clicense type=\"BSD-3-Clause\" url=\"https://github.com/sebastianbergmann/phpunit-example-extension/blob/master/LICENSE\"/\u003e\n    \u003c/copyright\u003e\n\n    \u003crequires\u003e\n        \u003cphp version=\"^7.1\"/\u003e\n    \u003c/requires\u003e\n\u003c/phar\u003e\n```\n\nOf course, the extension to be loaded must also be compatible with the version of PHPUnit trying to load it. The extension provides the information required for this compatbility check in its manifest.\n\nWhen verbose output is activated, PHPUnit will print loaded extension PHARs:\n\n```\n$ phpunit --verbose tests\nPHPUnit 6.3.0 by Sebastian Bergmann and contributors.\n\nRuntime:       PHP 7.1.8 with Xdebug 2.5.5\nConfiguration: /home/sb/example/phpunit.xml\nExtension:     phpunit/phpunit-example-extension 3.0.0\n\n.                                                                   1 / 1 (100%)\n\nTime: 32 ms, Memory: 4.00MB\n\nOK (1 test, 1 assertion)\n```\n\nThe `--no-extensions` commandline option can be used to suppress the loading of extensions from the directory configured using `extensionsDirectory`:\n\n```\n$ phpunit --no-extensions\nPHP Fatal error:  Trait 'PHPUnit\\ExampleExtension\\TestCaseTrait' not found in ...\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsebastianbergmann%2Fphpunit-example-extension","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsebastianbergmann%2Fphpunit-example-extension","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsebastianbergmann%2Fphpunit-example-extension/lists"}