diff --git a/psalm-baseline.xml b/psalm-baseline.xml
index 0982d520..8402f187 100644
--- a/psalm-baseline.xml
+++ b/psalm-baseline.xml
@@ -63,6 +63,7 @@
sleepWithAfterAnnotation
+ sleepWithAfterClassAnnotation
@@ -70,14 +71,21 @@
sleepWithAfterAnnotation
+
+
+ sleepWithAfterClassAnnotation
+
+
sleepWithAfterAnnotation
+ sleepWithAfterClassAnnotation
sleepWithAfterAnnotation
+ sleepWithAfterClassAnnotation
@@ -85,9 +93,15 @@
sleepWithAfterAnnotation
+
+
+ sleepWithAfterClassAnnotation
+
+
sleepWithAfterAnnotation
+ sleepWithAfterClassAnnotation
@@ -115,6 +129,8 @@
provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration
sleepWithAfterAnnotation
sleepWithAfterAttribute
+ sleepWithAfterClassAnnotation
+ sleepWithAfterClassAttribute
@@ -129,6 +145,18 @@
sleepWithAfterAttribute
+
+
+ provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration
+ sleepWithAfterClassAnnotation
+
+
+
+
+ provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration
+ sleepWithAfterClassAttribute
+
+
provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration
@@ -168,12 +196,16 @@
sleepWithAfterAnnotation
sleepWithAfterAttribute
+ sleepWithAfterClassAnnotation
+ sleepWithAfterClassAttribute
sleepWithAfterAnnotation
sleepWithAfterAttribute
+ sleepWithAfterClassAnnotation
+ sleepWithAfterClassAttribute
@@ -200,6 +232,7 @@
provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration
sleepWithAfterAttribute
+ sleepWithAfterClassAttribute
@@ -208,6 +241,12 @@
sleepWithAfterAttribute
+
+
+ provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration
+ sleepWithAfterClassAttribute
+
+
provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration
@@ -246,6 +285,7 @@
sleepWithAfterAttribute
+ sleepWithAfterClassAttribute
diff --git a/test/EndToEnd/Version08/TestCase/Combination/SleeperTest.php b/test/EndToEnd/Version08/TestCase/Combination/SleeperTest.php
index 96db98e1..59c53b7c 100644
--- a/test/EndToEnd/Version08/TestCase/Combination/SleeperTest.php
+++ b/test/EndToEnd/Version08/TestCase/Combination/SleeperTest.php
@@ -59,6 +59,14 @@ public function sleepWithAfterAnnotation(): void
Test\Fixture\Sleeper::fromMilliseconds(100)->sleep();
}
+ /**
+ * @afterClass
+ */
+ public static function sleepWithAfterClassAnnotation(): void
+ {
+ Test\Fixture\Sleeper::fromMilliseconds(100)->sleep();
+ }
+
public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void
{
$milliseconds = 10;
diff --git a/test/EndToEnd/Version08/TestCase/WithAfterClassAnnotation/SleeperTest.php b/test/EndToEnd/Version08/TestCase/WithAfterClassAnnotation/SleeperTest.php
new file mode 100644
index 00000000..754e6e24
--- /dev/null
+++ b/test/EndToEnd/Version08/TestCase/WithAfterClassAnnotation/SleeperTest.php
@@ -0,0 +1,72 @@
+sleep();
+ }
+
+ public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void
+ {
+ $milliseconds = 10;
+
+ $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds);
+
+ $sleeper->sleep();
+
+ self::assertSame($milliseconds, $sleeper->milliseconds());
+ }
+
+ /**
+ * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration
+ */
+ public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void
+ {
+ $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds);
+
+ $sleeper->sleep();
+
+ self::assertSame($milliseconds, $sleeper->milliseconds());
+ }
+
+ /**
+ * @return \Generator
+ */
+ public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable
+ {
+ $values = \range(
+ 200,
+ 300,
+ 100,
+ );
+
+ foreach ($values as $value) {
+ yield $value => [
+ $value,
+ ];
+ }
+ }
+}
diff --git a/test/EndToEnd/Version08/TestCase/WithAfterClassAnnotation/phpunit.xml b/test/EndToEnd/Version08/TestCase/WithAfterClassAnnotation/phpunit.xml
new file mode 100644
index 00000000..c7b6adaa
--- /dev/null
+++ b/test/EndToEnd/Version08/TestCase/WithAfterClassAnnotation/phpunit.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+ 100
+
+
+
+
+
+
+
+ .
+
+
+
diff --git a/test/EndToEnd/Version08/TestCase/WithAfterClassAnnotation/test.phpt b/test/EndToEnd/Version08/TestCase/WithAfterClassAnnotation/test.phpt
new file mode 100644
index 00000000..07c6c112
--- /dev/null
+++ b/test/EndToEnd/Version08/TestCase/WithAfterClassAnnotation/test.phpt
@@ -0,0 +1,30 @@
+--TEST--
+With a test case that sleeps in a method with @afterClass annotation
+--FILE--
+sleep();
}
+ /**
+ * @afterClass
+ */
+ public static function sleepWithAfterClassAnnotation(): void
+ {
+ Test\Fixture\Sleeper::fromMilliseconds(100)->sleep();
+ }
+
public function testSleeperSleepsShorterThanMaximumDurationFromXmlConfiguration(): void
{
$milliseconds = 10;
diff --git a/test/EndToEnd/Version08/TestMethod/WithRunInSeparateProcessAnnotation/test.phpt b/test/EndToEnd/Version08/TestMethod/WithRunInSeparateProcessAnnotation/test.phpt
index bd53055e..4102205c 100644
--- a/test/EndToEnd/Version08/TestMethod/WithRunInSeparateProcessAnnotation/test.phpt
+++ b/test/EndToEnd/Version08/TestMethod/WithRunInSeparateProcessAnnotation/test.phpt
@@ -27,8 +27,8 @@ Configuration: %s/EndToEnd/Version08/TestMethod/WithRunInSeparateProcessAnnotati
Detected 4 tests that took longer than expected.
-1. 1.0%s (0.100) Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\Version08\TestMethod\WithRunInSeparateProcessAnnotation\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWhenMethodHasRunInSeparateProcessAnnotation
-2. 0.7%s (0.100) Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\Version08\TestMethod\WithRunInSeparateProcessAnnotation\SleeperTest::testSleeperSleepsShorterThanMaximumDurationFromXmlConfigurationWhenMethodHasRunInSeparateProcessAnnotation
+1. 1.1%s (0.100) Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\Version08\TestMethod\WithRunInSeparateProcessAnnotation\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWhenMethodHasRunInSeparateProcessAnnotation
+2. 0.8%s (0.100) Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\Version08\TestMethod\WithRunInSeparateProcessAnnotation\SleeperTest::testSleeperSleepsShorterThanMaximumDurationFromXmlConfigurationWhenMethodHasRunInSeparateProcessAnnotation
3. 0.7%s (0.100) Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\Version08\TestMethod\WithRunInSeparateProcessAnnotation\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfiguration
4. 0.5%s (0.100) Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\Version08\TestMethod\WithRunInSeparateProcessAnnotation\SleeperTest::testSleeperSleepsShorterThanMaximumDurationFromXmlConfiguration
diff --git a/test/EndToEnd/Version09/TestCase/Combination/SleeperTest.php b/test/EndToEnd/Version09/TestCase/Combination/SleeperTest.php
index 52212a91..b145ac61 100644
--- a/test/EndToEnd/Version09/TestCase/Combination/SleeperTest.php
+++ b/test/EndToEnd/Version09/TestCase/Combination/SleeperTest.php
@@ -59,6 +59,14 @@ public function sleepWithAfterAnnotation(): void
Test\Fixture\Sleeper::fromMilliseconds(100)->sleep();
}
+ /**
+ * @afterClass
+ */
+ public static function sleepWithAfterClassAnnotation(): void
+ {
+ Test\Fixture\Sleeper::fromMilliseconds(100)->sleep();
+ }
+
public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void
{
$milliseconds = 10;
diff --git a/test/EndToEnd/Version09/TestCase/WithAfterClassAnnotation/SleeperTest.php b/test/EndToEnd/Version09/TestCase/WithAfterClassAnnotation/SleeperTest.php
new file mode 100644
index 00000000..95dae1ed
--- /dev/null
+++ b/test/EndToEnd/Version09/TestCase/WithAfterClassAnnotation/SleeperTest.php
@@ -0,0 +1,72 @@
+sleep();
+ }
+
+ public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void
+ {
+ $milliseconds = 10;
+
+ $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds);
+
+ $sleeper->sleep();
+
+ self::assertSame($milliseconds, $sleeper->milliseconds());
+ }
+
+ /**
+ * @dataProvider provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration
+ */
+ public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void
+ {
+ $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds);
+
+ $sleeper->sleep();
+
+ self::assertSame($milliseconds, $sleeper->milliseconds());
+ }
+
+ /**
+ * @return \Generator
+ */
+ public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable
+ {
+ $values = \range(
+ 200,
+ 300,
+ 100,
+ );
+
+ foreach ($values as $value) {
+ yield $value => [
+ $value,
+ ];
+ }
+ }
+}
diff --git a/test/EndToEnd/Version09/TestCase/WithAfterClassAnnotation/phpunit.xml b/test/EndToEnd/Version09/TestCase/WithAfterClassAnnotation/phpunit.xml
new file mode 100644
index 00000000..7f7ff83b
--- /dev/null
+++ b/test/EndToEnd/Version09/TestCase/WithAfterClassAnnotation/phpunit.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+ 100
+
+
+
+
+
+
+
+ .
+
+
+
diff --git a/test/EndToEnd/Version09/TestCase/WithAfterClassAnnotation/test.phpt b/test/EndToEnd/Version09/TestCase/WithAfterClassAnnotation/test.phpt
new file mode 100644
index 00000000..feb3cbce
--- /dev/null
+++ b/test/EndToEnd/Version09/TestCase/WithAfterClassAnnotation/test.phpt
@@ -0,0 +1,30 @@
+--TEST--
+With a test case that sleeps in a method with @afterClass annotation
+--FILE--
+sleep();
}
+ /**
+ * @afterClass
+ */
+ public static function sleepWithAfterClassAnnotation(): void
+ {
+ Test\Fixture\Sleeper::fromMilliseconds(100)->sleep();
+ }
+
public function testSleeperSleepsShorterThanMaximumDurationFromXmlConfiguration(): void
{
$milliseconds = 10;
diff --git a/test/EndToEnd/Version09/TestMethod/WithRunInSeparateProcessAnnotation/test.phpt b/test/EndToEnd/Version09/TestMethod/WithRunInSeparateProcessAnnotation/test.phpt
index fc333230..5234c981 100644
--- a/test/EndToEnd/Version09/TestMethod/WithRunInSeparateProcessAnnotation/test.phpt
+++ b/test/EndToEnd/Version09/TestMethod/WithRunInSeparateProcessAnnotation/test.phpt
@@ -27,8 +27,8 @@ Configuration: %s/EndToEnd/Version09/TestMethod/WithRunInSeparateProcessAnnotati
Detected 4 tests that took longer than expected.
-1. 1.0%s (0.100) Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\Version09\TestMethod\WithRunInSeparateProcessAnnotation\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWhenMethodHasRunInSeparateProcessAnnotation
-2. 0.7%s (0.100) Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\Version09\TestMethod\WithRunInSeparateProcessAnnotation\SleeperTest::testSleeperSleepsShorterThanMaximumDurationFromXmlConfigurationWhenMethodHasRunInSeparateProcessAnnotation
+1. 1.1%s (0.100) Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\Version09\TestMethod\WithRunInSeparateProcessAnnotation\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWhenMethodHasRunInSeparateProcessAnnotation
+2. 0.8%s (0.100) Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\Version09\TestMethod\WithRunInSeparateProcessAnnotation\SleeperTest::testSleeperSleepsShorterThanMaximumDurationFromXmlConfigurationWhenMethodHasRunInSeparateProcessAnnotation
3. 0.7%s (0.100) Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\Version09\TestMethod\WithRunInSeparateProcessAnnotation\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfiguration
4. 0.5%s (0.100) Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\Version09\TestMethod\WithRunInSeparateProcessAnnotation\SleeperTest::testSleeperSleepsShorterThanMaximumDurationFromXmlConfiguration
diff --git a/test/EndToEnd/Version10/TestCase/Combination/SleeperTest.php b/test/EndToEnd/Version10/TestCase/Combination/SleeperTest.php
index 217cca46..df51bc76 100644
--- a/test/EndToEnd/Version10/TestCase/Combination/SleeperTest.php
+++ b/test/EndToEnd/Version10/TestCase/Combination/SleeperTest.php
@@ -63,6 +63,20 @@ public function sleepWithAfterAttribute(): void
Test\Fixture\Sleeper::fromMilliseconds(100)->sleep();
}
+ /**
+ * @afterClass
+ */
+ public function sleepWithAfterClassAnnotation(): void
+ {
+ Test\Fixture\Sleeper::fromMilliseconds(100)->sleep();
+ }
+
+ #[Framework\Attributes\AfterClass]
+ public function sleepWithAfterClassAttribute(): void
+ {
+ Test\Fixture\Sleeper::fromMilliseconds(100)->sleep();
+ }
+
public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void
{
$milliseconds = 10;
diff --git a/test/EndToEnd/Version10/TestCase/WithAfterClassAnnotation/SleeperTest.php b/test/EndToEnd/Version10/TestCase/WithAfterClassAnnotation/SleeperTest.php
new file mode 100644
index 00000000..cacf630a
--- /dev/null
+++ b/test/EndToEnd/Version10/TestCase/WithAfterClassAnnotation/SleeperTest.php
@@ -0,0 +1,68 @@
+sleep();
+ }
+
+ public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void
+ {
+ $milliseconds = 10;
+
+ $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds);
+
+ $sleeper->sleep();
+
+ self::assertSame($milliseconds, $sleeper->milliseconds());
+ }
+
+ #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')]
+ public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void
+ {
+ $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds);
+
+ $sleeper->sleep();
+
+ self::assertSame($milliseconds, $sleeper->milliseconds());
+ }
+
+ /**
+ * @return \Generator
+ */
+ public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable
+ {
+ $values = \range(
+ 200,
+ 300,
+ 100,
+ );
+
+ foreach ($values as $value) {
+ yield $value => [
+ $value,
+ ];
+ }
+ }
+}
diff --git a/test/EndToEnd/Version10/TestCase/WithAfterClassAnnotation/phpunit.xml b/test/EndToEnd/Version10/TestCase/WithAfterClassAnnotation/phpunit.xml
new file mode 100644
index 00000000..1ec47824
--- /dev/null
+++ b/test/EndToEnd/Version10/TestCase/WithAfterClassAnnotation/phpunit.xml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+ .
+
+
+
diff --git a/test/EndToEnd/Version10/TestCase/WithAfterClassAnnotation/test.phpt b/test/EndToEnd/Version10/TestCase/WithAfterClassAnnotation/test.phpt
new file mode 100644
index 00000000..d5a37439
--- /dev/null
+++ b/test/EndToEnd/Version10/TestCase/WithAfterClassAnnotation/test.phpt
@@ -0,0 +1,32 @@
+--TEST--
+With a test case that sleeps in a method with @afterClass annotation
+--FILE--
+run($_SERVER['argv']);
+--EXPECTF--
+PHPUnit %s
+
+Runtime: %s
+Configuration: %s/EndToEnd/Version10/TestCase/WithAfterClassAnnotation/phpunit.xml
+
+... 3 / 3 (100%)
+
+Detected 2 tests that took longer than expected.
+
+1. 0.3%s (0.100) Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\Version10\TestCase\WithAfterClassAnnotation\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider#1
+2. 0.2%s (0.100) Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\Version10\TestCase\WithAfterClassAnnotation\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider#0
+
+Time: %s, Memory: %s
+
+OK (3 tests, 3 assertions)
diff --git a/test/EndToEnd/Version10/TestCase/WithAfterClassAttribute/SleeperTest.php b/test/EndToEnd/Version10/TestCase/WithAfterClassAttribute/SleeperTest.php
new file mode 100644
index 00000000..28cf3879
--- /dev/null
+++ b/test/EndToEnd/Version10/TestCase/WithAfterClassAttribute/SleeperTest.php
@@ -0,0 +1,66 @@
+sleep();
+ }
+
+ public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void
+ {
+ $milliseconds = 10;
+
+ $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds);
+
+ $sleeper->sleep();
+
+ self::assertSame($milliseconds, $sleeper->milliseconds());
+ }
+
+ #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')]
+ public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void
+ {
+ $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds);
+
+ $sleeper->sleep();
+
+ self::assertSame($milliseconds, $sleeper->milliseconds());
+ }
+
+ /**
+ * @return \Generator
+ */
+ public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable
+ {
+ $values = \range(
+ 200,
+ 300,
+ 100,
+ );
+
+ foreach ($values as $value) {
+ yield $value => [
+ $value,
+ ];
+ }
+ }
+}
diff --git a/test/EndToEnd/Version10/TestCase/WithAfterClassAttribute/phpunit.xml b/test/EndToEnd/Version10/TestCase/WithAfterClassAttribute/phpunit.xml
new file mode 100644
index 00000000..1ec47824
--- /dev/null
+++ b/test/EndToEnd/Version10/TestCase/WithAfterClassAttribute/phpunit.xml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+ .
+
+
+
diff --git a/test/EndToEnd/Version10/TestCase/WithAfterClassAttribute/test.phpt b/test/EndToEnd/Version10/TestCase/WithAfterClassAttribute/test.phpt
new file mode 100644
index 00000000..0a1b7991
--- /dev/null
+++ b/test/EndToEnd/Version10/TestCase/WithAfterClassAttribute/test.phpt
@@ -0,0 +1,32 @@
+--TEST--
+With a test case that sleeps in a method with AfterClass attribute
+--FILE--
+run($_SERVER['argv']);
+--EXPECTF--
+PHPUnit %s
+
+Runtime: %s
+Configuration: %s/EndToEnd/Version10/TestCase/WithAfterClassAttribute/phpunit.xml
+
+... 3 / 3 (100%)
+
+Detected 2 tests that took longer than expected.
+
+1. 0.3%s (0.100) Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\Version10\TestCase\WithAfterClassAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider#1
+2. 0.2%s (0.100) Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\Version10\TestCase\WithAfterClassAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider#0
+
+Time: %s, Memory: %s
+
+OK (3 tests, 3 assertions)
diff --git a/test/EndToEnd/Version10/TestMethod/WithRunInSeparateProcessAnnotation/SleeperTest.php b/test/EndToEnd/Version10/TestMethod/WithRunInSeparateProcessAnnotation/SleeperTest.php
index c5ac1032..3042b822 100644
--- a/test/EndToEnd/Version10/TestMethod/WithRunInSeparateProcessAnnotation/SleeperTest.php
+++ b/test/EndToEnd/Version10/TestMethod/WithRunInSeparateProcessAnnotation/SleeperTest.php
@@ -63,6 +63,20 @@ public function sleepWithAfterAttribute(): void
Test\Fixture\Sleeper::fromMilliseconds(100)->sleep();
}
+ /**
+ * @afterClass
+ */
+ public function sleepWithAfterClassAnnotation(): void
+ {
+ Test\Fixture\Sleeper::fromMilliseconds(100)->sleep();
+ }
+
+ #[Framework\Attributes\AfterClass]
+ public function sleepWithAfterClassAttribute(): void
+ {
+ Test\Fixture\Sleeper::fromMilliseconds(100)->sleep();
+ }
+
public function testSleeperSleepsShorterThanMaximumDurationFromXmlConfiguration(): void
{
$milliseconds = 10;
diff --git a/test/EndToEnd/Version10/TestMethod/WithRunInSeparateProcessAttribute/SleeperTest.php b/test/EndToEnd/Version10/TestMethod/WithRunInSeparateProcessAttribute/SleeperTest.php
index 6d7c46b5..2dfab863 100644
--- a/test/EndToEnd/Version10/TestMethod/WithRunInSeparateProcessAttribute/SleeperTest.php
+++ b/test/EndToEnd/Version10/TestMethod/WithRunInSeparateProcessAttribute/SleeperTest.php
@@ -63,6 +63,20 @@ public function sleepWithAfterAttribute(): void
Test\Fixture\Sleeper::fromMilliseconds(100)->sleep();
}
+ /**
+ * @afterClass
+ */
+ public function sleepWithAfterClassAnnotation(): void
+ {
+ Test\Fixture\Sleeper::fromMilliseconds(100)->sleep();
+ }
+
+ #[Framework\Attributes\AfterClass]
+ public function sleepWithAfterClassAttribute(): void
+ {
+ Test\Fixture\Sleeper::fromMilliseconds(100)->sleep();
+ }
+
public function testSleeperSleepsShorterThanMaximumDurationFromXmlConfiguration(): void
{
$milliseconds = 10;
diff --git a/test/EndToEnd/Version11/TestCase/Combination/SleeperTest.php b/test/EndToEnd/Version11/TestCase/Combination/SleeperTest.php
index 00bd09c6..48c68718 100644
--- a/test/EndToEnd/Version11/TestCase/Combination/SleeperTest.php
+++ b/test/EndToEnd/Version11/TestCase/Combination/SleeperTest.php
@@ -55,6 +55,12 @@ public function sleepWithAfterAttribute(): void
Test\Fixture\Sleeper::fromMilliseconds(100)->sleep();
}
+ #[Framework\Attributes\AfterClass]
+ public static function sleepWithAfterClassAttribute(): void
+ {
+ Test\Fixture\Sleeper::fromMilliseconds(100)->sleep();
+ }
+
public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void
{
$milliseconds = 10;
diff --git a/test/EndToEnd/Version11/TestCase/WithAfterClassAttribute/SleeperTest.php b/test/EndToEnd/Version11/TestCase/WithAfterClassAttribute/SleeperTest.php
new file mode 100644
index 00000000..789e5823
--- /dev/null
+++ b/test/EndToEnd/Version11/TestCase/WithAfterClassAttribute/SleeperTest.php
@@ -0,0 +1,66 @@
+sleep();
+ }
+
+ public function testSleeperSleepsLessThanMaximumDurationFromXmlConfiguration(): void
+ {
+ $milliseconds = 10;
+
+ $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds);
+
+ $sleeper->sleep();
+
+ self::assertSame($milliseconds, $sleeper->milliseconds());
+ }
+
+ #[Framework\Attributes\DataProvider('provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration')]
+ public function testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider(int $milliseconds): void
+ {
+ $sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds);
+
+ $sleeper->sleep();
+
+ self::assertSame($milliseconds, $sleeper->milliseconds());
+ }
+
+ /**
+ * @return \Generator
+ */
+ public static function provideMillisecondsGreaterThanMaximumDurationFromXmlConfiguration(): iterable
+ {
+ $values = \range(
+ 200,
+ 300,
+ 100,
+ );
+
+ foreach ($values as $value) {
+ yield $value => [
+ $value,
+ ];
+ }
+ }
+}
diff --git a/test/EndToEnd/Version11/TestCase/WithAfterClassAttribute/phpunit.xml b/test/EndToEnd/Version11/TestCase/WithAfterClassAttribute/phpunit.xml
new file mode 100644
index 00000000..db311762
--- /dev/null
+++ b/test/EndToEnd/Version11/TestCase/WithAfterClassAttribute/phpunit.xml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+ .
+
+
+
diff --git a/test/EndToEnd/Version11/TestCase/WithAfterClassAttribute/test.phpt b/test/EndToEnd/Version11/TestCase/WithAfterClassAttribute/test.phpt
new file mode 100644
index 00000000..ba4697e9
--- /dev/null
+++ b/test/EndToEnd/Version11/TestCase/WithAfterClassAttribute/test.phpt
@@ -0,0 +1,32 @@
+--TEST--
+With a test case that sleeps in a method with AfterClass attribute
+--FILE--
+run($_SERVER['argv']);
+--EXPECTF--
+PHPUnit %s
+
+Runtime: %s
+Configuration: %s/EndToEnd/Version11/TestCase/WithAfterClassAttribute/phpunit.xml
+
+... 3 / 3 (100%)
+
+Detected 2 tests that took longer than expected.
+
+1. 0.3%s (0.100) Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\Version11\TestCase\WithAfterClassAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider#1
+2. 0.2%s (0.100) Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\Version11\TestCase\WithAfterClassAttribute\SleeperTest::testSleeperSleepsLongerThanMaximumDurationFromXmlConfigurationWithDataProvider#0
+
+Time: %s, Memory: %s
+
+OK (3 tests, 3 assertions)
diff --git a/test/EndToEnd/Version11/TestMethod/WithRunInSeparateProcessAttribute/SleeperTest.php b/test/EndToEnd/Version11/TestMethod/WithRunInSeparateProcessAttribute/SleeperTest.php
index 479ed226..2118a994 100644
--- a/test/EndToEnd/Version11/TestMethod/WithRunInSeparateProcessAttribute/SleeperTest.php
+++ b/test/EndToEnd/Version11/TestMethod/WithRunInSeparateProcessAttribute/SleeperTest.php
@@ -55,6 +55,12 @@ public function sleepWithAfterAttribute(): void
Test\Fixture\Sleeper::fromMilliseconds(100)->sleep();
}
+ #[Framework\Attributes\AfterClass]
+ public static function sleepWithAfterClassAttribute(): void
+ {
+ Test\Fixture\Sleeper::fromMilliseconds(100)->sleep();
+ }
+
public function testSleeperSleepsShorterThanMaximumDurationFromXmlConfiguration(): void
{
$milliseconds = 50;