Skip to content

Commit 0faa897

Browse files
Merge pull request #190 from Yoast/feature/2.x/readme-updates
README: update links to PHPUnit docs
2 parents eb2db84 + 199bd09 commit 0faa897

File tree

1 file changed

+66
-66
lines changed

1 file changed

+66
-66
lines changed

README.md

Lines changed: 66 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ The polyfills in this library support the first two ways of calling the assertio
151151

152152
For the polyfills to work, a test class is **required** to be a (grand-)child of the PHPUnit native `TestCase` class.
153153

154-
[four ways of calling assertions]: https://docs.phpunit.de/en/main/assertions.html#static-vs-non-static-usage-of-assertion-methods
154+
[four ways of calling assertions]: https://docs.phpunit.de/en/10.5/assertions.html#static-vs-non-static-usage-of-assertion-methods
155155

156156
### Use with PHPUnit < 7.5.0
157157

@@ -204,7 +204,7 @@ Polyfills the [`TestCase::expectExceptionObject()`] method to test all aspects o
204204

205205
This method was introduced in PHPUnit 6.4.0.
206206

207-
[`TestCase::expectExceptionObject()`]: https://docs.phpunit.de/en/main/writing-tests-for-phpunit.html#testing-exceptions
207+
[`TestCase::expectExceptionObject()`]: https://docs.phpunit.de/en/10.5/writing-tests-for-phpunit.html#testing-exceptions
208208

209209
#### PHPUnit < 7.5.0: `Yoast\PHPUnitPolyfills\Polyfills\AssertIsType`
210210

@@ -222,28 +222,28 @@ Polyfills the following methods:
222222

223223
These 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.
224224

