1414// Declare chdemko\SortedCollection namespace
1515namespace chdemko \SortedCollection ;
1616
17+ use PHPUnit \Framework \Attributes \DataProvider ;
1718use PHPUnit \Framework \TestCase ;
1819
1920/**
@@ -31,13 +32,12 @@ class ReversedMapTest extends TestCase
3132 *
3233 * @return void
3334 *
34- * @covers chdemko\SortedCollection\ReversedMap::__construct
35- * @covers chdemko\SortedCollection\ReversedMap::create
36- * @covers chdemko\SortedCollection\ReversedMap::__get
37- * @covers chdemko\SortedCollection\ReversedMap::comparator
38- *
3935 * @since 1.0.0
4036 */
37+ #[CoversFunction('chdemko\SortedCollection\ReversedMap::__construct ' )]
38+ #[CoversFunction('chdemko\SortedCollection\ReversedMap::create ' )]
39+ #[CoversFunction('chdemko\SortedCollection\ReversedMap::__get ' )]
40+ #[CoversFunction('chdemko\SortedCollection\ReversedMap::comparator ' )]
4141 public function testConstruct ()
4242 {
4343 $ tree = TreeMap::create ()->initialise (array (0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 ));
@@ -71,10 +71,9 @@ public function testConstruct()
7171 *
7272 * @return void
7373 *
74- * @covers chdemko\SortedCollection\ReversedMap::first
75- *
7674 * @since 1.0.0
7775 */
76+ #[CoversFunction('chdemko\SortedCollection\ReversedMap::first ' )]
7877 public function testFirst ()
7978 {
8079 $ tree = TreeMap::create ()->initialise (array (0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 ));
@@ -91,10 +90,9 @@ public function testFirst()
9190 *
9291 * @return void
9392 *
94- * @covers chdemko\SortedCollection\ReversedMap::last
95- *
9693 * @since 1.0.0
9794 */
95+ #[CoversFunction('chdemko\SortedCollection\ReversedMap::last ' )]
9896 public function testLast ()
9997 {
10098 $ tree = TreeMap::create ()->initialise (array (0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 ));
@@ -111,11 +109,10 @@ public function testLast()
111109 *
112110 * @return void
113111 *
114- * @covers chdemko\SortedCollection\ReversedMap::predecessor
115- * @covers chdemko\SortedCollection\AbstractMap::predecessor
116- *
117112 * @since 1.0.0
118113 */
114+ #[CoversFunction('chdemko\SortedCollection\ReversedMap::predecessor ' )]
115+ #[CoversFunction('chdemko\SortedCollection\AbstractMap::predecessor ' )]
119116 public function testPredecessor ()
120117 {
121118 $ tree = TreeMap::create ()->initialise (array (0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 ));
@@ -133,11 +130,10 @@ public function testPredecessor()
133130 *
134131 * @return void
135132 *
136- * @covers chdemko\SortedCollection\ReversedMap::successor
137- * @covers chdemko\SortedCollection\AbstractMap::successor
138- *
139133 * @since 1.0.0
140134 */
135+ #[CoversFunction('chdemko\SortedCollection\ReversedMap::successor ' )]
136+ #[CoversFunction('chdemko\SortedCollection\AbstractMap::successor ' )]
141137 public function testSuccessor ()
142138 {
143139 $ tree = TreeMap::create ()->initialise (array (0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 ));
@@ -179,13 +175,11 @@ public static function casesLowerKey()
179175 *
180176 * @return void
181177 *
182- * @covers chdemko\SortedCollection\ReversedMap::lower
183- * @covers chdemko\SortedCollection\AbstractMap::lowerKey
184- *
185- * @dataProvider casesLowerKey
186- *
187178 * @since 1.0.0
188179 */
180+ #[DataProvider('casesLowerKey ' )]
181+ #[CoversFunction('chdemko\SortedCollection\ReversedMap::lower ' )]
182+ #[CoversFunction('chdemko\SortedCollection\AbstractMap::lowerKey ' )]
189183 public function testLowerKey ($ values , $ key , $ expected , $ exception )
190184 {
191185 if ($ exception ) {
@@ -230,13 +224,11 @@ public static function casesFloorKey()
230224 *
231225 * @return void
232226 *
233- * @covers chdemko\SortedCollection\ReversedMap::floor
234- * @covers chdemko\SortedCollection\AbstractMap::floorKey
235- *
236- * @dataProvider casesFloorKey
237- *
238227 * @since 1.0.0
239228 */
229+ #[DataProvider('casesFloorKey ' )]
230+ #[CoversFunction('chdemko\SortedCollection\ReversedMap::floor ' )]
231+ #[CoversFunction('chdemko\SortedCollection\AbstractMap::floorKey ' )]
240232 public function testFloorKey ($ values , $ key , $ found , $ exception )
241233 {
242234 if ($ exception ) {
@@ -257,11 +249,10 @@ public function testFloorKey($values, $key, $found, $exception)
257249 *
258250 * @return void
259251 *
260- * @covers chdemko\SortedCollection\ReversedMap::find
261- * @covers chdemko\SortedCollection\AbstractMap::findKey
262- *
263252 * @since 1.0.0
264253 */
254+ #[CoversFunction('chdemko\SortedCollection\ReversedMap::find ' )]
255+ #[CoversFunction('chdemko\SortedCollection\AbstractMap::findKey ' )]
265256 public function testFindKey ()
266257 {
267258 $ tree = TreeMap::create ()->initialise (array (0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 ));
@@ -307,13 +298,11 @@ public static function casesCeilingKey()
307298 *
308299 * @return void
309300 *
310- * @covers chdemko\SortedCollection\ReversedMap::ceiling
311- * @covers chdemko\SortedCollection\AbstractMap::floorKey
312- *
313- * @dataProvider casesCeilingKey
314- *
315301 * @since 1.0.0
316302 */
303+ #[DataProvider('casesCeilingKey ' )]
304+ #[CoversFunction('chdemko\SortedCollection\ReversedMap::ceiling ' )]
305+ #[CoversFunction('chdemko\SortedCollection\AbstractMap::floorKey ' )]
317306 public function testCeilingKey ($ values , $ key , $ expected , $ exception )
318307 {
319308 if ($ exception ) {
@@ -358,13 +347,11 @@ public static function casesHigherKey()
358347 *
359348 * @return void
360349 *
361- * @covers chdemko\SortedCollection\ReversedMap::higher
362- * @covers chdemko\SortedCollection\AbstractMap::higherKey
363- *
364- * @dataProvider casesHigherKey
365- *
366350 * @since 1.0.0
367351 */
352+ #[DataProvider('casesHigherKey ' )]
353+ #[CoversFunction('chdemko\SortedCollection\ReversedMap::higher ' )]
354+ #[CoversFunction('chdemko\SortedCollection\AbstractMap::higherKey ' )]
368355 public function testHigherKey ($ values , $ key , $ expected , $ exception )
369356 {
370357 if ($ exception ) {
@@ -385,11 +372,10 @@ public function testHigherKey($values, $key, $expected, $exception)
385372 *
386373 * @return void
387374 *
388- * @covers chdemko\SortedCollection\ReversedMap::keys
389- * @covers chdemko\SortedCollection\AbstractMap::__get
390- *
391375 * @since 1.0.0
392376 */
377+ #[CoversFunction('chdemko\SortedCollection\ReversedMap::keys ' )]
378+ #[CoversFunction('chdemko\SortedCollection\AbstractMap::__get ' )]
393379 public function testKeys ()
394380 {
395381 $ empty = true ;
@@ -417,11 +403,10 @@ public function testKeys()
417403 *
418404 * @return void
419405 *
420- * @covers chdemko\SortedCollection\AbstractMap::values
421- * @covers chdemko\SortedCollection\AbstractMap::__get
422- *
423406 * @since 1.0.0
424407 */
408+ #[CoversFunction('chdemko\SortedCollection\AbstractMap::values ' )]
409+ #[CoversFunction('chdemko\SortedCollection\AbstractMap::__get ' )]
425410 public function testValues ()
426411 {
427412 $ empty = true ;
@@ -473,12 +458,10 @@ public static function casesOffsetGet()
473458 *
474459 * @return void
475460 *
476- * @covers chdemko\SortedCollection\AbstractMap::offsetGet
477- *
478- * @dataProvider casesOffsetGet
479- *
480461 * @since 1.0.0
481462 */
463+ #[DataProvider('casesOffsetGet ' )]
464+ #[CoversFunction('chdemko\SortedCollection\AbstractMap::offsetGet ' )]
482465 public function testOffsetGet ($ values , $ key , $ value , $ exception )
483466 {
484467 if ($ exception ) {
@@ -499,10 +482,9 @@ public function testOffsetGet($values, $key, $value, $exception)
499482 *
500483 * @return void
501484 *
502- * @covers chdemko\SortedCollection\AbstractMap::offsetSet
503- *
504485 * @since 1.0.0
505486 */
487+ #[CoversFunction('chdemko\SortedCollection\AbstractMap::offsetSet ' )]
506488 public function testOffsetSet ()
507489 {
508490 $ this ->expectException ('RuntimeException ' );
@@ -517,10 +499,9 @@ public function testOffsetSet()
517499 *
518500 * @return void
519501 *
520- * @covers chdemko\SortedCollection\ReversedMap::offsetExists
521- *
522502 * @since 1.0.0
523503 */
504+ #[CoversFunction('chdemko\SortedCollection\ReversedMap::offsetExists ' )]
524505 public function testOffsetExists ()
525506 {
526507 $ tree = TreeMap::create ();
@@ -545,10 +526,9 @@ public function testOffsetExists()
545526 *
546527 * @return void
547528 *
548- * @covers chdemko\SortedCollection\AbstractMap::offsetUnset
549- *
550529 * @since 1.0.0
551530 */
531+ #[CoversFunction('chdemko\SortedCollection\AbstractMap::offsetUnset ' )]
552532 public function testOffsetUnset ()
553533 {
554534 $ this ->expectException ('RuntimeException ' );
@@ -563,11 +543,10 @@ public function testOffsetUnset()
563543 *
564544 * @return void
565545 *
566- * @covers chdemko\SortedCollection\ReversedMap::count
567- * @covers chdemko\SortedCollection\AbstractMap::__get
568- *
569546 * @since 1.0.0
570547 */
548+ #[CoversFunction('chdemko\SortedCollection\ReversedMap::count ' )]
549+ #[CoversFunction('chdemko\SortedCollection\AbstractMap::__get ' )]
571550 public function testCount ()
572551 {
573552 $ tree = TreeMap::create ();
@@ -591,10 +570,9 @@ public function testCount()
591570 *
592571 * @return void
593572 *
594- * @covers chdemko\SortedCollection\ReversedMap::jsonSerialize
595- *
596573 * @since 1.0.0
597574 */
575+ #[CoversFunction('chdemko\SortedCollection\ReversedMap::jsonSerialize ' )]
598576 public function testJsonSerialize ()
599577 {
600578 $ tree = TreeMap::create ();
0 commit comments