4
4
5
5
namespace SonsOfPHP \Component \Link \Tests ;
6
6
7
+ use PHPUnit \Framework \Attributes \CoversClass ;
8
+ use PHPUnit \Framework \Attributes \UsesClass ;
7
9
use PHPUnit \Framework \TestCase ;
8
10
use Psr \Link \EvolvableLinkInterface ;
9
11
use SonsOfPHP \Component \Link \EvolvableLink ;
12
+ use SonsOfPHP \Component \Link \Link ;
13
+ use Stringable ;
10
14
11
- /**
12
- * @coversDefaultClass \SonsOfPHP\Component\Link\EvolvableLink
13
- *
14
- * @uses \SonsOfPHP\Component\Link\EvolvableLink
15
- * @uses \SonsOfPHP\Component\Link\Link
16
- */
15
+ #[CoversClass(EvolvableLink::class)]
16
+ #[UsesClass(Link::class)]
17
17
final class EvolvableLinkTest extends TestCase
18
18
{
19
- /**
20
- * @covers ::__construct
21
- */
22
19
public function testItHasTheCorrectInterface (): void
23
20
{
24
21
$ link = new EvolvableLink ();
25
22
26
23
$ this ->assertInstanceOf (EvolvableLinkInterface::class, $ link );
27
24
}
28
25
29
- /**
30
- * @covers ::withHref
31
- */
32
26
public function testWithHrefWhenStringable (): void
33
27
{
34
- $ href = new class () implements \ Stringable {
28
+ $ href = new class () implements Stringable {
35
29
public function __toString (): string
36
30
{
37
31
return 'https://docs.sonsofphp.com ' ;
@@ -43,9 +37,6 @@ public function __toString(): string
43
37
$ this ->assertSame ((string ) $ href , $ link ->withHref ($ href )->getHref ());
44
38
}
45
39
46
- /**
47
- * @covers ::withHref
48
- */
49
40
public function testWithHref (): void
50
41
{
51
42
$ href = 'https://docs.sonsofphp.com ' ;
@@ -55,9 +46,6 @@ public function testWithHref(): void
55
46
$ this ->assertSame ($ href , $ link ->withHref ($ href )->getHref ());
56
47
}
57
48
58
- /**
59
- * @covers ::withRel
60
- */
61
49
public function testWithRelWhenAlreadyExists (): void
62
50
{
63
51
$ rel = 'next ' ;
@@ -66,9 +54,6 @@ public function testWithRelWhenAlreadyExists(): void
66
54
$ this ->assertSame ($ link , $ link ->withRel ($ rel ));
67
55
}
68
56
69
- /**
70
- * @covers ::withRel
71
- */
72
57
public function testWithRel (): void
73
58
{
74
59
$ rel = 'next ' ;
@@ -78,9 +63,6 @@ public function testWithRel(): void
78
63
$ this ->assertContains ($ rel , $ link ->withRel ($ rel )->getRels ());
79
64
}
80
65
81
- /**
82
- * @covers ::withoutRel
83
- */
84
66
public function testWithoutRelWhenRelNotPresent (): void
85
67
{
86
68
$ rel = 'next ' ;
@@ -90,9 +72,6 @@ public function testWithoutRelWhenRelNotPresent(): void
90
72
$ this ->assertNotContains ($ rel , $ link ->withoutRel ($ rel )->getRels ());
91
73
}
92
74
93
- /**
94
- * @covers ::withoutRel
95
- */
96
75
public function testWithoutRel (): void
97
76
{
98
77
$ rel = 'next ' ;
@@ -102,9 +81,6 @@ public function testWithoutRel(): void
102
81
$ this ->assertNotContains ($ rel , $ link ->withoutRel ($ rel )->getRels ());
103
82
}
104
83
105
- /**
106
- * @covers ::withAttribute
107
- */
108
84
public function testWithAttribute (): void
109
85
{
110
86
$ key = 'key ' ;
@@ -115,9 +91,6 @@ public function testWithAttribute(): void
115
91
$ this ->assertArrayHasKey ($ key , $ link ->withAttribute ($ key , $ value )->getAttributes ());
116
92
}
117
93
118
- /**
119
- * @covers ::withoutAttribute
120
- */
121
94
public function testWithoutAttributeWhenKeyDoesNotExist (): void
122
95
{
123
96
$ key = 'key ' ;
@@ -127,9 +100,6 @@ public function testWithoutAttributeWhenKeyDoesNotExist(): void
127
100
$ this ->assertArrayNotHasKey ($ key , $ link ->withoutAttribute ($ key )->getAttributes ());
128
101
}
129
102
130
- /**
131
- * @covers ::withoutAttribute
132
- */
133
103
public function testWithoutAttribute (): void
134
104
{
135
105
$ key = 'key ' ;
0 commit comments