Skip to content

Commit 611d814

Browse files
committed
TEST: Updated parameterised tests to use attributes instead of deprecated comments.
1 parent 40963cd commit 611d814

File tree

2 files changed

+9
-27
lines changed

2 files changed

+9
-27
lines changed

tests/EnableCookiesTests.php

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
use fiftyone\pipeline\core\SequenceElement;
3232
use fiftyone\pipeline\core\JsonBundlerElement;
3333
use PHPUnit\Framework\TestCase;
34+
use PHPUnit\Framework\Attributes\TestWith;
3435

3536
class CookieElement extends FlowElement
3637
{
@@ -57,24 +58,13 @@ public function processInternal($flowData): void
5758

5859
class EnableCookiesTests extends TestCase
5960
{
60-
public function provider_testJavaScriptCookies()
61-
{
62-
return [
63-
[false, false, false],
64-
[true, false, false],
65-
[false, true, true],
66-
[true, true, true]
67-
];
68-
}
69-
7061
/**
7162
* Test that the cookie settings are respected correctly.
72-
*
73-
* @dataProvider provider_testJavaScriptCookies
74-
* @param mixed $enableInConfig
75-
* @param mixed $enableInEvidence
76-
* @param mixed $expectCookie
7763
*/
64+
#[TestWith([false, false, false])]
65+
#[TestWith([true, false, false])]
66+
#[TestWith([false, true, true])]
67+
#[TestWith([true, true, true])]
7868
public function testJavaScriptCookies($enableInConfig, $enableInEvidence, $expectCookie)
7969
{
8070
$jsElement = new JavascriptBuilderElement([

tests/SetHeaderTests.php

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
use fiftyone\pipeline\core\tests\classes\TestPipeline;
3232
use fiftyone\pipeline\core\Utils;
3333
use PHPUnit\Framework\TestCase;
34+
use PHPUnit\Framework\Attributes\DataProvider;
3435

3536
class SetHeaderTests extends TestCase
3637
{
@@ -80,11 +81,8 @@ public static function provider_testGetResponseHeaderValue()
8081

8182
/**
8283
* Test response header value to be set for UACH.
83-
*
84-
* @dataProvider provider_testGetResponseHeaderValue
85-
* @param mixed $device
86-
* @param mixed $expectedValue
8784
*/
85+
#[DataProvider("provider_testGetResponseHeaderValue")]
8886
public function testGetResponseHeaderValue($device, $expectedValue)
8987
{
9088
$setHeaderPropertiesDict = [
@@ -142,11 +140,8 @@ public static function provider_testGetResponseHeaderName_Valid()
142140

143141
/**
144142
* Test get response header function for valid formats.
145-
*
146-
* @dataProvider provider_testGetResponseHeaderName_Valid
147-
* @param mixed $data
148-
* @param mixed $expectedValue
149143
*/
144+
#[DataProvider("provider_testGetResponseHeaderName_Valid")]
150145
public function testGetResponseHeaderNameValid($data, $expectedValue)
151146
{
152147
$setHeaderElement = new SetHeaderElement();
@@ -166,11 +161,8 @@ public static function provider_testGetResponseHeaderName_InValid()
166161

167162
/**
168163
* Test get response header function for valid formats.
169-
*
170-
* @dataProvider provider_testGetResponseHeaderName_InValid
171-
* @param mixed $data
172-
* @param mixed $expectedValue
173164
*/
165+
#[DataProvider("provider_testGetResponseHeaderName_InValid")]
174166
public function testGetResponseHeaderNameInValid($data, $expectedValue)
175167
{
176168
$setHeaderElement = new SetHeaderElement();

0 commit comments

Comments
 (0)