66
77use F9Web \Meta \Exceptions \GuessorException ;
88use F9Web \Meta \TitleGuessor ;
9+ use PHPUnit \Framework \Attributes \DataProvider ;
910
1011class TitleGuessorTest extends TestCase
1112{
@@ -25,8 +26,7 @@ public function tearDown(): void
2526 parent ::tearDown ();
2627 }
2728
28- /** @test */
29- public function it_resets_class_properties ()
29+ public function test_it_resets_class_properties ()
3030 {
3131 $ service = new TitleGuessor ();
3232 $ service ->withRoute ('users.create ' );
@@ -40,8 +40,7 @@ public function it_resets_class_properties()
4040 $ this ->assertNull ($ service ->getRoute ());
4141 }
4242
43- /** @test */
44- public function it_returns_null_when_disabled ()
43+ public function test_it_returns_null_when_disabled ()
4544 {
4645 $ this ->app ['config ' ]->set (
4746 [
@@ -56,8 +55,7 @@ public function it_returns_null_when_disabled()
5655 $ this ->assertNull ((new TitleGuessor ())->render ());
5756 }
5857
59- /** @test */
60- public function it_throws_an_exception__when_an_invalid_guessing_method_is_provided ()
58+ public function test_it_throws_an_exception__when_an_invalid_guessing_method_is_provided ()
6159 {
6260 $ this ->expectException (GuessorException::class);
6361
@@ -70,13 +68,8 @@ public function it_throws_an_exception__when_an_invalid_guessing_method_is_provi
7068 (new TitleGuessor ())->render ();
7169 }
7270
73- /**
74- * @test
75- * @dataProvider uriSegmentsProvider
76- * @param string $title
77- * @param string $uri
78- */
79- public function it_determines_the_title_using_uri_segments (string $ title , string $ uri )
71+ #[DataProvider('uriSegmentsProvider ' )]
72+ public function test_it_determines_the_title_using_uri_segments (string $ title , string $ uri )
8073 {
8174 $ this ->app ['config ' ]->set (
8275 [
@@ -114,13 +107,8 @@ public static function uriSegmentsProvider(): array
114107 ];
115108 }
116109
117- /**
118- * @test
119- * @dataProvider namedRoutesProvider
120- * @param string $title
121- * @param string $route
122- */
123- public function it_determines_the_title_using_named_routes (string $ title , string $ route )
110+ #[DataProvider('namedRoutesProvider ' )]
111+ public function test_it_determines_the_title_using_named_routes (string $ title , string $ route )
124112 {
125113 $ this ->app ['config ' ]->set (
126114 [
0 commit comments