1111use Carbon \Carbon ;
1212use Exception ;
1313use Illuminate \Contracts \Debug \ExceptionHandler ;
14+ use PHPUnit \Framework \Attributes \Test ;
1415use Throwable ;
1516
1617class BasicTest extends Base
1718{
18- /** @test */
19+ #[Test]
1920 public function it_works_with_no_exceptions ()
2021 {
2122 $ result = Flaky::make (__FUNCTION__ )->run (function () {
@@ -29,7 +30,7 @@ public function it_works_with_no_exceptions()
2930 $ this ->assertNull ($ result ->exception );
3031 }
3132
32- /** @test */
33+ #[Test]
3334 public function failures_past_the_deadline_throw ()
3435 {
3536 Carbon::setTestNow ();
@@ -51,7 +52,7 @@ public function failures_past_the_deadline_throw()
5152 });
5253 }
5354
54- /** @test */
55+ #[Test]
5556 public function too_many_consecutive_throw ()
5657 {
5758 $ flaky = Flaky::make (__FUNCTION__ )->allowConsecutiveFailures (5 );
@@ -71,7 +72,7 @@ public function too_many_consecutive_throw()
7172 });
7273 }
7374
74- /** @test */
75+ #[Test]
7576 public function too_many_total_throw ()
7677 {
7778 $ flaky = Flaky::make (__FUNCTION__ )->allowTotalFailures (5 );
@@ -91,7 +92,7 @@ public function too_many_total_throw()
9192 });
9293 }
9394
94- /** @test */
95+ #[Test]
9596 public function reported_instead_of_thrown ()
9697 {
9798 $ handler = new class
@@ -119,7 +120,7 @@ public function report(Throwable $e)
119120 $ this ->assertInstanceOf (Exception::class, $ handler ->reported );
120121 }
121122
122- /** @test */
123+ #[Test]
123124 public function throws_for_unset_specific_exceptions ()
124125 {
125126 $ this ->expectException (Exception::class);
@@ -134,7 +135,7 @@ public function throws_for_unset_specific_exceptions()
134135 });
135136 }
136137
137- /** @test */
138+ #[Test]
138139 public function does_not_throws_for_specific_exceptions ()
139140 {
140141 Carbon::setTestNow ();
@@ -157,7 +158,7 @@ public function does_not_throws_for_specific_exceptions()
157158 });
158159 }
159160
160- /** @test */
161+ #[Test]
161162 public function can_disable ()
162163 {
163164 $ this ->expectException (Exception::class);
@@ -173,7 +174,7 @@ public function can_disable()
173174 config (['app.env ' => 'production ' ]);
174175 }
175176
176- /** @test */
177+ #[Test]
177178 public function can_disable_locally ()
178179 {
179180 Flaky::make (__FUNCTION__ )
@@ -197,7 +198,7 @@ public function can_disable_locally()
197198 });
198199 }
199200
200- /** @test */
201+ #[Test]
201202 public function can_handle_failures_ourselves ()
202203 {
203204 $ caught = null ;
@@ -217,15 +218,15 @@ public function can_handle_failures_ourselves()
217218 $ this ->assertInstanceOf (Exception::class, $ caught );
218219 }
219220
220- /** @test */
221+ #[Test]
221222 public function can_pass_in_our_own_exception ()
222223 {
223224 $ result = Flaky::make (__FUNCTION__ )->handle (new Exception ('Oops ' ));
224225
225226 $ this ->assertInstanceOf (Result::class, $ result );
226227 }
227228
228- /** @test */
229+ #[Test]
229230 public function it_does_not_throw_for_non_exceptions_when_protections_are_bypassed ()
230231 {
231232 $ result = Flaky::make (__FUNCTION__ )
@@ -238,7 +239,7 @@ public function it_does_not_throw_for_non_exceptions_when_protections_are_bypass
238239 $ this ->assertEquals (1 , $ result ->value );
239240 }
240241
241- /** @test */
242+ #[Test]
242243 public function handles_errors_as_well_as_exceptions ()
243244 {
244245 $ result = Flaky::make (__FUNCTION__ )
0 commit comments