Skip to content

Commit 9b5a2e5

Browse files
* Update documentation for TestListener deprecation
* Document that the Hook interfaces will be removed in PHPUnit 10
1 parent c474b4a commit 9b5a2e5

14 files changed

+97
-47
lines changed

src/Framework/TestListener.php

Lines changed: 6 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -12,73 +12,32 @@
1212
use Throwable;
1313

1414
/**
15-
* @deprecated Use the `TestHook` interfaces instead
15+
* This interface, as well as the associated mechanism for extending PHPUnit,
16+
* will be removed in PHPUnit 10. There is no alternative available in this
17+
* version of PHPUnit.
18+
*
19+
* @deprecated
20+
* @see https://github.com/sebastianbergmann/phpunit/issues/4676
1621
*/
1722
interface TestListener
1823
{
19-
/**
20-
* An error occurred.
21-
*
22-
* @deprecated Use `AfterTestErrorHook::executeAfterTestError` instead
23-
*/
2424
public function addError(Test $test, Throwable $t, float $time): void;
2525

26-
/**
27-
* A warning occurred.
28-
*
29-
* @deprecated Use `AfterTestWarningHook::executeAfterTestWarning` instead
30-
*/
3126
public function addWarning(Test $test, Warning $e, float $time): void;
3227

33-
/**
34-
* A failure occurred.
35-
*
36-
* @deprecated Use `AfterTestFailureHook::executeAfterTestFailure` instead
37-
*/
3828
public function addFailure(Test $test, AssertionFailedError $e, float $time): void;
3929

40-
/**
41-
* Incomplete test.
42-
*
43-
* @deprecated Use `AfterIncompleteTestHook::executeAfterIncompleteTest` instead
44-
*/
4530
public function addIncompleteTest(Test $test, Throwable $t, float $time): void;
4631

47-
/**
48-
* Risky test.
49-
*
50-
* @deprecated Use `AfterRiskyTestHook::executeAfterRiskyTest` instead
51-
*/
5232
public function addRiskyTest(Test $test, Throwable $t, float $time): void;
5333

54-
/**
55-
* Skipped test.
56-
*
57-
* @deprecated Use `AfterSkippedTestHook::executeAfterSkippedTest` instead
58-
*/
5934
public function addSkippedTest(Test $test, Throwable $t, float $time): void;
6035

61-
/**
62-
* A test suite started.
63-
*/
6436
public function startTestSuite(TestSuite $suite): void;
6537

66-
/**
67-
* A test suite ended.
68-
*/
6938
public function endTestSuite(TestSuite $suite): void;
7039

71-
/**
72-
* A test started.
73-
*
74-
* @deprecated Use `BeforeTestHook::executeBeforeTest` instead
75-
*/
7640
public function startTest(Test $test): void;
7741

78-
/**
79-
* A test ended.
80-
*
81-
* @deprecated Use `AfterTestHook::executeAfterTest` instead
82-
*/
8342
public function endTest(Test $test, float $time): void;
8443
}

src/Runner/Hook/AfterIncompleteTestHook.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@
99
*/
1010
namespace PHPUnit\Runner;
1111

