From: =?utf-8?q?David_Pr=C3=A9vot?= <taffit@debian.org>
Date: Sat, 30 Aug 2025 11:47:59 +0200
Subject: Compatibility with recent PHPUnit (12)

---
 .../Phpunit/MockeryPHPUnitIntegrationTest.php      |  9 ++--
 tests/Mockery/AllowsExpectsSyntaxTest.php          | 21 ++++----
 tests/Mockery/CallableSpyTest.php                  | 33 +++++++------
 tests/Mockery/ContainerTest.php                    | 25 +++++-----
 tests/Mockery/ExpectationTest.php                  |  7 +--
 tests/Mockery/Generator/DefinedTargetClassTest.php |  3 +-
 .../Generator/MockConfigurationBuilderTest.php     | 11 ++---
 tests/Mockery/Generator/MockConfigurationTest.php  | 49 +++++--------------
 .../Pass/CallTypeHintPassTest.php                  |  9 ++--
 .../Pass/ClassAttributesPassTest.php               |  4 +-
 .../StringManipulation/Pass/ClassNamePassTest.php  | 17 ++-----
 .../StringManipulation/Pass/ClassPassTest.php      |  5 +-
 .../StringManipulation/Pass/ConstantsPassTest.php  |  5 +-
 .../Pass/InstanceMockPassTest.php                  |  5 +-
 .../StringManipulation/Pass/InterfacePassTest.php  |  9 ++--
 tests/Mockery/GlobalHelpersTest.php                |  7 +--
 tests/Mockery/Loader/LoaderTestCase.php            |  5 +-
 tests/Mockery/Matcher/HasKeyTest.php               |  7 +--
 tests/Mockery/Matcher/HasValueTest.php             |  7 +--
 tests/Mockery/Matcher/IsEqualTest.php              |  3 +-
 tests/Mockery/Matcher/IsSameTest.php               |  3 +-
 tests/Mockery/Matcher/SubsetTest.php               | 13 ++---
 tests/Mockery/MockClassWithFinalToStringTest.php   |  4 +-
 tests/Mockery/MockClassWithFinalWakeupTest.php     |  4 +-
 tests/Mockery/MockClassWithUnknownTypeHintTest.php |  3 +-
 tests/Mockery/MockTest.php                         |  7 +--
 ...keryCanMockClassesWithSemiReservedWordsTest.php |  5 +-
 ...ryCanMockMultipleInterfacesWhichOverlapTest.php |  3 +-
 tests/Mockery/MockingAllLowerCasedMethodsTest.php  |  3 +-
 tests/Mockery/MockingClassConstantsTest.php        |  3 +-
 .../MockingMethodsWithIterableTypeHintsTest.php    |  3 +-
 .../MockingMethodsWithNullableParametersTest.php   |  5 +-
 tests/Mockery/MockingNullableMethodsTest.php       | 57 +++++++---------------
 tests/Mockery/MockingProtectedMethodsTest.php      | 17 +++----
 tests/Mockery/MockingVariadicArgumentsTest.php     |  3 +-
 tests/Mockery/MockingVoidMethodsTest.php           |  5 +-
 tests/Mockery/NamedMockTest.php                    | 11 +++--
 tests/Mockery/ProxyMockingTest.php                 |  7 +--
 tests/Mockery/ReflectorTest.php                    |  7 ++-
 tests/Mockery/SpyTest.php                          | 25 +++++-----
 tests/Mockery/TraitsTest.php                       |  7 +--
 .../Mockery/WithCustomFormatterExpectationTest.php |  9 ++--
 tests/Mockery/WithFormatterExpectationTest.php     |  8 +--
 tests/PHP80/Php80LanguageFeaturesTest.php          | 15 +++---
 tests/PHP81/Php81LanguageFeaturesTest.php          | 28 +++++------
 tests/PHP82/Php82LanguageFeaturesTest.php          |  3 +-
 tests/Unit/PHP82/Php82LanguageFeaturesTest.php     |  5 +-
 tests/Unit/Regression/Issue1404Test.php            | 17 ++-----
 48 files changed, 230 insertions(+), 291 deletions(-)

diff --git a/tests/Mockery/Adapter/Phpunit/MockeryPHPUnitIntegrationTest.php b/tests/Mockery/Adapter/Phpunit/MockeryPHPUnitIntegrationTest.php
index 7924508..d7a84f8 100644
--- a/tests/Mockery/Adapter/Phpunit/MockeryPHPUnitIntegrationTest.php
+++ b/tests/Mockery/Adapter/Phpunit/MockeryPHPUnitIntegrationTest.php
@@ -6,6 +6,7 @@ use Mockery as m;
 use Mockery\Adapter\Phpunit\MockeryPHPUnitIntegration;
 use Mockery\Adapter\Phpunit\MockeryTestCase;
 use Mockery\Exception\BadMethodCallException;
