Skip to content

Commit

Permalink
Merge branch '2.x' into 3.x
Browse files Browse the repository at this point in the history
  • Loading branch information
jrfnl committed Jan 6, 2025
2 parents 3244100 + 7d642a4 commit 648f805
Show file tree
Hide file tree
Showing 35 changed files with 80 additions and 0 deletions.
4 changes: 4 additions & 0 deletions phpunitpolyfills-autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,16 @@

/**
* Custom autoloader.
*
* @since 0.1.0
*/
final class Autoload {

/**
* Version number.
*
* @since 1.0.1
*
* @var string
*/
const VERSION = '3.0.0';
Expand Down
2 changes: 2 additions & 0 deletions src/Exceptions/InvalidComparisonMethodException.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
*
* PHPUnit natively throws a range of different exceptions.
* The polyfills throw just one exception type with different messages.
*
* @since 1.0.0
*/
final class InvalidComparisonMethodException extends Exception {

Expand Down
2 changes: 2 additions & 0 deletions src/Helpers/ComparatorValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
* ---------------------------------------------------------------------------------------------
*
* @internal
*
* @since 3.0.0
*/
final class ComparatorValidator {

Expand Down
2 changes: 2 additions & 0 deletions src/Helpers/ResourceHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
* ---------------------------------------------------------------------------------------------
*
* @internal
*
* @since 1.0.0
*/
final class ResourceHelper {

Expand Down
2 changes: 2 additions & 0 deletions src/Polyfills/AssertArrayWithListKeys_Empty.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@

/**
* Empty trait for use with PHPUnit >= 11.0.0 in which the polyfill is not needed.
*
* @since 3.0.0
*/
trait AssertArrayWithListKeys {}
2 changes: 2 additions & 0 deletions src/Polyfills/AssertClosedResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
*
* @link https://github.com/sebastianbergmann/phpunit/issues/4276
* @link https://github.com/sebastianbergmann/phpunit/pull/4365
*
* @since 1.0.0
*/
trait AssertClosedResource {

Expand Down
2 changes: 2 additions & 0 deletions src/Polyfills/AssertClosedResource_Empty.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
* For consistency, the "should this test be skipped" method is included
* as the PHPUnit native versions of the `assertIs[Not]ClosedResource()`
* assertions are affected by the same bugs.
*
* @since 1.0.0
*/
trait AssertClosedResource {

Expand Down
2 changes: 2 additions & 0 deletions src/Polyfills/AssertEqualsSpecializations.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
* deprecated in PHPUnit 7.5.0 and removed in PHPUnit 9.0.0.
*
* @link https://github.com/sebastianbergmann/phpunit/issues/3340
*
* @since 0.1.0
*/
trait AssertEqualsSpecializations {

Expand Down
2 changes: 2 additions & 0 deletions src/Polyfills/AssertEqualsSpecializations_Empty.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@

/**
* Empty trait for use with PHPUnit >= 7.5.0 in which this polyfill is not needed.
*
* @since 0.1.0
*/
trait AssertEqualsSpecializations {}
2 changes: 2 additions & 0 deletions src/Polyfills/AssertFileEqualsSpecializations.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
*
* @link https://github.com/sebastianbergmann/phpunit/issues/3949
* @link https://github.com/sebastianbergmann/phpunit/issues/3951
*
* @since 0.1.0
*/
trait AssertFileEqualsSpecializations {

Expand Down
2 changes: 2 additions & 0 deletions src/Polyfills/AssertFileEqualsSpecializations_Empty.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@

/**
* Empty trait for use with PHPUnit >= 8.5.0 in which this polyfill is not needed.
*
* @since 0.1.0
*/
trait AssertFileEqualsSpecializations {}
2 changes: 2 additions & 0 deletions src/Polyfills/AssertIsType.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
*
* @link https://github.com/sebastianbergmann/phpunit/issues/3368
* @link https://github.com/sebastianbergmann/phpunit/issues/3369
*
* @since 0.1.0
*/
trait AssertIsType {

Expand Down
2 changes: 2 additions & 0 deletions src/Polyfills/AssertIsType_Empty.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@

/**
* Empty trait for use with PHPUnit >= 7.5.0 in which this polyfill is not needed.
*
* @since 0.1.0
*/
trait AssertIsType {}
2 changes: 2 additions & 0 deletions src/Polyfills/AssertObjectEquals.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
* @link https://github.com/sebastianbergmann/phpunit/issues/4707
* @link https://github.com/sebastianbergmann/phpunit/commit/1dba8c3a4b2dd04a3ff1869f75daaeb6757a14ee
* @link https://github.com/sebastianbergmann/phpunit/commit/6099c5eefccfda860c889f575d58b5fe6cc10c83
*
* @since 1.0.0
*/
trait AssertObjectEquals {

Expand Down
2 changes: 2 additions & 0 deletions src/Polyfills/AssertObjectEquals_Empty.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@

/**
* Empty trait for use with PHPUnit >= 9.4.0 in which this polyfill is not needed.
*
* @since 1.0.0
*/
trait AssertObjectEquals {}
2 changes: 2 additions & 0 deletions src/Polyfills/AssertObjectNotEquals.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
*
* @link https://github.com/sebastianbergmann/phpunit/issues/5811
* @link https://github.com/sebastianbergmann/phpunit/commit/8e3b7c18506312df0676f2e079c414cc56b49f69
*
* @since 3.0.0
*/
trait AssertObjectNotEquals {

Expand Down
2 changes: 2 additions & 0 deletions src/Polyfills/AssertObjectNotEquals_Empty.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@

/**
* Empty trait for use with PHPUnit >= 11.2.0 in which this polyfill is not needed.
*
* @since 3.0.0
*/
trait AssertObjectNotEquals {}
2 changes: 2 additions & 0 deletions src/Polyfills/AssertObjectProperty.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
*
* @link https://github.com/sebastianbergmann/phpunit/pull/5231
* @link https://github.com/sebastianbergmann/phpunit/issues/5478
*
* @since 2.0.0
*/
trait AssertObjectProperty {

Expand Down
2 changes: 2 additions & 0 deletions src/Polyfills/AssertObjectProperty_Empty.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@

/**
* Empty trait for use with PHPUnit >= 9.6.11 < 10.0.0 and PHPUnit >= 10.1.0 in which this polyfill is not needed.
*
* @since 2.0.0
*/
trait AssertObjectProperty {}
2 changes: 2 additions & 0 deletions src/Polyfills/AssertStringContains.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
* @link https://github.com/sebastianbergmann/phpunit/issues/3422
* @link https://github.com/sebastianbergmann/phpunit/issues/2520
* @link https://github.com/sebastianbergmann/phpunit/pull/2778
*
* @since 0.1.0
*/
trait AssertStringContains {

Expand Down
2 changes: 2 additions & 0 deletions src/Polyfills/AssertStringContains_Empty.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@

/**
* Empty trait for use with PHPUnit >= 7.5.0 in which this polyfill is not needed.
*
* @since 0.1.0
*/
trait AssertStringContains {}
2 changes: 2 additions & 0 deletions src/Polyfills/AssertionRenames.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
* @link https://github.com/sebastianbergmann/phpunit/issues/4088
* @link https://github.com/sebastianbergmann/phpunit/issues/4089
* @link https://github.com/sebastianbergmann/phpunit/issues/4090
*
* @since 0.1.0
*/
trait AssertionRenames {

Expand Down
2 changes: 2 additions & 0 deletions src/Polyfills/AssertionRenames_Empty.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@

/**
* Empty trait for use with PHPUnit >= 9.1.0 in which this polyfill is not needed.
*
* @since 0.1.0
*/
trait AssertionRenames {}
2 changes: 2 additions & 0 deletions src/Polyfills/EqualToSpecializations.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
* never deprecated but leads to unexpected behaviour as they are ignored in PHPUnit 9.0.0.
*
* @link https://github.com/sebastianbergmann/phpunit/commit/43c01a4e0c74a4bf019a8d879bced5146af2fbb6
*
* @since 1.0.0
*/
trait EqualToSpecializations {

Expand Down
2 changes: 2 additions & 0 deletions src/Polyfills/EqualToSpecializations_Empty.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@

/**
* Empty trait for use with PHPUnit >= 9.0.0 in which this polyfill is not needed.
*
* @since 1.0.0
*/
trait EqualToSpecializations {}
2 changes: 2 additions & 0 deletions src/Polyfills/ExpectExceptionMessageMatches.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
* @link https://github.com/sebastianbergmann/phpunit/commit/d1199cb2e43a934b51521656be9748f63febe18e
* @link https://github.com/sebastianbergmann/phpunit/issues/4133
* @link https://github.com/sebastianbergmann/phpunit/issues/3957
*
* @since 0.1.0
*/
trait ExpectExceptionMessageMatches {

Expand Down
2 changes: 2 additions & 0 deletions src/Polyfills/ExpectExceptionMessageMatches_Empty.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@

/**
* Empty trait for use with PHPUnit >= 8.4.0 in which this polyfill is not needed.
*
* @since 0.1.0
*/
trait ExpectExceptionMessageMatches {}
2 changes: 2 additions & 0 deletions src/Polyfills/ExpectUserDeprecation.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
* Note: PHPUnit 10 is not and will not be supported for these polyfills.
*
* @link https://github.com/sebastianbergmann/phpunit/pull/5605
*
* @since 3.0.0
*/
trait ExpectUserDeprecation {

Expand Down
2 changes: 2 additions & 0 deletions src/Polyfills/ExpectUserDeprecation_Empty.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@

/**
* Empty trait for use with PHPUnit >= 11.0.0 in which this polyfill is not needed.
*
* @since 3.0.0
*/
trait ExpectUserDeprecation {}
6 changes: 6 additions & 0 deletions src/TestCases/TestCasePHPUnitGte8.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
* methods to get round the signature change in PHPUnit 8.
*
* When using this TestCase, the snakecase method names need to be used to overload a fixture method.
*
* @since 0.1.0
*/
abstract class TestCase extends PHPUnit_TestCase {

Expand Down Expand Up @@ -69,6 +71,8 @@ protected function setUp(): void {
*
* This method is called before the execution of a test starts and after setUp() is called.
*
* @since 0.2.0
*
* @return void
*/
protected function assertPreConditions(): void {
Expand All @@ -81,6 +85,8 @@ protected function assertPreConditions(): void {
*
* This method is called before the execution of a test ends and before tearDown() is called.
*
* @since 0.2.0
*
* @return void
*/
protected function assertPostConditions(): void {
Expand Down
6 changes: 6 additions & 0 deletions src/TestCases/TestCasePHPUnitLte7.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
* methods to get round the signature change in PHPUnit 8.
*
* When using this TestCase, the snakecase method names need to be used to overload a fixture method.
*
* @since 0.1.0
*/
abstract class TestCase extends PHPUnit_TestCase {

Expand Down Expand Up @@ -75,6 +77,8 @@ protected function setUp() {
*
* This method is called before the execution of a test starts and after setUp() is called.
*
* @since 0.2.0
*
* @return void
*/
protected function assertPreConditions() {
Expand All @@ -87,6 +91,8 @@ protected function assertPreConditions() {
*
* This method is called before the execution of a test ends and before tearDown() is called.
*
* @since 0.2.0
*
* @return void
*/
protected function assertPostConditions() {
Expand Down
2 changes: 2 additions & 0 deletions src/TestCases/XTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
* `@after` and `@afterClass` annotations.
* The naming of the overloaded methods is open as long as the method names don't conflict with
* the PHPUnit native method names.
*
* @since 0.1.0
*/
abstract class XTestCase extends PHPUnit_TestCase {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
*
* When using this TestListener trait, the snake_case method names need to be used to implement
* the listener functionality.
*
* @since 0.2.0
*/
trait TestListenerDefaultImplementation {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
*
* When using this TestListener trait, the snake_case method names need to be used to implement
* the listener functionality.
*
* @since 0.2.0
*/
trait TestListenerDefaultImplementation {

Expand Down
2 changes: 2 additions & 0 deletions src/TestListeners/TestListenerSnakeCaseMethods.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
/**
* Renamed snake_case TestListener method collection used by the TestListenerDefaultImplementation traits.
*
* @since 0.2.0
*
* @phpcs:disable VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable -- This is intentional as these are template methods.
*/
trait TestListenerSnakeCaseMethods {
Expand Down

0 comments on commit 648f805

Please sign in to comment.