12+
/**
13+
* This interface, as well as the associated mechanism for extending PHPUnit,
14+
* will be removed in PHPUnit 10. There is no alternative available in this
15+
* version of PHPUnit.
16+
*
17+
* @see https://github.com/sebastianbergmann/phpunit/issues/4676
18+
*/
1219
interface AfterIncompleteTestHook extends TestHook
1320
{
1421
public function executeAfterIncompleteTest(string $test, string $message, float $time): void;

src/Runner/Hook/AfterLastTestHook.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@
99
*/
1010
namespace PHPUnit\Runner;
1111

12+
/**
13+
* This interface, as well as the associated mechanism for extending PHPUnit,
14+
* will be removed in PHPUnit 10. There is no alternative available in this
15+
* version of PHPUnit.
16+
*
17+
* @see https://github.com/sebastianbergmann/phpunit/issues/4676
18+
*/
1219
interface AfterLastTestHook extends Hook
1320
{
1421
public function executeAfterLastTest(): void;

src/Runner/Hook/AfterRiskyTestHook.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@
99
*/
1010
namespace PHPUnit\Runner;
1111

12+
/**
13+
* This interface, as well as the associated mechanism for extending PHPUnit,
14+
* will be removed in PHPUnit 10. There is no alternative available in this
15+
* version of PHPUnit.
16+
*
17+
* @see https://github.com/sebastianbergmann/phpunit/issues/4676
18+
*/
1219
interface AfterRiskyTestHook extends TestHook
1320
{
1421
public function executeAfterRiskyTest(string $test, string $message, float $time): void;

src/Runner/Hook/AfterSkippedTestHook.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@
99
*/
1010
namespace PHPUnit\Runner;
1111

12+
/**
13+
* This interface, as well as the associated mechanism for extending PHPUnit,
14+
* will be removed in PHPUnit 10. There is no alternative available in this
15+
* version of PHPUnit.
16+
*
17+
* @see https://github.com/sebastianbergmann/phpunit/issues/4676
18+
*/
1219
interface AfterSkippedTestHook extends TestHook
1320
{
1421
public function executeAfterSkippedTest(string $test, string $message, float $time): void;

src/Runner/Hook/AfterSuccessfulTestHook.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@
99
*/
1010
namespace PHPUnit\Runner;
1111

12+
/**
13+
* This interface, as well as the associated mechanism for extending PHPUnit,
14+
* will be removed in PHPUnit 10. There is no alternative available in this
15+
* version of PHPUnit.
16+
*
17+
* @see https://github.com/sebastianbergmann/phpunit/issues/4676
18+
*/
1219
interface AfterSuccessfulTestHook extends TestHook
1320
{
1421
public function executeAfterSuccessfulTest(string $test, float $time): void;

src/Runner/Hook/AfterTestErrorHook.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@
99
*/
1010
namespace PHPUnit\Runner;
1111

12+
/**
13+
* This interface, as well as the associated mechanism for extending PHPUnit,
14+
* will be removed in PHPUnit 10. There is no alternative available in this
15+
* version of PHPUnit.
16+
*
17+
* @see https://github.com/sebastianbergmann/phpunit/issues/4676
18+
*/
1219
interface AfterTestErrorHook extends TestHook
1320
{
1421
public function executeAfterTestError(string $test, string $message, float $time): void;

src/Runner/Hook/AfterTestFailureHook.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@
99
*/
1010
namespace PHPUnit\Runner;
1111

12+
/**
13+
* This interface, as well as the associated mechanism for extending PHPUnit,
14+
* will be removed in PHPUnit 10. There is no alternative available in this
15+
* version of PHPUnit.
16+
*
17+
* @see https://github.com/sebastianbergmann/phpunit/issues/4676
18+
*/
1219
interface AfterTestFailureHook extends TestHook
1320
{
1421
public function executeAfterTestFailure(string $test, string $message, float $time): void;

src/Runner/Hook/AfterTestHook.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@
99
*/
1010
namespace PHPUnit\Runner;
1111

12+
/**
13+
* This interface, as well as the associated mechanism for extending PHPUnit,
14+
* will be removed in PHPUnit 10. There is no alternative available in this
15+
* version of PHPUnit.
16+
*
17+
* @see https://github.com/sebastianbergmann/phpunit/issues/4676
18+
*/
1219
interface AfterTestHook extends TestHook
1320
{
1421
/**

src/Runner/Hook/AfterTestWarningHook.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@
99
*/
1010
namespace PHPUnit\Runner;
1111

12+
/**
13+
* This interface, as well as the associated mechanism for extending PHPUnit,
14+
* will be removed in PHPUnit 10. There is no alternative available in this
15+
* version of PHPUnit.
16+
*
17+
* @see https://github.com/sebastianbergmann/phpunit/issues/4676
18+
*/
1219
interface AfterTestWarningHook extends TestHook
1320
{
1421
public function executeAfterTestWarning(string $test, string $message, float $time): void;

src/Runner/Hook/BeforeFirstTestHook.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@
99
*/
1010
namespace PHPUnit\Runner;
1111

12+
/**
13+
* This interface, as well as the associated mechanism for extending PHPUnit,
14+
* will be removed in PHPUnit 10. There is no alternative available in this
15+
* version of PHPUnit.
16+
*
17+
* @see https://github.com/sebastianbergmann/phpunit/issues/4676
18+
*/
1219
interface BeforeFirstTestHook extends Hook
1320
{
1421
public function executeBeforeFirstTest(): void;

src/Runner/Hook/BeforeTestHook.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@
99
*/
1010
namespace PHPUnit\Runner;
1111

12+
/**
13+
* This interface, as well as the associated mechanism for extending PHPUnit,
14+
* will be removed in PHPUnit 10. There is no alternative available in this
15+
* version of PHPUnit.
16+
*
17+
* @see https://github.com/sebastianbergmann/phpunit/issues/4676
18+
*/
1219
interface BeforeTestHook extends TestHook
1320
{
1421
public function executeBeforeTest(string $test): void;

src/Runner/Hook/Hook.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@
99
*/
1010
namespace PHPUnit\Runner;
1111

12+
/**
13+
* This interface, as well as the associated mechanism for extending PHPUnit,
14+
* will be removed in PHPUnit 10. There is no alternative available in this
15+
* version of PHPUnit.
16+
*
17+
* @see https://github.com/sebastianbergmann/phpunit/issues/4676
18+
*/
1219
interface Hook
1320
{
1421
}

src/Runner/Hook/TestHook.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@
99
*/
1010
namespace PHPUnit\Runner;
1111

12+
/**
13+
* This interface, as well as the associated mechanism for extending PHPUnit,
14+
* will be removed in PHPUnit 10. There is no alternative available in this
15+
* version of PHPUnit.
16+
*
17+
* @see https://github.com/sebastianbergmann/phpunit/issues/4676
18+
*/
1219
interface TestHook extends Hook
1320
{
1421
}

0 commit comments

Comments
 (0)