+use PHPUnit\Framework\Attributes\Test;
 
 class BaseClassStub
 {
@@ -23,9 +24,7 @@ class BaseClassStub
 
 class MockeryPHPUnitIntegrationTest extends MockeryTestCase
 {
-    /**
-     * @test
-     */
+    #[Test]
     public function it_marks_a_passing_test_as_risky_if_we_threw_exceptions()
     {
         $mock = mock();
@@ -41,9 +40,7 @@ class MockeryPHPUnitIntegrationTest extends MockeryTestCase
         $test->shouldHaveReceived()->markAsRisky();
     }
 
-    /**
-     * @test
-     */
+    #[Test]
     public function the_user_can_manually_dismiss_an_exception_to_avoid_the_risky_test()
     {
         $mock = mock();
diff --git a/tests/Mockery/AllowsExpectsSyntaxTest.php b/tests/Mockery/AllowsExpectsSyntaxTest.php
index 0e4b553..d2a1657 100644
--- a/tests/Mockery/AllowsExpectsSyntaxTest.php
+++ b/tests/Mockery/AllowsExpectsSyntaxTest.php
@@ -24,6 +24,7 @@ namespace test\Mockery;
 use Mockery;
 use Mockery\Spy;
 use Mockery\Exception\InvalidCountException;
+use PHPUnit\Framework\Attributes\Test;
 use PHPUnit\Framework\TestCase;
 
 class ClassWithAllowsMethod
@@ -45,7 +46,7 @@ class ClassWithExpectsMethod
 
 class AllowsExpectsSyntaxTest extends Mockery\Adapter\Phpunit\MockeryTestCase
 {
-    /** @test */
+    #[Test]
     public function allowsSetsUpMethodStub()
     {
         $stub = Mockery::mock();
@@ -54,7 +55,7 @@ class AllowsExpectsSyntaxTest extends Mockery\Adapter\Phpunit\MockeryTestCase
         $this->assertEquals(456, $stub->foo(123));
     }
 
-    /** @test */
+    #[Test]
     public function allowsCanTakeAnArrayOfCalls()
     {
         $stub = Mockery::mock();
@@ -67,7 +68,7 @@ class AllowsExpectsSyntaxTest extends Mockery\Adapter\Phpunit\MockeryTestCase
         $this->assertEquals("baz", $stub->bar());
     }
 
-    /** @test */
+    #[Test]
     public function allowsCanTakeAString()
     {
         $stub = Mockery::mock();
@@ -75,7 +76,7 @@ class AllowsExpectsSyntaxTest extends Mockery\Adapter\Phpunit\MockeryTestCase
         $this->assertEquals("bar", $stub->foo());
     }
 
-    /** @test */
+    #[Test]
     public function expects_can_optionally_match_on_any_arguments()
     {
         $mock = Mockery::mock();
@@ -84,7 +85,7 @@ class AllowsExpectsSyntaxTest extends Mockery\Adapter\Phpunit\MockeryTestCase
         $this->assertEquals(123, $mock->foo(456, 789));
     }
 
-    /** @test */
+    #[Test]
     public function expects_can_take_a_string()
     {
         $mock = Mockery::mock();
@@ -93,7 +94,7 @@ class AllowsExpectsSyntaxTest extends Mockery\Adapter\Phpunit\MockeryTestCase
         $this->assertEquals(123, $mock->foo(456, 789));
     }
 
-    /** @test */
+    #[Test]
     public function expectsSetsUpExpectationOfOneCall()
     {
         $mock = Mockery::mock();
@@ -103,7 +104,7 @@ class AllowsExpectsSyntaxTest extends Mockery\Adapter\Phpunit\MockeryTestCase
         Mockery::close();
     }
 
-    /** @test */
+    #[Test]
     public function callVerificationCountCanBeOverridenAfterExpectsThrowsExceptionWhenIncorrectNumberOfCalls()
     {
         $mock = Mockery::mock();
@@ -114,7 +115,7 @@ class AllowsExpectsSyntaxTest extends Mockery\Adapter\Phpunit\MockeryTestCase
         Mockery::close();
     }
 
-    /** @test */
+    #[Test]
     public function callVerificationCountCanBeOverridenAfterExpects()
     {
         $mock = Mockery::mock();
@@ -124,7 +125,7 @@ class AllowsExpectsSyntaxTest extends Mockery\Adapter\Phpunit\MockeryTestCase
         $mock->foo(123);
     }
 
-    /** @test */
+    #[Test]
     public function generateSkipsAllowsMethodIfAlreadyExists()
     {
         $stub = Mockery::mock("test\Mockery\ClassWithAllowsMethod");
@@ -134,7 +135,7 @@ class AllowsExpectsSyntaxTest extends Mockery\Adapter\Phpunit\MockeryTestCase
         $this->assertEquals(123, $stub->allows());
     }
 
-    /** @test */
+    #[Test]
     public function generateSkipsExpectsMethodIfAlreadyExists()
     {
         $stub = Mockery::mock("test\Mockery\ClassWithExpectsMethod");
diff --git a/tests/Mockery/CallableSpyTest.php b/tests/Mockery/CallableSpyTest.php
index df74dec..76c4bf4 100644
--- a/tests/Mockery/CallableSpyTest.php
+++ b/tests/Mockery/CallableSpyTest.php
@@ -23,10 +23,11 @@ namespace test\Mockery;
 
 use Mockery\Adapter\Phpunit\MockeryTestCase;
 use Mockery\Exception\InvalidCountException;
+use PHPUnit\Framework\Attributes\Test;
 
 class CallableSpyTest extends MockeryTestCase
 {
-    /** @test */
+    #[Test]
     public function it_verifies_the_closure_was_called()
     {
         $spy = spy(function () {});
@@ -36,7 +37,7 @@ class CallableSpyTest extends MockeryTestCase
         $spy->shouldHaveBeenCalled();
     }
 
-    /** @test */
+    #[Test]
     public function it_throws_if_the_callable_was_not_called_at_all()
     {
         $spy = spy(function () {});
@@ -45,7 +46,7 @@ class CallableSpyTest extends MockeryTestCase
         $spy->shouldHaveBeenCalled();
     }
 
-    /** @test */
+    #[Test]
     public function it_throws_if_there_were_no_arguments_but_we_expected_some()
     {
         $spy = spy(function () {});
@@ -56,7 +57,7 @@ class CallableSpyTest extends MockeryTestCase
         $spy->shouldHaveBeenCalled()->with(123, 546);
     }
 
-    /** @test */
+    #[Test]
     public function it_throws_if_the_arguments_do_not_match()
     {
         $spy = spy(function () {});
@@ -67,7 +68,7 @@ class CallableSpyTest extends MockeryTestCase
         $spy->shouldHaveBeenCalled()->with(123, 546);
     }
 
-    /** @test */
+    #[Test]
     public function it_verifies_the_closure_was_not_called()
     {
         $spy = spy(function () {});
@@ -75,7 +76,7 @@ class CallableSpyTest extends MockeryTestCase
         $spy->shouldNotHaveBeenCalled();
     }
 
-    /** @test */
+    #[Test]
     public function it_throws_if_it_was_called_when_we_expected_it_to_not_have_been_called()
     {
         $spy = spy(function () {});
@@ -86,7 +87,7 @@ class CallableSpyTest extends MockeryTestCase
         $spy->shouldNotHaveBeenCalled();
     }
 
-    /** @test */
+    #[Test]
     public function it_verifies_it_was_not_called_with_some_particular_arguments_when_called_with_no_args()
     {
         $spy = spy(function () {});
@@ -96,7 +97,7 @@ class CallableSpyTest extends MockeryTestCase
         $spy->shouldNotHaveBeenCalled([123]);
     }
 
-    /** @test */
+    #[Test]
     public function it_verifies_it_was_not_called_with_some_particular_arguments_when_called_with_different_args()
     {
         $spy = spy(function () {});
@@ -106,7 +107,7 @@ class CallableSpyTest extends MockeryTestCase
         $spy->shouldNotHaveBeenCalled([123]);
     }
 
-    /** @test */
+    #[Test]
     public function it_throws_if_it_was_called_with_the_args_we_were_not_expecting()
     {
         $spy = spy(function () {});
@@ -117,7 +118,7 @@ class CallableSpyTest extends MockeryTestCase
         $spy->shouldNotHaveBeenCalled([123]);
     }
 
-    /** @test */
+    #[Test]
     public function it_can_verify_it_was_called_a_number_of_times()
     {
         $spy = spy(function () {});
@@ -128,7 +129,7 @@ class CallableSpyTest extends MockeryTestCase
         $spy->shouldHaveBeenCalled()->twice();
     }
 
-    /** @test */
+    #[Test]
     public function it_can_verify_it_was_called_a_number_of_times_with_particular_arguments()
     {
         $spy = spy(function () {});
@@ -139,7 +140,7 @@ class CallableSpyTest extends MockeryTestCase
         $spy->shouldHaveBeenCalled()->with(123)->twice();
     }
 
-    /** @test */
+    #[Test]
     public function it_throws_if_it_was_called_less_than_the_number_of_times_we_expected()
     {
         $spy = spy(function () {});
@@ -150,7 +151,7 @@ class CallableSpyTest extends MockeryTestCase
         $spy->shouldHaveBeenCalled()->twice();
     }
 
-    /** @test */
+    #[Test]
     public function it_throws_if_it_was_called_less_than_the_number_of_times_we_expected_with_particular_arguments()
     {
         $spy = spy(function () {});
@@ -162,7 +163,7 @@ class CallableSpyTest extends MockeryTestCase
         $spy->shouldHaveBeenCalled()->with(123)->twice();
     }
 
-    /** @test */
+    #[Test]
     public function it_throws_if_it_was_called_more_than_the_number_of_times_we_expected()
     {
         $spy = spy(function () {});
@@ -175,7 +176,7 @@ class CallableSpyTest extends MockeryTestCase
         $spy->shouldHaveBeenCalled()->twice();
     }
 
-    /** @test */
+    #[Test]
     public function it_throws_if_it_was_called_more_than_the_number_of_times_we_expected_with_particular_arguments()
     {
         $spy = spy(function () {});
@@ -188,7 +189,7 @@ class CallableSpyTest extends MockeryTestCase
         $spy->shouldHaveBeenCalled()->with(123)->twice();
     }
 
-    /** @test */
+    #[Test]
     public function it_acts_as_partial()
     {
         $spy = spy(function ($number) { return $number + 1;});
diff --git a/tests/Mockery/ContainerTest.php b/tests/Mockery/ContainerTest.php
index ca4141a..265aec9 100644
--- a/tests/Mockery/ContainerTest.php
+++ b/tests/Mockery/ContainerTest.php
@@ -23,6 +23,9 @@ use Mockery\Generator\MockConfigurationBuilder;
 use Mockery\Adapter\Phpunit\MockeryTestCase;
 use Mockery\MockInterface;
 use Mockery\Exception\BadMethodCallException;
+use PHPUnit\Framework\Attributes\DataProvider;
+use PHPUnit\Framework\Attributes\RequiresPhp;
+use PHPUnit\Framework\Attributes\Test;
 use test\Mockery\RegExpCompatability;
 
 class ContainerTest extends MockeryTestCase
@@ -1120,9 +1123,7 @@ class ContainerTest extends MockeryTestCase
         $m->foo();
     }
 
-    /**
-     * @requires PHP < 8.0
-     */
+    #[RequiresPhp('< 8.0')]
     public function testMockingIteratorAggregateDoesNotImplementIterator()
     {
         $mock = mock('MockeryTest_ImplementsIteratorAggregate');
@@ -1161,9 +1162,7 @@ class ContainerTest extends MockeryTestCase
         $this->assertInstanceOf('Traversable', $mock);
     }
 
-    /**
-     * @requires PHP < 8.0
-     */
+    #[RequiresPhp('< 8.0')]
     public function testMockingIteratorDoesNotImplementIterator()
     {
         $mock = mock('MockeryTest_ImplementsIterator');
@@ -1274,9 +1273,9 @@ class ContainerTest extends MockeryTestCase
     }
 
     /**
-     * @test
      * @group issue/294
      */
+    #[Test]
     public function testThrowsWhenNamedMockClassExistsAndIsNotMockery()
     {
         $builder = new MockConfigurationBuilder();
@@ -1380,9 +1379,9 @@ class ContainerTest extends MockeryTestCase
     }
 
     /**
-     * @test
      * @group issue/339
      */
+    #[Test]
     public function canMockClassesThatDescendFromInternalClasses()
     {
         $mock = mock("MockeryTest_ClassThatDescendsFromInternalClass");
@@ -1390,10 +1389,10 @@ class ContainerTest extends MockeryTestCase
     }
 
     /**
-     * @test
      * @group issue/339
-     * @requires PHP <8.1
      */
+    #[RequiresPhp('< 8.1')]
+    #[Test]
     public function canMockClassesThatImplementSerializable()
     {
         $mock = mock("MockeryTest_ClassThatImplementsSerializable");
@@ -1401,18 +1400,16 @@ class ContainerTest extends MockeryTestCase
     }
 
     /**
-     * @test
      * @group issue/346
      */
+    #[Test]
     public function canMockInternalClassesThatImplementSerializable()
     {
         $mock = mock("ArrayObject");
         $this->assertInstanceOf("Serializable", $mock);
     }
 
-    /**
-     * @dataProvider classNameProvider
-     */
+    #[DataProvider('classNameProvider')]
     public function testIsValidClassName($expected, $className)
     {
         $container = new \Mockery\Container();
diff --git a/tests/Mockery/ExpectationTest.php b/tests/Mockery/ExpectationTest.php
index 7dab9dc..bfae453 100644
--- a/tests/Mockery/ExpectationTest.php
+++ b/tests/Mockery/ExpectationTest.php
@@ -22,6 +22,7 @@
 use Mockery\Adapter\Phpunit\MockeryTestCase;
 use Mockery\Exception\InvalidCountException;
 use Mockery\MockInterface;
+use PHPUnit\Framework\Attributes\Test;
 use test\Mockery\RegExpCompatability;
 
 class ExpectationTest extends MockeryTestCase
@@ -301,7 +302,7 @@ class ExpectationTest extends MockeryTestCase
         Mockery::close();
     }
 
-    /** @test */
+    #[Test]
     public function and_throws_is_an_alias_to_and_throw()
     {
         $this->mock->shouldReceive('foo')->andThrows(new OutOfBoundsException());
@@ -310,7 +311,7 @@ class ExpectationTest extends MockeryTestCase
         $this->mock->foo();
     }
 
-    /** @test */
+    #[Test]
     public function it_can_throw_a_throwable()
     {
         $this->expectException(\Error::class);
@@ -2144,7 +2145,7 @@ class ExpectationTest extends MockeryTestCase
         Mockery::close();
     }
 
-    /** @test */
+    #[Test]
     public function it_uses_a_matchers_to_string_method_in_the_exception_output()
     {
         $mock = Mockery::mock();
diff --git a/tests/Mockery/Generator/DefinedTargetClassTest.php b/tests/Mockery/Generator/DefinedTargetClassTest.php
index bed7171..ab53af1 100644
--- a/tests/Mockery/Generator/DefinedTargetClassTest.php
+++ b/tests/Mockery/Generator/DefinedTargetClassTest.php
@@ -22,11 +22,12 @@
 namespace Mockery;
 
 use Mockery\Generator\DefinedTargetClass;
+use PHPUnit\Framework\Attributes\Test;
 use PHPUnit\Framework\TestCase;
 
 class DefinedTargetClassTest extends TestCase
 {
-    /** @test */
+    #[Test]
     public function it_knows_if_one_of_its_ancestors_is_internal()
     {
         $target = new DefinedTargetClass(new \ReflectionClass("ArrayObject"));
diff --git a/tests/Mockery/Generator/MockConfigurationBuilderTest.php b/tests/Mockery/Generator/MockConfigurationBuilderTest.php
index b950e42..5d47538 100644
--- a/tests/Mockery/Generator/MockConfigurationBuilderTest.php
+++ b/tests/Mockery/Generator/MockConfigurationBuilderTest.php
@@ -23,13 +23,12 @@ namespace tests\Mockery\Generator;
 
 use Mockery as m;
 use Mockery\Generator\MockConfigurationBuilder;
+use PHPUnit\Framework\Attributes\Test;
 use PHPUnit\Framework\TestCase;
 
 class MockConfigurationBuilderTest extends TestCase
 {
-    /**
-     * @test
-     */
+    #[Test]
     public function reservedWordsAreBlackListedByDefault()
     {
         $builder = new MockConfigurationBuilder();
@@ -39,9 +38,7 @@ class MockConfigurationBuilderTest extends TestCase
         $this->markTestSkipped("Need a builtin class with a method that is a reserved word");
     }
 
-    /**
-     * @test
-     */
+    #[Test]
     public function magicMethodsAreBlackListedByDefault()
     {
         $builder = new MockConfigurationBuilder();
@@ -51,7 +48,7 @@ class MockConfigurationBuilderTest extends TestCase
         $this->assertEquals("foo", $methods[0]->getName());
     }
 
-    /** @test */
+    #[Test]
     public function xdebugs_debug_info_is_black_listed_by_default()
     {
         $builder = new MockConfigurationBuilder();
diff --git a/tests/Mockery/Generator/MockConfigurationTest.php b/tests/Mockery/Generator/MockConfigurationTest.php
index 75f1f01..fc45d88 100644
--- a/tests/Mockery/Generator/MockConfigurationTest.php
+++ b/tests/Mockery/Generator/MockConfigurationTest.php
@@ -21,13 +21,12 @@
 
 namespace Mockery\Generator;
 
+use PHPUnit\Framework\Attributes\Test;
 use PHPUnit\Framework\TestCase;
 
 class MockConfigurationTest extends TestCase
 {
-    /**
-     * @test
-     */
+    #[Test]
     public function blackListedMethodsShouldNotBeInListToBeMocked()
     {
         $config = new MockConfiguration(array("Mockery\Generator\\TestSubject"), array("foo"));
@@ -37,9 +36,7 @@ class MockConfigurationTest extends TestCase
         $this->assertEquals("bar", $methods[0]->getName());
     }
 
-    /**
-     * @test
-     */
+    #[Test]
     public function blackListsAreCaseInsensitive()
     {
         $config = new MockConfiguration(array("Mockery\Generator\\TestSubject"), array("FOO"));
@@ -50,9 +47,7 @@ class MockConfigurationTest extends TestCase
     }
 
 
-    /**
-     * @test
-     */
+    #[Test]
     public function onlyWhiteListedMethodsShouldBeInListToBeMocked()
     {
         $config = new MockConfiguration(array("Mockery\Generator\\TestSubject"), array(), array('foo'));
@@ -62,9 +57,7 @@ class MockConfigurationTest extends TestCase
         $this->assertEquals("foo", $methods[0]->getName());
     }
 
-    /**
-     * @test
-     */
+    #[Test]
     public function whitelistOverRulesBlackList()
     {
         $config = new MockConfiguration(array("Mockery\Generator\\TestSubject"), array("foo"), array("foo"));
@@ -74,9 +67,7 @@ class MockConfigurationTest extends TestCase
         $this->assertEquals("foo", $methods[0]->getName());
     }
 
-    /**
-     * @test
-     */
+    #[Test]
     public function whiteListsAreCaseInsensitive()
     {
         $config = new MockConfiguration(array("Mockery\Generator\\TestSubject"), array(), array("FOO"));
@@ -86,9 +77,7 @@ class MockConfigurationTest extends TestCase
         $this->assertEquals("foo", $methods[0]->getName());
     }
 
-    /**
-     * @test
-     */
+    #[Test]
     public function finalMethodsAreExcluded()
     {
         $config = new MockConfiguration(array("Mockery\Generator\\ClassWithFinalMethod"));
@@ -98,9 +87,7 @@ class MockConfigurationTest extends TestCase
         $this->assertEquals("bar", $methods[0]->getName());
     }
 
-    /**
-     * @test
-     */
+    #[Test]
     public function shouldIncludeMethodsFromAllTargets()
     {
         $config = new MockConfiguration(array("Mockery\\Generator\\TestInterface", "Mockery\\Generator\\TestInterface2"));
@@ -108,9 +95,7 @@ class MockConfigurationTest extends TestCase
         $this->assertCount(2, $methods);
     }
 
-    /**
-     * @test
-     */
+    #[Test]
     public function shouldThrowIfTargetClassIsFinal()
     {
         $this->expectException(\Mockery\Exception::class);
@@ -118,9 +103,7 @@ class MockConfigurationTest extends TestCase
         $config->getTargetClass();
     }
 
-    /**
-     * @test
-     */
+    #[Test]
     public function shouldTargetIteratorAggregateIfTryingToMockTraversable()
     {
         $config = new MockConfiguration(array("\\Traversable"));
@@ -131,9 +114,7 @@ class MockConfigurationTest extends TestCase
         $this->assertEquals("IteratorAggregate", $first->getName());
     }
 
-    /**
-     * @test
-     */
+    #[Test]
     public function shouldTargetIteratorAggregateIfTraversableInTargetsTree()
     {
         $config = new MockConfiguration(array("Mockery\Generator\TestTraversableInterface"));
@@ -144,9 +125,7 @@ class MockConfigurationTest extends TestCase
         $this->assertEquals("Mockery\Generator\TestTraversableInterface", $interfaces[1]->getName());
     }
 
-    /**
-     * @test
-     */
+    #[Test]
     public function shouldBringIteratorToHeadOfTargetListIfTraversablePresent()
     {
         $config = new MockConfiguration(array("Mockery\Generator\TestTraversableInterface2"));
@@ -157,9 +136,7 @@ class MockConfigurationTest extends TestCase
         $this->assertEquals("Mockery\Generator\TestTraversableInterface2", $interfaces[1]->getName());
     }
 
-    /**
-     * @test
-     */
+    #[Test]
     public function shouldBringIteratorAggregateToHeadOfTargetListIfTraversablePresent()
     {
         $config = new MockConfiguration(array("Mockery\Generator\TestTraversableInterface3"));
diff --git a/tests/Mockery/Generator/StringManipulation/Pass/CallTypeHintPassTest.php b/tests/Mockery/Generator/StringManipulation/Pass/CallTypeHintPassTest.php
index 09fc819..d5450f0 100644
--- a/tests/Mockery/Generator/StringManipulation/Pass/CallTypeHintPassTest.php
+++ b/tests/Mockery/Generator/StringManipulation/Pass/CallTypeHintPassTest.php
@@ -23,6 +23,7 @@ namespace Mockery\Test\Generator\StringManipulation\Pass;
 
 use Mockery as m;
 use Mockery\Generator\StringManipulation\Pass\CallTypeHintPass;
+use PHPUnit\Framework\Attributes\Test;
 use PHPUnit\Framework\TestCase;
 
 class CallTypeHintPassTest extends TestCase
@@ -31,9 +32,7 @@ class CallTypeHintPassTest extends TestCase
                    public static function __callStatic($method, array $args) {}
     ';
 
-    /**
-     * @test
-     */
+    #[Test]
     public function shouldRemoveCallTypeHintIfRequired()
     {
         $pass = new CallTypeHintPass();
@@ -44,9 +43,7 @@ class CallTypeHintPassTest extends TestCase
         $this->assertTrue(\mb_strpos($code, '__call($method, $args)') !== false);
     }
 
-    /**
-     * @test
-     */
+    #[Test]
     public function shouldRemoveCallStaticTypeHintIfRequired()
     {
         $pass = new CallTypeHintPass();
diff --git a/tests/Mockery/Generator/StringManipulation/Pass/ClassAttributesPassTest.php b/tests/Mockery/Generator/StringManipulation/Pass/ClassAttributesPassTest.php
index 72e1b11..76292b4 100644
--- a/tests/Mockery/Generator/StringManipulation/Pass/ClassAttributesPassTest.php
+++ b/tests/Mockery/Generator/StringManipulation/Pass/ClassAttributesPassTest.php
@@ -8,6 +8,7 @@ use Mockery\Adapter\Phpunit\MockeryTestCase;
 use Mockery\Generator\MockConfiguration;
 use Mockery\Generator\StringManipulation\Pass\ClassAttributesPass;
 use Mockery\Generator\UndefinedTargetClass;
+use PHPUnit\Framework\Attributes\DataProvider;
 
 use function mb_strpos;
 
@@ -16,12 +17,11 @@ class ClassAttributesPassTest extends MockeryTestCase
     const CODE = "namespace Mockery; class Mock {}";
 
     /**
-     * @dataProvider providerCanApplyClassAttributes
-     *
      * @param array $attributes
      * @param string $expected
      * @return void
      */
+    #[DataProvider('providerCanApplyClassAttributes')]
     public function testCanApplyClassAttributes(
         array $attributes,
         string $expected
diff --git a/tests/Mockery/Generator/StringManipulation/Pass/ClassNamePassTest.php b/tests/Mockery/Generator/StringManipulation/Pass/ClassNamePassTest.php
index 29a8210..897aa03 100644
--- a/tests/Mockery/Generator/StringManipulation/Pass/ClassNamePassTest.php
+++ b/tests/Mockery/Generator/StringManipulation/Pass/ClassNamePassTest.php
@@ -23,6 +23,7 @@ namespace Mockery\Generator\StringManipulation\Pass;
 
 use Mockery\Adapter\Phpunit\MockeryTestCase;
 use Mockery\Generator\MockConfiguration;
+use PHPUnit\Framework\Attributes\Test;
 
 class ClassNamePassTest extends MockeryTestCase
 {
@@ -35,9 +36,7 @@ class ClassNamePassTest extends MockeryTestCase
         $this->pass = new ClassNamePass();
     }
 
-    /**
-     * @test
-     */
+    #[Test]
     public function shouldRemoveNamespaceDefinition()
     {
         $config = new MockConfiguration(array(), array(), array(), "Dave\Dave");
@@ -45,9 +44,7 @@ class ClassNamePassTest extends MockeryTestCase
         $this->assertTrue(\mb_strpos($code, 'namespace Mockery;') === false);
     }
 
-    /**
-     * @test
-     */
+    #[Test]
     public function shouldReplaceNamespaceIfClassNameIsNamespaced()
     {
         $config = new MockConfiguration(array(), array(), array(), "Dave\Dave");
@@ -56,9 +53,7 @@ class ClassNamePassTest extends MockeryTestCase
         $this->assertTrue(\mb_strpos($code, 'namespace Dave;') !== false);
     }
 
-    /**
-     * @test
-     */
+    #[Test]
     public function shouldReplaceClassNameWithSpecifiedName()
     {
         $config = new MockConfiguration(array(), array(), array(), "Dave");
@@ -66,9 +61,7 @@ class ClassNamePassTest extends MockeryTestCase
         $this->assertTrue(\mb_strpos($code, 'class Dave') !== false);
     }
 
-    /**
-     * @test
-     */
+    #[Test]
     public function shouldRemoveLeadingBackslashesFromNamespace()
     {
         $config = new MockConfiguration(array(), array(), array(), "\Dave\Dave");
diff --git a/tests/Mockery/Generator/StringManipulation/Pass/ClassPassTest.php b/tests/Mockery/Generator/StringManipulation/Pass/ClassPassTest.php
index 31e6ce0..25c85c2 100644
--- a/tests/Mockery/Generator/StringManipulation/Pass/ClassPassTest.php
+++ b/tests/Mockery/Generator/StringManipulation/Pass/ClassPassTest.php
@@ -23,6 +23,7 @@ namespace Mockery\Generator\StringManipulation\Pass;
 
 use Mockery\Adapter\Phpunit\MockeryTestCase;
 use Mockery\Generator\MockConfiguration;
+use PHPUnit\Framework\Attributes\Test;
 
 class ClassPassTest extends MockeryTestCase
 {
@@ -35,9 +36,7 @@ class ClassPassTest extends MockeryTestCase
         $this->pass = new ClassPass();
     }
 
-    /**
-     * @test
-     */
+    #[Test]
     public function shouldDeclareUnknownClass()
     {
         $config = new MockConfiguration(array("Testing\TestClass"), array(), array(), "Dave\Dave");
diff --git a/tests/Mockery/Generator/StringManipulation/Pass/ConstantsPassTest.php b/tests/Mockery/Generator/StringManipulation/Pass/ConstantsPassTest.php
index 34fb670..1a0c2a9 100644
--- a/tests/Mockery/Generator/StringManipulation/Pass/ConstantsPassTest.php
+++ b/tests/Mockery/Generator/StringManipulation/Pass/ConstantsPassTest.php
@@ -24,15 +24,14 @@ namespace Mockery\Test\Generator\StringManipulation\Pass;
 use Mockery as m;
 use Mockery\Generator\MockConfiguration;
 use Mockery\Generator\StringManipulation\Pass\ConstantsPass;
+use PHPUnit\Framework\Attributes\Test;
 use PHPUnit\Framework\TestCase;
 
 class ConstantsPassTest extends TestCase
 {
     const CODE = 'class Foo {}';
 
-    /**
-     * @test
-     */
+    #[Test]
     public function shouldAddConstants()
     {
         $pass = new ConstantsPass();
diff --git a/tests/Mockery/Generator/StringManipulation/Pass/InstanceMockPassTest.php b/tests/Mockery/Generator/StringManipulation/Pass/InstanceMockPassTest.php
index 14cd62e..fc44dfb 100644
--- a/tests/Mockery/Generator/StringManipulation/Pass/InstanceMockPassTest.php
+++ b/tests/Mockery/Generator/StringManipulation/Pass/InstanceMockPassTest.php
@@ -24,13 +24,12 @@ namespace Mockery\Test\Generator\StringManipulation\Pass;
 use Mockery as m;
 use Mockery\Generator\MockConfigurationBuilder;
 use Mockery\Generator\StringManipulation\Pass\InstanceMockPass;
+use PHPUnit\Framework\Attributes\Test;
 use PHPUnit\Framework\TestCase;
 
 class InstanceMockPassTest extends TestCase
 {
-    /**
-     * @test
-     */
+    #[Test]
     public function shouldAppendConstructorAndPropertyForInstanceMock()
     {
         $builder = new MockConfigurationBuilder();
diff --git a/tests/Mockery/Generator/StringManipulation/Pass/InterfacePassTest.php b/tests/Mockery/Generator/StringManipulation/Pass/InterfacePassTest.php
index 5a0a6c6..5d31e7c 100644
--- a/tests/Mockery/Generator/StringManipulation/Pass/InterfacePassTest.php
+++ b/tests/Mockery/Generator/StringManipulation/Pass/InterfacePassTest.php
@@ -24,15 +24,14 @@ namespace Mockery\Test\Generator\StringManipulation\Pass;
 use Mockery as m;
 use Mockery\Generator\MockConfiguration;
 use Mockery\Generator\StringManipulation\Pass\InterfacePass;
+use PHPUnit\Framework\Attributes\Test;
 use PHPUnit\Framework\TestCase;
 
 class InterfacePassTest extends TestCase
 {
     const CODE = "class Mock implements MockInterface";
 
-    /**
-     * @test
-     */
+    #[Test]
     public function shouldNotAlterCodeIfNoTargetInterfaces()
     {
         $pass = new InterfacePass();
@@ -45,9 +44,7 @@ class InterfacePassTest extends TestCase
         $this->assertEquals(static::CODE, $code);
     }
 
-    /**
-     * @test
-     */
+    #[Test]
     public function shouldAddAnyInterfaceNamesToImplementsDefinition()
     {
         $pass = new InterfacePass();
diff --git a/tests/Mockery/GlobalHelpersTest.php b/tests/Mockery/GlobalHelpersTest.php
index cbf8b34..cace456 100644
--- a/tests/Mockery/GlobalHelpersTest.php
+++ b/tests/Mockery/GlobalHelpersTest.php
@@ -19,6 +19,7 @@
  */
 
 use Mockery\Adapter\Phpunit\MockeryTestCase;
+use PHPUnit\Framework\Attributes\Test;
 
 class GlobalHelpersTest extends MockeryTestCase
 {
@@ -32,7 +33,7 @@ class GlobalHelpersTest extends MockeryTestCase
         \Mockery::close();
     }
 
-    /** @test */
+    #[Test]
     public function mock_creates_a_mock()
     {
         $double = mock();
@@ -42,7 +43,7 @@ class GlobalHelpersTest extends MockeryTestCase
         $double->foo();
     }
 
-    /** @test */
+    #[Test]
     public function spy_creates_a_spy()
     {
         $double = spy();
@@ -51,7 +52,7 @@ class GlobalHelpersTest extends MockeryTestCase
         $double->foo();
     }
 
-    /** @test */
+    #[Test]
     public function named_mock_creates_a_named_mock()
     {
         $className = "Class" . uniqid();
diff --git a/tests/Mockery/Loader/LoaderTestCase.php b/tests/Mockery/Loader/LoaderTestCase.php
index aed412a..bb3a78f 100644
--- a/tests/Mockery/Loader/LoaderTestCase.php
+++ b/tests/Mockery/Loader/LoaderTestCase.php
@@ -23,13 +23,12 @@ namespace Mockery\Loader;
 
 use Mockery\Generator\MockConfiguration;
 use Mockery\Generator\MockDefinition;
+use PHPUnit\Framework\Attributes\Test;
 use PHPUnit\Framework\TestCase;
 
 abstract class LoaderTestCase extends TestCase
 {
-    /**
-     * @test
-     */
+    #[Test]
     public function loadLoadsTheCode()
     {
         $className = 'Mock_' . uniqid();
diff --git a/tests/Mockery/Matcher/HasKeyTest.php b/tests/Mockery/Matcher/HasKeyTest.php
index 61bc7cc..0bcacaf 100644
--- a/tests/Mockery/Matcher/HasKeyTest.php
+++ b/tests/Mockery/Matcher/HasKeyTest.php
@@ -3,11 +3,12 @@
 namespace test\Mockery\Matcher;
 
 use Mockery\Matcher\HasKey;
+use PHPUnit\Framework\Attributes\Test;
 use PHPUnit\Framework\TestCase;
 
 class HasKeyTest extends TestCase
 {
-    /** @test */
+    #[Test]
     public function it_can_handle_a_non_array()
     {
         $matcher = new HasKey('dave');
@@ -17,7 +18,7 @@ class HasKeyTest extends TestCase
         $this->assertFalse($matcher->match($actual));
     }
 
-    /** @test */
+    #[Test]
     public function it_matches_an_array()
     {
         $matcher = new HasKey('dave');
@@ -31,7 +32,7 @@ class HasKeyTest extends TestCase
         $this->assertTrue($matcher->match($actual));
     }
 
-    /** @test */
+    #[Test]
     public function it_matches_an_array_like_object()
     {
         $matcher = new HasKey('dave');
diff --git a/tests/Mockery/Matcher/HasValueTest.php b/tests/Mockery/Matcher/HasValueTest.php
index 842a3a8..c3cc1d4 100644
--- a/tests/Mockery/Matcher/HasValueTest.php
+++ b/tests/Mockery/Matcher/HasValueTest.php
@@ -3,11 +3,12 @@
 namespace test\Mockery\Matcher;
 
 use Mockery\Matcher\HasValue;
+use PHPUnit\Framework\Attributes\Test;
 use PHPUnit\Framework\TestCase;
 
 class HasValueTest extends TestCase
 {
-    /** @test */
+    #[Test]
     public function it_can_handle_a_non_array()
     {
         $matcher = new HasValue(123);
@@ -17,7 +18,7 @@ class HasValueTest extends TestCase
         $this->assertFalse($matcher->match($actual));
     }
 
-    /** @test */
+    #[Test]
     public function it_matches_an_array()
     {
         $matcher = new HasValue(123);
@@ -31,7 +32,7 @@ class HasValueTest extends TestCase
         $this->assertTrue($matcher->match($actual));
     }
 
-    /** @test */
+    #[Test]
     public function it_matches_an_array_like_object()
     {
         $matcher = new HasValue(123);
diff --git a/tests/Mockery/Matcher/IsEqualTest.php b/tests/Mockery/Matcher/IsEqualTest.php
index 998f6d2..228ce79 100644
--- a/tests/Mockery/Matcher/IsEqualTest.php
+++ b/tests/Mockery/Matcher/IsEqualTest.php
@@ -5,12 +5,13 @@ namespace test\Mockery\Matcher;
 use Mockery;
 use Mockery\Adapter\Phpunit\MockeryTestCase;
 use Mockery\Matcher\IsEqual;
+use PHPUnit\Framework\Attributes\DataProvider;
 
 class IsEqualTest extends MockeryTestCase
 {
     use MatcherDataProviderTrait;
 
-    /** @dataProvider isEqualDataProvider */
+    #[DataProvider('isEqualDataProvider')]
     public function testItWorks($expected, $actual)
     {
         self::assertTrue(Mockery::isEqual($expected)->match($actual));
diff --git a/tests/Mockery/Matcher/IsSameTest.php b/tests/Mockery/Matcher/IsSameTest.php
index 765fe50..b433fa1 100644
--- a/tests/Mockery/Matcher/IsSameTest.php
+++ b/tests/Mockery/Matcher/IsSameTest.php
@@ -5,12 +5,13 @@ namespace test\Mockery\Matcher;
 use Mockery;
 use Mockery\Adapter\Phpunit\MockeryTestCase;
 use Mockery\Matcher\IsSame;
+use PHPUnit\Framework\Attributes\DataProvider;
 
 class IsSameTest extends MockeryTestCase
 {
     use MatcherDataProviderTrait;
 
-    /** @dataProvider isSameDataProvider */
+    #[DataProvider('isSameDataProvider')]
     public function testItWorks($expected, $actual)
     {
         self::assertTrue(Mockery::isSame($expected)->match($actual));
diff --git a/tests/Mockery/Matcher/SubsetTest.php b/tests/Mockery/Matcher/SubsetTest.php
index c941795..5f59f49 100644
--- a/tests/Mockery/Matcher/SubsetTest.php
+++ b/tests/Mockery/Matcher/SubsetTest.php
@@ -22,12 +22,13 @@ namespace test\Mockery\Matcher;
 
 use Mockery\Adapter\Phpunit\MockeryTestCase;
 use Mockery\Matcher\Subset;
+use PHPUnit\Framework\Attributes\Test;
 use test\Mockery\RegExpCompatability;
 
 class SubsetTest extends MockeryTestCase
 {
     use RegExpCompatability;
-    /** @test */
+    #[Test]
     public function it_matches_a_shallow_subset()
     {
         $matcher = Subset::strict(['dave' => 123]);
@@ -41,7 +42,7 @@ class SubsetTest extends MockeryTestCase
         $this->assertTrue($matcher->match($actual));
     }
 
-    /** @test */
+    #[Test]
     public function it_recursively_matches()
     {
         $matcher = Subset::strict(['foo' => ['bar' => ['baz' => 123]]]);
@@ -59,7 +60,7 @@ class SubsetTest extends MockeryTestCase
         $this->assertTrue($matcher->match($actual));
     }
 
-    /** @test */
+    #[Test]
     public function it_is_strict_by_default()
     {
         $matcher = new Subset(['dave' => 123]);
@@ -73,7 +74,7 @@ class SubsetTest extends MockeryTestCase
         $this->assertFalse($matcher->match($actual));
     }
 
-    /** @test */
+    #[Test]
     public function it_can_run_a_loose_comparison()
     {
         $matcher = Subset::loose(['dave' => 123]);
@@ -87,7 +88,7 @@ class SubsetTest extends MockeryTestCase
         $this->assertTrue($matcher->match($actual));
     }
 
-    /** @test */
+    #[Test]
     public function it_returns_false_if_actual_is_not_an_array()
     {
         $matcher = new Subset(['dave' => 123]);
@@ -97,7 +98,7 @@ class SubsetTest extends MockeryTestCase
         $this->assertFalse($matcher->match($actual));
     }
 
-    /** @test */
+    #[Test]
     public function it_correctly_formats_nested_arrays_into_a_string()
     {
         $expected = [
diff --git a/tests/Mockery/MockClassWithFinalToStringTest.php b/tests/Mockery/MockClassWithFinalToStringTest.php
index c277872..7f11e57 100644
--- a/tests/Mockery/MockClassWithFinalToStringTest.php
+++ b/tests/Mockery/MockClassWithFinalToStringTest.php
@@ -22,6 +22,7 @@
 namespace test\Mockery;
 
 use Mockery\Adapter\Phpunit\MockeryTestCase;
+use PHPUnit\Framework\Attributes\Test;
 
 class MockClassWithFinalToStringTest extends MockeryTestCase
 {
@@ -38,12 +39,11 @@ class MockClassWithFinalToStringTest extends MockeryTestCase
     }
 
     /**
-     * @test
-     *
      * Test that we are able to create partial mocks of classes that have
      * a __wakeup method marked as final. As long as __wakeup is not one of the
      * mocked methods.
      */
+    #[Test]
     public function testCreateMockForClassWithFinalToString()
     {
         $mock = $this->container->mock("test\Mockery\TestWithFinalToString");
diff --git a/tests/Mockery/MockClassWithFinalWakeupTest.php b/tests/Mockery/MockClassWithFinalWakeupTest.php
index fd64092..511a795 100644
--- a/tests/Mockery/MockClassWithFinalWakeupTest.php
+++ b/tests/Mockery/MockClassWithFinalWakeupTest.php
@@ -22,6 +22,7 @@
 namespace test\Mockery;
 
 use Mockery\Adapter\Phpunit\MockeryTestCase;
+use PHPUnit\Framework\Attributes\Test;
 
 class MockClassWithFinalWakeupTest extends MockeryTestCase
 {
@@ -38,12 +39,11 @@ class MockClassWithFinalWakeupTest extends MockeryTestCase
     }
 
     /**
-     * @test
-     *
      * Test that we are able to create partial mocks of classes that have
      * a __wakeup method marked as final. As long as __wakeup is not one of the
      * mocked methods.
      */
+    #[Test]
     public function testCreateMockForClassWithFinalWakeup()
     {
         $mock = $this->container->mock("test\Mockery\TestWithFinalWakeup");
diff --git a/tests/Mockery/MockClassWithUnknownTypeHintTest.php b/tests/Mockery/MockClassWithUnknownTypeHintTest.php
index 8706f8d..c6f7b9c 100644
--- a/tests/Mockery/MockClassWithUnknownTypeHintTest.php
+++ b/tests/Mockery/MockClassWithUnknownTypeHintTest.php
@@ -23,10 +23,11 @@ namespace test\Mockery;
 
 use Mockery\MockInterface;
 use Mockery\Adapter\Phpunit\MockeryTestCase;
+use PHPUnit\Framework\Attributes\Test;
 
 class MockClassWithUnknownTypeHintTest extends MockeryTestCase
 {
-    /** @test */
+    #[Test]
     public function itShouldSuccessfullyBuildTheMock()
     {
         $mock = mock("test\Mockery\HasUnknownClassAsTypeHintOnMethod");
diff --git a/tests/Mockery/MockTest.php b/tests/Mockery/MockTest.php
index c4355aa..eed6f43 100644
--- a/tests/Mockery/MockTest.php
+++ b/tests/Mockery/MockTest.php
@@ -21,6 +21,7 @@
 
 use Mockery\Adapter\Phpunit\MockeryTestCase;
 use Mockery\Mock;
+use PHPUnit\Framework\Attributes\Test;
 
 class Mockery_MockTest extends MockeryTestCase
 {
@@ -167,7 +168,7 @@ class Mockery_MockTest extends MockeryTestCase
     }
 
 
-    /** @test */
+    #[Test]
     public function expectation_count_will_count_expectations()
     {
         $mock = new Mock();
@@ -177,7 +178,7 @@ class Mockery_MockTest extends MockeryTestCase
         $this->assertEquals(2, $mock->mockery_getExpectationCount());
     }
 
-    /** @test */
+    #[Test]
     public function expectation_count_will_ignore_defaults_if_overriden()
     {
         $mock = new Mock();
@@ -188,7 +189,7 @@ class Mockery_MockTest extends MockeryTestCase
         $this->assertEquals(2, $mock->mockery_getExpectationCount());
     }
 
-    /** @test */
+    #[Test]
     public function expectation_count_will_count_defaults_if_not_overriden()
     {
         $mock = new Mock();
diff --git a/tests/Mockery/MockeryCanMockClassesWithSemiReservedWordsTest.php b/tests/Mockery/MockeryCanMockClassesWithSemiReservedWordsTest.php
index 09a61d7..eba7c6e 100644
--- a/tests/Mockery/MockeryCanMockClassesWithSemiReservedWordsTest.php
+++ b/tests/Mockery/MockeryCanMockClassesWithSemiReservedWordsTest.php
@@ -4,13 +4,12 @@ namespace Mockery;
 
 use Mockery as m;
 use test\Mockery\Fixtures\SemiReservedWordsAsMethods;
+use PHPUnit\Framework\Attributes\Test;
 use PHPUnit\Framework\TestCase;
 
 class MockeryCanMockClassesWithSemiReservedWordsTest extends TestCase
 {
-    /**
-     * @test
-     */
+    #[Test]
     public function smoke_test()
     {
         $mock = m::mock(SemiReservedWordsAsMethods::class);
diff --git a/tests/Mockery/MockeryCanMockMultipleInterfacesWhichOverlapTest.php b/tests/Mockery/MockeryCanMockMultipleInterfacesWhichOverlapTest.php
index 684f98c..cc78df6 100644
--- a/tests/Mockery/MockeryCanMockMultipleInterfacesWhichOverlapTest.php
+++ b/tests/Mockery/MockeryCanMockMultipleInterfacesWhichOverlapTest.php
@@ -22,10 +22,11 @@
 namespace Mockery\Tests;
 
 use Mockery\Adapter\Phpunit\MockeryTestCase;
+use PHPUnit\Framework\Attributes\Test;
 
 class MockeryCanMockMultipleInterfacesWhichOverlapTest extends MockeryTestCase
 {
-    /** @test */
+    #[Test]
     public function shouldNotDuplicateDoublyInheritedMethods()
     {
         $container = new \Mockery\Container();
diff --git a/tests/Mockery/MockingAllLowerCasedMethodsTest.php b/tests/Mockery/MockingAllLowerCasedMethodsTest.php
index a99f1c9..5087997 100644
--- a/tests/Mockery/MockingAllLowerCasedMethodsTest.php
+++ b/tests/Mockery/MockingAllLowerCasedMethodsTest.php
@@ -23,10 +23,11 @@ namespace test\Mockery;
 
 use test\Mockery\Fixtures\ClassWithAllLowerCaseMethod;
 use Mockery\Adapter\Phpunit\MockeryTestCase;
+use PHPUnit\Framework\Attributes\Test;
 
 class MockingAllLowerCasedMethodsTest extends MockeryTestCase
 {
-    /** @test */
+    #[Test]
     public function itShouldAllowToCallAllLowerCasedMethodAsCamelCased()
     {
         $mock = mock(ClassWithAllLowerCaseMethod::class);
diff --git a/tests/Mockery/MockingClassConstantsTest.php b/tests/Mockery/MockingClassConstantsTest.php
index 47622eb..3f127d3 100644
--- a/tests/Mockery/MockingClassConstantsTest.php
+++ b/tests/Mockery/MockingClassConstantsTest.php
@@ -22,10 +22,11 @@
 namespace test\Mockery;
 
 use Mockery\Adapter\Phpunit\MockeryTestCase;
+use PHPUnit\Framework\Attributes\Test;
 
 class MockingClassConstantsTest extends MockeryTestCase
 {
-    /** @test */
+    #[Test]
     public function itShouldAllowToMockClassConstants()
     {
         \Mockery::getConfiguration()->setConstantsMap([
diff --git a/tests/Mockery/MockingMethodsWithIterableTypeHintsTest.php b/tests/Mockery/MockingMethodsWithIterableTypeHintsTest.php
index f25b641..55a72d9 100644
--- a/tests/Mockery/MockingMethodsWithIterableTypeHintsTest.php
+++ b/tests/Mockery/MockingMethodsWithIterableTypeHintsTest.php
@@ -23,10 +23,11 @@ namespace test\Mockery;
 
 use test\Mockery\Fixtures\MethodWithIterableTypeHints;
 use Mockery\Adapter\Phpunit\MockeryTestCase;
+use PHPUnit\Framework\Attributes\Test;
 
 class MockingMethodsWithIterableTypeHintsTest extends MockeryTestCase
 {
-    /** @test */
+    #[Test]
     public function itShouldSuccessfullyBuildTheMock()
     {
         $mock = mock(MethodWithIterableTypeHints::class);
diff --git a/tests/Mockery/MockingMethodsWithNullableParametersTest.php b/tests/Mockery/MockingMethodsWithNullableParametersTest.php
index 7c06e62..32bfbe1 100644
--- a/tests/Mockery/MockingMethodsWithNullableParametersTest.php
+++ b/tests/Mockery/MockingMethodsWithNullableParametersTest.php
@@ -24,10 +24,11 @@ namespace test\Mockery;
 use test\Mockery\Fixtures\MethodWithNullableReturnType;
 use test\Mockery\Fixtures\MethodWithParametersWithDefaultValues;
 use Mockery\Adapter\Phpunit\MockeryTestCase;
+use PHPUnit\Framework\Attributes\Test;
 
 class MockingMethodsWithNullableParametersTest extends MockeryTestCase
 {
-    /** @test */
+    #[Test]
     public function it_can_handle_nullable_typed_parameters()
     {
         $mock = mock(MethodWithNullableTypedParameter::class);
@@ -35,7 +36,7 @@ class MockingMethodsWithNullableParametersTest extends MockeryTestCase
         $this->assertInstanceOf(MethodWithNullableTypedParameter::class, $mock);
     }
 
-    /** @test */
+    #[Test]
     public function it_can_handle_default_parameters()
     {
         $mock = mock(MethodWithParametersWithDefaultValues::class);
diff --git a/tests/Mockery/MockingNullableMethodsTest.php b/tests/Mockery/MockingNullableMethodsTest.php
index 554929c..9e36919 100644
--- a/tests/Mockery/MockingNullableMethodsTest.php
+++ b/tests/Mockery/MockingNullableMethodsTest.php
@@ -24,6 +24,7 @@ namespace test\Mockery;
 use Mockery\Adapter\Phpunit\MockeryTestCase;
 use Mockery\Generator\Method;
 use PHPUnit\Framework\Attributes\RequiresPhpunit;
+use PHPUnit\Framework\Attributes\Test;
 use test\Mockery\Fixtures\MethodWithNullableReturnType;
 
 class MockingNullableMethodsTest extends MockeryTestCase
@@ -33,9 +34,7 @@ class MockingNullableMethodsTest extends MockeryTestCase
      */
     private $container;
 
-    /**
-     * @test
-     */
+    #[Test]
     public function itShouldAllowNonNullableTypeToBeSet()
     {
         $mock = mock("test\Mockery\Fixtures\MethodWithNullableReturnType");
@@ -44,9 +43,7 @@ class MockingNullableMethodsTest extends MockeryTestCase
         $mock->nonNullablePrimitive();
     }
 
-    /**
-     * @test
-     */
+    #[Test]
     public function itShouldNotAllowNonNullToBeNull()
     {
         $mock = mock("test\Mockery\Fixtures\MethodWithNullableReturnType");
@@ -56,9 +53,7 @@ class MockingNullableMethodsTest extends MockeryTestCase
         $mock->nonNullablePrimitive();
     }
 
-    /**
-     * @test
-     */
+    #[Test]
     public function itShouldAllowPrimitiveNullableToBeNull()
     {
         $mock = mock("test\Mockery\Fixtures\MethodWithNullableReturnType");
@@ -67,9 +62,7 @@ class MockingNullableMethodsTest extends MockeryTestCase
         $mock->nullablePrimitive();
     }
 
-    /**
-     * @test
-     */
+    #[Test]
     public function itShouldAllowPrimitiveNullableToBeSet()
     {
         $mock = mock("test\Mockery\Fixtures\MethodWithNullableReturnType");
@@ -78,9 +71,7 @@ class MockingNullableMethodsTest extends MockeryTestCase
         $mock->nullablePrimitive();
     }
 
-    /**
-     * @test
-     */
+    #[Test]
     #[RequiresPhpunit('< 11')]
     public function itShouldAllowSelfToBeSet()
     {
@@ -92,9 +83,7 @@ class MockingNullableMethodsTest extends MockeryTestCase
         $mock->nonNullableSelf();
     }
 
-    /**
-     * @test
-     */
+    #[Test]
     public function itShouldNotAllowSelfToBeNull()
     {
         $mock = mock("test\Mockery\Fixtures\MethodWithNullableReturnType");
@@ -104,9 +93,7 @@ class MockingNullableMethodsTest extends MockeryTestCase
         $mock->nonNullableSelf();
     }
 
-    /**
-     * @test
-     */
+    #[Test]
     #[RequiresPhpunit('< 11')]
     public function itShouldAllowNullableSelfToBeSet()
     {
@@ -116,9 +103,7 @@ class MockingNullableMethodsTest extends MockeryTestCase
         $mock->nullableSelf();
     }
 
-    /**
-     * @test
-     */
+    #[Test]
     public function itShouldAllowNullableSelfToBeNull()
     {
         $mock = mock("test\Mockery\Fixtures\MethodWithNullableReturnType");
@@ -127,9 +112,7 @@ class MockingNullableMethodsTest extends MockeryTestCase
         $mock->nullableSelf();
     }
 
-    /**
-     * @test
-     */
+    #[Test]
     #[RequiresPhpunit('< 11')]
     public function itShouldAllowClassToBeSet()
     {
@@ -142,9 +125,7 @@ class MockingNullableMethodsTest extends MockeryTestCase
         $mock->nonNullableClass();
     }
 
-    /**
-     * @test
-     */
+    #[Test]
     public function itShouldNotAllowClassToBeNull()
     {
         $mock = mock("test\Mockery\Fixtures\MethodWithNullableReturnType");
@@ -154,9 +135,7 @@ class MockingNullableMethodsTest extends MockeryTestCase
         $mock->nonNullableClass();
     }
 
-    /**
-     * @test
-     */
+    #[Test]
     #[RequiresPhpunit('< 11')]
     public function itShouldAllowNullalbeClassToBeSet()
     {
@@ -166,9 +145,7 @@ class MockingNullableMethodsTest extends MockeryTestCase
         $mock->nullableClass();
     }
 
-    /**
-     * @test
-     */
+    #[Test]
     public function itShouldAllowNullableClassToBeNull()
     {
         $mock = mock("test\Mockery\Fixtures\MethodWithNullableReturnType");
@@ -177,7 +154,7 @@ class MockingNullableMethodsTest extends MockeryTestCase
         $mock->nullableClass();
     }
 
-    /** @test */
+    #[Test]
     public function it_allows_returning_null_for_nullable_object_return_types()
     {
         $double= \Mockery::mock(MethodWithNullableReturnType::class);
@@ -187,7 +164,7 @@ class MockingNullableMethodsTest extends MockeryTestCase
         $this->assertNull($double->nullableClass());
     }
 
-    /** @test */
+    #[Test]
     public function it_allows_returning_null_for_nullable_string_return_types()
     {
         $double= \Mockery::mock(MethodWithNullableReturnType::class);
@@ -197,7 +174,7 @@ class MockingNullableMethodsTest extends MockeryTestCase
         $this->assertNull($double->nullableString());
     }
 
-    /** @test */
+    #[Test]
     public function it_allows_returning_null_for_nullable_int_return_types()
     {
         $double= \Mockery::mock(MethodWithNullableReturnType::class);
@@ -207,7 +184,7 @@ class MockingNullableMethodsTest extends MockeryTestCase
         $this->assertNull($double->nullableInt());
     }
 
-    /** @test */
+    #[Test]
     public function it_returns_null_on_calls_to_ignored_methods_of_spies_if_return_type_is_nullable()
     {
         $double = \Mockery::spy(MethodWithNullableReturnType::class);
diff --git a/tests/Mockery/MockingProtectedMethodsTest.php b/tests/Mockery/MockingProtectedMethodsTest.php
index 7810d1b..0f52b63 100644
--- a/tests/Mockery/MockingProtectedMethodsTest.php
+++ b/tests/Mockery/MockingProtectedMethodsTest.php
@@ -22,15 +22,15 @@
 namespace test\Mockery;
 
 use Mockery\Adapter\Phpunit\MockeryTestCase;
+use PHPUnit\Framework\Attributes\Test;
 
 class MockingProtectedMethodsTest extends MockeryTestCase
 {
     /**
-     * @test
-     *
      * This is a regression test, basically we don't want the mock handling
      * interfering with calling protected methods partials
      */
+    #[Test]
     public function shouldAutomaticallyDeferCallsToProtectedMethodsForPartials()
     {
         $mock = mock("test\Mockery\TestWithProtectedMethods[foo]");
@@ -38,25 +38,24 @@ class MockingProtectedMethodsTest extends MockeryTestCase
     }
 
     /**
-     * @test
-     *
      * This is a regression test, basically we don't want the mock handling
      * interfering with calling protected methods partials
      */
+    #[Test]
     public function shouldAutomaticallyDeferCallsToProtectedMethodsForRuntimePartials()
     {
         $mock = mock("test\Mockery\TestWithProtectedMethods")->makePartial();
         $this->assertEquals("bar", $mock->bar());
     }
 
-    /** @test */
+    #[Test]
     public function shouldAutomaticallyIgnoreAbstractProtectedMethods()
     {
         $mock = mock("test\Mockery\TestWithProtectedMethods")->makePartial();
         $this->assertNull($mock->foo());
     }
 
-    /** @test */
+    #[Test]
     public function shouldAllowMockingProtectedMethods()
     {
         $mock = mock("test\Mockery\TestWithProtectedMethods")
@@ -67,7 +66,7 @@ class MockingProtectedMethodsTest extends MockeryTestCase
         $this->assertEquals("notbar", $mock->bar());
     }
 
-    /** @test */
+    #[Test]
     public function shouldAllowMockingProtectedMethodOnDefinitionTimePartial()
     {
         $mock = mock("test\Mockery\TestWithProtectedMethods[protectedBar]")
@@ -77,7 +76,7 @@ class MockingProtectedMethodsTest extends MockeryTestCase
         $this->assertEquals("notbar", $mock->bar());
     }
 
-    /** @test */
+    #[Test]
     public function shouldAllowMockingAbstractProtectedMethods()
     {
         $mock = mock("test\Mockery\TestWithProtectedMethods")
@@ -88,7 +87,7 @@ class MockingProtectedMethodsTest extends MockeryTestCase
         $this->assertEquals("abstractProtected", $mock->foo());
     }
 
-    /** @test */
+    #[Test]
     public function shouldAllowMockingIncreasedVisabilityMethods()
     {
         $mock = mock("test\Mockery\TestIncreasedVisibilityChild");
diff --git a/tests/Mockery/MockingVariadicArgumentsTest.php b/tests/Mockery/MockingVariadicArgumentsTest.php
index a940f63..e7d8a3d 100644
--- a/tests/Mockery/MockingVariadicArgumentsTest.php
+++ b/tests/Mockery/MockingVariadicArgumentsTest.php
@@ -22,10 +22,11 @@
 namespace test\Mockery;
 
 use Mockery\Adapter\Phpunit\MockeryTestCase;
+use PHPUnit\Framework\Attributes\Test;
 
 class MockingVariadicArgumentsTest extends MockeryTestCase
 {
-    /** @test */
+    #[Test]
     public function shouldAllowMockingVariadicArguments()
     {
         $mock = mock("test\Mockery\TestWithVariadicArguments");
diff --git a/tests/Mockery/MockingVoidMethodsTest.php b/tests/Mockery/MockingVoidMethodsTest.php
index 2feb211..0ba7b98 100644
--- a/tests/Mockery/MockingVoidMethodsTest.php
+++ b/tests/Mockery/MockingVoidMethodsTest.php
@@ -22,6 +22,7 @@
 namespace test\Mockery;
 
 use Mockery\Adapter\Phpunit\MockeryTestCase;
+use PHPUnit\Framework\Attributes\Test;
 
 class MockingVoidMethodsTest extends MockeryTestCase
 {
@@ -31,7 +32,7 @@ class MockingVoidMethodsTest extends MockeryTestCase
     }
 
 
-    /** @test */
+    #[Test]
     public function itShouldSuccessfullyBuildTheMock()
     {
         $mock = mock("test\Mockery\Fixtures\MethodWithVoidReturnType");
@@ -39,7 +40,7 @@ class MockingVoidMethodsTest extends MockeryTestCase
         $this->assertInstanceOf(\test\Mockery\Fixtures\MethodWithVoidReturnType::class, $mock);
     }
 
-    /** @test */
+    #[Test]
     public function it_can_stub_and_mock_void_methods()
     {
         $mock = mock("test\Mockery\Fixtures\MethodWithVoidReturnType");
diff --git a/tests/Mockery/NamedMockTest.php b/tests/Mockery/NamedMockTest.php
index 9ea28e2..5d59c3a 100644
--- a/tests/Mockery/NamedMockTest.php
+++ b/tests/Mockery/NamedMockTest.php
@@ -22,19 +22,20 @@
 require_once __DIR__ . '/DummyClasses/Namespaced.php';
 
 use Mockery\Adapter\Phpunit\MockeryTestCase;
+use PHPUnit\Framework\Attributes\Test;
 use test\Mockery\Stubs\Animal;
 use test\Mockery\Stubs\Habitat;
 
 class NamedMockTest extends MockeryTestCase
 {
-    /** @test */
+    #[Test]
     public function itCreatesANamedMock()
     {
         $mock = Mockery::namedMock("Mockery\Dave123");
         $this->assertInstanceOf("Mockery\Dave123", $mock);
     }
 
-    /** @test */
+    #[Test]
     public function itCreatesPassesFurtherArgumentsJustLikeMock()
     {
         $mock = Mockery::namedMock("Mockery\Dave456", "DateTime", array(
@@ -45,7 +46,7 @@ class NamedMockTest extends MockeryTestCase
         $this->assertEquals("dave", $mock->getDave());
     }
 
-    /** @test */
+    #[Test]
     public function itShouldThrowIfAttemptingToRedefineNamedMock()
     {
         $mock = Mockery::namedMock("Mockery\Dave7");
@@ -54,7 +55,7 @@ class NamedMockTest extends MockeryTestCase
         $mock = Mockery::namedMock("Mockery\Dave7", "DateTime");
     }
 
-    /** @test */
+    #[Test]
     public function itCreatesConcreteMethodImplementationWithReturnType()
     {
         $cactus = new \Nature\Plant();
@@ -66,7 +67,7 @@ class NamedMockTest extends MockeryTestCase
         $this->assertTrue($gardener->water($cactus));
     }
 
-    /** @test */
+    #[Test]
     public function it_gracefully_handles_namespacing()
     {
         $animal = Mockery::namedMock(
diff --git a/tests/Mockery/ProxyMockingTest.php b/tests/Mockery/ProxyMockingTest.php
index 4ba102e..c14808c 100644
--- a/tests/Mockery/ProxyMockingTest.php
+++ b/tests/Mockery/ProxyMockingTest.php
@@ -4,10 +4,11 @@ namespace test\Mockery;
 
 use Mockery\Adapter\Phpunit\MockeryTestCase;
 use Mockery\Exception;
+use PHPUnit\Framework\Attributes\Test;
 
 class ProxyMockingTest extends MockeryTestCase
 {
-    /** @test */
+    #[Test]
     public function finalClassCannotBeMocked()
     {
         $this->expectException(Exception::class);
@@ -15,7 +16,7 @@ class ProxyMockingTest extends MockeryTestCase
         mock(UnmockableClass::class);
     }
 
-    /** @test */
+    #[Test]
     public function passesThruAnyMethod()
     {
         $mock = mock(new UnmockableClass());
@@ -23,7 +24,7 @@ class ProxyMockingTest extends MockeryTestCase
         $this->assertSame(1, $mock->anyMethod());
     }
 
-    /** @test */
+    #[Test]
     public function passesThruVirtualMethods()
     {
         $mock = mock(new UnmockableClass());
diff --git a/tests/Mockery/ReflectorTest.php b/tests/Mockery/ReflectorTest.php
index 0e4dca4..2a71083 100644
--- a/tests/Mockery/ReflectorTest.php
+++ b/tests/Mockery/ReflectorTest.php
@@ -7,6 +7,7 @@ namespace Mockery\Tests\Mockery;
 use Generator;
 use Mockery\Adapter\Phpunit\MockeryTestCase;
 use Mockery\Reflector;
+use PHPUnit\Framework\Attributes\DataProvider;
 use ReflectionClass;
 
 /**
@@ -16,8 +17,8 @@ class ReflectorTest extends MockeryTestCase
 {
     /**
      * @covers \Mockery\Reflector::getTypeHint
-     * @dataProvider typeHintDataProvider
      */
+    #[DataProvider('typeHintDataProvider')]
     public function testGetTypeHint(string $class, string $expectedTypeHint): void
     {
         $refClass = new ReflectionClass($class);
@@ -40,9 +41,7 @@ class ReflectorTest extends MockeryTestCase
         ];
     }
 
-    /**
-     * @dataProvider provideReservedWords
-     */
+    #[DataProvider('provideReservedWords')]
     public function testIsReservedWord(string $type): void
     {
         self::assertTrue(Reflector::isReservedWord($type));
diff --git a/tests/Mockery/SpyTest.php b/tests/Mockery/SpyTest.php
index 73de84c..4629063 100644
--- a/tests/Mockery/SpyTest.php
+++ b/tests/Mockery/SpyTest.php
@@ -24,10 +24,11 @@ namespace test\Mockery;
 use Mockery as m;
 use Mockery\Spy;
 use Mockery\Adapter\Phpunit\MockeryTestCase;
+use PHPUnit\Framework\Attributes\Test;
 
 class SpyTest extends MockeryTestCase
 {
-    /** @test */
+    #[Test]
     public function itVerifiesAMethodWasCalled()
     {
         $spy = m::spy();
@@ -38,7 +39,7 @@ class SpyTest extends MockeryTestCase
         $spy->shouldHaveReceived("someMethodThatWasNotCalled");
     }
 
-    /** @test */
+    #[Test]
     public function itVerifiesAMethodWasNotCalled()
     {
         $spy = m::spy();
@@ -49,7 +50,7 @@ class SpyTest extends MockeryTestCase
         $spy->shouldNotHaveReceived("myMethod");
     }
 
-    /** @test */
+    #[Test]
     public function itVerifiesAMethodWasNotCalledWithParticularArguments()
     {
         $spy = m::spy();
@@ -61,7 +62,7 @@ class SpyTest extends MockeryTestCase
         $spy->shouldNotHaveReceived("myMethod", array(123, 456));
     }
 
-    /** @test */
+    #[Test]
     public function itVerifiesAMethodWasCalledASpecificNumberOfTimes()
     {
         $spy = m::spy();
@@ -74,7 +75,7 @@ class SpyTest extends MockeryTestCase
         $spy->shouldHaveReceived("myMethod")->twice();
     }
 
-    /** @test */
+    #[Test]
     public function itVerifiesAMethodWasCalledWithSpecificArguments()
     {
         $spy = m::spy();
@@ -86,7 +87,7 @@ class SpyTest extends MockeryTestCase
         $spy->shouldHaveReceived("myMethod")->with(123);
     }
 
-    /** @test */
+    #[Test]
     public function itIncrementsExpectationCountWhenShouldHaveReceivedIsUsed()
     {
         $spy = m::spy();
@@ -95,7 +96,7 @@ class SpyTest extends MockeryTestCase
         $this->assertEquals(1, $spy->mockery_getExpectationCount());
     }
 
-    /** @test */
+    #[Test]
     public function itIncrementsExpectationCountWhenShouldNotHaveReceivedIsUsed()
     {
         $spy = m::spy();
@@ -103,7 +104,7 @@ class SpyTest extends MockeryTestCase
         $this->assertEquals(1, $spy->mockery_getExpectationCount());
     }
 
-    /** @test */
+    #[Test]
     public function any_args_can_be_used_with_alternative_syntax()
     {
         $spy = m::spy();
@@ -112,7 +113,7 @@ class SpyTest extends MockeryTestCase
         $spy->shouldHaveReceived()->foo(anyArgs());
     }
 
-    /** @test */
+    #[Test]
     public function should_have_received_higher_order_message_call_a_method_with_correct_arguments()
     {
         $spy = m::spy();
@@ -121,7 +122,7 @@ class SpyTest extends MockeryTestCase
         $spy->shouldHaveReceived()->foo(123);
     }
 
-    /** @test */
+    #[Test]
     public function should_have_received_higher_order_message_call_a_method_with_incorrect_arguments_throws_exception()
     {
         $spy = m::spy();
@@ -131,7 +132,7 @@ class SpyTest extends MockeryTestCase
         $spy->shouldHaveReceived()->foo(456);
     }
 
-    /** @test */
+    #[Test]
     public function should_not_have_received_higher_order_message_call_a_method_with_incorrect_arguments()
     {
         $spy = m::spy();
@@ -140,7 +141,7 @@ class SpyTest extends MockeryTestCase
         $spy->shouldNotHaveReceived()->foo(456);
     }
 
-    /** @test */
+    #[Test]
     public function should_not_have_received_higher_order_message_call_a_method_with_correct_arguments_throws_an_exception()
     {
         $spy = m::spy();
diff --git a/tests/Mockery/TraitsTest.php b/tests/Mockery/TraitsTest.php
index e44890c..f166a85 100644
--- a/tests/Mockery/TraitsTest.php
+++ b/tests/Mockery/TraitsTest.php
@@ -22,10 +22,11 @@ namespace test\Mockery;
 
 use Mockery\Adapter\Phpunit\MockeryTestCase;
 use Mockery\Loader\RequireLoader;
+use PHPUnit\Framework\Attributes\Test;
 
 class TraitsTest extends MockeryTestCase
 {
-    /** @test */
+    #[Test]
     public function it_can_create_an_object_for_a_simple_trait()
     {
         $trait = mock(SimpleTrait::class);
@@ -33,7 +34,7 @@ class TraitsTest extends MockeryTestCase
         $this->assertEquals('bar', $trait->foo());
     }
 
-    /** @test */
+    #[Test]
     public function it_creates_abstract_methods_as_necessary()
     {
         $trait = mock(TraitWithAbstractMethod::class, ['doBaz' => 'baz']);
@@ -41,7 +42,7 @@ class TraitsTest extends MockeryTestCase
         $this->assertEquals('baz', $trait->baz());
     }
 
-    /** @test */
+    #[Test]
     public function it_can_create_an_object_using_multiple_traits()
     {
         $trait = mock(SimpleTrait::class, TraitWithAbstractMethod::class, [
diff --git a/tests/Mockery/WithCustomFormatterExpectationTest.php b/tests/Mockery/WithCustomFormatterExpectationTest.php
index 2401466..182fe2b 100644
--- a/tests/Mockery/WithCustomFormatterExpectationTest.php
+++ b/tests/Mockery/WithCustomFormatterExpectationTest.php
@@ -19,6 +19,7 @@
  * @license        http://github.com/padraic/mockery/blob/master/LICENSE New BSD License
  */
 
+use PHPUnit\Framework\Attributes\DataProvider;
 use PHPUnit\Framework\TestCase;
 
 class WithCustomFormatterExpectationTest extends TestCase
@@ -55,9 +56,7 @@ class WithCustomFormatterExpectationTest extends TestCase
         );
     }
 
-    /**
-     * @dataProvider getObjectFormatterDataProvider
-     */
+    #[DataProvider('getObjectFormatterDataProvider')]
     public function testGetObjectFormatter($object, $expected)
     {
         $defaultFormatter = function ($class, $nesting) {
@@ -99,9 +98,7 @@ class WithCustomFormatterExpectationTest extends TestCase
         );
     }
 
-    /**
-     * @dataProvider formatObjectsDataProvider
-     */
+    #[DataProvider('formatObjectsDataProvider')]
     public function testFormatObjects($obj, $shouldContains, $shouldNotContains)
     {
         $string = Mockery::formatObjects(array($obj));
diff --git a/tests/Mockery/WithFormatterExpectationTest.php b/tests/Mockery/WithFormatterExpectationTest.php
index 6def550..1d83211 100644
--- a/tests/Mockery/WithFormatterExpectationTest.php
+++ b/tests/Mockery/WithFormatterExpectationTest.php
@@ -19,13 +19,13 @@
  * @license    http://github.com/padraic/mockery/blob/master/LICENSE New BSD License
  */
 
+use PHPUnit\Framework\Attributes\DataProvider;
 use PHPUnit\Framework\TestCase;
+use PHPUnit\Framework\Attributes\Test;
 
 class WithFormatterExpectationTest extends TestCase
 {
-    /**
-     * @dataProvider formatObjectsDataProvider
-     */
+    #[DataProvider('formatObjectsDataProvider')]
     public function testFormatObjects($args, $expected)
     {
         $this->assertEquals(
@@ -61,7 +61,7 @@ class WithFormatterExpectationTest extends TestCase
         );
     }
 
-    /** @test */
+    #[Test]
     public function format_objects_should_not_call_getters_with_params()
     {
         $obj = new ClassWithGetterWithParam();
diff --git a/tests/PHP80/Php80LanguageFeaturesTest.php b/tests/PHP80/Php80LanguageFeaturesTest.php
index d421704..02fcb3c 100644
--- a/tests/PHP80/Php80LanguageFeaturesTest.php
+++ b/tests/PHP80/Php80LanguageFeaturesTest.php
@@ -7,6 +7,7 @@ use DateTime;
 use Iterator;
 use IteratorAggregate;
 use Mockery\Adapter\Phpunit\MockeryTestCase;
+use PHPUnit\Framework\Attributes\Test;
 use ReturnTypeWillChange;
 
 /**
@@ -29,7 +30,7 @@ class Php80LanguageFeaturesTest extends MockeryTestCase
         $this->assertInstanceOf('Traversable', $mock);
     }
 
-    /** @test */
+    #[Test]
     public function it_can_mock_a_class_with_a_mixed_argument_type_hint()
     {
         $mock = mock(ArgumentMixedTypeHint::class);
@@ -39,7 +40,7 @@ class Php80LanguageFeaturesTest extends MockeryTestCase
         $mock->foo($object);
     }
 
-    /** @test */
+    #[Test]
     public function it_can_mock_a_class_with_a_union_argument_type_hint()
     {
         $mock = mock(ArgumentUnionTypeHint::class);
@@ -49,7 +50,7 @@ class Php80LanguageFeaturesTest extends MockeryTestCase
         $mock->foo($object);
     }
 
-    /** @test */
+    #[Test]
     public function it_can_mock_a_class_with_a_union_argument_type_hint_including_null()
     {
         $mock = mock(ArgumentUnionTypeHintWithNull::class);
@@ -58,7 +59,7 @@ class Php80LanguageFeaturesTest extends MockeryTestCase
         $mock->foo(null);
     }
 
-    /** @test */
+    #[Test]
     public function it_can_mock_a_class_with_a_parent_argument_type_hint()
     {
         $mock = mock(ArgumentParentTypeHint::class);
@@ -68,7 +69,7 @@ class Php80LanguageFeaturesTest extends MockeryTestCase
         $mock->foo($object);
     }
 
-    /** @test */
+    #[Test]
     public function it_can_mock_a_class_with_a_mixed_return_type_hint()
     {
         $mock = spy(ReturnTypeMixedTypeHint::class);
@@ -76,7 +77,7 @@ class Php80LanguageFeaturesTest extends MockeryTestCase
         $this->assertNull($mock->foo());
     }
 
-    /** @test */
+    #[Test]
     public function it_can_mock_a_class_with_a_union_return_type_hint()
     {
         $mock = spy(ReturnTypeUnionTypeHint::class);
@@ -84,7 +85,7 @@ class Php80LanguageFeaturesTest extends MockeryTestCase
         $this->assertTrue(is_object($mock->foo()));
     }
 
-    /** @test */
+    #[Test]
     public function it_can_mock_a_class_with_a_parent_return_type_hint()
     {
         $mock = spy(ReturnTypeParentTypeHint::class);
diff --git a/tests/PHP81/Php81LanguageFeaturesTest.php b/tests/PHP81/Php81LanguageFeaturesTest.php
index 39da847..8a7a2dc 100644
--- a/tests/PHP81/Php81LanguageFeaturesTest.php
+++ b/tests/PHP81/Php81LanguageFeaturesTest.php
@@ -6,6 +6,8 @@ use DateTime;
 use Mockery;
 use Mockery\Adapter\Phpunit\MockeryTestCase;
 use PDO;
+use PHPUnit\Framework\Attributes\RequiresPhp;
+use PHPUnit\Framework\Attributes\Test;
 use ReturnTypeWillChange;
 use RuntimeException;
 use Serializable;
@@ -14,22 +16,20 @@ use function pcntl_fork;
 use function pcntl_waitpid;
 use function pcntl_wexitstatus;
 
-/**
- * @requires PHP 8.1.0-dev
- */
+#[RequiresPhp('8.1-dev')]
 class Php81LanguageFeaturesTest extends MockeryTestCase
 {
     /**
-     * @test
      * @group issue/339
      */
+    #[Test]
     public function canMockClassesThatImplementSerializable()
     {
         $mock = mock(ClassThatImplementsSerializable::class);
         $this->assertInstanceOf("Serializable", $mock);
     }
 
-    /** @test */
+    #[Test]
     public function it_can_mock_an_internal_class_with_tentative_return_types()
     {
         $mock = spy(DateTime::class);
@@ -37,9 +37,7 @@ class Php81LanguageFeaturesTest extends MockeryTestCase
         $this->assertSame(0, $mock->getTimestamp());
     }
 
-    /**
-     * @test
-     */
+    #[Test]
     public function it_can_mock_an_internal_class_with_tentative_union_return_types()
     {
         $mock = Mockery::mock(PDO::class);
@@ -55,7 +53,7 @@ class Php81LanguageFeaturesTest extends MockeryTestCase
         }
     }
 
-    /** @test */
+    #[Test]
     public function it_can_mock_a_class_with_return_type_will_change_attribute_and_no_return_type()
     {
         $mock = spy(ReturnTypeWillChangeAttributeNoReturnType::class);
@@ -63,7 +61,7 @@ class Php81LanguageFeaturesTest extends MockeryTestCase
         $this->assertNull($mock->getTimestamp());
     }
 
-    /** @test */
+    #[Test]
     public function it_can_mock_a_class_with_return_type_will_change_attribute_and_wrong_return_type()
     {
         $mock = spy(ReturnTypeWillChangeAttributeWrongReturnType::class);
@@ -71,7 +69,7 @@ class Php81LanguageFeaturesTest extends MockeryTestCase
         $this->assertSame(0.0, $mock->getTimestamp());
     }
 
-    /** @test */
+    #[Test]
     public function testMockingClassWithNewInInitializer()
     {
         $mock = Mockery::mock(ClassWithNewInInitializer::class);
@@ -79,7 +77,7 @@ class Php81LanguageFeaturesTest extends MockeryTestCase
         $this->assertInstanceOf(ClassWithNewInInitializer::class, $mock);
     }
 
-    /** @test */
+    #[Test]
     public function it_can_mock_a_class_with_an_intersection_argument_type_hint()
     {
         $mock = Mockery::spy(ArgumentIntersectionTypeHint::class);
@@ -92,7 +90,7 @@ class Php81LanguageFeaturesTest extends MockeryTestCase
         $mock->foo(Mockery::mock(IntersectionTypeHelper1Interface::class));
     }
 
-    /** @test */
+    #[Test]
     public function it_can_mock_a_class_with_a_never_returning_type_hint()
     {
         $mock = Mockery::mock(NeverReturningTypehintClass::class)->makePartial();
@@ -103,8 +101,8 @@ class Php81LanguageFeaturesTest extends MockeryTestCase
 
     /**
      * @requires extension pcntl
-     * @test
      */
+    #[Test]
     public function it_can_mock_a_class_with_a_never_returning_type_hint_with_exit()
     {
         $mock = Mockery::mock(NeverReturningTypehintClass::class)->makePartial();
@@ -125,7 +123,7 @@ class Php81LanguageFeaturesTest extends MockeryTestCase
         $mock->exits();
     }
 
-    /** @test */
+    #[Test]
     public function it_can_parse_enum_as_default_value_correctly()
     {
         $mock = Mockery::mock(UsesEnums::class);
diff --git a/tests/PHP82/Php82LanguageFeaturesTest.php b/tests/PHP82/Php82LanguageFeaturesTest.php
index b364ca7..a3768d8 100644
--- a/tests/PHP82/Php82LanguageFeaturesTest.php
+++ b/tests/PHP82/Php82LanguageFeaturesTest.php
@@ -4,13 +4,14 @@ namespace Mockery\Tests\PHP82;
 
 use Mockery;
 use Mockery\Adapter\Phpunit\MockeryTestCase;
+use PHPUnit\Framework\Attributes\Test;
 
 /**
  * @requires PHP 8.2.0-dev
  */
 class Php82LanguageFeaturesTest extends MockeryTestCase
 {
-    /** @test */
+    #[Test]
     public function it_can_mock_an_class_with_null_return_type()
     {
         $mock = Mockery::mock(HasNullReturnType::class);
diff --git a/tests/Unit/PHP82/Php82LanguageFeaturesTest.php b/tests/Unit/PHP82/Php82LanguageFeaturesTest.php
index 260b479..0f9d9b2 100644
--- a/tests/Unit/PHP82/Php82LanguageFeaturesTest.php
+++ b/tests/Unit/PHP82/Php82LanguageFeaturesTest.php
@@ -5,6 +5,7 @@ namespace Mockery\Tests\Unit\PHP82;
 use Generator;
 use Mockery\Adapter\Phpunit\MockeryTestCase;
 use Mockery\Reflector;
+use PHPUnit\Framework\Attributes\DataProvider;
 use ReflectionType;
 
 /**
@@ -14,8 +15,8 @@ class Php82LanguageFeaturesTest extends MockeryTestCase
 {
     /**
      * @param class-string $fullyQualifiedClassName
-     * @dataProvider parameterContraVarianceDataProvider
      */
+    #[DataProvider('parameterContraVarianceDataProvider')]
     public function testMockParameterDisjunctiveNormalFormTypes(string $fullyQualifiedClassName): void
     {
         $expectedReflectionClass = new \ReflectionClass($fullyQualifiedClassName);
@@ -36,8 +37,8 @@ class Php82LanguageFeaturesTest extends MockeryTestCase
 
     /**
      * @param class-string $fullyQualifiedClassName
-     * @dataProvider returnCoVarianceDataProvider
      */
+    #[DataProvider('returnCoVarianceDataProvider')]
     public function testMockReturnDisjunctiveNormalFormTypes(string $fullyQualifiedClassName): void
     {
         $expectedReflectionClass = new \ReflectionClass($fullyQualifiedClassName);
diff --git a/tests/Unit/Regression/Issue1404Test.php b/tests/Unit/Regression/Issue1404Test.php
index 81267a3..4e023b0 100644
--- a/tests/Unit/Regression/Issue1404Test.php
+++ b/tests/Unit/Regression/Issue1404Test.php
@@ -8,6 +8,7 @@ use Generator;
 use Mockery;
 use PDO;
 use PDOStatement;
+use PHPUnit\Framework\Attributes\DataProvider;
 use PHPUnit\Framework\TestCase;
 
 /**
@@ -27,9 +28,7 @@ final class Issue1404Test extends TestCase
         ];
     }
 
-    /**
-     * @dataProvider provideResult
-     */
+    #[DataProvider('provideResult')]
     public function testDemeterChainsAllows(array $result): void
     {
         $dbConnection = Mockery::mock(PDO::class);
@@ -38,9 +37,7 @@ final class Issue1404Test extends TestCase
 
         self::assertSame($result, $dbConnection->query('sql')->fetchAll());
     }
-    /**
-     * @dataProvider provideResult
-     */
+    #[DataProvider('provideResult')]
     public function testDemeterChainsExpects(array $result): void
     {
         $dbConnection = Mockery::mock(PDO::class);
@@ -50,9 +47,7 @@ final class Issue1404Test extends TestCase
         self::assertSame($result, $dbConnection->query('sql')->fetchAll());
     }
 
-    /**
-     * @dataProvider provideResult
-     */
+    #[DataProvider('provideResult')]
     public function testDemeterChainsAlternativeSyntax(array $result): void
     {
         $dbConnection = Mockery::mock(PDO::class);
@@ -62,9 +57,7 @@ final class Issue1404Test extends TestCase
         self::assertSame($result, $dbConnection->query('sql')->fetchAll());
     }
 
-    /**
-     * @dataProvider provideResult
-     */
+    #[DataProvider('provideResult')]
     public function testNonDemeterChainsSyntax(array $result): void
     {
         $dbStatement = Mockery::mock(PDOStatement::class);