225-
[`Assert::assertIsArray()`]: https://docs.phpunit.de/en/main/assertions.html#assertisarray
226-
[`Assert::assertIsNotArray()`]: https://docs.phpunit.de/en/main/assertions.html#assertisarray
227-
[`Assert::assertIsBool()`]: https://docs.phpunit.de/en/main/assertions.html#assertisbool
228-
[`Assert::assertIsNotBool()`]: https://docs.phpunit.de/en/main/assertions.html#assertisbool
229-
[`Assert::assertIsFloat()`]: https://docs.phpunit.de/en/main/assertions.html#assertisfloat
230-
[`Assert::assertIsNotFloat()`]: https://docs.phpunit.de/en/main/assertions.html#assertisfloat
231-
[`Assert::assertIsInt()`]: https://docs.phpunit.de/en/main/assertions.html#assertisint
232-
[`Assert::assertIsNotInt()`]: https://docs.phpunit.de/en/main/assertions.html#assertisint
233-
[`Assert::assertIsNumeric()`]: https://docs.phpunit.de/en/main/assertions.html#assertisnumeric
234-
[`Assert::assertIsNotNumeric()`]: https://docs.phpunit.de/en/main/assertions.html#assertisnumeric
235-
[`Assert::assertIsObject()`]: https://docs.phpunit.de/en/main/assertions.html#assertisobject
236-
[`Assert::assertIsNotObject()`]: https://docs.phpunit.de/en/main/assertions.html#assertisobject
237-
[`Assert::assertIsResource()`]: https://docs.phpunit.de/en/main/assertions.html#assertisresource
238-
[`Assert::assertIsNotResource()`]: https://docs.phpunit.de/en/main/assertions.html#assertisresource
239-
[`Assert::assertIsString()`]: https://docs.phpunit.de/en/main/assertions.html#assertisstring
240-
[`Assert::assertIsNotString()`]: https://docs.phpunit.de/en/main/assertions.html#assertisstring
241-
[`Assert::assertIsScalar()`]: https://docs.phpunit.de/en/main/assertions.html#assertisscalar
242-
[`Assert::assertIsNotScalar()`]: https://docs.phpunit.de/en/main/assertions.html#assertisscalar
243-
[`Assert::assertIsCallable()`]: https://docs.phpunit.de/en/main/assertions.html#assertiscallable
244-
[`Assert::assertIsNotCallable()`]: https://docs.phpunit.de/en/main/assertions.html#assertiscallable
245-
[`Assert::assertIsIterable()`]: https://docs.phpunit.de/en/main/assertions.html#assertisiterable
246-
[`Assert::assertIsNotIterable()`]: https://docs.phpunit.de/en/main/assertions.html#assertisiterable
225+
[`Assert::assertIsArray()`]: https://docs.phpunit.de/en/10.5/assertions.html#assertisarray
226+
[`Assert::assertIsNotArray()`]: https://docs.phpunit.de/en/10.5/assertions.html#assertisarray
227+
[`Assert::assertIsBool()`]: https://docs.phpunit.de/en/10.5/assertions.html#assertisbool
228+
[`Assert::assertIsNotBool()`]: https://docs.phpunit.de/en/10.5/assertions.html#assertisbool
229+
[`Assert::assertIsFloat()`]: https://docs.phpunit.de/en/10.5/assertions.html#assertisfloat
230+
[`Assert::assertIsNotFloat()`]: https://docs.phpunit.de/en/10.5/assertions.html#assertisfloat
231+
[`Assert::assertIsInt()`]: https://docs.phpunit.de/en/10.5/assertions.html#assertisint
232+
[`Assert::assertIsNotInt()`]: https://docs.phpunit.de/en/10.5/assertions.html#assertisint
233+
[`Assert::assertIsNumeric()`]: https://docs.phpunit.de/en/10.5/assertions.html#assertisnumeric
234+
[`Assert::assertIsNotNumeric()`]: https://docs.phpunit.de/en/10.5/assertions.html#assertisnumeric
235+
[`Assert::assertIsObject()`]: https://docs.phpunit.de/en/10.5/assertions.html#assertisobject
236+
[`Assert::assertIsNotObject()`]: https://docs.phpunit.de/en/10.5/assertions.html#assertisobject
237+
[`Assert::assertIsResource()`]: https://docs.phpunit.de/en/10.5/assertions.html#assertisresource
238+
[`Assert::assertIsNotResource()`]: https://docs.phpunit.de/en/10.5/assertions.html#assertisresource
239+
[`Assert::assertIsString()`]: https://docs.phpunit.de/en/10.5/assertions.html#assertisstring
240+
[`Assert::assertIsNotString()`]: https://docs.phpunit.de/en/10.5/assertions.html#assertisstring
241+
[`Assert::assertIsScalar()`]: https://docs.phpunit.de/en/10.5/assertions.html#assertisscalar
242+
[`Assert::assertIsNotScalar()`]: https://docs.phpunit.de/en/10.5/assertions.html#assertisscalar
243+
[`Assert::assertIsCallable()`]: https://docs.phpunit.de/en/10.5/assertions.html#assertiscallable
244+
[`Assert::assertIsNotCallable()`]: https://docs.phpunit.de/en/10.5/assertions.html#assertiscallable
245+
[`Assert::assertIsIterable()`]: https://docs.phpunit.de/en/10.5/assertions.html#assertisiterable
246+
[`Assert::assertIsNotIterable()`]: https://docs.phpunit.de/en/10.5/assertions.html#assertisiterable
247247

248248
#### PHPUnit < 7.5.0: `Yoast\PHPUnitPolyfills\Polyfills\AssertStringContains`
249249

@@ -255,10 +255,10 @@ Polyfills the following methods:
255255

256256
These 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.
257257

