2020use Facebook \WebDriver \JavaScriptExecutor ;
2121use Facebook \WebDriver \WebDriver ;
2222use Facebook \WebDriver \WebDriverExpectedCondition ;
23+ use PHPUnit \Framework \Attributes \DataProvider ;
2324use Symfony \Component \BrowserKit \AbstractBrowser ;
2425use Symfony \Component \BrowserKit \Cookie ;
2526use Symfony \Component \BrowserKit \CookieJar as BrowserKitCookieJar ;
@@ -56,6 +57,7 @@ public function testWaitForEmptyLocator(): void
5657 $ client ->waitFor ('' );
5758 }
5859
60+ #[DataProvider('waitForDataProvider ' )]
5961 /**
6062 * @dataProvider waitForDataProvider
6163 */
@@ -83,6 +85,7 @@ public static function waitForDataProvider(): iterable
8385 yield 'xpath expression ' => ['locator ' => '//*[@id="hello"] ' ];
8486 }
8587
88+ #[DataProvider('waitForDataProvider ' )]
8689 /**
8790 * @dataProvider waitForDataProvider
8891 */
@@ -95,6 +98,7 @@ public function testWaitForVisibility(string $locator): void
9598 $ this ->assertSame ('Hello ' , $ crawler ->filter ('#hello ' )->text (null , true ));
9699 }
97100
101+ #[DataProvider('waitForDataProvider ' )]
98102 /**
99103 * @dataProvider waitForDataProvider
100104 */
@@ -107,6 +111,7 @@ public function testWaitForInvisibility(string $locator): void
107111 $ this ->assertSame ('' , $ crawler ->filter ('#hello ' )->text (null , true ));
108112 }
109113
114+ #[DataProvider('waitForDataProvider ' )]
110115 /**
111116 * @dataProvider waitForDataProvider
112117 */
@@ -119,6 +124,7 @@ public function testWaitForElementToContain(string $locator): void
119124 $ this ->assertSame ('Hello new content ' , $ crawler ->filter ('#hello ' )->text (null , true ));
120125 }
121126
127+ #[DataProvider('waitForDataProvider ' )]
122128 /**
123129 * @dataProvider waitForDataProvider
124130 */
@@ -131,6 +137,7 @@ public function testWaitForElementToNotContain(string $locator): void
131137 $ this ->assertSame ('Hello ' , $ crawler ->filter ('#hello ' )->text (null , true ));
132138 }
133139
140+ #[DataProvider('waitForDataProvider ' )]
134141 /**
135142 * @dataProvider waitForDataProvider
136143 */
@@ -143,6 +150,7 @@ public function testWaitForEnabled(string $locator): void
143150 $ this ->assertTrue ($ crawler ->filter ('#hello ' )->isEnabled ());
144151 }
145152
153+ #[DataProvider('waitForDataProvider ' )]
146154 /**
147155 * @dataProvider waitForDataProvider
148156 */
@@ -155,6 +163,7 @@ public function testWaitForDisabled(string $locator): void
155163 $ this ->assertFalse ($ crawler ->filter ('#hello ' )->isEnabled ());
156164 }
157165
166+ #[DataProvider('waitForDataProvider ' )]
158167 /**
159168 * @dataProvider waitForDataProvider
160169 */
@@ -167,6 +176,7 @@ public function testWaitForAttributeToContain(string $locator): void
167176 $ this ->assertSame ('42 ' , $ crawler ->filter ('#hello ' )->getAttribute ('data-old-price ' ));
168177 }
169178
179+ #[DataProvider('waitForDataProvider ' )]
170180 /**
171181 * @dataProvider waitForDataProvider
172182 */
@@ -179,6 +189,7 @@ public function testWaitForAttributeToNotContain(string $locator): void
179189 $ this ->assertSame ('36 ' , $ crawler ->filter ('#hello ' )->getAttribute ('data-old-price ' ));
180190 }
181191
192+ #[DataProvider('waitForDataProvider ' )]
182193 /**
183194 * @dataProvider waitForDataProvider
184195 */
@@ -244,6 +255,7 @@ public static function waitForExceptionsProvider(): iterable
244255 ];
245256 }
246257
258+ #[DataProvider('waitForExceptionsProvider ' )]
247259 /**
248260 * @dataProvider waitForExceptionsProvider
249261 */
@@ -287,6 +299,7 @@ public function testExecuteAsyncScript(): void
287299 $ this ->assertSame ('P1 ' , $ innerText );
288300 }
289301
302+ #[DataProvider('clientFactoryProvider ' )]
290303 /**
291304 * @dataProvider clientFactoryProvider
292305 */
@@ -318,6 +331,7 @@ public function testRefreshCrawler(): void
318331 $ this ->assertSame ('Hello ' , $ refreshedCrawler ->filter ('h1 ' )->text (null , true ));
319332 }
320333
334+ #[DataProvider('clientFactoryProvider ' )]
321335 /**
322336 * @dataProvider clientFactoryProvider
323337 */
@@ -336,6 +350,7 @@ public function testFollowLink(callable $clientFactory, string $type): void
336350 $ this ->assertSame (self ::$ baseUri .'/basic.html#e12 ' , $ crawler ->getUri ());
337351 }
338352
353+ #[DataProvider('clientFactoryProvider ' )]
339354 /**
340355 * @dataProvider clientFactoryProvider
341356 */
@@ -391,6 +406,7 @@ public function testSubmitForm(callable $clientFactory): void
391406 $ this ->assertSame ('I1: n/a ' , $ crawler ->filter ('#result ' )->text (null , true ));
392407 }
393408
409+ #[DataProvider('clientFactoryProvider ' )]
394410 /**
395411 * @dataProvider clientFactoryProvider
396412 */
@@ -417,6 +433,7 @@ public function testSubmitFormWithValues(callable $clientFactory): void
417433 $ this ->assertSame ('I1: Reclus ' , $ crawler ->filter ('#result ' )->text (null , true ));
418434 }
419435
436+ #[DataProvider('clientFactoryProvider ' )]
420437 /**
421438 * @dataProvider clientFactoryProvider
422439 */
@@ -444,6 +461,7 @@ public function testHistory(callable $clientFactory): void
444461 $ this ->assertSame (self ::$ baseUri .'/link.html ' , $ crawler ->getUri ());
445462 }
446463
464+ #[DataProvider('clientFactoryProvider ' )]
447465 /**
448466 * @dataProvider clientFactoryProvider
449467 */
@@ -496,6 +514,7 @@ public function testCookie(callable $clientFactory, string $type): void
496514 $ this ->assertNull ($ cookieJar ->get ('foo ' ));
497515 }
498516
517+ #[DataProvider('clientFactoryProvider ' )]
499518 /**
500519 * @dataProvider clientFactoryProvider
501520 */
@@ -506,6 +525,7 @@ public function testServerPort(callable $clientFactory): void
506525 $ this ->assertEquals ($ expectedPort , mb_substr (self ::$ baseUri , -4 ));
507526 }
508527
528+ #[DataProvider('clientFactoryProvider ' )]
509529 /**
510530 * @dataProvider clientFactoryProvider
511531 */
@@ -593,6 +613,7 @@ public function testCreateHttpBrowserClientWithInvalidHttpClientOptions(): void
593613 ]);
594614 }
595615
616+ #[DataProvider('providePrefersReducedMotion ' )]
596617 /**
597618 * @dataProvider providePrefersReducedMotion
598619 */
@@ -605,6 +626,7 @@ public function testPrefersReducedMotion(string $browser): void
605626 $ this ->assertStringEndsWith ('#clicked ' , $ client ->getCurrentURL ());
606627 }
607628
629+ #[DataProvider('providePrefersReducedMotion ' )]
608630 /**
609631 * @dataProvider providePrefersReducedMotion
610632 */
0 commit comments