File: 0003-Modernize-PHPUnit-syntax.patch

package info (click to toggle)
php-enum 4.7.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 556 kB
  • sloc: php: 3,489; xml: 15; makefile: 8
file content (93 lines) | stat: -rw-r--r-- 3,215 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
From: =?utf-8?q?David_Pr=C3=A9vot?= <taffit@debian.org>
Date: Sun, 6 Apr 2025 10:48:14 +0200
Subject: Modernize PHPUnit syntax

---
 tests/MabeEnumTest/EnumSetIteratorTest.php |  3 ++-
 tests/MabeEnumTest/EnumSetTest.php         | 11 ++++++-----
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/tests/MabeEnumTest/EnumSetIteratorTest.php b/tests/MabeEnumTest/EnumSetIteratorTest.php
index ed98c64..f2b0d23 100644
--- a/tests/MabeEnumTest/EnumSetIteratorTest.php
+++ b/tests/MabeEnumTest/EnumSetIteratorTest.php
@@ -14,6 +14,7 @@ use MabeEnumTest\TestAsset\Enum64;
 use MabeEnumTest\TestAsset\Enum65;
 use MabeEnumTest\TestAsset\Enum66;
 use OutOfBoundsException;
+use PHPUnit\Framework\Attributes\DataProvider;
 use PHPUnit\Framework\TestCase;
 
 /**
@@ -82,8 +83,8 @@ class EnumSetIteratorTest extends TestCase
 
     /**
      * @param class-string<Enum> $enumeration
-     * @dataProvider getIntegerEnumerations
      */
+    #[DataProvider('getIntegerEnumerations')]
     public function testNextCurrentOutOfRange(string $enumeration): void
     {
         $set   = new EnumSet($enumeration);
diff --git a/tests/MabeEnumTest/EnumSetTest.php b/tests/MabeEnumTest/EnumSetTest.php
index f6fe5c7..14c0f64 100644
--- a/tests/MabeEnumTest/EnumSetTest.php
+++ b/tests/MabeEnumTest/EnumSetTest.php
@@ -14,6 +14,7 @@ use MabeEnumTest\TestAsset\Enum64;
 use MabeEnumTest\TestAsset\Enum65;
 use MabeEnumTest\TestAsset\Enum66;
 use MabeEnumTest\TestAsset\EnumSetExt;
+use PHPUnit\Framework\Attributes\DataProvider;
 use PHPUnit\Framework\TestCase;
 
 /**
@@ -170,8 +171,8 @@ class EnumSetTest extends TestCase
 
     /**
      * @param class-string<Enum> $enumeration
-     * @dataProvider getIntegerEnumerations
      */
+    #[DataProvider('getIntegerEnumerations')]
     public function testAddRemove(string $enumeration): void
     {
         $set = new EnumSet($enumeration);
@@ -198,8 +199,8 @@ class EnumSetTest extends TestCase
 
     /**
      * @param class-string<Enum> $enumeration
-     * @dataProvider getIntegerEnumerations
      */
+    #[DataProvider('getIntegerEnumerations')]
     public function testAddRemoveIterable(string $enumeration): void
     {
         $set = new EnumSet($enumeration);
@@ -215,8 +216,8 @@ class EnumSetTest extends TestCase
 
     /**
      * @param class-string<Enum> $enumeration
-     * @dataProvider getIntegerEnumerations
      */
+    #[DataProvider('getIntegerEnumerations')]
     public function testWithWithout(string $enumeration): void
     {
         $set = new EnumSet($enumeration);
@@ -242,8 +243,8 @@ class EnumSetTest extends TestCase
 
     /**
      * @param class-string<Enum> $enumeration
-     * @dataProvider getIntegerEnumerations
      */
+    #[DataProvider('getIntegerEnumerations')]
     public function testWithWithoutIterable(string $enumeration): void
     {
         $set = new EnumSet($enumeration);
@@ -764,8 +765,8 @@ class EnumSetTest extends TestCase
 
     /**
      * @param class-string<Enum> $enumeration
-     * @dataProvider getIntegerEnumerations
      */
+    #[DataProvider('getIntegerEnumerations')]
     public function testIsEmpty(string $enumeration): void
     {
         $set1 = new EnumSet($enumeration, []);