258-
[`Assert::assertStringContainsString()`]: https://docs.phpunit.de/en/main/assertions.html#assertstringcontainsstring
259-
[`Assert::assertStringNotContainsString()`]: https://docs.phpunit.de/en/main/assertions.html#assertstringcontainsstring
260-
[`Assert::assertStringContainsStringIgnoringCase()`]: https://docs.phpunit.de/en/main/assertions.html#assertstringcontainsstringignoringcase
261-
[`Assert::assertStringNotContainsStringIgnoringCase()`]: https://docs.phpunit.de/en/main/assertions.html#assertstringcontainsstringignoringcase
258+
[`Assert::assertStringContainsString()`]: https://docs.phpunit.de/en/10.5/assertions.html#assertstringcontainsstring
259+
[`Assert::assertStringNotContainsString()`]: https://docs.phpunit.de/en/10.5/assertions.html#assertstringcontainsstring
260+
[`Assert::assertStringContainsStringIgnoringCase()`]: https://docs.phpunit.de/en/10.5/assertions.html#assertstringcontainsstringignoringcase
261+
[`Assert::assertStringNotContainsStringIgnoringCase()`]: https://docs.phpunit.de/en/10.5/assertions.html#assertstringcontainsstringignoringcase
262262

263263
#### PHPUnit < 7.5.0: `Yoast\PHPUnitPolyfills\Polyfills\AssertEqualsSpecializations`
264264

@@ -271,12 +271,12 @@ Polyfills the following methods:
271271

272272
These 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.
273273

274-
[`Assert::assertEqualsCanonicalizing()`]: https://docs.phpunit.de/en/main/assertions.html#assertequalscanonicalizing
275-
[`Assert::assertNotEqualsCanonicalizing()`]: https://docs.phpunit.de/en/main/assertions.html#assertequalscanonicalizing
276-
[`Assert::assertEqualsIgnoringCase()`]: https://docs.phpunit.de/en/main/assertions.html#assertequalsignoringcase
277-
[`Assert::assertNotEqualsIgnoringCase()`]: https://docs.phpunit.de/en/main/assertions.html#assertequalsignoringcase
278-
[`Assert::assertEqualsWithDelta()`]: https://docs.phpunit.de/en/main/assertions.html#assertequalswithdelta
279-
[`Assert::assertNotEqualsWithDelta()`]: https://docs.phpunit.de/en/main/assertions.html#assertequalswithdelta
274+
[`Assert::assertEqualsCanonicalizing()`]: https://docs.phpunit.de/en/10.5/assertions.html#assertequalscanonicalizing
275+
[`Assert::assertNotEqualsCanonicalizing()`]: https://docs.phpunit.de/en/10.5/assertions.html#assertequalscanonicalizing
276+
[`Assert::assertEqualsIgnoringCase()`]: https://docs.phpunit.de/en/10.5/assertions.html#assertequalsignoringcase
277+
[`Assert::assertNotEqualsIgnoringCase()`]: https://docs.phpunit.de/en/10.5/assertions.html#assertequalsignoringcase
278+
[`Assert::assertEqualsWithDelta()`]: https://docs.phpunit.de/en/10.5/assertions.html#assertequalswithdelta
279+
[`Assert::assertNotEqualsWithDelta()`]: https://docs.phpunit.de/en/10.5/assertions.html#assertequalswithdelta
280280

281281
#### PHPUnit < 8.4.0: `Yoast\PHPUnitPolyfills\Polyfills\ExpectExceptionMessageMatches`
282282

