|
15 | 15 | use PHPUnit\Metadata\DependsOnClass; |
16 | 16 | use PHPUnit\Metadata\DependsOnMethod; |
17 | 17 | use PHPUnit\Metadata\InvalidAttributeException; |
| 18 | +use PHPUnit\Metadata\Repeat; |
18 | 19 | use PHPUnit\Metadata\RequiresEnvironmentVariable; |
19 | 20 | use PHPUnit\Metadata\RequiresPhp; |
20 | 21 | use PHPUnit\Metadata\RequiresPhpExtension; |
|
52 | 53 | use PHPUnit\TestFixture\Metadata\Attribute\PhpunitAttributeThatDoesNotExistTest; |
53 | 54 | use PHPUnit\TestFixture\Metadata\Attribute\PreserveGlobalStateTest; |
54 | 55 | use PHPUnit\TestFixture\Metadata\Attribute\ProcessIsolationTest; |
| 56 | +use PHPUnit\TestFixture\Metadata\Attribute\RepeatTest; |
55 | 57 | use PHPUnit\TestFixture\Metadata\Attribute\RequiresEnvironmentVariableTest; |
56 | 58 | use PHPUnit\TestFixture\Metadata\Attribute\RequiresFunctionTest; |
57 | 59 | use PHPUnit\TestFixture\Metadata\Attribute\RequiresMethodTest; |
@@ -1201,6 +1203,22 @@ public function test_parses_Ticket_attribute_on_method(): void |
1201 | 1203 | $this->assertSame('another-ticket', $metadata->asArray()[1]->groupName()); |
1202 | 1204 | } |
1203 | 1205 |
|
| 1206 | + #[TestDox('Parses #[Repeat] attribute on method')] |
| 1207 | + public function test_parses_Repeat_attribute_on_method(): void |
| 1208 | + { |
| 1209 | + $metadata = $this->parser()->forMethod(RepeatTest::class, 'testOne')->isRepeat(); |
| 1210 | + |
| 1211 | + $this->assertCount(1, $metadata); |
| 1212 | + $this->assertTrue($metadata->asArray()[0]->isRepeat()); |
| 1213 | + |
| 1214 | + $repeat = $metadata->asArray()[0]; |
| 1215 | + |
| 1216 | + assert($repeat instanceof Repeat); |
| 1217 | + |
| 1218 | + $this->assertSame(5, $repeat->times()); |
| 1219 | + $this->assertSame(2, $repeat->failureThreshold()); |
| 1220 | + } |
| 1221 | + |
1204 | 1222 | #[TestDox('Parses #[WithoutErrorHandler] attribute on method')] |
1205 | 1223 | public function test_parses_WithoutErrorHandler_attribute_on_method(): void |
1206 | 1224 | { |
|
0 commit comments