|
17 | 17 | use PHPCSUtils\Tests\ExpectWithConsecutiveArgs; |
18 | 18 | use PHPCSUtils\TestUtils\UtilityMethodTestCase; |
19 | 19 | use Yoast\PHPUnitPolyfills\Autoload; |
| 20 | +use Yoast\PHPUnitPolyfills\Polyfills\AssertArrayWithListKeys; |
20 | 21 | use Yoast\PHPUnitPolyfills\Polyfills\AssertClosedResource; |
21 | 22 | use Yoast\PHPUnitPolyfills\Polyfills\AssertEqualsSpecializations; |
22 | 23 | use Yoast\PHPUnitPolyfills\Polyfills\AssertFileDirectory; |
|
27 | 28 | use Yoast\PHPUnitPolyfills\Polyfills\AssertIsType; |
28 | 29 | use Yoast\PHPUnitPolyfills\Polyfills\AssertNumericType; |
29 | 30 | use Yoast\PHPUnitPolyfills\Polyfills\AssertObjectEquals; |
| 31 | +use Yoast\PHPUnitPolyfills\Polyfills\AssertObjectNotEquals; |
30 | 32 | use Yoast\PHPUnitPolyfills\Polyfills\AssertObjectProperty; |
31 | 33 | use Yoast\PHPUnitPolyfills\Polyfills\AssertStringContains; |
32 | 34 | use Yoast\PHPUnitPolyfills\Polyfills\EqualToSpecializations; |
33 | 35 | use Yoast\PHPUnitPolyfills\Polyfills\ExpectException; |
34 | 36 | use Yoast\PHPUnitPolyfills\Polyfills\ExpectExceptionMessageMatches; |
35 | 37 | use Yoast\PHPUnitPolyfills\Polyfills\ExpectExceptionObject; |
36 | 38 | use Yoast\PHPUnitPolyfills\Polyfills\ExpectPHPException; |
| 39 | +use Yoast\PHPUnitPolyfills\Polyfills\ExpectUserDeprecation; |
37 | 40 |
|
38 | | -if (\version_compare(Autoload::VERSION, '2.0.0', '>=')) { |
| 41 | +if (\version_compare(Autoload::VERSION, '3.0.0', '>=')) { |
39 | 42 | /** |
40 | | - * Abstract utility method base test case which includes all available polyfills (PHPUnit Polyfills 2.x compaible). |
| 43 | + * Abstract utility method base test case which includes all available polyfills (PHPUnit Polyfills 3.x compatible). |
| 44 | + * |
| 45 | + * This test case includes all polyfills from the PHPUnit Polyfill library to make them |
| 46 | + * available to the tests. |
| 47 | + * |
| 48 | + * Generally speaking, this testcase only needs to be used when the concrete test class will |
| 49 | + * use functionality which has changed in PHPUnit cross-version. |
| 50 | + * In all other cases, the `UtilityMethodTestCase` can be extended directly. |
| 51 | + * |
| 52 | + * {@internal The list of included polyfill traits should be reviewed after each new |
| 53 | + * release of the PHPUnit Polyfill library.} |
| 54 | + * |
| 55 | + * @since 1.1.0 |
| 56 | + */ |
| 57 | + abstract class PolyfilledTestCase extends UtilityMethodTestCase |
| 58 | + { |
| 59 | + // PHPCSUtils native helpers. |
| 60 | + use AssertPropertySame; |
| 61 | + use ExpectWithConsecutiveArgs; |
| 62 | + |
| 63 | + // PHPUnit Polyfills. |
| 64 | + use AssertArrayWithListKeys; |
| 65 | + use AssertClosedResource; |
| 66 | + use AssertEqualsSpecializations; |
| 67 | + use AssertFileEqualsSpecializations; |
| 68 | + use AssertIgnoringLineEndings; |
| 69 | + use AssertionRenames; |
| 70 | + use AssertIsList; |
| 71 | + use AssertIsType; |
| 72 | + use AssertObjectEquals; |
| 73 | + use AssertObjectNotEquals; |
| 74 | + use AssertObjectProperty; |
| 75 | + use AssertStringContains; |
| 76 | + use EqualToSpecializations; |
| 77 | + use ExpectExceptionMessageMatches; |
| 78 | + use ExpectUserDeprecation; |
| 79 | + } |
| 80 | +} elseif (\version_compare(Autoload::VERSION, '2.0.0', '>=')) { |
| 81 | + /** |
| 82 | + * Abstract utility method base test case which includes all available polyfills (PHPUnit Polyfills 2.x compatible). |
41 | 83 | * |
42 | 84 | * This test case includes all polyfills from the PHPUnit Polyfill library to make them |
43 | 85 | * available to the tests. |
@@ -74,7 +116,7 @@ abstract class PolyfilledTestCase extends UtilityMethodTestCase |
74 | 116 | } |
75 | 117 | } else { |
76 | 118 | /** |
77 | | - * Abstract utility method base test case which includes all available polyfills (PHPUnit Polyfills 1.x compaible). |
| 119 | + * Abstract utility method base test case which includes all available polyfills (PHPUnit Polyfills 1.x compatible). |
78 | 120 | * |
79 | 121 | * This test case includes all polyfills from the PHPUnit Polyfill library to make them |
80 | 122 | * available to the tests. |
|
0 commit comments