44
55namespace WayOfDev \Tests \Functional ;
66
7+ use PHPUnit \Framework \Attributes \Test ;
78use Spiral \Pagination \Paginator as SpiralPaginator ;
89use TiagoHillebrandt \ParseLinkHeader ;
910use WayOfDev \Paginator \CyclePaginator ;
@@ -17,119 +18,91 @@ final class CyclePaginatorTest extends TestCase
1718
1819 private int $ perPage = 5 ;
1920
20- /**
21- * @test
22- */
21+ #[Test]
2322 public function it_gets_total_items (): void
2423 {
2524 self ::assertEquals (34 , $ this ->getPaginator ()->total ());
2625 }
2726
28- /**
29- * @test
30- */
27+ #[Test]
3128 public function it_gets_last_page (): void
3229 {
3330 self ::assertEquals (7 , $ this ->getPaginator ()->lastPage ());
3431 }
3532
36- /**
37- * @test
38- */
33+ #[Test]
3934 public function it_gets_next_page_url_when_it_exists (): void
4035 {
4136 self ::assertEquals ('/?page=3 ' , $ this ->getPaginator ()->nextPageUrl ());
4237 }
4338
44- /**
45- * @test
46- */
39+ #[Test]
4740 public function it_gets_next_page_url_when_it_not_exists (): void
4841 {
4942 self ::assertNull (
5043 $ this ->getPaginator (1 , 200 )->nextPageUrl ()
5144 );
5245 }
5346
54- /**
55- * @test
56- */
47+ #[Test]
5748 public function it_gets_previous_page_url_when_it_exists (): void
5849 {
5950 self ::assertEquals ('/?page=1 ' , $ this ->getPaginator ()->previousPageUrl ());
6051 }
6152
62- /**
63- * @test
64- */
53+ #[Test]
6554 public function it_gets_previous_page_url_when_it_not_exists (): void
6655 {
6756 self ::assertNull (
6857 $ this ->getPaginator (1 , 1 )->previousPageUrl ()
6958 );
7059 }
7160
72- /**
73- * @test
74- */
61+ #[Test]
7562 public function it_gets_items (): void
7663 {
7764 $ items = array_slice ($ this ->items , 5 , 5 , true );
7865
7966 self ::assertEquals ($ items , $ this ->getPaginator ()->items ());
8067 }
8168
82- /**
83- * @test
84- */
69+ #[Test]
8570 public function it_gets_first_item (): void
8671 {
8772 self ::assertEquals (6 , $ this ->getPaginator ()->firstItem ());
8873 }
8974
90- /**
91- * @test
92- */
75+ #[Test]
9376 public function it_gets_last_item (): void
9477 {
9578 self ::assertEquals (10 , $ this ->getPaginator ()->lastItem ());
9679 }
9780
98- /**
99- * @test
100- */
81+ #[Test]
10182 public function it_gets_per_page (): void
10283 {
10384 self ::assertEquals (5 , $ this ->getPaginator ()->perPage ());
10485 }
10586
106- /**
107- * @test
108- */
87+ #[Test]
10988 public function it_gets_current_page (): void
11089 {
11190 self ::assertEquals (2 , $ this ->getPaginator ()->currentPage ());
11291 }
11392
114- /**
115- * @test
116- */
93+ #[Test]
11794 public function it_gets_page_name (): void
11895 {
11996 self ::assertEquals ('page ' , $ this ->getPaginator ()->getPageName ());
12097 }
12198
122- /**
123- * @test
124- */
99+ #[Test]
125100 public function it_gets_count (): void
126101 {
127102 self ::assertEquals (5 , $ this ->getPaginator ()->count ());
128103 }
129104
130- /**
131- * @test
132- */
105+ #[Test]
133106 public function it_returns_links (): void
134107 {
135108 $ paginator = $ this ->getPaginator ();
@@ -150,9 +123,7 @@ public function it_returns_links(): void
150123 self ::assertEquals ('3 ' , $ links ['next ' ]['page ' ]);
151124 }
152125
153- /**
154- * @test
155- */
126+ #[Test]
156127 public function it_returns_response_headers (): void
157128 {
158129 $ paginator = $ this ->getPaginator ();
0 commit comments