@@ -285,7 +285,7 @@ Polyfills the [`TestCase::expectExceptionMessageMatches()`] method.
285285
This method was introduced in PHPUnit 8.4.0 to improve the name of the `TestCase::expectExceptionMessageRegExp()` method.
286286
The `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.
287287

288-
[`TestCase::expectExceptionMessageMatches()`]: https://docs.phpunit.de/en/main/writing-tests-for-phpunit.html#testing-exceptions
288+
[`TestCase::expectExceptionMessageMatches()`]: https://docs.phpunit.de/en/10.5/writing-tests-for-phpunit.html#testing-exceptions
289289

290290
#### PHPUnit < 8.5.0: `Yoast\PHPUnitPolyfills\Polyfills\AssertFileEqualsSpecializations`
291291

@@ -299,14 +299,14 @@ Polyfills the following methods:
299299

300300
These 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.
301301

302-
[`Assert::assertFileEqualsCanonicalizing()`]: https://docs.phpunit.de/en/main/assertions.html#assertfileequals
303-
[`Assert::assertFileNotEqualsCanonicalizing()`]: https://docs.phpunit.de/en/main/assertions.html#assertfileequals
304-
[`Assert::assertFileEqualsIgnoringCase()`]: https://docs.phpunit.de/en/main/assertions.html#assertfileequals
305-
[`Assert::assertFileNotEqualsIgnoringCase()`]: https://docs.phpunit.de/en/main/assertions.html#assertfileequals
306-
[`Assert::assertStringEqualsFileCanonicalizing()`]: https://docs.phpunit.de/en/main/assertions.html#assertfileequals
307-
[`Assert::assertStringNotEqualsFileCanonicalizing()`]: https://docs.phpunit.de/en/main/assertions.html#assertfileequals
308-
[`Assert::assertStringEqualsFileIgnoringCase()`]: https://docs.phpunit.de/en/main/assertions.html#assertfileequals
309-
[`Assert::assertStringNotEqualsFileIgnoringCase()`]: https://docs.phpunit.de/en/main/assertions.html#assertfileequals
302+
[`Assert::assertFileEqualsCanonicalizing()`]: https://docs.phpunit.de/en/10.5/assertions.html#assertfileequals
303+
[`Assert::assertFileNotEqualsCanonicalizing()`]: https://docs.phpunit.de/en/10.5/assertions.html#assertfileequals
304+
[`Assert::assertFileEqualsIgnoringCase()`]: https://docs.phpunit.de/en/10.5/assertions.html#assertfileequals
305+
[`Assert::assertFileNotEqualsIgnoringCase()`]: https://docs.phpunit.de/en/10.5/assertions.html#assertfileequals
306+
[`Assert::assertStringEqualsFileCanonicalizing()`]: https://docs.phpunit.de/en/10.5/assertions.html#assertfileequals
307+
[`Assert::assertStringNotEqualsFileCanonicalizing()`]: https://docs.phpunit.de/en/10.5/assertions.html#assertfileequals
308+
[`Assert::assertStringEqualsFileIgnoringCase()`]: https://docs.phpunit.de/en/10.5/assertions.html#assertfileequals
309+
[`Assert::assertStringNotEqualsFileIgnoringCase()`]: https://docs.phpunit.de/en/10.5/assertions.html#assertfileequals
310310

311311
#### PHPUnit < 9.0.0: `Yoast\PHPUnitPolyfills\Polyfills\EqualToSpecializations`
312312

@@ -335,16 +335,16 @@ Polyfills the following renamed methods:
335335
These methods were introduced in PHPUnit 9.1.0.
336336
The original methods these new methods replace were hard deprecated in PHPUnit 9.1.0 and removed in PHPUnit 10.0.0.
337337

338-
[`Assert::assertIsNotReadable()`]: https://docs.phpunit.de/en/main/assertions.html#assertisreadable
339-
[`Assert::assertIsNotWritable()`]: https://docs.phpunit.de/en/main/assertions.html#assertiswritable
340-
[`Assert::assertDirectoryDoesNotExist()`]: https://docs.phpunit.de/en/main/assertions.html#assertdirectoryexists
341-
[`Assert::assertDirectoryIsNotReadable()`]: https://docs.phpunit.de/en/main/assertions.html#assertdirectoryisreadable
342-
[`Assert::assertDirectoryIsNotWritable()`]: https://docs.phpunit.de/en/main/assertions.html#assertdirectoryiswritable
343-
[`Assert::assertFileDoesNotExist()`]: https://docs.phpunit.de/en/main/assertions.html#assertfileexists
344-
[`Assert::assertFileIsNotReadable()`]: https://docs.phpunit.de/en/main/assertions.html#assertfileisreadable
345-
[`Assert::assertFileIsNotWritable()`]: https://docs.phpunit.de/en/main/assertions.html#assertfileiswritable
346-
[`Assert::assertMatchesRegularExpression()`]: https://docs.phpunit.de/en/main/assertions.html#assertmatchesregularexpression
347-
[`Assert::assertDoesNotMatchRegularExpression()`]: https://docs.phpunit.de/en/main/assertions.html#assertmatchesregularexpression
338+
[`Assert::assertIsNotReadable()`]: https://docs.phpunit.de/en/10.5/assertions.html#assertisreadable
339+
[`Assert::assertIsNotWritable()`]: https://docs.phpunit.de/en/10.5/assertions.html#assertiswritable
340+
[`Assert::assertDirectoryDoesNotExist()`]: https://docs.phpunit.de/en/10.5/assertions.html#assertdirectoryexists
341+
[`Assert::assertDirectoryIsNotReadable()`]: https://docs.phpunit.de/en/10.5/assertions.html#assertdirectoryisreadable
342+
[`Assert::assertDirectoryIsNotWritable()`]: https://docs.phpunit.de/en/10.5/assertions.html#assertdirectoryiswritable
343+
[`Assert::assertFileDoesNotExist()`]: https://docs.phpunit.de/en/10.5/assertions.html#assertfileexists
344+
[`Assert::assertFileIsNotReadable()`]: https://docs.phpunit.de/en/10.5/assertions.html#assertfileisreadable
345+
[`Assert::assertFileIsNotWritable()`]: https://docs.phpunit.de/en/10.5/assertions.html#assertfileiswritable
346+
[`Assert::assertMatchesRegularExpression()`]: https://docs.phpunit.de/en/10.5/assertions.html#assertmatchesregularexpression
347+
[`Assert::assertDoesNotMatchRegularExpression()`]: https://docs.phpunit.de/en/10.5/assertions.html#assertmatchesregularexpression
348348

349349
#### PHPUnit < 9.3.0: `Yoast\PHPUnitPolyfills\Polyfills\AssertClosedResource`
350350

@@ -355,8 +355,8 @@ Polyfills the following methods:
355355

356356
These methods were introduced in PHPUnit 9.3.0.
357357

358-
[`Assert::assertIsClosedResource()`]: https://docs.phpunit.de/en/main/assertions.html#assertisresource
359-
[`Assert::assertIsNotClosedResource()`]: https://docs.phpunit.de/en/main/assertions.html#assertisresource
358+
[`Assert::assertIsClosedResource()`]: https://docs.phpunit.de/en/10.5/assertions.html#assertisresource
359+
[`Assert::assertIsNotClosedResource()`]: https://docs.phpunit.de/en/10.5/assertions.html#assertisresource
360360

361361
Additionally, this trait contains a helper method `shouldClosedResourceAssertionBeSkipped()`.
362362

@@ -401,7 +401,7 @@ The `assertObjectEquals()` assertion was introduced in PHPUnit 9.4.0.
401401
402402
[limitations in how this assertion is implemented in PHPUnit]: https://github.com/sebastianbergmann/phpunit/issues/4707
403403

404-
[`Assert::assertObjectEquals()`]: https://docs.phpunit.de/en/main/assertions.html#assertobjectequals
404+
[`Assert::assertObjectEquals()`]: https://docs.phpunit.de/en/10.5/assertions.html#assertobjectequals
405405

406406
#### PHPUnit < 10.0.0: `Yoast\PHPUnitPolyfills\Polyfills\AssertIgnoringLineEndings`
407407

@@ -412,8 +412,8 @@ Polyfills the following methods:
412412

413413
These methods were introduced in PHPUnit 10.0.0.
414414

415-
[`Assert::assertStringEqualsStringIgnoringLineEndings()`]: https://docs.phpunit.de/en/main/assertions.html#assertstringequalsstringignoringlineendings
416-
[`Assert::assertStringContainsStringIgnoringLineEndings()`]: https://docs.phpunit.de/en/main/assertions.html#assertstringcontainsstringignoringlineendings
415+
[`Assert::assertStringEqualsStringIgnoringLineEndings()`]: https://docs.phpunit.de/en/10.5/assertions.html#assertstringequalsstringignoringlineendings
416+
[`Assert::assertStringContainsStringIgnoringLineEndings()`]: https://docs.phpunit.de/en/10.5/assertions.html#assertstringcontainsstringignoringlineendings
417417

418418
#### PHPUnit < 10.0.0: `Yoast\PHPUnitPolyfills\Polyfills\AssertIsList`
419419

@@ -424,7 +424,7 @@ Polyfills the following method:
424424

425425
This method was introduced in PHPUnit 10.0.0.
426426

427-
[`Assert::assertIsList()`]: https://docs.phpunit.de/en/main/assertions.html#assertislist
427+
[`Assert::assertIsList()`]: https://docs.phpunit.de/en/10.5/assertions.html#assertislist
428428

429429
#### PHPUnit < 10.1.0: `Yoast\PHPUnitPolyfills\Polyfills\AssertObjectProperty`
430430

@@ -437,8 +437,8 @@ These methods were introduced in PHPUnit 10.1.0 as alternatives to the `Assert::
437437

