3131use fiftyone \pipeline \core \SequenceElement ;
3232use fiftyone \pipeline \core \JsonBundlerElement ;
3333use PHPUnit \Framework \TestCase ;
34- use PHPUnit \Framework \Attributes \TestWith ;
34+ use PHPUnit \Framework \Attributes \DataProvider ;
3535
3636class CookieElement extends FlowElement
3737{
@@ -58,13 +58,21 @@ public function processInternal($flowData): void
5858
5959class EnableCookiesTests extends TestCase
6060{
61+ public static function provider_testJavaScriptCookies ()
62+ {
63+ return [
64+ [false , false , false ],
65+ [true , false , false ],
66+ [false , true , true ],
67+ [true , true , true ]
68+ ];
69+ }
70+
6171 /**
6272 * Test that the cookie settings are respected correctly.
73+ * @dataProvider provider_testJavaScriptCookies
6374 */
64- #[TestWith([false , false , false ])]
65- #[TestWith([true , false , false ])]
66- #[TestWith([false , true , true ])]
67- #[TestWith([true , true , true ])]
75+ #[DataProvider("provider_testJavaScriptCookies " )]
6876 public function testJavaScriptCookies ($ enableInConfig , $ enableInEvidence , $ expectCookie )
6977 {
7078 $ jsElement = new JavascriptBuilderElement ([
@@ -84,7 +92,7 @@ public function testJavaScriptCookies($enableInConfig, $enableInEvidence, $expec
8492
8593 $ js = $ flowData ->javascriptbuilder ->javascript ;
8694 $ matches = substr_count ($ js , 'document.cookie ' );
87- if ($ expectCookie ) {
95+ if ($ expectCookie === true ) {
8896 $ this ->assertSame (2 , $ matches );
8997 }
9098 else {
0 commit comments