{"id":14421296,"url":"https://github.com/Yoast/PHPUnit-Polyfills","last_synced_at":"2025-08-25T06:31:02.932Z","repository":{"id":37866409,"uuid":"303998479","full_name":"Yoast/PHPUnit-Polyfills","owner":"Yoast","description":"Set of polyfills for changed PHPUnit functionality to allow for creating PHPUnit cross-version compatible tests","archived":false,"fork":false,"pushed_at":"2024-04-15T07:01:17.000Z","size":523,"stargazers_count":167,"open_issues_count":4,"forks_count":12,"subscribers_count":17,"default_branch":"2.x","last_synced_at":"2024-04-16T01:09:33.434Z","etag":null,"topics":["compatibility","php","phpunit","polyfill","unit-testing"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Yoast.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-10-14T11:48:26.000Z","updated_at":"2024-06-18T11:13:44.083Z","dependencies_parsed_at":"2024-02-23T07:26:06.108Z","dependency_job_id":"321b43cf-dbb8-4324-a6d4-8a682706784d","html_url":"https://github.com/Yoast/PHPUnit-Polyfills","commit_stats":{"total_commits":157,"total_committers":6,"mean_commits":"26.166666666666668","dds":0.03821656050955413,"last_synced_commit":"976fb51ddfb7a9d1ce69c7de2d7dcd2499d8489f"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yoast%2FPHPUnit-Polyfills","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yoast%2FPHPUnit-Polyfills/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yoast%2FPHPUnit-Polyfills/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yoast%2FPHPUnit-Polyfills/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Yoast","download_url":"https://codeload.github.com/Yoast/PHPUnit-Polyfills/tar.gz/refs/heads/2.x","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":215711763,"owners_count":15919849,"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":["compatibility","php","phpunit","polyfill","unit-testing"],"created_at":"2024-08-29T22:01:23.054Z","updated_at":"2025-08-25T06:31:02.922Z","avatar_url":"https://github.com/Yoast.png","language":"PHP","readme":"PHPUnit Polyfills\n=====================================================\n\n[![Version](https://img.shields.io/packagist/v/yoast/phpunit-polyfills?label=stable)][Packagist]\n[![CS Build Status](https://github.com/Yoast/PHPUnit-Polyfills/actions/workflows/cs.yml/badge.svg)](https://github.com/Yoast/PHPUnit-Polyfills/actions/workflows/cs.yml)\n[![Lint Build Status](https://github.com/Yoast/PHPUnit-Polyfills/actions/workflows/lint.yml/badge.svg)](https://github.com/Yoast/PHPUnit-Polyfills/actions/workflows/lint.yml)\n[![Test Build Status](https://github.com/Yoast/PHPUnit-Polyfills/actions/workflows/test.yml/badge.svg)](https://github.com/Yoast/PHPUnit-Polyfills/actions/workflows/test.yml)\n[![Coverage Status](https://coveralls.io/repos/github/Yoast/PHPUnit-Polyfills/badge.svg?branch=2.x)](https://coveralls.io/github/Yoast/PHPUnit-Polyfills?branch=2.x)\n\n[![Minimum PHP Version](https://img.shields.io/packagist/dependency-v/yoast/phpunit-polyfills/php.svg)][Packagist]\n[![License: BSD3](https://img.shields.io/github/license/Yoast/PHPUnit-Polyfills)](https://github.com/Yoast/PHPUnit-Polyfills/blob/main/LICENSE)\n\n[Packagist]: https://packagist.org/packages/yoast/phpunit-polyfills\n\nSet of polyfills for changed PHPUnit functionality to allow for creating PHPUnit cross-version compatible tests.\n\n* [Requirements](#requirements)\n* [Installation](#installation)\n    - [Autoloading](#autoloading)\n* [Why use the PHPUnit Polyfills?](#why-use-the-phpunit-polyfills)\n    - [PHPUnit support](#phpunit-support)\n* [Using this library](#using-this-library)\n    - [Supported ways of calling the assertions](#supported-ways-of-calling-the-assertions)\n    - [Use with PHPUnit \u003c 7.5.0](#use-with-phpunit--750)\n* [Features](#features)\n    - [Polyfill traits](#polyfill-traits)\n    - [Helper traits](#helper-traits)\n    - [TestCases](#testcases)\n    - [TestListener](#testlistener)\n* [Frequently Asked Questions](#frequently-asked-questions)\n* [Contributing](#contributing)\n* [License](#license)\n\n\nRequirements\n------------\n\n* PHP 5.6 or higher.\n* [PHPUnit] 5.7 - 10.x (automatically required via Composer).\n\n[PHPUnit]: https://packagist.org/packages/phpunit/phpunit\n\n\nInstallation\n------------\n\nTo install this package, run:\n```bash\ncomposer require --dev yoast/phpunit-polyfills:\"^2.0\"\n```\n\nTo update this package, run:\n```bash\ncomposer update --dev yoast/phpunit-polyfills --with-dependencies\n```\n\n### Autoloading\n\nMake sure to:\n* Either use the Composer `vendor/autoload.php` file _as_ your test bootstrap file;\n* Or require the `vendor/yoast/phpunit-polyfills/phpunitpolyfills-autoload.php` file _in_ your test bootstrap.\n\n\nWhy use the PHPUnit Polyfills?\n------------------------------\n\nThis library is set up to allow for creating PHPUnit cross-version compatible tests by offering a number of polyfills for functionality which was introduced, split up or renamed in PHPUnit.\n\n### Write your tests for PHPUnit 10.x and run them on PHPUnit 5.7 - 10.x\n\nThe polyfills have been setup to allow tests to be _forward_-compatible. What that means is, that your tests can use the assertions supported by the _latest_ PHPUnit version, even when running on older PHPUnit versions.\n\nThis puts the burden of upgrading to use the syntax of newer PHPUnit versions at the point when you want to _start_ running your tests on a newer version.\nBy doing so, dropping support for an older PHPUnit version becomes as straight-forward as removing it from the version constraint in your `composer.json` file.\n\n### PHPUnit support\n\n* Releases in the `1.x` series of the PHPUnit Polyfills support PHPUnit 4.8 - 9.x.\n* Releases in the `2.x` series of the PHPUnit Polyfills support PHPUnit 5.7 - 10.x.\n* Releases in the `3.x` series of the PHPUnit Polyfills support PHPUnit 6.4 - 11.x (but don't support running tests on PHPUnit 10).\n* Releases in the `4.x` series of the PHPUnit Polyfills support PHPUnit 7.5 - 12.x (but don't support running tests on PHPUnit 10).\n\nPlease keep in mind that the PHPUnit Polyfills provide _forward_-compatibility.\nThis means that features which PHPUnit no longer supports in PHPUnit 10.x, like expecting PHP deprecation notices or warnings, will not be supported in the PHPUnit Polyfills 2.x series and features not supported in PHPUnit 11.x, will not be supported in the PHPUnit Polyfills 3.x series etc.\n\nPlease refer to the [PHPUnit 10 release notification]/[PHPUnit 10 changelog], [PHPUnit 11 release notification]/[PHPUnit 11 changelog] and/or the [PHPUnit 12 release notification]/[PHPUnit 12 changelog] to inform your decision on whether or not to upgrade (yet).\n\n[PHPUnit 10 release notification]: https://phpunit.de/announcements/phpunit-10.html\n[PHPUnit 10 changelog]:            https://github.com/sebastianbergmann/phpunit/blob/10.0.19/ChangeLog-10.0.md\n[PHPUnit 11 release notification]: https://phpunit.de/announcements/phpunit-11.html\n[PHPUnit 11 changelog]:            https://github.com/sebastianbergmann/phpunit/blob/11.0.10/ChangeLog-11.0.md\n[PHPUnit 12 release notification]: https://phpunit.de/announcements/phpunit-12.html\n[PHPUnit 12 changelog]:            https://github.com/sebastianbergmann/phpunit/blob/12.0.2/ChangeLog-12.0.md\n\n\nUsing this library\n------------------\n\nEach of the polyfills and helpers has been setup as a trait and can be imported and `use`d in any test file which extends the PHPUnit native `TestCase` class.\n\nIf the polyfill is not needed for the particular PHPUnit version on which the tests are being run, the autoloader\nwill automatically load an empty trait with that same name, so you can safely use these traits in tests which\nneed to be PHPUnit cross-version compatible.\n\n```php\n\u003c?php\n\nnamespace Vendor\\YourPackage\\Tests;\n\nuse PHPUnit\\Framework\\TestCase;\nuse Yoast\\PHPUnitPolyfills\\Polyfills\\AssertIsType;\n\nclass FooTest extends TestCase\n{\n    use AssertIsType;\n\n    public function testSomething()\n    {\n        $this-\u003eassertIsBool( $maybeBool );\n        self::assertIsNotIterable( $maybeIterable );\n    }\n}\n```\n\nAlternatively, you can use one of the [`TestCase` classes](#testcases) provided by this library instead of using the PHPUnit native `TestCase` class.\n\nIn that case, all polyfills and helpers will be available whenever needed.\n\n```php\n\u003c?php\n\nnamespace Vendor\\YourPackage\\Tests;\n\nuse Yoast\\PHPUnitPolyfills\\TestCases\\TestCase;\n\nclass FooTest extends TestCase\n{\n    public function testSomething()\n    {\n        $this-\u003eassertIsBool( $maybeBool );\n        self::assertMatchesRegularExpression( $pattern, $string, $message );\n    }\n}\n```\n\n### Supported ways of calling the assertions\n\nBy default, PHPUnit supports [four ways of calling assertions]:\n1. **As a method in the `TestCase` class - `$this-\u003eassertSomething()`.**\n2. **Statically as a method in the `TestCase` class - `self/static/parent::assertSomething()`.**\n3. Statically as a method of the `Assert` class - `Assert::assertSomething()`.\n4. As a global function - `assertSomething()`.\n\nThe polyfills in this library support the first two ways of calling the assertions as those are the most commonly used type of assertion calls.\n\nFor the polyfills to work, a test class is **required** to be a (grand-)child of the PHPUnit native `TestCase` class.\n\n[four ways of calling assertions]: https://docs.phpunit.de/en/10.5/assertions.html#static-vs-non-static-usage-of-assertion-methods\n\n### Use with PHPUnit \u003c 7.5.0\n\nIf your library still needs to support PHP \u003c 7.1 and therefore needs PHPUnit \u003c 7 for testing, there are a few caveats when using the traits stand-alone as we then enter \"double-polyfill\" territory.\n\nTo prevent _\"conflicting method names\"_ errors when a trait is `use`d multiple times in a class, the traits offered here do not attempt to solve this.\n\nYou will need to make sure to `use` any additional traits needed for the polyfills to work.\n\n| PHPUnit   | When `use`-ing this trait   | You also need to `use` this trait |\n| --------- | --------------------------- | --------------------------------- |\n| 5.7 \u003c 7.5 | `AssertIgnoringLineEndings` | `AssertStringContains`            |\n\n_**Note: this only applies to the stand-alone use of the traits. The [`TestCase` classes](#testcases) provided by this library already take care of this automatically.**_\n\nCode example for a test using the `AssertIgnoringLineEndings` trait, which needs to be able to run on PHPUnit 5.7:\n```php\n\u003c?php\n\nnamespace Vendor\\YourPackage\\Tests;\n\nuse PHPUnit\\Framework\\TestCase;\nuse Yoast\\PHPUnitPolyfills\\Polyfills\\AssertIgnoringLineEndings;\nuse Yoast\\PHPUnitPolyfills\\Polyfills\\AssertStringContains;\n\nclass FooTest extends TestCase\n{\n    use AssertIgnoringLineEndings;\n    use AssertStringContains;\n\n    public function testSomething()\n    {\n        $this-\u003eassertStringContainsStringIgnoringLineEndings(\n            \"something\\nelse\",\n            \"this is something\\r\\nelse\"\n        );\n    }\n}\n```\n\n\nFeatures\n--------\n\n### Polyfill traits\n\n#### PHPUnit \u003c 6.4.0: `Yoast\\PHPUnitPolyfills\\Polyfills\\ExpectExceptionObject`\n\nPolyfills the [`TestCase::expectExceptionObject()`] method to test all aspects of an `Exception` by passing an object to the method.\n\nThis method was introduced in PHPUnit 6.4.0.\n\n[`TestCase::expectExceptionObject()`]: https://docs.phpunit.de/en/10.5/writing-tests-for-phpunit.html#expecting-exceptions\n\n#### PHPUnit \u003c 7.5.0: `Yoast\\PHPUnitPolyfills\\Polyfills\\AssertIsType`\n\nPolyfills the following methods:\n\n|                                |                                   |\n| ------------------------------ | --------------------------------- |\n| [`Assert::assertIsArray()`]    | [`Assert::assertIsNotArray()`]    |\n| [`Assert::assertIsBool()`]     | [`Assert::assertIsNotBool()`]     |\n| [`Assert::assertIsFloat()`]    | [`Assert::assertIsNotFloat()`]    |\n| [`Assert::assertIsInt()`]      | [`Assert::assertIsNotInt()`]      |\n| [`Assert::assertIsNumeric()`]  | [`Assert::assertIsNotNumeric()`]  |\n| [`Assert::assertIsObject()`]   | [`Assert::assertIsNotObject()`]   |\n| [`Assert::assertIsResource()`] | [`Assert::assertIsNotResource()`] |\n| [`Assert::assertIsString()`]   | [`Assert::assertIsNotString()`]   |\n| [`Assert::assertIsScalar()`]   | [`Assert::assertIsNotScalar()`]   |\n| [`Assert::assertIsCallable()`] | [`Assert::assertIsNotCallable()`] |\n| [`Assert::assertIsIterable()`] | [`Assert::assertIsNotIterable()`] |\n\nThese methods were introduced in PHPUnit 7.5.0 as alternatives to the `Assert::assertInternalType()` and `Assert::assertNotInternalType()` methods, which were soft deprecated in PHPUnit 7.5.0, hard deprecated (warning) in PHPUnit 8.0.0 and removed in PHPUnit 9.0.0.\n\n[`Assert::assertIsArray()`]:       https://docs.phpunit.de/en/10.5/assertions.html#assertisarray\n[`Assert::assertIsNotArray()`]:    https://docs.phpunit.de/en/10.5/assertions.html#assertisarray\n[`Assert::assertIsBool()`]:        https://docs.phpunit.de/en/10.5/assertions.html#assertisbool\n[`Assert::assertIsNotBool()`]:     https://docs.phpunit.de/en/10.5/assertions.html#assertisbool\n[`Assert::assertIsFloat()`]:       https://docs.phpunit.de/en/10.5/assertions.html#assertisfloat\n[`Assert::assertIsNotFloat()`]:    https://docs.phpunit.de/en/10.5/assertions.html#assertisfloat\n[`Assert::assertIsInt()`]:         https://docs.phpunit.de/en/10.5/assertions.html#assertisint\n[`Assert::assertIsNotInt()`]:      https://docs.phpunit.de/en/10.5/assertions.html#assertisint\n[`Assert::assertIsNumeric()`]:     https://docs.phpunit.de/en/10.5/assertions.html#assertisnumeric\n[`Assert::assertIsNotNumeric()`]:  https://docs.phpunit.de/en/10.5/assertions.html#assertisnumeric\n[`Assert::assertIsObject()`]:      https://docs.phpunit.de/en/10.5/assertions.html#assertisobject\n[`Assert::assertIsNotObject()`]:   https://docs.phpunit.de/en/10.5/assertions.html#assertisobject\n[`Assert::assertIsResource()`]:    https://docs.phpunit.de/en/10.5/assertions.html#assertisresource\n[`Assert::assertIsNotResource()`]: https://docs.phpunit.de/en/10.5/assertions.html#assertisresource\n[`Assert::assertIsString()`]:      https://docs.phpunit.de/en/10.5/assertions.html#assertisstring\n[`Assert::assertIsNotString()`]:   https://docs.phpunit.de/en/10.5/assertions.html#assertisstring\n[`Assert::assertIsScalar()`]:      https://docs.phpunit.de/en/10.5/assertions.html#assertisscalar\n[`Assert::assertIsNotScalar()`]:   https://docs.phpunit.de/en/10.5/assertions.html#assertisscalar\n[`Assert::assertIsCallable()`]:    https://docs.phpunit.de/en/10.5/assertions.html#assertiscallable\n[`Assert::assertIsNotCallable()`]: https://docs.phpunit.de/en/10.5/assertions.html#assertiscallable\n[`Assert::assertIsIterable()`]:    https://docs.phpunit.de/en/10.5/assertions.html#assertisiterable\n[`Assert::assertIsNotIterable()`]: https://docs.phpunit.de/en/10.5/assertions.html#assertisiterable\n\n#### PHPUnit \u003c 7.5.0: `Yoast\\PHPUnitPolyfills\\Polyfills\\AssertStringContains`\n\nPolyfills the following methods:\n\n|                                                      |                                                         |\n| ---------------------------------------------------- | ------------------------------------------------------- |\n| [`Assert::assertStringContainsString()`]             | [`Assert::assertStringNotContainsString()`]             |\n| [`Assert::assertStringContainsStringIgnoringCase()`] | [`Assert::assertStringNotContainsStringIgnoringCase()`] |\n\nThese methods were introduced in PHPUnit 7.5.0 as alternatives to using `Assert::assertContains()` and `Assert::assertNotContains()` with string haystacks. Passing string haystacks to these methods was soft deprecated in PHPUnit 7.5.0, hard deprecated (warning) in PHPUnit 8.0.0 and removed in PHPUnit 9.0.0.\n\n[`Assert::assertStringContainsString()`]:                https://docs.phpunit.de/en/10.5/assertions.html#assertstringcontainsstring\n[`Assert::assertStringNotContainsString()`]:             https://docs.phpunit.de/en/10.5/assertions.html#assertstringcontainsstring\n[`Assert::assertStringContainsStringIgnoringCase()`]:    https://docs.phpunit.de/en/10.5/assertions.html#assertstringcontainsstringignoringcase\n[`Assert::assertStringNotContainsStringIgnoringCase()`]: https://docs.phpunit.de/en/10.5/assertions.html#assertstringcontainsstringignoringcase\n\n#### PHPUnit \u003c 7.5.0: `Yoast\\PHPUnitPolyfills\\Polyfills\\AssertEqualsSpecializations`\n\nPolyfills the following methods:\n\n|                                          |                                             |\n| ---------------------------------------- | ------------------------------------------- |\n| [`Assert::assertEqualsCanonicalizing()`] | [`Assert::assertNotEqualsCanonicalizing()`] |\n| [`Assert::assertEqualsIgnoringCase()`]   | [`Assert::assertNotEqualsIgnoringCase()`]   |\n| [`Assert::assertEqualsWithDelta()`]      | [`Assert::assertNotEqualsWithDelta()`]      |\n\nThese methods were introduced in PHPUnit 7.5.0 as alternatives to using `Assert::assertEquals()` and `Assert::assertNotEquals()` with these optional parameters. Passing the respective optional parameters to these methods was soft deprecated in PHPUnit 7.5.0, hard deprecated (warning) in PHPUnit 8.0.0 and removed in PHPUnit 9.0.0.\n\n[`Assert::assertEqualsCanonicalizing()`]:    https://docs.phpunit.de/en/10.5/assertions.html#assertequalscanonicalizing\n[`Assert::assertNotEqualsCanonicalizing()`]: https://docs.phpunit.de/en/10.5/assertions.html#assertequalscanonicalizing\n[`Assert::assertEqualsIgnoringCase()`]:      https://docs.phpunit.de/en/10.5/assertions.html#assertequalsignoringcase\n[`Assert::assertNotEqualsIgnoringCase()`]:   https://docs.phpunit.de/en/10.5/assertions.html#assertequalsignoringcase\n[`Assert::assertEqualsWithDelta()`]:         https://docs.phpunit.de/en/10.5/assertions.html#assertequalswithdelta\n[`Assert::assertNotEqualsWithDelta()`]:      https://docs.phpunit.de/en/10.5/assertions.html#assertequalswithdelta\n\n\n#### PHPUnit \u003c 8.4.0: `Yoast\\PHPUnitPolyfills\\Polyfills\\ExpectExceptionMessageMatches`\n\nPolyfills the [`TestCase::expectExceptionMessageMatches()`] method.\n\nThis method was introduced in PHPUnit 8.4.0 to improve the name of the `TestCase::expectExceptionMessageRegExp()` method.\nThe `TestCase::expectExceptionMessageRegExp()` method was soft deprecated in PHPUnit 8.4.0, hard deprecated (warning) in PHPUnit 8.5.3 and removed in PHPUnit 9.0.0.\n\n[`TestCase::expectExceptionMessageMatches()`]: https://docs.phpunit.de/en/10.5/writing-tests-for-phpunit.html#expecting-exceptions\n\n#### PHPUnit \u003c 8.5.0: `Yoast\\PHPUnitPolyfills\\Polyfills\\AssertFileEqualsSpecializations`\n\nPolyfills the following methods:\n\n|                                                    |                                                       |\n| -------------------------------------------------- | ----------------------------------------------------- |\n| [`Assert::assertFileEqualsCanonicalizing()`]       | [`Assert::assertFileNotEqualsCanonicalizing()`]       |\n| [`Assert::assertFileEqualsIgnoringCase()`]         | [`Assert::assertFileNotEqualsIgnoringCase()`]         |\n| [`Assert::assertStringEqualsFileCanonicalizing()`] | [`Assert::assertStringNotEqualsFileCanonicalizing()`] |\n| [`Assert::assertStringEqualsFileIgnoringCase()`]   | [`Assert::assertStringNotEqualsFileIgnoringCase()`]   |\n\nThese methods were introduced in PHPUnit 8.5.0 as alternatives to using `Assert::assertFileEquals()` and `Assert::assertFileNotEquals()` with these optional parameters. Passing the respective optional parameters to these methods was hard deprecated in PHPUnit 8.5.0 and removed in PHPUnit 9.0.0.\n\n[`Assert::assertFileEqualsCanonicalizing()`]:          https://docs.phpunit.de/en/10.5/assertions.html#assertfileequals\n[`Assert::assertFileNotEqualsCanonicalizing()`]:       https://docs.phpunit.de/en/10.5/assertions.html#assertfileequals\n[`Assert::assertFileEqualsIgnoringCase()`]:            https://docs.phpunit.de/en/10.5/assertions.html#assertfileequals\n[`Assert::assertFileNotEqualsIgnoringCase()`]:         https://docs.phpunit.de/en/10.5/assertions.html#assertfileequals\n[`Assert::assertStringEqualsFileCanonicalizing()`]:    https://docs.phpunit.de/en/10.5/assertions.html#assertfileequals\n[`Assert::assertStringNotEqualsFileCanonicalizing()`]: https://docs.phpunit.de/en/10.5/assertions.html#assertfileequals\n[`Assert::assertStringEqualsFileIgnoringCase()`]:      https://docs.phpunit.de/en/10.5/assertions.html#assertfileequals\n[`Assert::assertStringNotEqualsFileIgnoringCase()`]:   https://docs.phpunit.de/en/10.5/assertions.html#assertfileequals\n\n#### PHPUnit \u003c 9.0.0: `Yoast\\PHPUnitPolyfills\\Polyfills\\EqualToSpecializations`\n\nPolyfills the following methods:\n\n|                                   |                                 |\n| --------------------------------- | ------------------------------- |\n| `Assert::equalToCanonicalizing()` | `Assert::equalToIgnoringCase()` |\n| `Assert::equalToWithDelta()`      |                                 |\n\nThese methods, which are typically used to verify parameters passed to Mock Objects, were introduced in PHPUnit 9.0.0 as alternatives to using `Assert::EqualTo()` with these optional parameters. Support for passing the respective optional parameters to `Assert::EqualTo()` was removed in PHPUnit 9.0.0.\n\n#### PHPUnit \u003c 9.1.0: `Yoast\\PHPUnitPolyfills\\Polyfills\\AssertionRenames`\n\nPolyfills the following renamed methods:\n* [`Assert::assertIsNotReadable()`], introduced as alternative for `Assert::assertNotIsReadable()`.\n* [`Assert::assertIsNotWritable()`], introduced as alternative for `Assert::assertNotIsWritable()`.\n* [`Assert::assertDirectoryDoesNotExist()`], introduced as alternative for `Assert::assertDirectoryNotExists()`.\n* [`Assert::assertDirectoryIsNotReadable()`], introduced as alternative for `Assert::assertDirectoryNotIsReadable()`.\n* [`Assert::assertDirectoryIsNotWritable()`], introduced as alternative for `Assert::assertDirectoryNotIsWritable()`.\n* [`Assert::assertFileDoesNotExist()`], introduced as alternative for `Assert::assertFileNotExists()`.\n* [`Assert::assertFileIsNotReadable()`], introduced as alternative for `Assert::assertFileNotIsReadable()`.\n* [`Assert::assertFileIsNotWritable()`], introduced as alternative for `Assert::assertFileNotIsWritable()`.\n* [`Assert::assertMatchesRegularExpression()`], introduced as alternative for `Assert::assertRegExp()`.\n* [`Assert::assertDoesNotMatchRegularExpression()`], introduced as alternative for `Assert::assertNotRegExp()`.\n\nThese methods were introduced in PHPUnit 9.1.0.\nThe original methods these new methods replace were hard deprecated in PHPUnit 9.1.0 and removed in PHPUnit 10.0.0.\n\n[`Assert::assertIsNotReadable()`]:                 https://docs.phpunit.de/en/10.5/assertions.html#assertisreadable\n[`Assert::assertIsNotWritable()`]:                 https://docs.phpunit.de/en/10.5/assertions.html#assertiswritable\n[`Assert::assertDirectoryDoesNotExist()`]:         https://docs.phpunit.de/en/10.5/assertions.html#assertdirectoryexists\n[`Assert::assertDirectoryIsNotReadable()`]:        https://docs.phpunit.de/en/10.5/assertions.html#assertdirectoryisreadable\n[`Assert::assertDirectoryIsNotWritable()`]:        https://docs.phpunit.de/en/10.5/assertions.html#assertdirectoryiswritable\n[`Assert::assertFileDoesNotExist()`]:              https://docs.phpunit.de/en/10.5/assertions.html#assertfileexists\n[`Assert::assertFileIsNotReadable()`]:             https://docs.phpunit.de/en/10.5/assertions.html#assertfileisreadable\n[`Assert::assertFileIsNotWritable()`]:             https://docs.phpunit.de/en/10.5/assertions.html#assertfileiswritable\n[`Assert::assertMatchesRegularExpression()`]:      https://docs.phpunit.de/en/10.5/assertions.html#assertmatchesregularexpression\n[`Assert::assertDoesNotMatchRegularExpression()`]: https://docs.phpunit.de/en/10.5/assertions.html#assertmatchesregularexpression\n\n#### PHPUnit \u003c 9.3.0: `Yoast\\PHPUnitPolyfills\\Polyfills\\AssertClosedResource`\n\nPolyfills the following methods:\n\n|                                      |                                         |\n| ------------------------------------ | --------------------------------------- |\n| [`Assert::assertIsClosedResource()`] | [`Assert::assertIsNotClosedResource()`] |\n\nThese methods were introduced in PHPUnit 9.3.0.\n\n[`Assert::assertIsClosedResource()`]:    https://docs.phpunit.de/en/10.5/assertions.html#assertisresource\n[`Assert::assertIsNotClosedResource()`]: https://docs.phpunit.de/en/10.5/assertions.html#assertisresource\n\nAdditionally, this trait contains a helper method `shouldClosedResourceAssertionBeSkipped()`.\n\nDue to some bugs in PHP itself, the \"is closed resource\" determination cannot always be done reliably, most notably for the `libxml` extension.\n\nThis helper function can determine whether or not the current \"value under test\" in combination with the PHP version on which the test is being run is affected by these bugs.\n\n\u003e :warning: The PHPUnit native implementation of these assertions is also affected by these bugs!\nThe `shouldClosedResourceAssertionBeSkipped()` helper method is therefore available cross-version.\n\nUsage examples:\n```php\n// Example: skipping the test completely.\nif ( $this-\u003eshouldClosedResourceAssertionBeSkipped( $actual ) === true ) {\n    $this-\u003emarkTestSkipped('assertIs[Not]ClosedResource() cannot determine whether this resource is'\n        . ' open or closed due to bugs in PHP (PHP ' . \\PHP_VERSION . ').');\n}\n\n// Example: selectively skipping the assertion.\nif ( self::shouldClosedResourceAssertionBeSkipped( $actual ) === false ) {\n    $this-\u003eassertIsClosedResource( $actual );\n}\n```\n\n\u003e :point_right: While this polyfill is tested extensively, testing for these kind of bugs _exhaustively_ is _hard_.\n\u003e Please [report any bugs](https://github.com/Yoast/PHPUnit-Polyfills/issues/new/choose) found and include a clear code sample to reproduce the issue.\n\n#### PHPUnit \u003c 9.4.0: `Yoast\\PHPUnitPolyfills\\Polyfills\\AssertObjectEquals`\n\nPolyfills the [`Assert::assertObjectEquals()`] method to verify two (value) objects are considered equal.\nThis assertion expects an object to contain a comparator method in the object itself. This comparator method is subsequently called to verify the \"equalness\" of the objects.\n\nThe `assertObjectEquals()` assertion was introduced in PHPUnit 9.4.0.\n\n\u003e :information_source: Due to [limitations in how this assertion is implemented in PHPUnit] itself, it is currently not possible to create a single comparator method which will be compatible with both PHP \u003c 7.0 and PHP 7.0 or higher.\n\u003e\n\u003e In effect two declarations of the same object would be needed to be compatible with PHP \u003c 7.0 and PHP 7.0 and higher and still allow for testing the object using the `assertObjectEquals()` assertion.\n\u003e\n\u003e Due to this limitation, it is recommended to only use this assertion if the minimum supported PHP version of a project is PHP 7.0 or higher; or if the project does not run its tests on PHPUnit \u003e= 9.4.0.\n\u003e\n\u003e The implementation of this assertion in the Polyfills is PHP cross-version compatible.\n\n[limitations in how this assertion is implemented in PHPUnit]: https://github.com/sebastianbergmann/phpunit/issues/4707\n\n[`Assert::assertObjectEquals()`]: https://docs.phpunit.de/en/10.5/assertions.html#assertobjectequals\n\n#### PHPUnit \u003c 10.0.0: `Yoast\\PHPUnitPolyfills\\Polyfills\\AssertIgnoringLineEndings`\n\nPolyfills the following methods:\n\n|                                                           |                                                             |\n| --------------------------------------------------------- | ----------------------------------------------------------- |\n| [`Assert::assertStringEqualsStringIgnoringLineEndings()`] | [`Assert::assertStringContainsStringIgnoringLineEndings()`] |\n\nThese methods were introduced in PHPUnit 10.0.0.\n\n[`Assert::assertStringEqualsStringIgnoringLineEndings()`]:   https://docs.phpunit.de/en/10.5/assertions.html#assertstringequalsstringignoringlineendings\n[`Assert::assertStringContainsStringIgnoringLineEndings()`]: https://docs.phpunit.de/en/10.5/assertions.html#assertstringcontainsstring\n\n#### PHPUnit \u003c 10.0.0: `Yoast\\PHPUnitPolyfills\\Polyfills\\AssertIsList`\n\nPolyfills the following method:\n\n|                            |\n| -------------------------- |\n| [`Assert::assertIsList()`] |\n\nThis method was introduced in PHPUnit 10.0.0.\n\n[`Assert::assertIsList()`]: https://docs.phpunit.de/en/10.5/assertions.html#assertislist\n\n#### PHPUnit \u003c 10.1.0: `Yoast\\PHPUnitPolyfills\\Polyfills\\AssertObjectProperty`\n\nPolyfills the following method:\n\n|                                       |                                          |\n| ------------------------------------- | ---------------------------------------- |\n| [`Assert::assertObjectHasProperty()`] | [`Assert::assertObjectNotHasProperty()`] |\n\nThese methods were introduced in PHPUnit 10.1.0 as alternatives to the `Assert::assertObjectHasAttribute()` and `Assert::assertObjectNotHasAttribute()` methods, which were hard deprecated (warning) in PHPUnit 9.6.1 and removed in PHPUnit 10.0.0.\n\nThese methods were later backported to the PHPUnit 9 branch and included in the PHPUnit 9.6.11 release.\n\n[`Assert::assertObjectHasProperty()`]:    https://docs.phpunit.de/en/10.5/assertions.html#assertobjecthasproperty\n[`Assert::assertObjectNotHasProperty()`]: https://docs.phpunit.de/en/10.5/assertions.html#assertobjecthasproperty\n\n\n### Helper traits\n\n#### `Yoast\\PHPUnitPolyfills\\Helpers\\AssertAttributeHelper`\n\nHelper to work around the removal of the `assertAttribute*()` methods.\n\nThe `assertAttribute*()` methods were deprecated in PHPUnit 8.0.0 and removed in PHPUnit 9.0.0.\n\nPublic properties can still be tested by accessing them directly:\n```php\n$this-\u003eassertSame( 'value', $obj-\u003epropertyName );\n```\n\nProtected and private properties can no longer be tested using PHPUnit native functionality.\nThe reasoning for the removal of these assertion methods is that _private and protected properties are an implementation detail and should not be tested directly, but via methods in the class_.\n\nIt is strongly recommended to refactor your tests, and if needs be, your classes to adhere to this.\n\nHowever, if for some reason the value of `protected` or `private` properties still needs to be tested, this helper can be used to get access to their value and attributes.\n\nThe trait contains two helper methods:\n* `public static getProperty( object $classInstance, string $propertyName ) : ReflectionProperty`\n* `public static getPropertyValue( object $classInstance, string $propertyName ) : mixed`\n\n```php\n// Test the value of a protected or private property.\n$this-\u003eassertSame( 'value', $this-\u003egetPropertyValue( $objInstance, $propertyName ) );\n\n// Retrieve a ReflectionProperty object to test other details of the property.\nself::assertSame( $propertyName, self::getProperty( $objInstance, $propertyName )-\u003egetName() );\n```\n\n### TestCases\n\nPHPUnit 8.0.0 introduced a `void` return type declaration to the [\"fixture\" methods] - `setUpBeforeClass()`, `setUp()`, `tearDown()` and `tearDownAfterClass()`.\nAs the `void` return type was not introduced until PHP 7.1, this makes it more difficult to create cross-version compatible tests when using fixtures, due to signature mismatches.\n\n[\"fixture\" methods]: https://docs.phpunit.de/en/10.5/fixtures.html\n\nThis library contains two basic `TestCase` options to overcome this issue.\n\n#### Option 1: `Yoast\\PHPUnitPolyfills\\TestCases\\TestCase`\n\nThis `TestCase` overcomes the signature mismatch by having two versions. The correct one will be loaded depending on the PHPUnit version being used.\n\nWhen using this `TestCase`, if an individual test, or another `TestCase` which extends this `TestCase`, needs to overload any of the \"fixture\" methods, it should do so by using a snake_case variant of the original fixture method name, i.e. `set_up_before_class()`, `set_up()`, `assert_pre_conditions()`, `assert_post_conditions()`, `tear_down()` and `tear_down_after_class()`.\n\nThe snake_case methods will automatically be called by PHPUnit.\n\n\u003e **IMPORTANT:** The snake_case methods should **not** call the PHPUnit parent, i.e. do **not** use `parent::setUp()` from within an overloaded `set_up()` method.\n\u003e If necessary, _DO_ call `parent::set_up()`.\n\n```php\nuse Yoast\\PHPUnitPolyfills\\TestCases\\TestCase;\n\nclass MyTest extends TestCase {\n    public static function set_up_before_class() {\n        parent::set_up_before_class();\n\n        // Set up a database connection or other fixture which needs to be available.\n    }\n\n    protected function set_up() {\n        parent::set_up();\n\n        // Set up function mocks which need to be available for all tests in this class.\n    }\n\n    protected function assert_pre_conditions() {\n        parent::assert_pre_conditions();\n\n        // Perform assertions shared by all tests of a test case (before the test).\n    }\n\n    protected function assert_post_conditions() {\n        // Performs assertions shared by all tests of a test case (after the test).\n\n        parent::assert_post_conditions();\n    }\n\n    protected function tear_down() {\n        // Any clean up needed related to `set_up()`.\n\n        parent::tear_down();\n    }\n\n    public static function tear_down_after_class() {\n        // Close database connection and other clean up related to `set_up_before_class()`.\n\n        parent::tear_down_after_class();\n    }\n}\n```\n\n#### Option 2: `Yoast\\PHPUnitPolyfills\\TestCases\\XTestCase`\n\nThis `TestCase` overcomes the signature mismatch by using the PHPUnit `@before[Class]` and `@after[Class]` annotations in combination with different methods names, i.e. `setUpFixturesBeforeClass()`, `setUpFixtures()`, `tearDownFixtures()` and `tearDownFixturesAfterClass()`.\n\nWhen using this TestCase, overloaded fixture methods need to use the [`@beforeClass`], [`@before`], [`@after`] and [`@afterClass`] annotations.\nThe naming of the overloaded methods is open as long as the method names don't conflict with the PHPUnit native method names.\n\n[`@beforeClass`]: https://docs.phpunit.de/en/10.5/annotations.html#beforeclass\n[`@before`]:      https://docs.phpunit.de/en/10.5/annotations.html#before\n[`@after`]:       https://docs.phpunit.de/en/10.5/annotations.html#after\n[`@afterClass`]:  https://docs.phpunit.de/en/10.5/annotations.html#afterclass\n\n```php\nuse Yoast\\PHPUnitPolyfills\\TestCases\\XTestCase;\n\nclass MyTest extends XTestCase {\n    /**\n     * @beforeClass\n     */\n    public static function setUpFixturesBeforeClass() {\n        parent::setUpFixturesBeforeClass();\n\n        // Set up a database connection or other fixture which needs to be available.\n    }\n\n    /**\n     * @before\n     */\n    protected function setUpFixtures() {\n        parent::setUpFixtures();\n\n        // Set up function mocks which need to be available for all tests in this class.\n    }\n\n    /**\n     * @after\n     */\n    protected function tearDownFixtures() {\n        // Any clean up needed related to `setUpFixtures()`.\n\n        parent::tearDownFixtures();\n    }\n\n    /**\n     * @afterClass\n     */\n    public static function tearDownFixturesAfterClass() {\n        // Close database connection and other clean up related to `setUpFixturesBeforeClass()`.\n\n        parent::tearDownFixturesAfterClass();\n    }\n}\n```\n\n### TestListener\n\n\u003e :warning: **Important** :warning:\n\u003e\n\u003e The TestListener polyfill in PHPUnit Polyfills 2.0 is [not (yet) compatible with PHPUnit 10.0.0][polyfill-ticket].\n\u003e\n\u003e If you need the TestListener polyfill, it is recommended to stay on the PHPUnit Polyfills 1.x series for the time being and to watch and upvote the [related ticket][polyfill-ticket].\n\u003e\n\u003e The below documentation is for the PHPUnit 5.x-9.x TestListener polyfill implementation.\n\n[polyfill-ticket]: https://github.com/Yoast/PHPUnit-Polyfills/issues/128\n\nThe method signatures in the PHPUnit `TestListener` interface have changed a number of times across versions.\nAdditionally, the use of the TestListener principle has been deprecated in PHPUnit 7 in favour of using the [TestRunner hook interfaces](https://docs.phpunit.de/en/7.5/extending-phpunit.html#extending-the-testrunner).\n\n\u003e Note: while deprecated in PHPUnit 7, the TestListener interface has not yet been removed and is still supported in PHPUnit 9.x.\n\nIf your test suite does not need to support PHPUnit \u003c 7, it is strongly recommended to use the TestRunner hook interfaces extensions instead.\n\nHowever, for test suites that still need to support PHPUnit 6 or lower, implementing the `TestListener` interface is the only viable option.\n\n#### `Yoast\\PHPUnitPolyfills\\TestListeners\\TestListenerDefaultImplementation`\n\nThis `TestListenerDefaultImplementation` trait overcomes the signature mismatches by having multiple versions and loading the correct one depending on the PHPUnit version being used.\n\nSimilar to the `TestCase` implementation, snake_case methods without type declarations are used to get round the signature mismatches. The snake_case methods will automatically be called.\n\n| PHPUnit native method name | Replacement                             | Notes                                     |\n| -------------------------- | --------------------------------------- | ----------------------------------------- |\n| `addError()`               | `add_error($test, $e, $time)`           |                                           |\n| `addWarning()`             | `add_warning($test, $e, $time)`         | Introduced in PHPUnit 6.                  |\n| `addFailure()`             | `add_failure($test, $e, $time)`         |                                           |\n| `addIncompleteTest()`      | `add_incomplete_test($test, $e, $time)` |                                           |\n| `addRiskyTest()`           | `add_risky_test($test, $e, $time)`      | Support appears to be flaky on PHPUnit 5. |\n| `addSkippedTest()`         | `add_skipped_test($test, $e, $time)`    |                                           |\n| `startTestSuite()`         | `start_test_suite($suite)`              |                                           |\n| `endTestSuite()`           | `end_test_suite($suite)`                |                                           |\n| `startTest()`              | `start_test($test)`                     |                                           |\n| `endTest()`                | `end_test($test, $time)`                |                                           |\n\nImplementations of the `TestListener` interface may be using any of the following patterns:\n```php\n// PHPUnit \u003c 6.\nclass MyTestListener extends \\PHPUnit_Framework_BaseTestListener {}\n\n// PHPUnit 6.\nclass MyTestListener extends \\PHPUnit\\Framework\\BaseTestListener {}\n\n// PHPUnit 7+.\nclass MyTestListener implements \\PHPUnit\\Framework\\TestListener {\n    use \\PHPUnit\\Framework\\TestListenerDefaultImplementation;\n}\n```\n\nReplace these with:\n```php\nuse PHPUnit\\Framework\\TestListener;\nuse Yoast\\PHPUnitPolyfills\\TestListeners\\TestListenerDefaultImplementation;\n\nclass MyTestListener implements TestListener {\n    use TestListenerDefaultImplementation;\n\n    // Implement any of the snakecase methods, for example:\n    public function add_error( $test, $e, $time ) {\n        // Do something when PHPUnit encounters an error.\n    }\n}\n```\n\n\nFrequently Asked Questions\n--------------------------\n\n### Q: Will this package polyfill functionality which was removed from PHPUnit ?\n\nAs a rule of thumb, removed functionality will **not** be polyfilled in this package.\n\nFor frequently used, removed PHPUnit functionality, \"helpers\" may be provided. These _helpers_ are only intended as an interim solution to allow users of this package more time to refactor their tests away from the removed functionality.\n\n#### Removed functionality without PHPUnit native replacement\n\n| PHPUnit | Removed               | Issue          | Remarks                                                                                                                                                                                                                                                                                                                                                                                                                                           |\n| ------- | --------------------- | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| 9.0.0   | `assertArraySubset()` | [#1][issue #1] | The [`dms/phpunit-arraysubset-asserts`](https://packagist.org/packages/dms/phpunit-arraysubset-asserts) package polyfills this functionality.\u003cbr/\u003eAs of [version 0.3.0](https://github.com/rdohms/phpunit-arraysubset-asserts/releases/tag/v0.3.0) this package can be installed in combination with PHP 5.4 - current and PHPUnit 4.8.36/5.7.21 - current.\u003cbr/\u003eAlternatively, tests can be refactored using the patterns outlined in [issue #1]. |\n| 9.0.0   | `assertAttribute*()`  | [#2][issue #2] | Refactor the tests to not directly test private/protected properties.\u003cbr/\u003eAs an interim solution, the [`Yoast\\PHPUnitPolyfills\\Helpers\\AssertAttributeHelper`](#yoastphpunitpolyfillshelpersassertattributehelper) trait is available.                                                                                                                                                                                                            |\n| 10.0.0  | `expectDeprecation*()` et al | [#186][issue #186] | A [custom polyfill approach tutorial](https://github.com/Yoast/PHPUnit-Polyfills/issues/186#issuecomment-2334326687) is available. Alternatively, tests can be refactored to skip running the `expectDeprecation*()` et al or skip the test completely on PHPUnit 10, while still running them on \u003c= PHPUnit 9. |\n\n[issue #1]: https://github.com/Yoast/PHPUnit-Polyfills/issues/1\n[issue #2]: https://github.com/Yoast/PHPUnit-Polyfills/issues/2\n[issue #186]: https://github.com/Yoast/PHPUnit-Polyfills/issues/186\n\n### Q: Can this library be used when the tests are being run via a PHPUnit Phar file ?\n\nYes, this package can also be used when running tests via a PHPUnit Phar file.\n\nIn that case, make sure that the `phpunitpolyfills-autoload.php` file is explicitly `require`d in the test bootstrap file.\n(Not necessary when the Composer `vendor/autoload.php` file is used as, or `require`d in, the test bootstrap.)\n\n\n### Q: How do I run my tests when the library is installed via the GitHub Actions `setup-php` action ?\n\nAs of [shivammathur/setup-php](https://github.com/shivammathur/setup-php) version [2.15.0](https://github.com/shivammathur/setup-php/releases/tag/2.15.0), the PHPUnit Polyfills are available as one of the tools which can be installed directly by the Setup-PHP GitHub action runner.\n\n```yaml\n- name: Setup PHP with tools\n  uses: shivammathur/setup-php@v2\n  with:\n    php-version: '8.0'\n    tools: phpunit-polyfills\n```\n\nThe above step will install both the PHPUnit Polyfills, as well as PHPUnit, as Composer global packages.\n\nAfter this step has run, you can run PHPUnit, like you would normally, by using `phpunit`.\n```yaml\n- name: Run tests\n  run: phpunit\n```\n\n:point_right: If you rely on Composer for autoloading your project files, you will still need to run `composer dump-autoload --dev` and include the project local `vendor/autoload.php` file as/in your test bootstrap.\n\n\u003e :mortar_board: Why this works:\n\u003e\n\u003e Composer will place all files in the global Composer `bin` directory in the system path and the Composer installed PHPUnit version will load the Composer global `autoload.php` file, which will automatically also load the PHPUnit Polyfills.\n\nNow you may wonder, _\"what about if I explicitly request both `phpunit` as well as `phpunit-polyfills` in `tools`?\"_\n\nIn that case, when you run `phpunit`, the PHPUnit PHAR will not know how to locate the PHPUnit Polyfills, so you will need to do some wizardry in your test bootstrap to get things working.\n\n\n### Q: How can I verify the version used of the PHPUnit Polyfills library ?\n\nFor complex test setups, like when the Polyfills are provided via a test suite dependency, or may already be loaded via an overarching project, it can be useful to be able to check that a version of the package is used which complies with the requirements for your test suite.\n\nAs of version 1.0.1, the PHPUnit Polyfills `Autoload` class contains a version number which can be used for this purpose.\n\nTypically such a check would be done in the test suite bootstrap file and could look something like this:\n```php\nif ( class_exists( '\\Yoast\\PHPUnitPolyfills\\Autoload' ) === false ) {\n    require_once 'vendor/yoast/phpunit-polyfills/phpunitpolyfills-autoload.php';\n}\n\n$versionRequirement = '1.0.1';\nif ( defined( '\\Yoast\\PHPUnitPolyfills\\Autoload::VERSION' ) === false\n    || version_compare( \\Yoast\\PHPUnitPolyfills\\Autoload::VERSION, $versionRequirement, '\u003c' )\n) {\n    echo 'Error: Version mismatch detected for the PHPUnit Polyfills.',\n        ' Please ensure that PHPUnit Polyfills ', $versionRequirement,\n        ' or higher is loaded.', PHP_EOL;\n    exit(1);\n} else {\n    echo 'Error: Please run `composer update -W` before running the tests.' . PHP_EOL;\n    echo 'You can still use a PHPUnit phar to run them,',\n        ' but the dependencies do need to be installed.', PHP_EOL;\n    exit(1);\n}\n```\n\n\nContributing\n------------\nContributions to this project are welcome. Clone the repo, branch off from the oldest #.x branch the patch applies to, make your changes, commit them and send in a pull request against the correct #.x branch.\n\nIf you are unsure whether the changes you are proposing would be welcome, please open an issue first to discuss your proposal.\n\n\nLicense\n-------\nThis code is released under the [BSD-3-Clause License](LICENSE).\n","funding_links":[],"categories":["Table of Contents"],"sub_categories":["Testing"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FYoast%2FPHPUnit-Polyfills","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FYoast%2FPHPUnit-Polyfills","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FYoast%2FPHPUnit-Polyfills/lists"}