22
33declare (strict_types=1 );
44
5+ use PHPUnit \Framework \Attributes \TestDox ;
56use PHPUnit \Framework \TestCase ;
67
78class RobotNameTest extends TestCase
@@ -11,12 +12,14 @@ public static function setUpBeforeClass(): void
1112 require_once 'RobotName.php ' ;
1213 }
1314
15+ #[TestDox('Has name ' )]
1416 public function testHasName (): void
1517 {
1618 $ robot = new Robot ();
1719 $ this ->assertMatchesRegularExpression ('/^[a-z]{2}\d{3}$/i ' , $ robot ->getName ());
1820 }
1921
22+ #[TestDox('Name sticks ' )]
2023 public function testNameSticks (): void
2124 {
2225 $ robot = new Robot ();
@@ -25,6 +28,7 @@ public function testNameSticks(): void
2528 $ this ->assertSame ($ robot ->getName (), $ old );
2629 }
2730
31+ #[TestDox('Different robots have different names ' )]
2832 public function testDifferentRobotsHaveDifferentNames (): void
2933 {
3034 $ robot = new Robot ();
@@ -35,6 +39,7 @@ public function testDifferentRobotsHaveDifferentNames(): void
3539 unset($ other_bot );
3640 }
3741
42+ #[TestDox('Reset name ' )]
3843 public function testResetName (): void
3944 {
4045 $ robot = new Robot ();
@@ -49,6 +54,7 @@ public function testResetName(): void
4954 $ this ->assertMatchesRegularExpression ('/\w{2}\d{3}/ ' , $ name2 );
5055 }
5156
57+ #[TestDox("Names aren't recycled " )]
5258 public function testNamesArentRecycled (): void
5359 {
5460 $ robot = new Robot ();
@@ -63,6 +69,7 @@ public function testNamesArentRecycled(): void
6369 }
6470
6571 // This test is optional.
72+ #[TestDox('Name uniqueness many robots ' )]
6673 public function testNameUniquenessManyRobots (): void
6774 {
6875 $ robot = new Robot ();
0 commit comments