1515use Overblog \PromiseAdapter \Adapter \ReactPromiseAdapter ;
1616use Overblog \PromiseAdapter \Adapter \WebonyxGraphQLSyncPromiseAdapter ;
1717use Overblog \PromiseAdapter \PromiseAdapterInterface ;
18+ use PHPUnit \Framework \Attributes \DataProvider ;
1819
1920class AdapterTest extends \PHPUnit \Framework \TestCase
2021{
2122 /**
22- * @dataProvider AdapterDataProvider
2323 * @param string $promiseClass
2424 * @param PromiseAdapterInterface $Adapter
2525 * @param string $context
2626 */
27+ #[DataProvider('AdapterDataProvider ' )]
2728 public function testCreate (PromiseAdapterInterface $ Adapter , $ context , $ promiseClass )
2829 {
2930 $ promise = $ Adapter ->create ($ resolve , $ reject );
@@ -34,10 +35,10 @@ public function testCreate(PromiseAdapterInterface $Adapter, $context, $promiseC
3435 }
3536
3637 /**
37- * @dataProvider AdapterDataProvider
3838 * @param PromiseAdapterInterface $Adapter
3939 * @param $message
4040 */
41+ #[DataProvider('AdapterDataProvider ' )]
4142 public function testResolveCreatedPromise (PromiseAdapterInterface $ Adapter , $ message )
4243 {
4344 $ promise = $ Adapter ->create ($ resolve , $ reject );
@@ -49,10 +50,10 @@ public function testResolveCreatedPromise(PromiseAdapterInterface $Adapter, $mes
4950 }
5051
5152 /**
52- * @dataProvider AdapterDataProvider
5353 * @param PromiseAdapterInterface $Adapter
5454 * @param string $context
5555 */
56+ #[DataProvider('AdapterDataProvider ' )]
5657 public function testRejectCreatedPromise (PromiseAdapterInterface $ Adapter , $ context )
5758 {
5859 $ promise = $ Adapter ->create ($ resolve , $ reject );
@@ -65,11 +66,11 @@ public function testRejectCreatedPromise(PromiseAdapterInterface $Adapter, $cont
6566 }
6667
6768 /**
68- * @dataProvider AdapterDataProvider
6969 * @param PromiseAdapterInterface $Adapter
7070 * @param string $context
7171 * @param string $promiseClass
7272 */
73+ #[DataProvider('AdapterDataProvider ' )]
7374 public function testCreateAll (PromiseAdapterInterface $ Adapter , $ context , $ promiseClass )
7475 {
7576 $ values = ['A ' , 'B ' , 'C ' ];
@@ -82,11 +83,11 @@ public function testCreateAll(PromiseAdapterInterface $Adapter, $context, $promi
8283 }
8384
8485 /**
85- * @dataProvider AdapterDataProvider
8686 * @param PromiseAdapterInterface $Adapter
8787 * @param string $context
8888 * @param string $promiseClass
8989 */
90+ #[DataProvider('AdapterDataProvider ' )]
9091 public function testCreateFulfilled (PromiseAdapterInterface $ Adapter , $ context , $ promiseClass )
9192 {
9293 $ value = 'resolved! ' ;
@@ -98,11 +99,11 @@ public function testCreateFulfilled(PromiseAdapterInterface $Adapter, $context,
9899 }
99100
100101 /**
101- * @dataProvider AdapterDataProvider
102102 * @param PromiseAdapterInterface $Adapter
103103 * @param string $context
104104 * @param string $promiseClass
105105 */
106+ #[DataProvider('AdapterDataProvider ' )]
106107 public function testCreatedRejected (PromiseAdapterInterface $ Adapter , $ context , $ promiseClass )
107108 {
108109 $ expectRejectionReason = new \Exception ('Error! ' );
@@ -114,10 +115,10 @@ public function testCreatedRejected(PromiseAdapterInterface $Adapter, $context,
114115 }
115116
116117 /**
117- * @dataProvider AdapterDataProvider
118118 * @param PromiseAdapterInterface $Adapter
119119 * @param string $context
120120 */
121+ #[DataProvider('AdapterDataProvider ' )]
121122 public function testIsPromise (PromiseAdapterInterface $ Adapter , $ context )
122123 {
123124 $ promise = $ Adapter ->create ();
@@ -128,10 +129,10 @@ public function testIsPromise(PromiseAdapterInterface $Adapter, $context)
128129 }
129130
130131 /**
131- * @dataProvider AdapterDataProvider
132132 * @param PromiseAdapterInterface $Adapter
133133 * @param string $context
134134 */
135+ #[DataProvider('AdapterDataProvider ' )]
135136 public function testAwaitWithoutPromise (PromiseAdapterInterface $ Adapter , $ context )
136137 {
137138 $ expected = 'expected value ' ;
@@ -148,10 +149,9 @@ public function testAwaitWithoutPromise(PromiseAdapterInterface $Adapter, $conte
148149 }
149150
150151 /**
151- * @dataProvider AdapterDataProvider
152152 * @param PromiseAdapterInterface $Adapter
153- *
154153 */
154+ #[DataProvider('AdapterDataProvider ' )]
155155 public function testAwaitWithUnwrap (PromiseAdapterInterface $ Adapter )
156156 {
157157 $ this ->expectException (\Exception::class);
@@ -164,9 +164,9 @@ public function testAwaitWithUnwrap(PromiseAdapterInterface $Adapter)
164164 }
165165
166166 /**
167- * @dataProvider AdapterDataProvider
168167 * @param PromiseAdapterInterface $Adapter
169168 */
169+ #[DataProvider('AdapterDataProvider ' )]
170170 public function testAwaitWithInvalidPromise (PromiseAdapterInterface $ Adapter )
171171 {
172172 $ this ->expectException (\InvalidArgumentException::class);
@@ -176,9 +176,9 @@ public function testAwaitWithInvalidPromise(PromiseAdapterInterface $Adapter)
176176 }
177177
178178 /**
179- * @dataProvider AdapterDataProvider
180179 * @param PromiseAdapterInterface $Adapter
181180 */
181+ #[DataProvider('AdapterDataProvider ' )]
182182 public function testCancel (PromiseAdapterInterface $ Adapter )
183183 {
184184 $ this ->expectException (\Exception::class);
@@ -193,9 +193,9 @@ public function testCancel(PromiseAdapterInterface $Adapter)
193193 }
194194
195195 /**
196- * @dataProvider AdapterDataProvider
197196 * @param PromiseAdapterInterface $Adapter
198197 */
198+ #[DataProvider('AdapterDataProvider ' )]
199199 public function testCancelInvalidPromise (PromiseAdapterInterface $ Adapter )
200200 {
201201 $ this ->expectException (\Exception::class);
@@ -208,7 +208,7 @@ public function testCancelInvalidPromise(PromiseAdapterInterface $Adapter)
208208 $ Adapter ->cancel (new \stdClass ());
209209 }
210210
211- public function AdapterDataProvider ()
211+ public static function AdapterDataProvider ()
212212 {
213213 return [
214214 [new GuzzleHttpPromiseAdapter (), 'guzzle ' , 'GuzzleHttp \\Promise \\PromiseInterface ' ],
0 commit comments