438438
These methods were later backported to the PHPUnit 9 branch and included in the PHPUnit 9.6.11 release.
439439

440-
[`Assert::assertObjectHasProperty()`]: https://docs.phpunit.de/en/main/assertions.html#assertObjectHasProperty
441-
[`Assert::assertObjectNotHasProperty()`]: https://docs.phpunit.de/en/main/assertions.html#assertObjectHasProperty
440+
[`Assert::assertObjectHasProperty()`]: https://docs.phpunit.de/en/10.5/assertions.html#assertObjectHasProperty
441+
[`Assert::assertObjectNotHasProperty()`]: https://docs.phpunit.de/en/10.5/assertions.html#assertObjectHasProperty
442442

443443

444444
### Helper traits
@@ -478,7 +478,7 @@ self::assertSame( $propertyName, self::getProperty( $objInstance, $propertyName
478478
PHPUnit 8.0.0 introduced a `void` return type declaration to the ["fixture" methods] - `setUpBeforeClass()`, `setUp()`, `tearDown()` and `tearDownAfterClass()`.
479479
As 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.
480480

481-
["fixture" methods]: https://docs.phpunit.de/en/main/fixtures.html
481+
["fixture" methods]: https://docs.phpunit.de/en/10.5/fixtures.html
482482

483483
This library contains two basic `TestCase` options to overcome this issue.
484484

@@ -542,10 +542,10 @@ This `TestCase` overcomes the signature mismatch by using the PHPUnit `@before[C
542542
When using this TestCase, overloaded fixture methods need to use the [`@beforeClass`], [`@before`], [`@after`] and [`@afterClass`] annotations.
543543
The naming of the overloaded methods is open as long as the method names don't conflict with the PHPUnit native method names.
544544

545-
[`@beforeClass`]: https://docs.phpunit.de/en/main/annotations.html#beforeclass
546-
[`@before`]: https://docs.phpunit.de/en/main/annotations.html#before
547-
[`@after`]: https://docs.phpunit.de/en/main/annotations.html#after
548-
[`@afterClass`]: https://docs.phpunit.de/en/main/annotations.html#afterclass
545+
[`@beforeClass`]: https://docs.phpunit.de/en/10.5/annotations.html#beforeclass
546+
[`@before`]: https://docs.phpunit.de/en/10.5/annotations.html#before
547+
[`@after`]: https://docs.phpunit.de/en/10.5/annotations.html#after
548+
[`@afterClass`]: https://docs.phpunit.de/en/10.5/annotations.html#afterclass
549549

550550
```php
551551
use Yoast\PHPUnitPolyfills\TestCases\XTestCase;

0 commit comments

Comments
 (0)